:root {
  --bg: #f0ede3;
  --bg-deep: #e9e5d8;
  --card: #fffdf7;
  --card-2: #f5f2e7;
  --ink: #232019;
  --ink-soft: #6f6a58;
  --accent: #9c7c2e;
  --line: rgb(35 32 25 / 16%);
  --line-soft: rgb(35 32 25 / 9%);
  --ok: #3d7d50;
  --warn: #936b1c;
  --bad: #b23a32;
  --radius: 18px;
  --shadow: 0 24px 60px rgb(35 32 25 / 10%);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.65 'Almarai', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 46px;
  padding: .7rem 1.5rem; border: 1px solid transparent; border-radius: 999px;
  color: #f4f1e6; background: var(--ink); cursor: pointer; font-weight: 700;
}
button:hover, .button:hover { color: #f4f1e6; background: #3b372a; }
input, textarea, select {
  width: 100%; padding: .75rem .9rem; border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); background: #fff;
}
input::placeholder, textarea::placeholder { color: #a49e8b; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgb(156 124 46 / 35%); border-color: var(--accent); }
input[type="radio"], input[type="checkbox"] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; }
code { padding: .1em .35em; border-radius: 5px; background: var(--bg-deep); color: var(--ink); }
h1, h2, h3 { color: var(--ink); }
h1, h2 { margin-top: 0; font-family: 'Almarai', 'Songti SC', 'STSong', 'PingFang SC', serif; line-height: 1.15; }
h1 { margin-bottom: 1.2rem; font-size: clamp(2.4rem, 6vw, 5rem); font-weight: 500; letter-spacing: -.03em; }
h2 { margin-bottom: .7rem; font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 700; }
h3 { font-size: 1.05rem; }

/* —— 布局基础 —— */
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(760px, calc(100% - 40px)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* —— 噪点纹理 —— */
.noise-overlay { position: absolute; inset: 0; z-index: 1; mix-blend-mode: overlay; opacity: .4; pointer-events: none; }
.noise-overlay::before, .bg-noise::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-noise { position: relative; overflow: hidden; }
.bg-noise::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .07; z-index: 0; pointer-events: none;
}
.bg-noise > * { position: relative; z-index: 1; }

/* —— 顶部胶囊导航（暖白磨砂玻璃） —— */
.site-header {
  position: fixed; z-index: 50; top: 0; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 24px);
  padding: .55rem .85rem; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 1.35rem 1.35rem; background: rgb(255 253 247 / 82%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgb(35 32 25 / 12%);
}
.site-header nav { display: flex; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: .6rem; margin-right: .6rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #f4f1e6; background: var(--ink); font: 800 17px/1 'Almarai', 'Songti SC', serif; }
.brand-copy strong, .brand-copy small { display: block; line-height: 1.15; }
.brand-copy strong { font-family: 'Almarai', 'Songti SC', serif; font-style: normal; font-size: .98rem; letter-spacing: .02em; }
.brand-copy small { margin-top: .15rem; color: var(--ink-soft); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; }
nav a, nav .link-button { color: rgb(35 32 25 / 75%); font-size: .8rem; font-weight: 400; white-space: nowrap; }
nav a:hover, nav .link-button:hover { color: var(--ink); }
nav form { display: inline; }
.link-button { min-height: 0; padding: 0; border: 0; color: inherit; background: none; font-weight: inherit; }
.link-button:hover { color: inherit; background: none; }
.nav-cta { padding: .32rem .8rem; border: 1px solid rgb(35 32 25 / 30%); border-radius: 999px; }
.nav-cta:hover { border-color: var(--ink); }
body { padding-top: 64px; }

/* —— 消息 —— */
.messages { position: fixed; z-index: 60; top: 78px; right: 20px; width: min(400px, calc(100% - 40px)); transition: opacity .7s ease; }
.message { padding: .85rem 1.1rem; border: 1px solid rgb(61 125 80 / 30%); border-radius: 12px; background: #e9f4ec; color: #2f6b40; box-shadow: var(--shadow); }
.message.error { border-color: rgb(178 58 50 / 28%); background: #f8e8e6; color: #93332c; }

/* —— 文本动效 —— */
.wp { display: inline-flex; flex-wrap: wrap; }
.wp-w { display: inline-block; opacity: 0; transform: translateY(20px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * .08s); }
.wp.in .wp-w { opacity: 1; transform: none; }
.char-reveal .ch { opacity: .2; transition: opacity .25s linear; }
.reveal { opacity: 0; transform: scale(.95) translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * .15s); }
.reveal.in { opacity: 1; transform: none; }

/* —— Hero —— */
.hero { padding: 18px 0 0; }
.hero-inner {
  position: relative; overflow: hidden;
  border-radius: 24px; border: 1px solid var(--line-soft);
  background:
    radial-gradient(60% 55% at 78% 12%, rgb(156 124 46 / 14%), transparent 65%),
    radial-gradient(45% 40% at 12% 85%, rgb(156 124 46 / 9%), transparent 60%),
    linear-gradient(180deg, #fdfbf3, #efece1 55%);
}
.hero-inner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(240 237 227 / 65%)); z-index: 1; }
.hero-content { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 2.6rem; padding: 92px 40px 108px; text-align: center; }
.hero-title {
  margin: 0; font-size: clamp(4.6rem, 16vw, 13rem); font-weight: 500; line-height: .85;
  letter-spacing: -.07em; color: var(--ink);
}
.hero-side { display: grid; justify-items: center; gap: 1.6rem; max-width: 660px; }
.hero-side p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.85; }
.hero-cta { display: inline-flex; align-items: center; gap: .6rem; padding: .3rem .3rem .3rem 1.35rem; border-radius: 999px; color: #f4f1e6; background: var(--ink); font-weight: 700; font-size: .95rem; transition: gap .35s var(--ease); }
.hero-cta:hover { gap: .9rem; color: #f4f1e6; }
.hero-cta .dot { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #f4f1e6; transition: transform .35s var(--ease); }
.hero-cta:hover .dot { transform: scale(1.1); }
.hero-cta svg { color: var(--ink); }
.hero-search { display: flex; width: min(480px, 100%); padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / 78%); backdrop-filter: blur(8px); }
.hero-search input { border: 0; background: transparent; }
.hero-search input:focus { outline: none; }
.hero-search button { min-width: 88px; }
.eyebrow { margin: 0 0 .8rem; color: var(--accent); font-family: 'Instrument Serif', 'Songti SC', serif; font-style: italic; font-size: .95rem; letter-spacing: .05em; text-transform: none; }
.lede { max-width: 720px; color: var(--ink-soft); }

/* —— About —— */
.about { padding: 90px 0 70px; }
.about-card { max-width: 1100px; margin-inline: auto; padding: 70px 40px 80px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-align: center; }
.about-label { color: var(--accent); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; }
.about-title { max-width: 800px; margin: 1.2rem auto 2.2rem; font-size: clamp(1.7rem, 4vw, 3.4rem); line-height: 1.1; font-weight: 300; letter-spacing: -.02em; }
.about-title .serif { font-family: 'Instrument Serif', 'Songti SC', serif; font-style: italic; font-weight: 400; }
.about-body { max-width: 760px; margin: 0 auto; color: var(--ink-soft); font-size: .95rem; line-height: 1.9; text-align: left; }

/* —— Features —— */
.features { position: relative; padding: 70px 0 110px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.feature-card { display: flex; flex-direction: column; min-height: 300px; padding: 1.5rem; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--card-2); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-card.feature-hero { position: relative; justify-content: flex-end; overflow: hidden; background: radial-gradient(70% 60% at 70% 20%, rgb(156 124 46 / 22%), transparent 60%), #f7f4ea; }
.feature-hero .noise-overlay { opacity: .3; }
.feature-hero p { position: relative; z-index: 2; margin: 0; color: var(--ink); font-family: 'Instrument Serif', 'Songti SC', serif; font-style: italic; font-size: 1.6rem; }
.feature-icon { width: 44px; height: 44px; margin-bottom: 1.1rem; border-radius: 12px; overflow: hidden; background: var(--ink); }
.feature-icon svg { stroke: #f4f1e6; }
.feature-card h3 { display: flex; gap: .55rem; margin: 0 0 .8rem; font-size: 1.12rem; font-weight: 700; }
.feature-desc { margin: 0 0 1.15rem; color: var(--ink-soft); font-size: .86rem; line-height: 1.6; }
.feature-card h3 b { color: #b3ab93; font-weight: 400; }
.feature-list { margin: 0 0 1.3rem; padding: 0; list-style: none; display: grid; gap: .65rem; }
.feature-list li { display: flex; gap: .6rem; align-items: flex-start; color: var(--ink-soft); font-size: .86rem; line-height: 1.5; }
.feature-list svg { flex: none; margin-top: .15rem; color: var(--accent); }
.feature-more { margin-top: auto; display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font-weight: 700; font-size: .85rem; }
.feature-more:hover { color: var(--accent); }
.feature-more svg { transform: rotate(-45deg); transition: transform .3s var(--ease); }
.feature-more:hover svg { transform: rotate(0); }

/* —— 榜单与列表 —— */
.section-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 60px; padding: 90px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.4rem; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.section-heading > a { color: var(--ink-soft); font-size: .86rem; }
.card-list { overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.book-card { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 1rem; min-height: 88px; padding: 1rem 1.3rem; color: var(--ink); border-bottom: 1px solid var(--line-soft); transition: background .25s; }
.book-card:last-child { border-bottom: 0; }
.book-card:hover { color: var(--ink); background: var(--card-2); }
.book-index { color: var(--accent); font-family: 'Instrument Serif', serif; font-style: italic; font-size: 1.05rem; }
.book-copy strong, .book-copy small, .book-meta small { display: block; }
.book-copy strong { margin-bottom: .15rem; font-family: 'Almarai', 'Songti SC', serif; font-weight: 700; font-size: 1.1rem; line-height: 1.35; }
.book-copy small, .book-meta small { color: var(--ink-soft); }
.book-meta { text-align: right; font-weight: 700; }
.book-meta small { font-size: .72rem; font-weight: 400; }
.book-card.roomy { grid-template-columns: 56px 1fr auto; min-height: 110px; }
.thumb { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-soft); box-shadow: 0 5px 16px rgb(35 32 25 / 14%); }
.thumb-placeholder { width: 44px; height: 58px; border-radius: 6px; background: var(--bg-deep); }
.cover.inline-cover { float: left; width: 150px; max-height: 210px; margin: 0 1.6rem 1rem 0; }
@media (max-width: 560px) {
  .cover.inline-cover { width: 110px; }
}
.ranking { margin: 0; padding: 0; list-style: none; counter-reset: rank; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.ranking li { counter-increment: rank; border-bottom: 1px solid var(--line-soft); }
.ranking li:last-child { border-bottom: 0; }
.ranking a { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .95rem 1.3rem; color: var(--ink); }
.ranking a:hover { background: var(--card-2); }
.ranking a span::before { content: counter(rank, decimal-leading-zero); margin-right: .75rem; color: var(--accent); font-family: 'Instrument Serif', serif; font-style: italic; font-size: .85rem; }
.ranking small { display: block; margin-left: 2.25rem; color: var(--ink-soft); }
.ranking b { font-size: .9rem; }
.empty { padding: 1.6rem; color: var(--ink-soft); text-align: center; }

/* —— 浏览页 —— */
.page-head { padding: 70px 0 40px; }
.page-head h1, .form-page h1, .auth-card h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.page-head > p { color: var(--ink-soft); }
.content-grid { display: grid; grid-template-columns: 220px 1fr; gap: 42px; padding-bottom: 100px; }
.filter { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; }
.filter h2 { font: 700 .74rem 'Almarai', sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.filter a { display: block; padding: .5rem .65rem; border-radius: 8px; color: var(--ink-soft); font-size: .88rem; }
.filter a:hover { color: var(--ink); }
.filter a.active { color: #f4f1e6; background: var(--ink); font-weight: 700; }
.category-branch { margin-block: .1rem; }
.category-branch summary { padding: .5rem .35rem; border-radius: 8px; color: var(--ink-soft); font-size: .88rem; cursor: pointer; list-style: none; }
.category-branch summary::-webkit-details-marker { display: none; }
.category-branch summary:hover { color: var(--ink); }
.category-links > .category-branch > summary { color: var(--ink); font-weight: 700; }
.category-children { margin-left: .65rem; padding-left: .25rem; border-left: 1px solid var(--line-soft); }
.filter .category-scope { color: #a49e8b; font-size: .78rem; }
.category-select { display: none; }

/* —— 搜索 —— */
.search-panel { margin-top: 2rem; }
.segmented { display: flex; gap: .4rem; margin-bottom: .8rem; }
.segmented label { padding: .4rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; font-size: .88rem; }
.segmented input { margin-right: .35rem; }
.search-row { display: flex; gap: .6rem; }
.search-row button { min-width: 90px; }
.results { padding-bottom: 100px; }
.results > p { color: var(--ink-soft); }
.avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #f4f1e6; background: var(--ink); font-weight: 800; }
.avatar.large { width: 86px; height: 86px; font-size: 2rem; }

/* —— 书籍 / 译本详情 —— */
.detail-hero { display: grid; grid-template-columns: 230px 1fr; gap: 55px; padding: 70px 0 55px; }
.detail-hero.one-column { display: block; max-width: 940px; }
.detail-hero h1 { max-width: 940px; font-size: clamp(2.5rem, 6vw, 4.6rem); }
.cover { width: 100%; max-height: 330px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.back { display: inline-block; margin-bottom: 2rem; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); max-width: 760px; margin-top: 2rem; border-top: 1px solid var(--line-soft); }
.facts div { padding: .9rem 1rem .9rem 0; border-bottom: 1px solid var(--line-soft); }
.facts dt { color: #a49e8b; font-size: .76rem; }
.facts dd { margin: .15rem 0 0; }
.tag { display: inline-block; margin: .1rem .3rem .1rem 0; padding: .16rem .5rem; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; color: var(--accent); }
.narrow-section { max-width: 950px; padding-bottom: 100px; }
.maintainer { color: var(--ink-soft); }
.prose { max-width: 760px; margin-top: 1.5rem; color: var(--ink-soft); }
.file-warning { color: #a49e8b; font-size: .76rem; }
.hero-actions { display: flex; align-items: center; gap: 1.3rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hero-actions a:not(.button) { color: var(--ink-soft); font-size: .88rem; }
.tabs-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 55px; padding-bottom: 110px; }
.version { border-top: 1px solid var(--line-soft); }
.version:last-of-type { border-bottom: 1px solid var(--line-soft); }
.version summary { display: flex; justify-content: space-between; padding: 1rem 0; cursor: pointer; }
.version summary b { margin-right: .6rem; font-size: 1.05rem; }
.version summary em { padding: .2rem .55rem; border-radius: 999px; color: #f4f1e6; background: var(--ink); font-size: .68rem; font-style: normal; }
.version summary small { color: var(--ink-soft); }
.version > div { padding: .2rem 0 1.4rem 1.6rem; }
.files { display: grid; gap: .5rem; }
.files a { padding: .6rem .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.files a:hover { background: var(--card-2); }
.spaced { margin-top: 4.5rem; }

/* —— 表单 —— */
.stack-form { display: grid; gap: .95rem; }
.stack-form > div { display: grid; gap: .35rem; }
.stack-form label { font-weight: 700; }
.stack-form .helptext, .stack-form small { color: var(--ink-soft); }
.stack-form ul.errorlist { margin: 0; padding: 0; color: var(--bad); list-style: none; }
.stack-form > button { justify-self: start; }
.login-prompt { color: var(--ink-soft); }

/* —— 评论 / 勘误 —— */
.discussion article { padding: 1.3rem 0; border-bottom: 1px solid var(--line-soft); }
.discussion header { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; }
.discussion header a { font-weight: 700; }
.discussion time, .discussion header small { color: #a49e8b; font-size: .76rem; }
.discussion footer { display: flex; gap: .9rem; margin-top: .7rem; font-size: .82rem; }
.discussion footer form { display: inline; }
.math-text { color: var(--ink); }
.danger, .link-button.danger { color: var(--bad); }
.errata { display: grid; gap: .8rem; }
.errata article { padding: 1.05rem; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--card); }
.errata header, .errata footer { display: flex; justify-content: space-between; gap: .8rem; }
.errata header { margin-bottom: .65rem; }
.errata header small { color: #a49e8b; }
.errata p { color: var(--ink-soft); }
.errata footer span { display: flex; gap: .7rem; }
.errata footer a { color: var(--ink-soft); font-size: .8rem; }
.errata-body p { color: var(--ink); }
.errata-body p + p { color: var(--ink-soft); }
.errata-body .errata-notes { color: #a49e8b; font-size: .82rem; }
.turnstile-hint { margin-top: .8rem; color: var(--bad); font-size: .82rem; }
.erratum-line { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line-soft); }
.erratum-line:last-child { border-bottom: 0; }
.erratum-line span { color: var(--ink-soft); font-size: .9rem; }

/* —— 状态徽章 —— */
.status { display: inline-block; padding: .16rem .55rem; border-radius: 999px; color: var(--warn); background: rgb(147 107 28 / 14%); font-size: .74rem; font-weight: 700; }
.status.published, .status.confirmed, .status.fixed, .status.approved { color: var(--ok); background: rgb(61 125 80 / 14%); }
.status.rejected { color: var(--bad); background: rgb(178 58 50 / 12%); }

/* —— 认证卡 —— */
.auth-card { max-width: 560px; margin: 70px auto 120px; padding: 2.4rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.auth-card.center { text-align: center; }
.auth-card p { color: var(--ink-soft); }
.auth-card b { color: var(--ink); }
.success-mark { display: grid; width: 62px; height: 62px; margin: 0 auto 1.3rem; place-items: center; border-radius: 50%; color: #f4f1e6; background: var(--ink); font-size: 1.6rem; }

/* —— 上传页 —— */
.form-page { max-width: 820px; padding: 60px 0 110px; }
.form-page.narrow { max-width: 660px; }
.form-page > p { color: var(--ink-soft); }
.upload-form fieldset { display: grid; gap: 1rem; margin: 0 0 1.4rem; padding: 1.4rem; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--card); }
.upload-form legend { padding: 0 .5rem; font-family: 'Almarai', 'Songti SC', serif; font-size: 1.2rem; font-weight: 700; }
.upload-form details { padding-top: .9rem; border-top: 1px solid var(--line-soft); }
.upload-form details summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.upload-form details[open] summary { margin-bottom: 1rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.field-help { color: var(--ink-soft); font-size: .82rem; }
.cat-field { display: grid; gap: .3rem; }
.cat-label { font-weight: 700; }
.cat-help { color: var(--ink-soft); font-size: .78rem; }
.category-slot select { max-width: 460px; }
.category-slot + .category-slot { margin-top: .5rem; }

/* —— 用户中心 / 公开主页 —— */
.dashboard-grid, .profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 100px; }
.panel { padding: 1.4rem; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--card); }
.panel h2 { font-size: 1.15rem; }
.panel p { color: var(--ink-soft); }
.panel a { color: var(--ink); }
.panel.wide { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem; border-bottom: 1px solid var(--line-soft); text-align: left; color: var(--ink); }
td { font-size: .92rem; }
th { color: #a49e8b; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 400; }
.rejection { display: block; margin-top: .25rem; color: var(--bad); }
.profile-head { display: flex; align-items: center; gap: 1.4rem; padding: 70px 0 40px; }
.profile-head h1 { margin-bottom: .2rem; font-size: clamp(2.6rem, 5vw, 4.6rem); }
.profile-head p { color: var(--ink-soft); margin: 0; }
.profile-grid { grid-template-columns: repeat(3, 1fr); }

/* —— 术语表 —— */
.term-head { padding-bottom: 50px; }
.term-head .lede { max-width: 960px; }
.term-stats { display: grid; grid-template-columns: repeat(3, minmax(120px, 180px)); gap: 10px; margin-block: 2rem; }
.term-stats div { padding: .85rem 1.1rem; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--card); }
.term-stats b, .term-stats span { display: block; }
.term-stats b { color: var(--accent); font-family: 'Almarai', 'Songti SC', serif; font-weight: 800; font-size: 1.55rem; }
.term-stats span { color: var(--ink-soft); font-size: .76rem; }
.term-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 1.6rem; }
.term-tabs a { padding: .42rem 1rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: .86rem; }
.term-tabs a:hover { color: var(--ink); border-color: var(--ink); }
.term-tabs a.active { color: #f4f1e6; background: var(--ink); border-color: var(--ink); }
.term-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.term-status { padding: .14rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.term-status.consensus { color: var(--ok); background: rgb(61 125 80 / 14%); }
.term-status.voting { color: var(--warn); background: rgb(147 107 28 / 14%); }
.term-status.empty { color: var(--ink-soft); background: rgb(35 32 25 / 8%); }
.term-consensus { margin: .2rem 0 .4rem; font-size: 1.02rem; color: var(--ink); }
.term-empty { margin: .2rem 0 .4rem; color: var(--ink-soft); }
.vote-list { margin: .3rem 0 .5rem; padding: 0; list-style: none; display: grid; gap: .35rem; }
.vote-option { display: flex; align-items: center; gap: .7rem; }
.vote-button { min-height: 0; padding: .32rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--card); font-weight: 400; }
.vote-button:hover { border-color: var(--ink); background: var(--card-2); }
.vote-button.disabled { cursor: default; }
.vote-option.mine .vote-button { color: #f4f1e6; background: var(--ink); border-color: var(--ink); }
.vote-meta { color: var(--ink-soft); font-size: .8rem; white-space: nowrap; }
.term-foot { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: .3rem; color: var(--ink-soft); font-size: .8rem; }
.term-search { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto auto; align-items: center; gap: .8rem; }
.term-search label { white-space: nowrap; font-size: .88rem; color: var(--ink-soft); }
.terminology, .contribution-results { padding-bottom: 100px; }
.term-tree { border-top: 1px solid var(--line-soft); }
.term-category { border-bottom: 1px solid var(--line-soft); }
.term-category .term-category { margin-left: 1.2rem; border-left: 1px solid var(--line-soft); border-bottom: 0; }
.term-category summary { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; cursor: pointer; }
.term-category summary small { color: #a49e8b; font-weight: 400; }
.term-category-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .7rem; padding: 0 0 1rem 1rem; align-items: start; }
.term-row { display: block; padding: .7rem .85rem; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--card); }
.term-row:hover { background: var(--card-2); }
.term-row strong { overflow-wrap: anywhere; font-family: 'Almarai', 'Songti SC', serif; }
.term-row span { overflow-wrap: anywhere; color: var(--ink-soft); }
.term-row em { color: #a49e8b; font-style: normal; }
.term-row i { color: var(--accent); font-style: normal; font-weight: 800; }
.contribution-results { display: grid; gap: 14px; }
.term-contribution h2 { font-size: 1.3rem; }
.term-contribution p { color: var(--ink-soft); }
.term-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.small-action { display: inline-block; margin: .25rem .7rem .25rem 0; font-size: .8rem; color: var(--bad); }

/* —— 页脚 —— */
body > footer { display: flex; justify-content: space-between; gap: 1rem; padding: 30px max(20px, calc((100vw - 1180px)/2)); border-top: 1px solid var(--line-soft); color: var(--ink-soft); font-size: .74rem; }

/* —— 响应式 —— */
@media (min-width: 821px) {
  nav { gap: 1.5rem; }
}
@media (max-width: 820px) {
  .site-header { width: auto; }
  nav { flex-wrap: wrap; justify-content: center; gap: .45rem .8rem; }
  nav a { font-size: .72rem; }
  .hero-content { gap: 2rem; padding: 56px 24px 64px; }
  .hero-title { font-size: clamp(3.6rem, 22vw, 8rem); }
  .section-grid, .tabs-layout { grid-template-columns: 1fr; gap: 45px; }
  .content-grid { grid-template-columns: 1fr; }
  .filter { position: static; max-height: none; overflow: visible; }
  .filter h2, .category-links { display: none; }
  .category-select { display: block; }
  .detail-hero { grid-template-columns: 140px 1fr; gap: 28px; }
  .profile-grid { grid-template-columns: 1fr; }
  .term-search { grid-template-columns: 1fr 1fr; }
  .term-search input:first-child { grid-column: 1 / -1; }
  .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .shell, .narrow { width: min(100% - 28px, 1180px); }
  .brand-copy small { display: none; }
  nav { gap: .35rem .5rem; }
  .hero-search, .search-row { display: grid; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: .7rem; }
  .book-card { grid-template-columns: 32px 1fr; }
  .thumb, .thumb-placeholder { width: 32px; height: 44px; }
  .book-meta { grid-column: 2; text-align: left; }
  .detail-hero { display: block; padding-top: 40px; }
  .cover { max-width: 140px; margin-bottom: 2rem; }
  .facts, .field-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.4rem; }
  .term-stats { grid-template-columns: repeat(3, 1fr); }
  .term-search { display: grid; grid-template-columns: 1fr; }
  .term-search input:first-child { grid-column: auto; }
  .term-row { grid-template-columns: 1fr; gap: .2rem; }
  .term-category .term-category { margin-left: .5rem; }
  .about-card { padding: 44px 22px 54px; }
  body > footer { flex-direction: column; }
}
