/* =============================================
   澜湄救通 · 应急语言服务平台
   主样式表 - 主题色：深青 #0F766E / 翡翠绿 #99F6E4
   ============================================= */

:root {
  --primary: #0F766E;
  --primary-dark: #0C5A54;
  --primary-light: #14B8A6;
  --accent: #99F6E4;
  --accent-dark: #134E4A;
  --danger: #DC2626;
  --warning: #F59E0B;
  --success: #10B981;

  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-elev: #F1F5F9;
  --text: #1F2937;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12);

  --term-highlight-bg: #FEF3C7;
  --term-highlight-border: #F59E0B;
  --term-highlight-text: #92400E;
  --term-match-bg: #D1FAE5;
  --term-match-text: #065F46;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 暗色主题 */
.theme-dark {
  --bg: #0F172A;
  --bg-card: #1E293B;
  --bg-elev: #334155;
  --text: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --border: #334155;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  transition: background .3s, color .3s;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }

/* ============ 导航 ============ */
.nav-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}
.theme-dark .nav-header {
  background: rgba(15,23,42,.92);
}
.nav-header.scrolled { box-shadow: var(--shadow); }

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-icon {
  font-size: 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.logo-text { display: flex; flex-direction: column; }
.logo-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 4px;
}
.nav-item {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: all .2s;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-elev); color: var(--primary); text-decoration: none; }
.nav-item.active { background: var(--bg-elev); color: var(--primary); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-select,
.term-lang-filter,
.term-domain-filter,
.term-status-filter,
.corpus-lang-filter,
.corpus-source-filter,
.intel-filters select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s;
}
.lang-select:hover, select:hover { border-color: var(--primary); }
.theme-toggle {
  font-size: 18px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  transition: all .2s;
}
.theme-toggle:hover { background: var(--bg-elev); }
.nav-toggle {
  display: none;
  font-size: 22px;
  background: none;
  border: none;
  color: var(--text);
}

/* ============ 页面区域 ============ */
.page-section {
  display: none;
  padding-top: 64px;
}
.page-section.active {
  display: block;
  animation: fadeIn .4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 20px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.section-num {
  font-size: 56px;
  font-weight: 700;
  color: var(--accent-dark);
  opacity: .2;
  line-height: 1;
}
.section-meta .section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.section-meta .section-desc {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 15px;
}

/* ============ Hero Banner ============ */
.hero-banner {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top right, rgba(20,184,166,.15), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(15,118,110,.12), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg));
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent);
  color: var(--accent-dark);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}
.theme-dark .hero-badge {
  background: var(--primary);
  color: var(--accent);
}
.hero-title {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 36px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 640px;
  margin: 0 auto 36px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

/* ============ 功能卡片 ============ */
.features-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  transition: all .25s;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
  text-decoration: none;
}
.feature-icon {
  font-size: 40px;
  margin-bottom: 14px;
}
.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 12px;
}
.feature-meta {
  display: flex;
  gap: 8px;
}
.chip {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg-elev);
  border-radius: 100px;
  color: var(--text-secondary);
}

/* ============ 场景 ============ */
.scenario-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}
.scenario-section .section-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
}
.scenario-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.scenario-icon {
  font-size: 36px;
  margin-bottom: 10px;
}
.scenario-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
.scenario-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ 情报聚合 ============ */
.intel-toolbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.intel-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.intel-search,
.term-search,
.corpus-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.intel-search:focus, .term-search:focus, .corpus-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.1);
}

.intel-sources-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
}
.source-chip:hover { border-color: var(--primary); color: var(--primary); }
.source-chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.source-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.intel-list {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.intel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.intel-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.intel-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.tag-earthquake { background: #FEE2E2; color: #991B1B; }
.tag-flood { background: #DBEAFE; color: #1E40AF; }
.tag-typhoon { background: #FEF3C7; color: #92400E; }
.tag-landslide { background: #F3E8FF; color: #6B21A8; }
.tag-other { background: #E5E7EB; color: #374151; }
.theme-dark .tag-earthquake { background: rgba(239,68,68,.2); color: #FCA5A5; }
.theme-dark .tag-flood { background: rgba(59,130,246,.2); color: #93C5FD; }
.theme-dark .tag-typhoon { background: rgba(245,158,11,.2); color: #FCD34D; }
.theme-dark .tag-landslide { background: rgba(139,92,246,.2); color: #C4B5FD; }
.theme-dark .tag-other { background: rgba(156,163,175,.2); color: #D1D5DB; }

.intel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.intel-summary {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.intel-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.intel-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.intel-source a { color: var(--primary); }

/* ============ 翻译 ============ */
.translate-box {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.translate-langs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.swap-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--primary);
  font-size: 16px;
  transition: all .2s;
}
.swap-btn:hover { background: var(--accent); border-color: var(--primary); }

.translate-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.translate-pane {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.translate-pane textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: none;
  resize: vertical;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}
.translate-pane textarea:focus { outline: none; }
.tgt-content {
  padding: 16px;
  min-height: 200px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}
.pane-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.pane-btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  font-size: 16px;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.pane-btn:hover { background: var(--border); }
.char-count { font-size: 12px; color: var(--text-muted); }
.status-badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--bg-elev);
  color: var(--text-muted);
}
.status-badge.success { background: #D1FAE5; color: #065F46; }
.theme-dark .status-badge.success { background: rgba(16,185,129,.2); color: #6EE7B7; }

/* 术语高亮 */
.term-highlight {
  background: var(--term-highlight-bg);
  border-bottom: 2px solid var(--term-highlight-border);
  color: var(--term-highlight-text);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 500;
}
.theme-dark .term-highlight {
  background: rgba(245,158,11,.25);
  color: #FCD34D;
  border-bottom-color: #F59E0B;
}
.term-match {
  background: var(--term-match-bg);
  border-bottom: 2px solid var(--success);
  color: var(--term-match-text);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 500;
}
.theme-dark .term-match {
  background: rgba(16,185,129,.25);
  color: #6EE7B7;
  border-bottom-color: #10B981;
}

.term-hits {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.term-hits h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary);
}
.term-hit-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.term-hit-item:last-child { border-bottom: none; }
.term-hit-orig { color: var(--text-muted); min-width: 120px; }
.term-hit-arrow { color: var(--primary); }
.term-hit-trans { color: var(--text); font-weight: 500; }

.corpus-refs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.corpus-refs h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary);
}
.corpus-ref-item {
  padding: 10px 12px;
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
}
.corpus-ref-score {
  float: right;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.btn-translate {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  margin-bottom: 24px;
}

.hidden { display: none !important; }

.quick-phrases {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.quick-phrases h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-secondary);
}
.phrase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.phrase-item {
  padding: 10px 14px;
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
  font-size: 13px;
  color: var(--text);
}
.phrase-item:hover {
  background: var(--accent);
  color: var(--accent-dark);
  transform: translateX(2px);
}

/* ============ 术语 ============ */
.terms-toolbar,
.corpus-toolbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.term-list,
.corpus-list {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.term-item,
.corpus-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
  cursor: pointer;
}
.term-item:hover,
.corpus-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
}
.term-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.term-cn {
  font-size: 17px;
  font-weight: 600;
}
.term-domain {
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-elev);
  color: var(--text-secondary);
}
.term-translations {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.term-trans-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  align-items: baseline;
}
.term-lang-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-dark);
  min-width: 28px;
  text-align: center;
}
.theme-dark .term-lang-tag {
  background: var(--primary);
  color: var(--accent);
}
.term-lang-val {
  color: var(--text);
  font-weight: 500;
}
.term-foot,
.corpus-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.status-approved {
  color: var(--success);
  font-weight: 600;
}
.status-reviewing {
  color: var(--warning);
  font-weight: 600;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border: none;
  background: var(--bg-elev);
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* 语料 */
.corpus-item { cursor: default; }
.corpus-src, .corpus-tgt {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.corpus-src {
  background: var(--bg-elev);
  border-left: 3px solid var(--primary);
}
.corpus-tgt {
  background: var(--accent);
  border-left: 3px solid var(--success);
  color: var(--accent-dark);
}
.theme-dark .corpus-tgt {
  background: rgba(20,184,166,.15);
  color: var(--accent);
}
.vector-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--bg-elev);
  color: var(--text-muted);
}
.vector-status.ready { background: var(--term-match-bg); color: var(--term-match-text); }
.theme-dark .vector-status.ready { background: rgba(16,185,129,.2); color: #6EE7B7; }

/* ============ RAG 问答 ============ */
.qa-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.qa-chat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 480px;
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.chat-welcome {
  text-align: center;
  padding: 40px 20px;
}
.chat-welcome-icon { font-size: 48px; margin-bottom: 16px; }
.chat-welcome h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.chat-welcome p { color: var(--text-muted); margin-bottom: 24px; }
.quick-questions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
}
.qq-btn {
  padding: 12px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  text-align: left;
  transition: all .2s;
}
.qq-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--accent);
}

.chat-msg {
  padding: 14px 18px;
  border-radius: var(--radius);
  max-width: 85%;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-msg.user {
  background: var(--primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  background: var(--bg-elev);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.deny {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}
.theme-dark .chat-msg.deny {
  background: rgba(220,38,38,.1);
  border-color: rgba(220,38,38,.3);
  color: #FCA5A5;
}
.chat-sources {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.chat-source-item {
  font-size: 12px;
  padding: 6px 10px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .2s;
}
.chat-source-item:hover { background: var(--accent); }
.citation-link {
  display: inline-block;
  padding: 1px 6px;
  background: var(--accent);
  color: var(--accent-dark);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 2px;
  cursor: pointer;
  transition: background .2s;
}
.theme-dark .citation-link {
  background: var(--primary);
  color: var(--accent);
}
.citation-link:hover { text-decoration: underline; }

.chat-typing {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
}
.typing-dot {
  width: 8px; height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.qa-input-bar {
  display: flex;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.qa-input-bar textarea {
  flex: 1;
  border: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  max-height: 150px;
}
.qa-input-bar textarea:focus { outline: none; }
.qa-send {
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  transition: background .2s;
}
.qa-send:hover { background: var(--primary-dark); }
.qa-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

/* ============ 页脚 ============ */
.site-footer {
  background: var(--accent-dark);
  color: #CBD5E1;
  padding: 48px 24px 20px;
  margin-top: 60px;
}
.site-footer h4 {
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}
.site-footer p { font-size: 13px; line-height: 1.6; }
.site-footer ul { list-style: none; }
.site-footer li {
  font-size: 13px;
  padding: 3px 0;
  color: #94A3B8;
}
.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  padding-bottom: 24px;
}
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(148,163,184,.2);
  text-align: center;
  font-size: 12px;
  color: #64748B;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .translate-panes { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .intel-list, .term-list, .corpus-list {
    grid-template-columns: 1fr;
  }
  .section-num { font-size: 40px; }
  .section-meta .section-title { font-size: 22px; }
  .intel-toolbar, .terms-toolbar, .corpus-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .intel-filters { flex-direction: column; }
  .intel-filters select { width: 100%; }
  .qa-chat { min-height: 400px; }
  .chat-msg { max-width: 95%; }
}

@media (max-width: 480px) {
  .hero-banner { padding: 80px 16px 40px; min-height: 420px; }
  .hero-stats { gap: 10px; }
  .stat-card { padding: 12px 8px; }
  .stat-num { font-size: 22px; }
  .hero-cta { flex-direction: column; }
  .btn { width: 100%; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
