@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/playfair-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/playfair-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/playfair-latin.woff2") format("woff2");
}
:root {
  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-soft: #fbfdfc;
  --line: #e2ece7;
  --line-strong: #d3e2db;
  --ink: #16332a;
  --ink-soft: #47655b;
  --muted: #7c9188;
  --brand: #23715c;
  --brand-deep: #1b5445;
  --brand-sky: #2f80b7;
  --brand-soft: #e4f1ec;
  --danger: #dc5f4b;
  --font-display: "Playfair Display", "Noto Serif SC", "Songti SC", "STZhongsong", "STSong", "SimSun", serif;
  --radius-lg: 24px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { cursor: pointer; font-family: inherit; }
a { color: var(--brand-deep); text-decoration: none; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid rgba(35, 113, 92, 0.55); outline-offset: 2px;
}

/* ---------- 背景装饰 ---------- */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.orb-a { width: 420px; height: 420px; background: radial-gradient(circle, rgba(35, 113, 92, 0.16), transparent 70%); top: -120px; right: -80px; }
.orb-b { width: 380px; height: 380px; background: radial-gradient(circle, rgba(185, 138, 31, 0.13), transparent 70%); bottom: -100px; left: -60px; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(22, 51, 42, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 51, 42, .05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}

/* ---------- 头部 ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 28px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-sky));
  color: #fff; font-size: 22px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 10px 22px -12px rgba(47, 128, 183, .7);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 22px; letter-spacing: .5px; font-weight: 800; font-family: var(--font-display); }
.brand-text span { font-size: 12px; color: var(--muted); }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 最新动态滚动条 ---------- */
.news-ticker {
  display: flex; align-items: center; gap: 12px;
  background: #ffffff; border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 16px; margin: 4px 28px 2px;
  box-shadow: 0 10px 24px -18px rgba(22, 51, 42, 0.45);
}
.news-ticker .nt-badge {
  flex: none; font-size: 10px; font-weight: 800; letter-spacing: 1.6px;
  color: #fff; background: linear-gradient(135deg, var(--gold, #b98a1f), #a87c18);
  padding: 3px 10px; border-radius: 6px; text-transform: uppercase;
}
.nt-viewport { flex: 1; min-width: 0; overflow: hidden; }
.nt-track {
  display: flex; align-items: center; white-space: nowrap;
  will-change: transform; animation: nt-roll 42s linear infinite;
}
.news-ticker:hover .nt-track { animation-play-state: paused; }
@keyframes nt-roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.nt-item { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); padding-right: 34px; }
.nt-item i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.nt-item .nt-src { color: var(--muted); font-size: 11px; margin-left: 2px; }
.model-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-soft);
}
.model-badge i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.back-link { font-size: 14px; color: var(--brand-deep); font-weight: 600; }

/* ---------- Logo 徽标 & 主导航 ---------- */
.brand-emblem { width: 44px; height: 44px; flex: none; display: block; }
.brand-emblem svg { width: 100%; height: 100%; display: block; }
.main-nav {
  display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%;
  overflow-x: auto; scrollbar-width: none; padding: 2px 0;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  flex: none; white-space: nowrap; padding: 7px 15px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.main-nav a:hover { background: var(--brand-soft); color: var(--brand-deep); }
.main-nav a.active {
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px -8px rgba(35,113,92,.8);
}

/* ---------- 首页 ---------- */
.home-main { max-width: 1080px; margin: 0 auto; padding: 12px 20px 40px; }
.hero { text-align: center; padding: 34px 8px 10px; }
.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: 3px; color: var(--brand-deep);
  background: var(--brand-soft); border: 1px solid rgba(35,113,92,.2);
  padding: 5px 14px; border-radius: 999px; margin: 0 0 14px; font-weight: 600;
}
.hero h1 { font-size: clamp(26px, 4.6vw, 44px); margin: 0 0 12px; line-height: 1.2; }
.hero h1 span { background: linear-gradient(90deg, var(--brand), var(--brand-sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--ink-soft); font-size: 15px; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0; }
.stat-chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px; text-align: center;
}
.stat-chip b { display: block; font-size: 26px; color: var(--brand-deep); }
.stat-chip span { font-size: 12.5px; color: var(--muted); }

.modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.module-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 18px; color: var(--ink); position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.mc-icon {
  width: 46px; height: 46px; border-radius: 14px; flex: none; font-size: 20px; font-weight: 700;
  color: #fff; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mc), color-mix(in srgb, var(--mc), #fff 25%));
}
.mc-body { flex: 1; min-width: 0; }
.mc-body h3 { margin: 0 0 4px; font-size: 16px; }
.mc-body p { margin: 0; font-size: 12.8px; color: var(--muted); line-height: 1.5; }
.mc-count {
  font-size: 13px; font-weight: 700; color: var(--brand-deep); white-space: nowrap;
  background: var(--brand-soft); border-radius: 999px; padding: 3px 10px;
}
.mc-arrow { color: var(--line-strong); font-size: 18px; }

.sos { text-align: center; margin: 30px 0 6px; }
.sos-btn {
  border: none; border-radius: 999px; padding: 14px 40px; font-size: 17px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--danger), #f59e0b);
  box-shadow: 0 16px 34px -14px rgba(220, 95, 75, .7);
  transition: transform .15s ease;
}
.sos-btn:hover { transform: scale(1.04); }
.sos-hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* ---------- 模块页 ---------- */
.page-main { max-width: 1000px; margin: 0 auto; padding: 8px 20px 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 0; }
.page-head h2 { margin: 0; font-size: 22px; font-family: var(--font-display); }
.page-head .count-pill {
  background: var(--brand-soft); color: var(--brand-deep); font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 16px; }
.search-box {
  flex: 1; min-width: 220px; display: flex; border: 1px solid var(--line-strong);
  background: var(--surface); border-radius: 12px; overflow: hidden;
}
.search-box input { flex: 1; border: none; outline: none; padding: 11px 14px; font-size: 14px; background: transparent; color: var(--ink); }
.search-box button {
  border: none; background: var(--brand); color: #fff; padding: 0 18px; font-size: 14px; font-weight: 600;
}
.pager { display: flex; gap: 8px; align-items: center; }
.pager button {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px;
  padding: 8px 14px; font-size: 13px; color: var(--ink-soft);
}
.pager button:disabled { opacity: .45; cursor: default; }

/* 数据列表 */
.data-list { display: flex; flex-direction: column; gap: 10px; }
.d-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px;
}
.d-item h4 { margin: 0 0 5px; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.d-item p { margin: 0; font-size: 13.4px; color: var(--ink-soft); }
.d-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink-soft);
}
.tag.brand { background: var(--brand-soft); color: var(--brand-deep); border-color: rgba(35,113,92,.25); }
.tag.orange { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.tag.red { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.tag.green { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.tag.blue { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.tag.purple { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.tag.gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.en-term { color: var(--brand-deep); font-weight: 700; font-size: 14.5px; }
.d-item a.src { color: var(--brand-sky); word-break: break-all; }

/* 问答页 */
.qa-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.qa-box textarea {
  width: 100%; min-height: 96px; border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-family: inherit; resize: vertical; background: var(--surface-soft); color: var(--ink);
}
.qa-actions { display: flex; justify-content: flex-end; margin-top: 12px; gap: 10px; }
.btn-primary {
  border: none; border-radius: 12px; padding: 10px 22px; font-size: 14.5px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-sky));
}
.btn-ghost { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 10px 18px; font-size: 14.5px; color: var(--ink-soft); }
.qa-answer { margin-top: 18px; }
.qa-refs { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12.8px; color: var(--muted); }
.qa-empty { text-align: center; color: var(--muted); padding: 30px 0; }

.empty-state { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(10, 30, 40, .45); padding: 20px; backdrop-filter: blur(3px);
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 460px; width: 100%;
  padding: 24px; box-shadow: var(--shadow-lg);
}
.modal-card h3 { margin: 0 0 12px; }
.sos-list { margin: 0 0 18px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 页脚 / 通用 ---------- */
.site-footer {
  text-align: center; padding: 22px 16px 40px; color: var(--muted); font-size: 12.8px;
}
.site-footer .disclaimer { margin-top: 4px; opacity: .85; }

.fullscreen-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.fullscreen-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 12px;
  font-size: 13.5px; z-index: 70; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .modules { grid-template-columns: 1fr; }
  .site-header { padding: 14px 16px; }
  .home-main, .page-main { padding-left: 14px; padding-right: 14px; }
  .module-card { padding: 14px; }
}
@media (min-width: 1440px) {
  .home-main, .page-main { max-width: 1180px; }
}
