/* ═══════════════════════════════════════════════════════════════════════
   地基：reset + 排版 + 通用零件（按钮 / 徽章 / 分区标题 / 设备外框 / 素材占位）
   分区专属布局在 sections.css。
   ═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background var(--dur-2) var(--ease-soft), color var(--dur-2) var(--ease-soft);
}

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: var(--lh-tight); text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-s); }

::selection { background: var(--accent-soft); color: var(--ink); }

/* 滚动条（能设就设，不能设也不难看） */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--surface); color: var(--ink); padding: 10px 16px;
  border-radius: var(--r-s); box-shadow: var(--shadow-1);
  transition: top var(--dur-1) var(--ease-out);
}
.skip:focus { top: 12px; }

/* ── 容器 / 分区 ──────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--wide { max-width: var(--maxw-wide); }
.sec { position: relative; padding-block: var(--sec-pad); }
.sec--alt { background: var(--bg-1); }
.sec--edge::before {
  content: ''; position: absolute; inset-inline: 0; top: 0; height: 1px; background: var(--line);
}

.sec-head { max-width: 62ch; margin-bottom: clamp(30px, 4.6vw, 62px); }
.sec-head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-micro); letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .6; }
.sec-title { font-size: var(--fs-h2); font-family: var(--font-display); letter-spacing: .01em; }
.sec-sub { margin-top: 14px; color: var(--ink-2); font-size: var(--fs-lead); max-width: 56ch; }
.sec-head--center .sec-sub { margin-inline: auto; }

.lede { font-size: var(--fs-lead); color: var(--ink-2); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-size: .92em; }

/* ── 按钮 ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; font-size: .98rem; font-weight: 600;
  white-space: nowrap; text-decoration: none;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out),
              box-shadow var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--big { padding: 15px 30px; font-size: 1.05rem; }
.btn .ico { width: 18px; height: 18px; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px; font-size: var(--fs-micro);
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  border: 1px solid var(--line);
}
.chip--plain { background: var(--bg-2); color: var(--ink-2); }

/* ── 顶栏 ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 90; height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease-soft), background var(--dur-2) var(--ease-soft);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; gap: 18px; width: 100%; }
.foot__sep { margin: 0 8px; font-style: normal; opacity: .4; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__sub { font-family: var(--font-ui); font-size: var(--fs-micro); color: var(--ink-3); letter-spacing: .14em; margin-left: 2px; }
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__links a {
  padding: 8px 13px; border-radius: 999px; font-size: .93rem; color: var(--ink-2);
  transition: color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.nav__links a:hover { color: var(--ink); background: var(--bg-2); text-decoration: none; }
.nav__links a.is-current { color: var(--accent); background: var(--accent-soft); }
.nav__tools { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2);
  transition: color var(--dur-1), border-color var(--dur-1), transform var(--dur-1);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 19px; height: 19px; }

/* 主题：没有开关，也就没有弹层样式 —— 深浅色只走 CSS 的 prefers-color-scheme。
   （这里原来是一套 .theme-menu 三态弹层，2026-10-28 按要求删了，别再写回来。）*/

/* ── 顶栏账号：未登录 = 一颗次要按钮；已登录 = 头像 + 下拉 ──────────────
   四条要求都落在具体的写法上，改动前请先读懂再删：
   ① 下拉**锚在头像上**：position:absolute + 父级 .nav__account 是 position:relative。
      绝不用 position:fixed —— 顶栏是 sticky，fixed 的东西不跟着它走，
      一滚动菜单就留在视口原来的位置（需求文档专门点了"滚动不许错位"这条）。
   ② 菜单宽度封顶在视口内（--menu-w），并 inset-inline-end:0 右对齐 —— 窄屏不会顶出屏幕右边。
   ③ .acct-menu 自己带 padding-top:10px 当"桥"：鼠标从头像移到菜单的过程中始终在
      .acct-menu 里，不会穿过那道缝触发 :hover 失效（写成 top:calc(100% + 10px) 就会抖）。
   ④ hover 只是**顺手**打开，click / tap 一样能开：触屏设备压根没有 hover，
      只有 :hover 的菜单在手机上等于没有（所以下面那条 hover 规则包在 (hover: hover) 里）。
   颜色全部吃 var()：卡片底 --surface、描边 --line、hover 底 --bg-2（和 .nav__links a:hover
   同一档，站里"变浅"从来就是这一档）、退出那一行 --danger。 */
.nav__account { position: relative; display: flex; align-items: center; }
/* 与「获取书斋」严格同高：两颗都是 .btn，主按钮没有边框、次要按钮有 1px 边框，
   所以竖向 padding 各减 1px（12 → 11），字号**不许**另写一档 ——
   .btn 的高度是 padding + 行高算出来的，字号一变行高就跟着变，两颗立刻对不齐。 */
.nav__signin { padding-block: 11px; padding-inline: 16px; }

.avatar-btn {
  width: var(--avatar); height: var(--avatar); padding: 0; flex: none;
  border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg-2);
  display: grid; place-items: center; overflow: hidden; position: relative;
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.avatar-btn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 没有头像图（服务端没给 / 图挂了被 JS 摘掉）就露出这一层首字 —— 不许出现空心圈。
   摘 img 的动作在 ui.js，CSS 只管"露底"。 */
.avatar-btn__i { font-size: .78rem; font-weight: 700; color: var(--accent); line-height: 1; }
.avatar-btn:hover, .nav__account.is-open .avatar-btn { border-color: var(--accent); }

.acct-menu {
  position: absolute; top: 100%; inset-inline-end: 0; z-index: 95;
  width: var(--menu-w); padding-top: 10px;
  display: none;
}
.acct-menu__in {
  padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); box-shadow: var(--shadow-2);
}
.nav__account.is-open .acct-menu { display: block; animation: acct-in var(--dur-1) var(--ease-out); }
@media (hover: hover) and (min-width: 900px) {
  .nav__account:hover .acct-menu { display: block; }
}
@keyframes acct-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .acct-menu, .modal__box { animation: none; } }
.acct-menu__name {
  padding: 9px 12px 8px; font-weight: 600; color: var(--ink); font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-menu__sep { height: 1px; background: var(--line); margin: 2px 6px 4px; }
.acct-menu__i {
  display: flex; align-items: center; width: 100%; text-align: start;
  padding: 9px 12px; border-radius: var(--r-s); font-size: .93rem; color: var(--ink-2);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.acct-menu__i:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.acct-menu__out { color: var(--danger); }
.acct-menu__out:hover { color: var(--danger); background: var(--bg-2); }
.acct-menu form { margin: 0; }

/* 登录 Modal：入口那颗「登录」在 HTML 里，这个弹层是 JS 加的增强 */
.modal {
  position: fixed; inset: 0; z-index: 130; display: none; place-items: center;
  padding: max(18px, 5vh) var(--gutter); background: var(--scrim);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal.is-open { display: grid; animation: modal-in var(--dur-1) var(--ease-out); }
@keyframes modal-in { from { opacity: 0; } }
.modal__scrim { position: absolute; inset: 0; }
.modal__box {
  position: relative; width: min(420px, 100%);
  padding: 26px 26px 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-2);
  animation: modal-up var(--dur-2) var(--ease-out);
}
@keyframes modal-up { from { opacity: 0; transform: translateY(14px); } }
.modal__x {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 34px; height: 34px;
  border-radius: 50%; display: grid; place-items: center; color: var(--ink-3);
  border: 1px solid transparent;
}
.modal__x:hover { color: var(--ink); background: var(--bg-2); }
.modal__t { font-family: var(--font-display); font-size: var(--fs-h3); margin-bottom: 8px; }
.modal__sub { color: var(--ink-2); font-size: .95rem; }
.modal__acts { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.modal__note { margin-top: 14px; color: var(--ink-3); font-size: var(--fs-small); line-height: 1.6; }
.modal__note:empty { display: none; }

/* 窄屏账号菜单项的家：汉堡抽屉（#drawer-links）里追加的一块，与下拉共用 site.js 的 account.menu */
.drawer-acct { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.drawer-acct__name { padding: 4px 4px 10px; font-weight: 600; color: var(--ink); }
.drawer-acct__i { display: block; width: 100%; text-align: start; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 1.02rem; }
.drawer-acct__i:hover { color: var(--accent); text-decoration: none; }
.drawer-acct .drawer-acct__out { color: var(--danger); }
.drawer-acct form { margin: 0; }
@media (min-width: 900px) { .drawer-acct { display: none; } }

/* 滚动进度条 */
.progress { position: fixed; inset-inline: 0; top: 0; height: 2px; z-index: 99; pointer-events: none; }
.progress__bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; }

/* 移动端汉堡 */
.nav__burger { display: none; }
@media (max-width: 899px) {
  .nav__links { display: none; }
  .nav__tools { margin-left: auto; }
  .nav__burger { display: grid; }
  /* 窄屏只收掉「获取书斋」这一颗，账号入口（登录 / 头像）留在顶栏，菜单项进抽屉。
     ⚠️ 选择器别写回 `.nav__tools .btn`：那颗「登录」也是 .btn，会被一起藏掉，
        于是窄屏整个账号模块人间蒸发 —— 这条专门有闸门盯着（⑦）。 */
  .nav__tools [data-nav-cta] { display: none; }
}
.drawer-links {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 89;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 12px var(--gutter) 22px; display: none;
}
.drawer-links.is-open { display: block; animation: slide-down var(--dur-2) var(--ease-out); }
.drawer-links a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 1.02rem; }
@keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } }

/* ── 设备外框（纯 CSS，不吃素材）────────────────────────────────────
   真实截图会放进 .screen 里，所以**没图的时候也不能塌**：
   占位状态由 .shot.is-empty 画一张"纸 + 几行字"的骨架。 */
.device { position: relative; background: var(--device); border-radius: var(--r-xl); padding: 9px; box-shadow: var(--shadow-2); }
.device::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 1px solid var(--on-scrim-soft); pointer-events: none; }
.device--phone { width: min(268px, 62vw); aspect-ratio: 9 / 19.5; }
.device--tablet { width: min(420px, 78vw); aspect-ratio: 3 / 4; border-radius: 28px; padding: 12px; }
.device--browser { width: 100%; aspect-ratio: var(--ar, 16 / 10); border-radius: var(--r-m); padding: 0; overflow: hidden; }
.device--browser .screen { border-radius: 0; }
/* 应用窗口框（大屏/电脑上的那一屏）：比例跟数据走，所以不裁图 */
.device--window { width: min(440px, 84vw); aspect-ratio: var(--ar, 1 / 1); border-radius: var(--r-l); padding: 0; overflow: hidden; }
.device--window .screen { border-radius: 0; }
.device__bar--win span { display: none; }
.device__bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--device-bar); }
.device__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--device-dot); }
.device__bar span { flex: 1; margin-left: 6px; height: 16px; border-radius: 6px; background: var(--device-dot); max-width: 46%; }
.device__notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 34%; height: 17px; background: var(--device); border-radius: 0 0 12px 12px; z-index: 3; }
.screen { position: relative; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; background: var(--paper); }
.device--phone .screen, .device--tablet .screen { border-radius: calc(var(--r-xl) - 9px); }

/* ── 素材槽 / 占位框 ───────────────────────────────────────────────────
   逻辑：图**在** → 只显示图；图**不在** → onerror 打 is-empty，画骨架 + 写清
   该放哪个文件、多大。这样没素材时站是"完整的示意图"，不是裂图一堆。 */
.shot { position: relative; margin: 0; width: 100%; height: 100%; overflow: hidden; }
/* 图默认就是可见的。原来写 opacity:0，靠 JS 加 .is-ok 才点亮 ——
   只要那个类没加上（尺寸未定、decode 未完成、懒加载没触发…），图就永远透明，
   而占位框又已被隐藏，屏幕上只剩一个空框。这是同一类事故第三次了，改成 CSS 兜底：
   图始终可画，没素材时靠 .ph 盖在上面（它本来就在上层）。 */
.shot img { width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity var(--dur-3) var(--ease-soft), transform var(--dur-3) var(--ease-soft); }
.shot img.is-ok { opacity: 1; }
.shot--fit-contain img { object-fit: contain; }
.shot:hover img.is-ok { transform: scale(1.022); }

.ph {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 9px; text-align: center;
  padding: 14px; background:
    repeating-linear-gradient(180deg, transparent 0 21px, var(--line) 21px 22px) center/auto 100% no-repeat,
    linear-gradient(160deg, var(--bg), var(--bg-2));
  border: 1px dashed var(--line-2); border-radius: inherit;
  transition: opacity var(--dur-2) var(--ease-soft);
}
.ph__k { font-size: var(--fs-micro); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.ph__n { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-2); word-break: break-all; }
.ph__d { font-size: .72rem; color: var(--ink-3); }
.shot.is-ok .ph { opacity: 0; pointer-events: none; }

/* 图上角标（"深色主题同款"之类的说明） */
.tag {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  padding: 4px 10px; border-radius: 999px; font-size: var(--fs-micro); font-weight: 600;
  background: var(--scrim); color: var(--on-scrim); backdrop-filter: blur(6px);
}

.figcap { margin-top: 10px; font-size: var(--fs-small); color: var(--ink-3); }

/* ── 页脚 ─────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); background: var(--bg-1); padding-block: clamp(40px, 6vw, 70px) 30px; }
.foot__grid { display: grid; gap: 30px; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); }
.foot h4 { font-size: .86rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.foot li { margin-bottom: 8px; }
.foot a { color: var(--ink-2); font-size: .94rem; }
.foot a:hover { color: var(--accent); }
/* 版权与备案号这一行：需求文档要 12px + 更弱的对比。
   字号照做（--fs-foot），颜色**没有**换成需求里那支 888 灰 —— 那样浅色底上只有约 3.3:1，
   跌破这个站自己定的 4.5:1 底线（--ink-3 是闸门认可的"最浅的一档"，注释里写着
   "再浅就不给用了"）。2026-11-02 鱼干拍板：走 12px + --ink-3。 */
.foot__bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; font-size: var(--fs-foot); color: var(--ink-3); }
.foot__beian a { color: var(--ink-3); }
.foot__beian a:hover { color: var(--accent); }
@media (max-width: 839px) { .foot__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 519px) { .foot__grid { grid-template-columns: 1fr; } }

/* ── 渐显（滚动出现）───────────────────────────────────────────────
   ⚠️ 隐藏态**只在 html.js 存在时生效**：head 里那一行 <script> 加这个类。
      这样 JS 挂了 / 被拦了 / 用户禁了脚本，内容照样全文可读 —— 特效可以没有，
      一片空白不能。轮播/占位框同理（见下面 .shot 那两条）。 */
html.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); }
html.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
}

/* 没有 JS 的时候：图直接显示、占位框让路、标题那道划线画满。
   （有 JS 时由 ui.js 的 hookShots 决定 —— 图没加载成功就退回占位框，绝不裂图。）*/
html:not(.js) .shot img { opacity: 1; }
html:not(.js) .shot .ph { display: none; }
html:not(.js) .hero h1 em::after { --ul: 1; }

/* ⭐ [2026-11-16] 首页公告条（对应 js/notice.js）。
   规矩：有没有公告都不该让页面"跳一下" —— 没公告时元素带 hidden，不参与布局。 */
.notice {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg));
  border-block: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  font-size: 0.92rem;
}
.notice__in { display: flex; align-items: center; gap: 10px; padding-block: 9px; }
.notice__dot {
  flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.notice__text {
  flex: 1 1 auto; min-width: 0; margin: 0; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notice__text b { font-weight: 600; margin-right: 8px; }
.notice__text span { color: var(--ink-2, var(--ink)); }
.notice__x {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background: transparent; color: var(--ink-2, var(--ink)); opacity: .7;
}
.notice__x:hover { opacity: 1; }
.notice--warn { background: color-mix(in srgb, var(--danger) 9%, var(--bg)); }
.notice--warn .notice__dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
@media (max-width: 560px) {
  .notice__text { -webkit-line-clamp: 3; font-size: 0.86rem; }
}
