/* ===================================================
   60秒读懂世界 · FateZero  —  主样式文件
   =================================================== */

/* ── CSS 变量 / 浅色主题 ─────────────────────────── */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --hover: #f1f5f9;
  --ai-bg: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --refresh-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ── 深色模式 ────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --accent: #a78bfa;
    --accent-hover: #8b5cf6;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
    --hover: #334155;
    --ai-bg: #1e3a5f;
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --refresh-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  }
}

/* ── Reset & Base ────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(59,130,246,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text);
  line-height: 1.65;
  padding: 20px;
  min-height: 100vh;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      linear-gradient(rgba(96,165,250,0.12) 1px, transparent 1px),
      linear-gradient(90deg, rgba(96,165,250,0.12) 1px, transparent 1px);
  }
}

.container { max-width: 900px; margin: 0 auto; }

/* ── 设置按钮 & 弹窗 ─────────────────────────────── */
.settings-btn {
  position: fixed; bottom: 30px; right: 30px;
  width: 56px; height: 56px;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--border); border-radius: 50%;
  font-size: 1.3em; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.settings-btn:hover {
  border-color: var(--primary); color: var(--primary);
  box-shadow: 0 4px 12px rgba(59,130,246,0.2); transform: translateY(-2px);
}
.settings-btn:active { transform: translateY(0); }

.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.1); backdrop-filter: blur(2px); z-index: 200;
}
.modal.active { display: block; }

.modal-content {
  position: absolute; right: 30px; bottom: 95px;
  background: var(--surface); border-radius: 16px; padding: 24px;
  max-width: 420px; width: calc(100% - 40px);
  max-height: calc(100vh - 120px); overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15); border: 1px solid var(--border);
  animation: modalSlideIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
  transform-origin: bottom right;
}

@keyframes modalSlideIn {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title  { font-size: 1.3em; font-weight: 700; }
.close-btn    {
  background: none; border: none; font-size: 1.5em;
  color: var(--text-light); cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px; transition: all 0.2s;
}
.close-btn:hover { background: var(--hover); }

.form-group  { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.form-label  { font-size: 0.9em; font-weight: 600; }
.form-input  {
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 1em; background: var(--surface); color: var(--text); font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--primary); }

.save-btn {
  padding: 12px 24px; background: var(--primary); color: white;
  border: none; border-radius: 10px; font-size: 1em; font-weight: 600;
  cursor: pointer; transition: all 0.3s;
}
.save-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* ── 主题选择 ────────────────────────────────────── */
.theme-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; margin-bottom: 20px; }
.theme-card  {
  padding: 16px; border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: all 0.3s; text-align: center; background: var(--surface);
}
.theme-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.theme-card.active { border-color: var(--primary); background: var(--primary); color: white; }
.theme-preview { font-size: 2em; margin-bottom: 8px; }
.theme-name   { font-size: 0.9em; font-weight: 600; margin-bottom: 4px; }
.theme-desc   { font-size: 0.75em; opacity: 0.7; }

/* ── 实时时钟 ────────────────────────────────────── */
.live-clock { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.live-clock-time {
  font-size: 2.2em; font-weight: 900; letter-spacing: 2px;
  color: var(--text); font-variant-numeric: tabular-nums; line-height: 1;
}
.live-clock-time .clock-colon { animation: clockBlink 1s step-end infinite; display: inline-block; }
@keyframes clockBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.15; } }
.live-clock-date { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.live-clock-weekday {
  font-size: 0.78em; font-weight: 700; color: var(--primary);
  background: var(--ai-bg); padding: 2px 10px; border-radius: 20px;
  border: 1px solid rgba(59,130,246,0.2); letter-spacing: 0.5px;
}
.live-clock-full-date { font-size: 0.8em; color: var(--text-light); padding-left: 2px; }

/* ── 头部 ────────────────────────────────────────── */
header { text-align: center; margin-bottom: 32px; padding: 40px 20px 16px; }
.logo  { font-size: 3.5em; margin-bottom: 16px; }
h1     { font-size: 2.5em; font-weight: 900; margin-bottom: 20px; letter-spacing: -0.5px; }

/* ── 日期导航 ────────────────────────────────────── */
.section-date-nav {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.date-nav-btn {
  width: 34px; height: 34px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-light); cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; line-height: 1;
}
.date-nav-btn svg { display: block; width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.date-nav-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--ai-bg); transform: scale(1.08); }
.date-nav-btn:disabled { opacity: 0.28; cursor: not-allowed; transform: none !important; }

.date-info {
  display: inline-block; background: var(--surface); padding: 8px 22px;
  border-radius: 50px; font-size: 0.95em; color: var(--text-light);
  border: 1px solid var(--border); transition: all 0.2s;
  cursor: pointer; user-select: none; position: relative; min-width: 180px; text-align: center;
}
.date-info:hover { border-color: var(--primary); color: var(--primary); }

/* ── 日历弹窗 ────────────────────────────────────── */
.date-picker-popup {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.14); padding: 0; z-index: 50;
  width: 300px; overflow: hidden;
  animation: popupFadeIn 0.2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes popupFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.date-picker-popup.hidden { display: none; }

.cal-header   { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.cal-month-label { font-size: 0.95em; font-weight: 700; color: var(--text); letter-spacing: 0.3px; }
.cal-nav-btn  {
  width: 28px; height: 28px; border: none; background: var(--hover); border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-light); transition: all 0.15s; padding: 0;
}
.cal-nav-btn:hover:not(:disabled) { background: var(--ai-bg); color: var(--primary); }
.cal-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.cal-nav-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: block; }

.cal-shortcuts { display: flex; gap: 6px; padding: 10px 14px 8px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.cal-shortcut  {
  padding: 4px 11px; background: var(--hover); border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.78em; color: var(--text-light);
  cursor: pointer; transition: all 0.15s; font-family: inherit; white-space: nowrap;
}
.cal-shortcut:hover  { background: var(--ai-bg); border-color: var(--primary); color: var(--primary); }
.cal-shortcut.active { background: var(--primary); border-color: var(--primary); color: white; }

.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); padding: 8px 12px 4px; gap: 2px; }
.cal-weekday  { text-align: center; font-size: 0.72em; font-weight: 700; color: var(--text-light); padding: 2px 0; letter-spacing: 0.3px; }
.cal-weekday.weekend { color: var(--error); opacity: 0.7; }

.cal-days { display: grid; grid-template-columns: repeat(7,1fr); padding: 0 12px 12px; gap: 2px; }
.cal-day  {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.82em; border-radius: 8px; cursor: pointer; transition: all 0.15s;
  border: none; background: transparent; color: var(--text); font-family: inherit;
  font-weight: 500; position: relative;
}
.cal-day:hover:not(.disabled):not(.active) { background: var(--hover); color: var(--primary); }
.cal-day.active { background: var(--primary); color: white; font-weight: 700; box-shadow: 0 2px 8px rgba(59,130,246,0.35); }
.cal-day.today:not(.active)::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}
.cal-day.disabled     { opacity: 0.25; cursor: not-allowed; }
.cal-day.other-month  { opacity: 0.35; }
.cal-day.weekend:not(.active) { color: var(--error); opacity: 0.7; }
.cal-day.other-month.weekend  { opacity: 0.25; }

/* ── 折叠 ────────────────────────────────────────── */
.collapsible-wrap { position: relative; }
.collapsible-wrap.collapsed { max-height: 72px; overflow: hidden; }
.collapsible-wrap.collapsed::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 32px;
  pointer-events: none; background: linear-gradient(to bottom, transparent, var(--surface));
}
.comment-item .collapsible-wrap.collapsed::after { background: linear-gradient(to bottom, transparent, var(--hover)); }
.zhiyi-reply-body .collapsible-wrap.collapsed::after { background: linear-gradient(to bottom, transparent, var(--ai-bg)); }
.expand-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 5px; padding: 2px 10px;
  background: transparent; border: 1px solid var(--border); border-radius: 20px;
  font-size: 0.78em; color: var(--primary); cursor: pointer; transition: all 0.2s;
  font-family: inherit; line-height: 1.6;
}
.expand-btn:hover { background: var(--ai-bg); border-color: var(--primary); }

/* ── 历史提示条 & 知一横幅 ───────────────────────── */
.history-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--hover); border: 1px solid var(--border);
  border-left: 3px solid var(--warning); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 20px; font-size: 0.9em; color: var(--text-light);
  animation: fadeIn 0.3s ease;
}
.history-banner-text { flex: 1; }
.history-banner-text strong { color: var(--text); }
.back-today-btn {
  padding: 5px 14px; background: var(--primary); color: white;
  border: none; border-radius: 8px; font-size: 0.85em; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.2s; flex-shrink: 0; font-family: inherit;
}
.back-today-btn:hover { background: var(--primary-hover); }

.zhiyi-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--ai-bg); border: 1px solid var(--border);
  border-left: 3px solid var(--primary); border-radius: 12px;
  padding: 12px 20px; margin-bottom: 20px; font-size: 0.9em; color: var(--primary);
  animation: fadeIn 0.5s ease;
}
.zhiyi-banner-icon { font-size: 1.4em; flex-shrink: 0; }
.zhiyi-banner-text { line-height: 1.5; }
.zhiyi-banner strong { font-weight: 700; }

/* ── 标签页 ──────────────────────────────────────── */
.tabs-wrapper { position: relative; margin-bottom: 30px; }
.tabs-wrapper::before,
.tabs-wrapper::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 36px;
  pointer-events: none; z-index: 2; transition: opacity 0.25s; opacity: 0;
}
.tabs-wrapper::before { left: 0; background: linear-gradient(to right, var(--bg) 0%, transparent 100%); border-radius: 12px 0 0 12px; }
.tabs-wrapper::after  { right: 0; background: linear-gradient(to left, var(--bg) 0%, transparent 100%); border-radius: 0 12px 12px 0; }
.tabs-wrapper.can-scroll-left::before  { opacity: 1; }
.tabs-wrapper.can-scroll-right::after  { opacity: 1; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 4px;
  background: var(--surface); border-radius: 12px; border: 1px solid var(--border);
  scrollbar-width: none; -ms-overflow-style: none;
  scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 10px 20px; background: transparent; border: none; border-radius: 8px;
  font-size: 0.92em; font-weight: 600; color: var(--text-light);
  cursor: pointer; transition: all 0.25s ease; white-space: nowrap; flex-shrink: 0;
}
.tab:hover  { background: var(--hover); color: var(--text); }
.tab.active { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 新闻卡片 ────────────────────────────────────── */
.news-card, .hot-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; margin-bottom: 20px; transition: all 0.3s ease;
}
.news-card:hover, .hot-card:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(59,130,246,0.1); transform: translateY(-2px); }

.news-main { display: grid; grid-template-columns: 44px 1fr; gap: 18px; margin-bottom: 16px; }
.news-number, .hot-rank {
  width: 44px; height: 44px; background: var(--primary); color: white;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.2em; font-weight: 700; flex-shrink: 0;
}
.news-text, .hot-title { font-size: 1.05em; line-height: 1.7; color: var(--text); padding-top: 2px; }
.hot-title a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.hot-title a:hover { color: var(--primary); }

.hot-meta   { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; margin-left: 62px; font-size: 0.85em; color: var(--text-light); }
.hot-badge  { padding: 4px 10px; background: var(--hover); border-radius: 6px; font-weight: 600; }
.hot-badge.hot { background: #fee2e2; color: #dc2626; }
.hot-badge.new { background: #dbeafe; color: #2563eb; }
.hot-cover  { width: 100%; max-width: 200px; height: auto; border-radius: 8px; margin-top: 12px; margin-left: 62px; }
.hot-detail { margin-left: 62px; margin-top: 8px; font-size: 0.9em; color: var(--text-light); line-height: 1.6; }

.ai-insight { margin-left: 62px; padding: 14px 18px; background: var(--ai-bg); border-left: 3px solid var(--primary); border-radius: 8px; margin-bottom: 16px; }
.ai-label   { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85em; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.ai-content { font-size: 0.95em; line-height: 1.7; color: var(--text-light); }

/* ── 知一回复 ────────────────────────────────────── */
.zhiyi-reply {
  margin-top: 12px; border-radius: 12px;
  background: var(--ai-bg); border: 1.5px solid var(--primary); overflow: hidden;
  animation: zhiyiSlideIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes zhiyiSlideIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.zhiyi-reply-label { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 0.82em; font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--border); }
.zhiyi-tag { font-size: 0.75em; background: var(--hover); color: var(--primary); padding: 2px 8px; border-radius: 10px; margin-left: auto; font-weight: 600; }
.zhiyi-reply-body { padding: 14px 16px; font-size: 0.95em; line-height: 1.75; color: var(--text); word-break: break-word; }
.zhiyi-reply-body p  { margin: 0 0 8px; }
.zhiyi-reply-body p:last-child { margin-bottom: 0; }
.zhiyi-reply-body strong { font-weight: 700; color: var(--text); }
.zhiyi-reply-body em   { font-style: italic; }
.zhiyi-reply-body ul, .zhiyi-reply-body ol { margin: 6px 0 8px 20px; padding: 0; }
.zhiyi-reply-body li   { margin-bottom: 4px; }
.zhiyi-reply-body code { font-family: 'Courier New', monospace; font-size: 0.88em; background: var(--hover); padding: 1px 5px; border-radius: 4px; }
.zhiyi-reply-body blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--primary); color: var(--text-light); font-style: italic; }

.zhiyi-followup { border-top: 1px dashed var(--border); padding: 8px 14px; }
.zhiyi-followup-toggle {
  background: none; border: none; color: var(--primary); font-size: 0.82em; font-weight: 600;
  cursor: pointer; padding: 2px 0; display: flex; align-items: center; gap: 5px; opacity: 0.8; transition: opacity 0.2s;
}
.zhiyi-followup-toggle:hover { opacity: 1; }
.zhiyi-followup-form { display: none; margin-top: 10px; gap: 8px; flex-direction: column; }
.zhiyi-followup-form.open { display: flex; }
.zhiyi-followup-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.88em; background: var(--surface); color: var(--text); font-family: inherit;
  resize: none; min-height: 60px; transition: border-color 0.2s;
}
.zhiyi-followup-input:focus { outline: none; border-color: var(--primary); }
.zhiyi-followup-send {
  align-self: flex-end; padding: 6px 18px; background: var(--primary); color: white;
  border: none; border-radius: 8px; font-size: 0.85em; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.zhiyi-followup-send:hover { background: var(--primary-hover); transform: translateY(-1px); }
.zhiyi-followup-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.zhiyi-loading { padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 0.9em; color: var(--primary); }
.zhiyi-dots { display: flex; gap: 4px; }
.zhiyi-dots span { width: 6px; height: 6px; background: var(--primary); border-radius: 50%; animation: zhiyiDot 1.2s infinite ease-in-out; }
.zhiyi-dots span:nth-child(2) { animation-delay: 0.2s; }
.zhiyi-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes zhiyiDot { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ── 评论区 ──────────────────────────────────────── */
.comments-section { margin-left: 62px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.tldr-special-section .comments-section,
.tldr-card .comments-section { margin-left: 0 !important; padding-left: 0; border-left: none; }

.comments-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.comments-title  { font-size: 0.9em; font-weight: 600; color: var(--text-light); display: flex; align-items: center; gap: 6px; }
.comment-toggle  { background: none; border: none; color: var(--primary); font-size: 0.9em; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background 0.2s; }
.comment-toggle:hover { background: var(--hover); }
.comments-content { display: none; }
.comments-content.active { display: block; animation: commentsSlideDown 0.3s ease; }
@keyframes commentsSlideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.comment-input-wrapper { position: relative; }
.comment-textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.9em; background: var(--surface); color: var(--text);
  font-family: inherit; resize: vertical; min-height: 80px; transition: border-color 0.2s;
}
.comment-textarea:focus { outline: none; border-color: var(--primary); }
.comment-textarea.zhiyi-mode { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.zhiyi-hint { display: none; align-items: center; gap: 6px; font-size: 0.82em; color: var(--primary); padding: 4px 0; animation: fadeIn 0.2s ease; }
.zhiyi-hint.visible { display: flex; }
.zhiyi-hint-icon { font-size: 1.1em; }

.comment-actions { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.at-zhiyi-btn {
  padding: 6px 14px; background: var(--ai-bg); color: var(--primary);
  border: 1px solid var(--border); border-radius: 8px; font-size: 0.85em; font-weight: 600;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 5px;
}
.at-zhiyi-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.submit-btn {
  padding: 8px 20px; background: var(--primary); color: white; border: none;
  border-radius: 8px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.3s; margin-left: auto;
}
.submit-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

.comments-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item  { padding: 12px; background: var(--hover); border-radius: 8px; }
.comment-item + .zhiyi-reply, .zhiyi-reply-inline { margin-top: -4px; margin-left: 16px; margin-bottom: 4px; border-top-left-radius: 4px; border-top-right-radius: 12px; }

.comments-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 0 4px; font-size: 0.85em; color: var(--text-light); }
.page-btn { background: var(--hover); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 12px; font-size: 0.85em; cursor: pointer; transition: all 0.2s; }
.page-btn:hover:not(:disabled) { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-info { font-size: 0.85em; color: var(--text-light); }

.comment-header  { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-author  { font-size: 0.85em; font-weight: 600; color: var(--primary); }
.comment-time    { font-size: 0.8em; color: var(--text-light); }
.comment-text    { font-size: 0.9em; line-height: 1.6; }
.at-mention      { color: var(--primary); font-weight: 600; background: var(--ai-bg); padding: 0 3px; border-radius: 3px; }
.no-comments     { text-align: center; padding: 20px; color: var(--text-light); font-size: 0.9em; }

/* ── AI 总评 ─────────────────────────────────────── */
.ai-summary   { background: var(--surface); border: 2px solid var(--primary); border-radius: 16px; padding: 32px; margin-bottom: 30px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.1em; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.summary-text  { font-size: 1.08em; line-height: 1.8; margin-bottom: 20px; }

/* ── 每日微语 ────────────────────────────────────── */
.daily-quote { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; margin-bottom: 40px; text-align: center; position: relative; }
.daily-quote::before, .daily-quote::after { position: absolute; font-size: 3em; opacity: 0.1; font-family: 'Noto Serif SC', Georgia, serif; }
.daily-quote::before { content: "\201C"; top: 15px; left: 20px; }
.daily-quote::after  { content: "\201D"; bottom: 15px; right: 20px; }
.quote-text { font-size: 1.2em; line-height: 1.8; font-style: italic; font-family: 'Noto Serif SC', Georgia, serif; color: var(--text-light); }

/* ── 操作按钮 ────────────────────────────────────── */
.actions { display: flex; justify-content: center; gap: 16px; margin-bottom: 50px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: white; padding: 14px 32px; border: none;
  border-radius: 10px; font-size: 1em; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: all 0.3s ease; position: relative; overflow: hidden; min-width: 160px;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59,130,246,0.3); }
.btn:active { transform: translateY(0); }

.refresh-btn { background: var(--refresh-gradient); position: relative; }
.refresh-btn:hover { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(102,126,234,0.4); }
.refresh-btn.loading  { pointer-events: none; opacity: 0.7; }
.refresh-btn.loading .refresh-icon { animation: rotate 1s linear infinite; }
.refresh-btn.cooldown { background: var(--text-light); pointer-events: none; cursor: not-allowed; }
.refresh-btn.success  { background: var(--success); }
.refresh-btn.error    { background: var(--error); }
.refresh-btn.loading:hover, .refresh-btn.cooldown:hover { transform: none !important; box-shadow: none !important; }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.refresh-icon { display: inline-block; transition: transform 0.3s ease; flex-shrink: 0; }
.refresh-text { flex-shrink: 0; min-width: 64px; text-align: center; }
.refresh-cooldown { font-size: 0.85em; opacity: 0.9; position: absolute; right: 12px; min-width: 40px; text-align: right; }
.progress-bar { position: absolute; bottom: 0; left: 0; height: 3px; background: rgba(255,255,255,0.5); transition: width 0.3s ease; border-radius: 0 0 10px 10px; }

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed; top: 20px; right: 20px; background: var(--surface); color: var(--text);
  padding: 16px 24px; border-radius: 12px; border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px;
  z-index: 1000; animation: slideIn 0.3s ease; max-width: 400px;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }
@keyframes slideIn  { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(400px); opacity: 0; } }
.toast.hiding   { animation: slideOut 0.3s ease forwards; }
.toast-icon     { font-size: 1.3em; flex-shrink: 0; }
.toast-content  { flex: 1; min-width: 0; }
.toast-title    { font-weight: 600; margin-bottom: 4px; }
.toast-message  { font-size: 0.9em; color: var(--text-light); }
.toast-close {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: none; border-radius: 50%;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s, transform 0.15s;
  padding: 0;
  margin-left: 4px;
  align-self: flex-start;
  margin-top: -2px;
}
.toast-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
  transform: rotate(90deg);
}
.toast-close:active { transform: rotate(90deg) scale(0.88); }
.toast.error   .toast-close:hover { background: rgba(239, 68, 68, 0.1); color: var(--error); }
.toast.success .toast-close:hover { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.toast.warning .toast-close:hover { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* ── 身份系统 ────────────────────────────────────── */
.identity-status {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--hover); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 16px; font-size: 0.9em;
}
.identity-avatar { width: 34px; height: 34px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95em; flex-shrink: 0; }
.identity-info   { flex: 1; }
.identity-name   { font-weight: 700; color: var(--text); }
.identity-hint   { font-size: 0.8em; color: var(--text-light); margin-top: 2px; }
.identity-clear-btn { background: none; border: 1px solid var(--border); color: var(--text-light); padding: 4px 10px; border-radius: 6px; font-size: 0.8em; cursor: pointer; transition: all 0.2s; }
.identity-clear-btn:hover { border-color: var(--error); color: var(--error); }

.passphrase-wrap .form-input { padding-right: 40px; }
.passphrase-wrap { position: relative; }
.passphrase-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-light); font-size: 1em; padding: 2px; }

#identityForm { display: flex; flex-direction: column; gap: 10px; }
.id-field {
  background: var(--hover); border: 1.5px solid var(--border); border-radius: 12px;
  padding: 10px 14px 12px; transition: border-color 0.2s, background 0.2s; margin-bottom: 5px;
}
.id-field:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }
.id-field-label { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; font-size: 0.78em; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.id-field-icon  { line-height: 1; }
.id-field-tag   { margin-left: auto; font-size: 0.72em; font-weight: 600; padding: 1px 7px; border-radius: 20px; background: var(--ai-bg); color: var(--primary); border: 1px solid rgba(59,130,246,0.2); white-space: nowrap; text-transform: none; letter-spacing: 0; }
.id-field-tag--private { background: rgba(16,185,129,0.08); color: var(--success); border-color: rgba(16,185,129,0.25); }
.id-field .form-input { border: none; background: transparent; padding: 2px 0; font-size: 0.95em; width: 100%; color: var(--text); }
.id-field .form-input:focus { outline: none; border: none; box-shadow: none; }
.id-field .passphrase-wrap .form-input { padding-right: 28px; }
.id-field .passphrase-toggle { right: 0; font-size: 0.88em; }
.id-hint-row { display: flex; align-items: center; gap: 8px; }
.id-hint-row .form-input { flex: 1; min-width: 0; }
.id-fetch-btn {
  flex-shrink: 0; padding: 5px 12px; background: var(--ai-bg); color: var(--primary);
  border: 1px solid rgba(59,130,246,0.35); border-radius: 7px; font-size: 0.8em;
  font-weight: 700; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.id-fetch-btn:hover   { background: var(--primary); color: white; border-color: var(--primary); }
.id-fetch-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.id-hint-result {
  margin-top: 8px; padding: 7px 10px; background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.3); border-radius: 7px; font-size: 0.85em;
  font-weight: 600; color: var(--success); animation: fadeIn 0.3s ease;
}
.id-hint-result--error { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.25); color: var(--error); }
.identity-tip {
  font-size: 0.81em; color: var(--text-light); line-height: 1.65; padding: 10px 14px;
  background: var(--ai-bg); border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0;
}
#identityConfirmBtn { width: 100%; padding: 13px; font-size: 1em; border-radius: 12px; margin-top: 2px; letter-spacing: 0.3px; }
.identity-avatar { border-radius: 10px; }

/* ── Footer ──────────────────────────────────────── */
footer { text-align: center; padding: 30px 20px; color: var(--text-light); font-size: 0.9em; border-top: 1px solid var(--border); }
footer a { color: var(--primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Loading ─────────────────────────────────────── */
.loading { text-align: center; padding: 60px 20px; color: var(--text-light); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 16px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 建议页 ──────────────────────────────────────── */
.feedback-header       { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.feedback-header-title { font-size: 1em; font-weight: 700; color: var(--text-light); display: flex; align-items: center; gap: 8px; }
.feedback-new-btn      { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; background: var(--primary); color: white; border: none; border-radius: 10px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.feedback-new-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.feedback-form-box      { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 20px; display: none; animation: fadeIn 0.3s ease; }
.feedback-form-box.open { display: block; }
.feedback-form-title    { font-size: 1em; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.feedback-textarea      { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 0.95em; background: var(--surface); color: var(--text); font-family: inherit; resize: vertical; min-height: 100px; margin-bottom: 12px; transition: border-color 0.2s; }
.feedback-textarea:focus { outline: none; border-color: var(--primary); }
.feedback-form-actions  { display: flex; justify-content: flex-end; gap: 10px; }
.feedback-cancel-btn    { padding: 8px 18px; background: var(--hover); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font-size: 0.9em; cursor: pointer; transition: all 0.2s; }
.feedback-cancel-btn:hover { border-color: var(--primary); color: var(--primary); }
.feedback-submit-btn    { padding: 8px 20px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.feedback-submit-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.feedback-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.feedback-card   { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; transition: all 0.3s; }
.feedback-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(59,130,246,0.08); }
.feedback-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.feedback-avatar { width: 36px; height: 36px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85em; font-weight: 700; flex-shrink: 0; }
.feedback-meta   { flex: 1; }
.feedback-author { font-size: 0.9em; font-weight: 700; color: var(--text); }
.feedback-time   { font-size: 0.8em; color: var(--text-light); margin-top: 2px; }
.feedback-text   { font-size: 0.95em; line-height: 1.7; color: var(--text); margin-bottom: 14px; white-space: pre-wrap; word-break: break-word; }
.feedback-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.support-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--hover); border: 1px solid var(--border); border-radius: 20px; font-size: 0.85em; font-weight: 600; color: var(--text-light); cursor: pointer; transition: all 0.2s; user-select: none; }
.support-btn:hover    { border-color: var(--primary); color: var(--primary); }
.support-btn.supported { background: var(--ai-bg); border-color: var(--primary); color: var(--primary); }
.support-btn .support-count { font-weight: 700; }

.reply-toggle-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; background: none; border: none; font-size: 0.85em; color: var(--text-light); cursor: pointer; border-radius: 20px; transition: all 0.2s; }
.reply-toggle-btn:hover { color: var(--primary); background: var(--hover); }

.feedback-replies      { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); display: none; }
.feedback-replies.open { display: block; }
.reply-item   { display: flex; gap: 10px; margin-bottom: 12px; }
.reply-avatar { width: 28px; height: 28px; background: var(--hover); border: 1px solid var(--border); color: var(--text-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75em; font-weight: 700; flex-shrink: 0; }
.reply-body   { flex: 1; }
.reply-meta   { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.reply-author { font-size: 0.82em; font-weight: 700; color: var(--primary); }
.reply-time   { font-size: 0.78em; color: var(--text-light); }
.reply-text   { font-size: 0.88em; line-height: 1.6; color: var(--text); }
.reply-form   { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.reply-input  { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.88em; background: var(--surface); color: var(--text); font-family: inherit; resize: none; min-height: 60px; transition: border-color 0.2s; }
.reply-input:focus { outline: none; border-color: var(--primary); }
.reply-send-btn { padding: 8px 16px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 0.85em; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; align-self: flex-end; }
.reply-send-btn:hover    { background: var(--primary-hover); }
.reply-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.feedback-empty      { text-align: center; padding: 60px 20px; color: var(--text-light); }
.feedback-empty-icon { font-size: 3em; margin-bottom: 12px; }
.feedback-empty-text { font-size: 0.95em; }
.feedback-card.resolved { opacity: 0.75; border-color: var(--success); }

.resolved-badge      { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; padding: 4px 10px; background: rgba(16,185,129,0.08); color: var(--success); border: 1px solid var(--success); border-radius: 10px; margin-left: auto; flex-shrink: 0; }
.resolved-badge-main { display: flex; align-items: center; gap: 4px; font-size: 0.78em; font-weight: 700; white-space: nowrap; }
.resolved-badge-time { font-size: 0.68em; font-weight: 400; opacity: 0.7; white-space: nowrap; }
.resolve-btn         { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; background: none; border: 1px dashed var(--border); border-radius: 20px; font-size: 0.82em; color: var(--text-light); cursor: pointer; transition: all 0.2s; margin-left: auto; }
.resolve-btn:hover   { border-color: var(--success); color: var(--success); background: rgba(16,185,129,0.06); }
.resolve-btn.resolving { opacity: 0.5; pointer-events: none; }

/* ── TLDR ────────────────────────────────────────── */
.tldr-section-header { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; font-size: 0.8em; font-weight: 800; color: var(--text-light); text-transform: uppercase; letter-spacing: 1.5px; }
.tldr-section-header::before, .tldr-section-header::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.tldr-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; transition: all 0.25s ease; }
.tldr-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(59,130,246,0.1); transform: translateY(-1px); }

.tldr-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.tldr-index { width: 28px; height: 28px; background: var(--primary); color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.8em; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.tldr-card-title { flex: 1; font-size: 1em; font-weight: 700; line-height: 1.5; color: var(--text); }
.tldr-card-title a { color: inherit; text-decoration: none; transition: color 0.2s; }
.tldr-card-title a:hover { color: var(--primary); }
.tldr-card-body { margin-left: 42px; }

.tldr-summary-en  { font-size: 0.9em; line-height: 1.7; color: var(--text-light); margin-bottom: 10px; }
.tldr-translation { display: none; background: var(--ai-bg); border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; padding: 12px 14px; margin-bottom: 10px; animation: fadeIn 0.3s ease; }
.tldr-translation.visible { display: block; }
.tldr-translation-label { display: flex; align-items: center; gap: 5px; font-size: 0.75em; font-weight: 700; color: var(--primary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.tldr-translation-title { font-size: 0.95em; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.tldr-translation-body  { font-size: 0.9em; line-height: 1.7; color: var(--text-light); }

.tldr-analyze { display: none; background: var(--ai-bg); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 12px 14px; margin-bottom: 10px; animation: fadeIn 0.3s ease; }
.tldr-analyze.visible { display: block; }
.tldr-analyze-label { display: flex; align-items: center; gap: 5px; font-size: 0.75em; font-weight: 700; color: var(--accent); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.tldr-analyze-body  { font-size: 0.9em; line-height: 1.7; color: var(--text-light); }

.tldr-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tldr-translate-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; background: var(--hover); border: 1px solid var(--border); border-radius: 20px; font-size: 0.8em; font-weight: 600; color: var(--text-light); cursor: pointer; transition: all 0.2s; font-family: inherit; }
.tldr-translate-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--ai-bg); }
.tldr-translate-btn.loading { opacity: 0.6; pointer-events: none; }
.tldr-translate-btn.done    { border-color: var(--primary); color: var(--primary); background: var(--ai-bg); }
.tldr-analyze-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; background: var(--hover); border: 1px solid var(--border); border-radius: 20px; font-size: 0.8em; font-weight: 600; color: var(--text-light); cursor: pointer; transition: all 0.2s; font-family: inherit; }
.tldr-analyze-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--ai-bg); }
.tldr-analyze-btn.loading { opacity: 0.6; pointer-events: none; }
.tldr-analyze-btn.done    { border-color: var(--accent); color: var(--accent); background: var(--ai-bg); }
.tldr-link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; background: transparent; border: 1px solid var(--border); border-radius: 20px; font-size: 0.8em; color: var(--text-light); text-decoration: none; transition: all 0.2s; }
.tldr-link-btn:hover { border-color: var(--primary); color: var(--primary); }

.tldr-summary-card { background: var(--surface); border: 2px solid var(--primary); border-radius: 16px; padding: 24px 26px; margin-bottom: 24px; }
.tldr-summary-card-title { display: flex; align-items: center; gap: 8px; font-size: 1em; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.tldr-summary-text { font-size: 0.95em; line-height: 1.8; color: var(--text-light); }
.tldr-summary-text strong { color: var(--text); font-weight: 700; }
.tldr-summary-text em { font-style: italic; color: var(--text); }
.tldr-summary-text code { background: var(--ai-bg); padding: 2px 8px; border-radius: 4px; font-size: 0.9em; color: var(--primary); }
.tldr-summary-text blockquote { border-left: 3px solid var(--primary); padding-left: 12px; margin: 8px 0; color: var(--text-light); font-style: italic; }
.tldr-summary-text ul { list-style-type: disc; padding-left: 20px; margin: 8px 0; }
.tldr-summary-text li { margin: 4px 0; }

.tldr-global-translate      { display: flex; justify-content: center; margin-bottom: 24px; }
.tldr-global-translate-btn  { display: inline-flex; align-items: center; gap: 8px; padding: 10px 28px; background: var(--primary); color: white; border: none; border-radius: 10px; font-size: 0.95em; font-weight: 600; cursor: pointer; transition: all 0.25s; font-family: inherit; }
.tldr-global-translate-btn:hover    { background: var(--primary-hover); transform: translateY(-1px); }
.tldr-global-translate-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.tldr-global-translate-btn.done     { background: var(--success); }

.tldr-empty      { text-align: center; padding: 60px 20px; color: var(--text-light); }
.tldr-empty-icon { font-size: 3em; margin-bottom: 12px; }
.tldr-empty-text { font-size: 0.95em; line-height: 1.7; }

/* ── 分享按钮 ────────────────────────────────────── */
.news-share-row { display: flex; align-items: center; padding: 2px 0 10px 58px; gap: 6px; }
.share-news-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px;
  background: transparent; border: 1px solid var(--border); border-radius: 20px;
  font-size: 0.78em; color: var(--text-light); cursor: pointer; transition: all 0.2s;
  font-family: inherit; line-height: 1.6;
}
.share-news-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--ai-bg); transform: scale(1.04); }
.share-news-btn svg   { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; }

.share-comment-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  background: transparent; border: 1px solid var(--border); border-radius: 20px;
  font-size: 0.72em; color: var(--text-light); cursor: pointer; transition: all 0.2s;
  font-family: inherit; margin-left: auto; flex-shrink: 0;
}
.share-comment-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--ai-bg); }
.share-comment-btn svg   { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── 双列布局 ────────────────────────────────────── */
@media (min-width: 768px) {
  .main-container   { display: flex; flex-direction: row; gap: 20px; align-items: flex-start; }
  .daily-news-section  { flex: 1.5; min-width: 0; }
  .tldr-special-section { flex: 1; min-width: 0; margin-top: 0 !important; }
}
@media (max-width: 767px) {
  .main-container { flex-direction: column; }
  .tldr-special-section { margin-top: 30px; }
}

/* ── 移动端适配 ──────────────────────────────────── */
@media (max-width: 768px) {
  body    { padding: 12px; }
  h1      { font-size: 1.8em; }
  .logo   { font-size: 2.2em; }
  header  { padding: 20px 10px 10px; margin-bottom: 24px; }
  .news-card, .hot-card { padding: 16px; }
  .news-main { grid-template-columns: 32px 1fr; gap: 12px; margin-bottom: 12px; }
  .news-number, .hot-rank { width: 32px; height: 32px; font-size: 1em; border-radius: 8px; }
  .ai-insight, .comments-section, .hot-meta, .hot-cover, .hot-detail { margin-left: 0; margin-top: 12px; }
  .ai-summary { padding: 16px; margin-bottom: 20px; }
  .daily-quote { padding: 20px 16px; }
  .settings-btn { bottom: 20px; right: 20px; width: 48px; height: 48px; font-size: 1.2em; }
  .tabs { font-size: 0.9em; margin-bottom: 20px; }
  .tab  { padding: 8px 14px; font-size: 0.88em; }
  .tabs-wrapper::before, .tabs-wrapper::after { width: 20px; }
  .actions { flex-direction: column; gap: 12px; }
  .btn    { width: 100%; justify-content: center; padding: 12px; }
  .toast  { max-width: calc(100vw - 40px); left: 20px; right: 20px; width: auto; }
  .theme-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .comment-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .submit-btn { width: 100%; margin: 0; }
  .modal-content {
    right: 0; bottom: 0; width: 100%; max-width: none;
    border-radius: 20px 20px 0 0; max-height: 75vh; padding: 24px 20px;
    border: none; border-top: 1px solid var(--border);
    animation: sheetSlideUp 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
    transform-origin: bottom center;
  }
  @keyframes sheetSlideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .comment-item + .zhiyi-reply, .zhiyi-reply-inline { margin-left: 8px; }
  .id-field-tag { display: none; }
  .date-picker-popup { left: 50%; transform: translateX(-50%); width: calc(100vw - 40px); max-width: 300px; }
  .live-clock-time { font-size: 1.7em; }
  .news-share-row { padding-left: 44px; }
}

/* ── 收藏功能 ────────────────────────────────────────── */
.favorites-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.favorites-title { font-size: 1em; font-weight: 700; color: var(--text-light); display: flex; align-items: center; gap: 8px; }
.favorites-refresh-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; background: var(--primary); color: white; border: none; border-radius: 10px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.favorites-refresh-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

.favorites-date-group { margin-bottom: 24px; }
.favorites-date-header { font-size: 0.85em; font-weight: 700; color: var(--text-light); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.favorite-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; transition: all 0.25s ease; position: relative; }
.favorite-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(59,130,246,0.1); transform: translateY(-1px); }

.favorite-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.favorite-card-type { font-size: 0.75em; font-weight: 700; color: var(--text-light); padding: 4px 10px; background: var(--hover); border-radius: 20px; }
.favorite-remove-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; background: transparent; border: 1px solid var(--border); border-radius: 20px; font-size: 0.8em; color: var(--text-light); cursor: pointer; transition: all 0.2s; }
.favorite-remove-btn:hover { border-color: var(--error); color: var(--error); background: rgba(239,68,68,0.08); }

.favorite-card-title { font-size: 1em; font-weight: 700; line-height: 1.5; color: var(--text); margin-bottom: 8px; }
.favorite-card-content { font-size: 0.9em; line-height: 1.7; color: var(--text-light); margin-bottom: 12px; }
.favorite-card-link { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; background: var(--hover); border: 1px solid var(--border); border-radius: 20px; font-size: 0.85em; color: var(--text-light); text-decoration: none; transition: all 0.2s; }
.favorite-card-link:hover { border-color: var(--primary); color: var(--primary); }
.favorite-card-footer { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.favorite-card-time { font-size: 0.8em; color: var(--text-light); }

.favorite-card .comments-section { margin-top: 16px; }

.favorites-empty { text-align: center; padding: 60px 20px; color: var(--text-light); }
.favorites-empty-icon { font-size: 3em; margin-bottom: 12px; }
.favorites-empty-text { font-size: 0.95em; line-height: 1.7; margin-bottom: 20px; }
.favorites-login-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; background: var(--primary); color: white; border: none; border-radius: 10px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.favorites-login-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

/* 收藏按钮（在卡片上） */
.favorite-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; background: var(--hover); border: 1px solid var(--border); border-radius: 20px; font-size: 0.8em; font-weight: 600; color: var(--text-light); cursor: pointer; transition: all 0.2s; font-family: inherit; }
.favorite-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--ai-bg); }
.favorite-btn.active { border-color: var(--primary); color: var(--primary); background: var(--ai-bg); }
.favorite-btn.active span:first-child { color: var(--primary); }

/* ═══════════════════════════════════════════════
   评论历史专栏
   ═══════════════════════════════════════════════ */
.comment-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.comment-history-title {
  font-size: 1em;
  font-weight: 700;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-history-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.comment-history-refresh-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.comment-history-date-group {
  margin-bottom: 24px;
}
.comment-history-date-header {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.comment-history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  transition: all 0.25s ease;
  position: relative;
}
.comment-history-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.comment-history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.comment-history-type-badge {
  font-size: 0.75em;
  font-weight: 700;
  color: var(--text-light);
  padding: 4px 10px;
  background: var(--hover);
  border-radius: 20px;
}
.comment-history-link {
  font-size: 0.8em;
  color: var(--primary);
  text-decoration: none;
  padding: 4px 10px;
  background: var(--ai-bg);
  border-radius: 15px;
  transition: all 0.2s;
}
.comment-history-link:hover {
  background: var(--primary);
  color: white;
}

.comment-history-card-title {
  font-size: 0.95em;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
}
.comment-history-card-text {
  font-size: 0.9em;
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--hover);
  border-radius: 8px;
  border-left: 2px solid var(--primary);
}
.comment-history-card-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.comment-history-time {
  font-size: 0.8em;
  color: var(--text-light);
}

/* 评论历史 AI 看点 */
.comment-history-ai-insight {
  font-size: 0.85em;
  color: var(--text-light);
  background: var(--ai-bg);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
  border-left: 3px solid var(--primary);
}
.comment-history-ai-label {
  font-weight: 600;
  color: var(--primary);
  margin-right: 6px;
}
.comment-history-ai-text {
  line-height: 1.6;
}

/* 评论历史 TLDR 块 */
.comment-history-tldr-block {
  background: var(--ai-bg);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}
.comment-history-tldr-block--translate {
  border-left: 3px solid var(--success);
}
.comment-history-tldr-block--analyze {
  border-left: 3px solid var(--warning);
}
.comment-history-tldr-block-label {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
}
.comment-history-tldr-block--translate .comment-history-tldr-block-label {
  color: var(--success);
}
.comment-history-tldr-block--analyze .comment-history-tldr-block-label {
  color: var(--warning);
}
.comment-history-tldr-block-title {
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 6px;
  color: var(--text);
}
.comment-history-tldr-block-body {
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--text-light);
}
.comment-history-tldr-summary {
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--text-light);
  background: var(--hover);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
}

/* 评论历史热搜样式 */
.comment-history-hot-value {
  font-size: 0.85em;
  color: var(--error);
  font-weight: 600;
  margin: 8px 0;
}
.comment-history-cover-wrap {
  margin: 10px 0;
}
.comment-history-cover {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
}
.comment-history-detail {
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--text-light);
  background: var(--hover);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
}

.comment-history-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.comment-history-empty-icon {
  font-size: 3em;
  margin-bottom: 12px;
}
.comment-history-empty-text {
  font-size: 0.95em;
  line-height: 1.7;
  margin-bottom: 20px;
}
.comment-history-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.comment-history-login-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* 不同类型的收藏卡片样式 */
.favorite-card-daily .favorite-card-ai {
  font-size: 0.85em;
  color: var(--text-light);
  background: var(--ai-bg);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
  border-left: 3px solid var(--primary);
}
.favorite-card-daily .favorite-card-ai .ai-label {
  font-weight: 600;
  color: var(--primary);
  margin-right: 6px;
}
.favorite-card-daily .favorite-card-date {
  color: var(--text-light);
  font-size: 0.75em;
  margin-left: 8px;
}

/* TLDR 收藏卡片样式 */
.favorite-card-tldr .favorite-card-translate,
.favorite-card-tldr .favorite-card-analyze {
  background: var(--ai-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}
.favorite-card-tldr .translate-label,
.favorite-card-tldr .analyze-label {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  display: block;
}
.favorite-card-tldr .translate-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.favorite-card-tldr .translate-body,
.favorite-card-tldr .analyze-body {
  font-size: 0.85em;
  color: var(--text-light);
  line-height: 1.6;
}

/* 热搜收藏卡片样式 */
.favorite-card-hotsearch .favorite-card-hot-value {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 600;
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.favorite-card-hotsearch .favorite-card-cover {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
  max-height: 200px;
  object-fit: cover;
}
.favorite-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
 
/* ================================================================
   favorites-patch.css — 收藏页卡片样式
   <link> 引入后放在 main.css 之后
   ================================================================ */

/* ── 空状态 ─────────────────────────────────────────────────── */
.favorites-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: .4rem 0 .3rem;
}

/* ── 日期分组 ────────────────────────────────────────────────── */
.favorites-date-group + .favorites-date-group { margin-top: 1.8rem; }

.favorites-date-header {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary, #9ca3af);
  padding: 0 .2rem .55rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: .9rem;
}

/* ── 基础卡片 ────────────────────────────────────────────────── */
/* 注意：不用 overflow:hidden，否则展开的评论区会被裁切 */
.fav-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 14px;
  margin-bottom: 1rem;
  /* overflow: visible（默认）让评论区能正常展开 */
  transition: box-shadow .2s, transform .2s;
}
.fav-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  transform: translateY(-1px);
}
/* 让圆角内部各区块首尾也保持圆角 */
.fav-card > .fav-card-header:first-child { border-radius: 14px 14px 0 0; }
.fav-card > .comments-section:last-child { border-radius: 0 0 14px 14px; overflow: hidden; }

/* ── 卡片头部 ────────────────────────────────────────────────── */
.fav-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem .4rem;
}

/* 操作按钮组（分享 + 收藏星） */
.fav-card-actions {
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* ── 类型徽章 ────────────────────────────────────────────────── */
.fav-type-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 600;
  padding: .22rem .65rem;
  border-radius: 20px;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.fav-type-badge--news      { background: #eff6ff; color: #2563eb; }
.fav-type-badge--tldr      { background: #f0fdf4; color: #16a34a; }
.fav-type-badge--hotsearch { background: #fff7ed; color: #ea580c; }

/* ── 星形收藏按钮 ────────────────────────────────────────────── */
.fav-star-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .18s, transform .15s;
  flex-shrink: 0;
  padding: 0;
}
.fav-star-btn svg {
  width: 17px;
  height: 17px;
  fill: #d1d5db;
  transition: fill .18s;
}
.fav-star-btn:hover { background: #fef2f2; transform: scale(1.1); }
.fav-star-btn:hover svg { fill: #ef4444; }
.fav-star-btn.active svg { fill: #f59e0b; }
.fav-star-btn.active:hover svg { fill: #ef4444; }

/* ── 分享按钮 ────────────────────────────────────────────────── */
.fav-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .18s, transform .15s;
  flex-shrink: 0;
  padding: 0;
  color: var(--text-tertiary, #9ca3af);
}
.fav-share-btn svg {
  width: 16px;
  height: 16px;
}
.fav-share-btn:hover {
  background: var(--hover-bg, #f3f4f6);
  color: var(--accent-color, #2563eb);
  transform: scale(1.1);
}

/* ── 卡片内容区 ─────────────────────────────────────────────── */
.fav-card-body {
  padding: .15rem 1rem .6rem;
}

.fav-card-title {
  font-size: .94rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 .5rem;
}
.fav-card-title a {
  color: inherit;
  text-decoration: none;
}
.fav-card-title a:hover {
  color: var(--accent-color, #2563eb);
  text-decoration: underline;
}

/* ── AI 看点（每日新闻）────────────────────────────────────── */
.fav-ai-insight {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  background: var(--ai-bg);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: .55rem .75rem;
  margin-top: .4rem;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--text-light);
}
.fav-ai-label {
  font-weight: 700;
  white-space: nowrap;
  color: var(--primary);
  flex-shrink: 0;
}

/* ── TLDR 英文摘要 ──────────────────────────────────────────── */
.fav-tldr-summary {
  font-size: .81rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: .3rem 0 .55rem;
  font-style: italic;
  border-left: 2px solid var(--border-color, #e5e7eb);
  padding-left: .65rem;
}

/* ── TLDR 翻译/分析块 ───────────────────────────────────────── */
.fav-tldr-block {
  display: none;
  border-radius: 8px;
  padding: .55rem .75rem;
  margin-bottom: .5rem;
  font-size: .82rem;
  line-height: 1.55;
}
.fav-tldr-block.visible { display: block; }
.fav-tldr-block--translate { background: #f0fdf4; border-left: 3px solid #4ade80; }
.fav-tldr-block--analyze   { background: #fefce8; border-left: 3px solid #facc15; }
.fav-tldr-block-label {
  font-weight: 700;
  font-size: .72rem;
  color: var(--text-tertiary, #9ca3af);
  margin-bottom: .3rem;
}
.fav-tldr-block-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .25rem;
}
.fav-tldr-block-body { color: var(--text-secondary); }

/* ── TLDR 操作按钮组 ────────────────────────────────────────── */
.fav-tldr-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.fav-tldr-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  padding: .28rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-light);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.fav-tldr-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.fav-tldr-btn.done {
  background: var(--ai-bg);
  color: var(--primary);
  border-color: var(--primary);
}

/* ── 热搜热度 & 封面 ────────────────────────────────────────── */
.fav-hot-value {
  display: inline-block;
  font-size: .72rem;
  color: #ea580c;
  background: #fff7ed;
  border-radius: 4px;
  padding: .1rem .4rem;
  margin-bottom: .4rem;
}
/* 固定 16:9 容器，横竖图统一裁切，不变形 */
.fav-hot-cover-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;   /* 16:9 */
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: .6rem;
  background: var(--border-color, #f3f4f6);
}
.fav-hot-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 0;
  margin: 0;
  transition: transform .3s ease;
}
.fav-hot-cover-wrap:hover .fav-hot-cover {
  transform: scale(1.03);
}
.fav-hot-detail {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: .3rem 0 0;
}

/* ── 评论模块对齐（与卡片内容保持一致的左右边距）──────────── */
/* 覆盖 main.css 里评论区可能有的 padding/margin，使其与卡片 body 对齐 */
.fav-card .comments-section {
  padding: 0;
  margin: 0;
}

/* ── 底部元信息栏 ────────────────────────────────────────────── */
.fav-card-meta {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .45rem 1rem .55rem;
  border-top: 1px solid var(--border-color, #f3f4f6);
  font-size: .71rem;
  color: var(--text-tertiary, #9ca3af);
  flex-wrap: wrap;
}
.fav-meta-link {
  color: var(--accent-color, #2563eb);
  text-decoration: none;
  font-weight: 500;
}
.fav-meta-link:hover { text-decoration: underline; }

/* ── 暗色主题 ────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .fav-card { background: var(--surface); }
  .fav-type-badge--news      { background: var(--ai-bg); color: var(--primary); }
  .fav-type-badge--tldr      { background: var(--ai-bg); color: var(--success); }
  .fav-type-badge--hotsearch { background: var(--hover); color: var(--warning); }
  .fav-ai-insight  { background: var(--ai-bg); border-color: var(--primary); }
  .fav-tldr-block--translate { background: var(--ai-bg); border-color: var(--success); }
  .fav-tldr-block--analyze   { background: var(--ai-bg); border-color: var(--warning); }
  .fav-hot-value   { background: var(--hover); color: var(--text-light); }
  .fav-tldr-btn.done { background: var(--ai-bg); color: var(--primary); border-color: var(--primary); }
  .fav-star-btn:hover { background: var(--hover); }
}

/* ── 主题变量兜底（防止 var() 无效时没有背景）─────────────── */
@supports not (background: var(--card-bg)) {
  .fav-card { background: #ffffff; }
}

/* ── 收藏卡片内评论区对齐修正 ──────────────────────────────── */
/* 评论区贴紧卡片边缘，与卡片内容对齐，去掉额外外边距 */
.fav-card .comments-section {
  margin: 0;
  border-top: 1px solid var(--border-color, #f0f0f0);
  /* 评论区头部（评论数 + 展开按钮）左右与卡片内容对齐 */
}
.fav-card .comments-header {
  padding: .65rem 1rem;
}
.fav-card .comments-title {
  font-size: .82rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.fav-card .comment-toggle {
  font-size: .78rem;
  padding: .2rem .6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: background .15s;
}
.fav-card .comment-toggle:hover {
  background: var(--hover);
}
/* 展开后的评论内容区 */
.fav-card .comments-content {
  padding: 0 1rem .8rem;
}
.fav-card .comments-content.active {
  display: block;
}
/* 输入框撑满卡片宽度 */
.fav-card .comment-textarea {
  width: 100%;
  box-sizing: border-box;
}

/* ── 序号徽章（替代类型徽章，用于新闻/TLDR/热搜列表页）──── */
.fav-index-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 .5rem;
  border-radius: 8px;
  background: var(--primary, #3b82f6);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  flex-shrink: 0;
}

/* ── TLDR 翻译/分析块（列表页复用收藏页样式）──────────────── */
/* tldr.js 生成的 .tldr-translation / .tldr-analyze 默认隐藏，
   加 .visible 后显示，映射到 fav-tldr-block 的外观 */
.fav-card .tldr-translation,
.fav-card .tldr-analyze {
  display: none;
  border-radius: 8px;
  padding: .55rem .75rem;
  margin-bottom: .5rem;
  font-size: .82rem;
  line-height: 1.55;
}
.fav-card .tldr-translation.visible { display: block; background: #f0fdf4; border-left: 3px solid #4ade80; }
.fav-card .tldr-analyze.visible     { display: block; background: #fefce8; border-left: 3px solid #facc15; }

.fav-card .tldr-translation-label,
.fav-card .tldr-analyze-label {
  font-weight: 700;
  font-size: .72rem;
  color: var(--text-tertiary, #9ca3af);
  margin-bottom: .3rem;
}
.fav-card .tldr-translation-title { font-weight: 600; color: var(--text-primary); margin-bottom: .25rem; }
.fav-card .tldr-translation-body,
.fav-card .tldr-analyze-body      { color: var(--text-secondary); }

@media (prefers-color-scheme: dark) {
  .fav-card .tldr-translation.visible { background: #052e16; border-color: #166534; }
  .fav-card .tldr-analyze.visible     { background: #1c1917; border-color: #78350f; }
}