/* 溯曜中医知识库 · 第一期
   配色取自用户抖音头像 / 背景原图（深青夜色底、淡青荧光、暖金太极五行）。
   排版与间距按 Fluent / Material 的克制路子：4px 基线、柔和圆角、淡阴影、克制主色。
   两套主题共用同一套版式，只换底色与点缀色，同一屏内不混色。 */

/* ===== 青套（默认：首页、本草、资源库、关于） ===== */
body {
  --bg: #08161a;
  --bg-soft: #0b1e22;
  --panel: #0f262b;
  --panel-2: #123038;
  --border: rgba(163, 216, 207, .14);
  --border-strong: rgba(163, 216, 207, .32);
  --text: #f2ede3;
  --muted: #a9bcb6;
  --faint: #7d938d;
  --accent: #a3d8cf;
  --accent-bright: #c9f2e8;
  --accent-dim: #6fb3a4;
  --on-accent: #06231f;
  --header-bg: rgba(8, 22, 26, .86);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .28);
  --ring: 0 0 0 3px rgba(163, 216, 207, .25);
}

/* ===== 金套（医理板块及文章页） ===== */
body.theme-jin {
  --bg: #0f0c08;
  --bg-soft: #14100a;
  --panel: #1a1409;
  --panel-2: #231a0c;
  --border: rgba(218, 182, 109, .17);
  --border-strong: rgba(218, 182, 109, .36);
  --text: #f4ecdc;
  --muted: #b3a888;
  --faint: #8d8168;
  --accent: #dab66d;
  --accent-bright: #f0d48f;
  --accent-dim: #b99a55;
  --on-accent: #241a08;
  --header-bg: rgba(15, 12, 8, .86);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .32);
  --ring: 0 0 0 3px rgba(218, 182, 109, .25);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--on-accent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ===== 顶栏 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  display: block;
}
.brand-name { font-size: 17px; font-weight: 650; letter-spacing: .02em; }
.site-nav { display: flex; gap: 18px; }
.site-nav a { color: var(--muted); font-size: 14px; }
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* ===== 首屏横幅（原图原比例，不裁切、不变形） ===== */
.hero { padding-top: 24px; }
.hero-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-title {
  margin: 28px 0 0;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .01em;
}
.en-sub {
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.tagline { margin: 12px 0 0; color: var(--muted); font-size: 16px; }

/* ===== 搜索 ===== */
.search-box { margin: 24px 0 0; }
.search-box input {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.search-box input::placeholder { color: var(--faint); }
.search-box input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.search-results { display: grid; gap: 8px; margin-top: 8px; }
.search-hit {
  display: block;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}
.search-hit:hover { border-color: var(--border-strong); text-decoration: none; }
.search-hit-tag {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
}
.search-hit-title { font-size: 15.5px; font-weight: 600; }
.search-hit-sum { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; }
.search-empty { padding: 12px 4px; color: var(--faint); font-size: 14px; }

/* ===== 板块与卡片 ===== */
.section { margin-top: 48px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { margin: 6px 0 0; font-size: 22px; line-height: 1.35; font-weight: 700; }
.section-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
}
.section-kicker::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: border-color .16s ease, transform .16s ease;
}
a.card:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }

.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  color: var(--text);
  position: relative;
}
.link-title { font-size: 16px; font-weight: 600; }
.link-desc { color: var(--muted); font-size: 13.5px; }
.link-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 20px;
}
.link-card.placeholder { border-style: dashed; box-shadow: none; cursor: default; }
.link-card.placeholder:hover { border-color: var(--border); transform: none; }

.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.section-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  color: var(--text);
}
.section-title { font-size: 20px; font-weight: 700; }
.section-desc { color: var(--muted); font-size: 14.5px; }
.section-meta { margin-top: 6px; color: var(--accent); font-size: 13.5px; }

.resource-entry {
  display: block;
  padding: 20px 22px;
  color: var(--text);
}
.resource-entry .section-desc { margin-top: 4px; }

.about-strip {
  margin-top: 48px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14.5px;
}
.about-strip p { margin: 0; }

/* ===== 文章目录 ===== */
.article-list { display: grid; gap: 12px; }
.article-item { display: block; padding: 18px 20px; color: var(--text); }
.article-item-title { display: block; font-size: 17px; font-weight: 600; line-height: 1.5; }
.article-item-sum { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.article-item-meta { display: block; margin-top: 8px; color: var(--faint); font-size: 13px; }

/* ===== 文章正文 ===== */
.article { padding-top: 28px; padding-bottom: 64px; }
.back-link { color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--text); text-decoration: none; }
.article-title {
  margin: 16px 0 0;
  font-size: 28px;
  line-height: 1.35;
  font-weight: 700;
}
.article-meta { margin: 10px 0 0; color: var(--faint); font-size: 13.5px; }
.article-body { margin-top: 28px; font-size: 17px; line-height: 2; }
.article-body h2 {
  margin: 44px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--accent-bright);
  font-size: 21px;
  line-height: 1.45;
  font-weight: 700;
}
.article-body h3 { margin: 32px 0 12px; font-size: 18px; line-height: 1.5; font-weight: 650; }
.article-body h4 { margin: 28px 0 10px; font-size: 17px; line-height: 1.5; font-weight: 650; }
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  margin: 0 0 20px;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--bg-soft);
  color: var(--muted);
}
.article-body blockquote p { margin: 0 0 8px; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.7;
}
.article-body th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  vertical-align: top;
}
.article-body td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.article-body hr { margin: 32px 0; border: none; border-top: 1px solid var(--border); }
.article-body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--panel-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
}
.article-body pre {
  padding: 16px;
  border-radius: 12px;
  background: var(--panel);
  overflow-x: auto;
}
.article-body pre code { padding: 0; background: none; }
.article-body img { border-radius: 12px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.pager-card { display: block; padding: 16px 18px; color: var(--text); }
.pager-label { display: block; color: var(--faint); font-size: 12.5px; letter-spacing: .08em; }
.pager-title { display: block; margin-top: 4px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.article-foot { margin-top: 28px; color: var(--faint); font-size: 14px; text-align: center; }

/* ===== 资源库 / 关于 ===== */
.page-head { padding-top: 32px; }
.page-head h1 { margin: 0; font-size: 28px; line-height: 1.35; font-weight: 700; }
.page-head .tagline { margin-top: 10px; }
.resource-list { display: grid; gap: 12px; margin-top: 24px; }
.resource-card { padding: 20px 22px; }
.resource-name { font-size: 17px; font-weight: 650; }
.resource-url {
  display: block;
  margin-top: 2px;
  color: var(--accent-dim);
  font-size: 13px;
  word-break: break-all;
}
.resource-desc { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }
.resource-warn {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.about-card { margin-top: 24px; padding: 24px; }
.about-big { margin: 0 0 12px; font-size: 20px; font-weight: 700; line-height: 1.5; }
.about-card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.about-card p:last-child { margin-bottom: 0; }

/* ===== 404 ===== */
.notfound { padding-top: 72px; padding-bottom: 72px; text-align: center; }
.notfound-code {
  margin: 0;
  color: var(--accent);
  font-size: 64px;
  font-weight: 700;
  letter-spacing: .04em;
}
.notfound h1 { margin: 8px 0 0; font-size: 22px; }
.notfound p { margin: 10px 0 0; color: var(--muted); }
.notfound .card { display: inline-block; margin-top: 28px; padding: 12px 28px; color: var(--text); }

/* ===== 页脚 ===== */
.site-footer {
  margin-top: 64px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
}
.footer-line { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.site-footer p { margin: 10px 0 0; }
.deco-ring {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  opacity: .8;
  flex: none;
}

/* ===== 小屏 ===== */
@media (max-width: 640px) {
  .hero { padding-top: 16px; }
  .hero-img { border-radius: 14px; }
  .hero-title { font-size: 28px; }
  .article-title { font-size: 25px; }
  .page-head h1 { font-size: 25px; }
  .section { margin-top: 36px; }
  .link-grid, .section-grid, .pager { grid-template-columns: 1fr; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 13.5px; }
  .article-body { font-size: 16.5px; }
  .article-body table { font-size: 14px; }
  .article-body th, .article-body td { padding: 8px; }
  .card, .link-card, .section-card, .resource-card, .about-card { padding-left: 16px; padding-right: 16px; }
}
