/* ============================================================
   贴图生成 — 全站骨架样式
   取值全部来自 static/tokens.css（《设计规范》v1.0 §2.3）。

   三条不可动摇的规矩（§5 / §8）：
     1. 圆角一律 0 —— 唯一例外是头像那种等宽高圆形；
     2. 不用 box-shadow —— 层级靠底色深浅、1px 发丝线、深色块反转；
     3. 标题一律衬线，正文/按钮/表格一律无衬线。
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@700&family=Noto+Sans+SC:wght@400;500;600&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 16px;
  margin: 0;
  padding: 0;
  /* 不做 scroll-behavior: smooth —— 它是「滚动动画」，和 scroll-reveal 同一类
     装饰。锚点跳转要的是立刻到位。 */
}
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.8;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}
body > .nav-glass { margin-top: 0; }
main#main-content { margin: 0; padding: 0; display: block; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ════════════ 字阶（§3.1）════════════
   两族分工：衬线给标题与数字，无衬线给正文与界面。
   `.t-*` 是工具类；h1–h6 给同样的默认值，省得每个标题都挂一个类。 */
.t-display { font-family: var(--font-serif); font-weight: 700; font-size: 56px; line-height: 1.15; margin: 0; }
.t-h1 { font-family: var(--font-serif); font-weight: 700; font-size: 40px; line-height: 1.2; margin: 0; }
.t-h2 { font-family: var(--font-serif); font-weight: 700; font-size: 32px; line-height: 1.25; margin: 0; }
.t-h3 { font-family: var(--font-serif); font-weight: 700; font-size: 24px; line-height: 1.3; margin: 0; }
.t-h4 { font-family: var(--font-serif); font-weight: 700; font-size: 20px; line-height: 1.3; margin: 0; }
.t-body { font-size: 16px; line-height: 1.9; margin: 0; }
.t-small { font-size: 13px; line-height: 1.7; margin: 0; }
.t-caption { font-size: 12px; line-height: 1.6; color: var(--mute); margin: 0; }
/* 眉标是区块的「门牌」：无衬线 / 600 / 10–11px / 字距 1.5–2.6 / 弱化色或承色。
   中文取 1.5，英文与数字取 2.5。**不得使用朱红**，除非它本身就是行动入口。 */
.t-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  line-height: 1.4;
  color: var(--mute);
  margin: 0;
}
.t-eyebrow--latin { letter-spacing: 2.5px; }
.t-eyebrow--accent { color: var(--accent); }
.t-num { font-family: var(--font-serif); font-weight: 700; font-variant-numeric: tabular-nums; }

h1 { font-family: var(--font-serif); font-weight: 700; font-size: 40px; line-height: 1.2; margin: 0 0 12px; }
h2 { font-family: var(--font-serif); font-weight: 700; font-size: 32px; line-height: 1.25; margin: 0 0 10px; }
h3 { font-family: var(--font-serif); font-weight: 700; font-size: 24px; line-height: 1.3; margin: 0 0 8px; }
h4 { font-family: var(--font-serif); font-weight: 700; font-size: 20px; line-height: 1.3; margin: 0 0 8px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: var(--z-skip);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 10px; }

/* ════════════ 导航 ════════════
   两套，按页面选（base.html 依 active_page 挂 .nav--marketing / .nav--app）：
     营销层（§6.1）：高 76、左右 56、无当前态下划线 —— 只有首页。
     应用层（§6.2）：高 72、左右 32、当前态 = 朱红 2px 底部内描边。
   两边都不是玻璃 —— 没有 backdrop-filter，也没有投影，只有一条 1px 发丝线。 */
.nav-glass {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  margin: 0;
  padding: var(--safe-top) 0 0;
  overflow: visible;
  background: var(--paper);
  border-bottom: var(--line-width) solid var(--line);
}
/* 导航行和 `.page-container` 是**同一个盒子**：同样 1440 居中、同样 56 的左右边距，
   所以品牌 logo 和正文的左边缘逐像素对齐。
   规范 §4.2 的「应用外壳」写的是导航 32 / 主内容 56 —— 那会让导航比正文宽出 24px
   （实测 1920 下品牌在 x=268、标题在 x=292）。**这里按用户的要求统一成 56**，
   两条都对齐。`--gutter-app` 那个 token 因此没人用了，已从 tokens.css 删掉。 */
.nav-inner {
  margin: 0 auto;
  height: var(--nav-h-app);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 16px;
  padding: 0 var(--gutter-marketing);
  max-width: var(--page-width);
}
.nav-brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}
/* 品牌标记装的是 static/images/logo-mark.png（黑底单字标）。
   规范 §6.1/§6.2 画的是纯色方块 —— 这里按「保留 logo 图、只改形状」落地：
   直角、无阴影，尺寸按两档（位图比纯色方块需要更大的最小尺寸才不糊）。
   底色写死和 logo 一致的 #060606，图没解码出来时是一块黑砖，不闪白。 */
.nav-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #060606;
  flex-shrink: 0;
  display: block;
}
.nav-brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.nav-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-links {
  justify-self: center;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 26px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
/* 当前态的下划线**画在链接自身**（§5.2 明令：不要用子元素矩形模拟，
   那样会环形依赖坍缩为 0）。链接铺满导航高度，2px 红线就落在底边线上。 */
.nav-link {
  display: flex;
  align-items: center;
  padding: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;          /* 压住导航那条 1px 发丝线 */
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-sub);
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

.nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}
.nav-right { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* 积分胶囊：`8 积分` + 朱红「充值」。充值那颗是**文字按钮**（§6.3），
   不做成第二个实心朱红块 —— 每屏最多一个主按钮。 */
.nav-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 12px;
  border: var(--line-width) solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
  transition: border-color var(--t-fast);
}
.nav-points-badge:hover { border-color: var(--ink); }
.nav-points-badge::after {
  content: "充值";
  padding: 2px 8px;
  background: var(--accent);
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
}
.nav-badge {
  padding: 3px 8px;
  background: var(--band);
  color: var(--ink-sub);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-user-menu { position: relative; }
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--t-fast);
}
.nav-user-btn:hover { color: var(--accent); }
/* 头像是全站唯一的圆形（§5.1）。圆由父层 overflow 裁 —— 给 <img> 自己写
   border-radius，父层不裁的话照样是方角。 */
.nav-avatar {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--band);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
/* 有头像时铺满整个圆，盖在底下那个首字母上。`position: absolute` 是为了让
   首字母留在 DOM 里当兜底：图 404 时 onerror 摘掉它，露出首字母而不是碎图标。 */
.nav-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: none;
}
.nav-username { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chevron { flex-shrink: 0; color: var(--mute); transition: transform var(--t-fast); }
.nav-user-btn[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  padding: 6px 0;
  z-index: var(--z-dropdown);
}
.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 18px;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-family: var(--font-sans);
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-dropdown-icon { display: none; }   /* §8：不引入图标集，菜单是纯文字 */
.nav-dropdown-item:hover { background: var(--band); color: var(--accent); }
.nav-dropdown-divider { height: var(--line-width); background: var(--line); margin: 6px 0; }
.nav-dropdown-danger { color: var(--accent); }

.nav-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border: none;
  background: var(--accent);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--t-fast);
}
.nav-login-btn:hover { background: var(--ink); }
.nav-login-text {
  font-size: 14px;
  color: var(--ink-sub);
  padding: 8px 0;
  transition: color var(--t-fast);
}
.nav-login-text:hover { color: var(--ink); }

/* 营销层（§6.1）：高 76、无当前态下划线、右侧「登录」+ 朱红「开始创作」。
   只有首页用它。
   左右内边距**不再单独写** —— 它和基础层一样是 56（`--gutter-marketing`），
   也就是和 `.page-container` 一样。以前这里写过 `max-width: none`，那会让导航
   横跨整个视口、和下面居中的内容对不齐，见 `tests/test_pc_shell.py`。 */
.nav--marketing .nav-inner { height: var(--nav-h-marketing); }
.nav--marketing .nav-brand-mark { width: 24px; height: 24px; }
.nav--marketing .nav-links { gap: 30px; }
.nav--marketing .nav-link { border-bottom: none; font-size: 14px; }
.nav--marketing .nav-link.active { color: var(--ink); font-weight: 600; }

/* Mobile nav hamburger */
.nav-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: var(--line-width) solid var(--line);
  background: var(--surface);
  color: var(--ink);
  flex-shrink: 0;
}
.nav-hamburger-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 1080px) { .nav-username { display: none; } }
@media (max-width: 960px) {
  /* 这里**不设 `padding`**：导航的左右内边距跟着 `.page-container` 走，
     统一写在文件末尾那三档里（1024 → 32、768 → 16）。在这儿再写一次的话，
     375px 的视口同时命中 960 和 768 两条，谁赢就看源码顺序 —— 那是靠运气。 */
  .nav-inner,
  .nav--marketing .nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    height: 64px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: var(--line-width) solid var(--line);
    padding: 8px 16px calc(16px + var(--safe-bottom));
    max-width: none;
    overflow-x: visible;
    max-height: min(70vh, 480px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open { display: flex; }
  .nav-links.open .nav-link,
  .nav--marketing .nav-links.open .nav-link {
    width: 100%;
    min-height: 48px;
    padding: 0 4px;
    border-bottom: var(--line-width) solid var(--line);
    font-size: 15px;
  }
  .nav-links.open .nav-link.active { border-bottom: 2px solid var(--accent); }
  .nav-hamburger { display: flex; }
  .nav-badge { display: none; }
  .nav-chevron { display: none; }
  .nav-points-badge { padding: 5px 6px 5px 10px; }
  .nav-user-btn { min-height: 44px; }
}
@media (max-width: 420px) {
  .nav-brand-name { display: none; }
  .nav-points-badge { font-size: 12px; }
  .nav-brand-mark { width: 26px; height: 26px; }
}

/* ── 页面骨架 ── */
.page-wrap { position: relative; min-height: calc(100vh - var(--nav-h-app)); }
.page-container {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--gutter-marketing);
}
/* 应用外壳：主内容 56（§4.2）。 */
.page-container--app { padding: 0 56px; }

/* ── 区块（§4.1 纵向梯级：64 / 80 / 100）── */
.section { padding: 80px 0; }
.section--tight { padding: 64px 0; }
.section--loose { padding: 100px 0; }

/* ── 区块头（§6.7）：眉标 → 区标题 → 区头注，三件套。
   可省略眉标或区头注，**但区标题必须有**。与内容之间 36–48。 ── */
.section-header { margin: 0 0 40px; max-width: 720px; }
.section-header--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-header .t-eyebrow { margin-bottom: 14px; }
.section-title { font-family: var(--font-serif); font-size: 32px; font-weight: 700; line-height: 1.25; margin: 0; color: var(--ink); }
.section-sub { font-size: 15px; line-height: 1.9; color: var(--ink-sub); margin: 14px 0 0; }

/* ── 卡片（§6.5）──
   白底置于纸底之上**不投影**，靠 1px 发丝线浮起。卡内边距 20–22。 */
.glass-card {
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.glass-card-accent { border-color: var(--accent); }
.glass-card-cta { border-color: var(--ink); }

/* ── 按钮（§6.3）── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
/* 主按钮：朱红填充 · 纸白文字。**每屏最多一个。** */
.btn-primary { background: var(--accent); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: var(--ink); }
/* 次按钮：白底 + 1px 墨色描边。与主按钮并排时放右侧。 */
.btn-outline { background: var(--surface); color: var(--ink); border: var(--line-width) solid var(--ink); padding: 10px 21px; }
.btn-outline:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
/* 弱次按钮：白底 + 1px 发丝线。用于工具条等密集区域。 */
.btn-ghost, .btn-glass { background: var(--surface); color: var(--ink-sub); border: var(--line-width) solid var(--line); padding: 10px 21px; }
.btn-ghost:hover:not(:disabled), .btn-glass:hover:not(:disabled) { color: var(--ink); border-color: var(--ink); }
/* .btn-cta 与主按钮同义 —— 留着这个名字，历史页面在用它。 */
.btn-cta { background: var(--accent); color: var(--paper); }
.btn-cta:hover:not(:disabled) { background: var(--ink); }
/* 危险操作不另造一个红：朱红本来就是这套色板里唯一的强调色。 */
.btn-danger { background: var(--surface); color: var(--accent); border: var(--line-width) solid var(--accent); }
.btn-danger:hover:not(:disabled) { background: var(--accent); color: var(--paper); }
/* 禁用态：舞台色填充 + 发丝线 + 弱化色文字。**不放朱红。** */
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--stage);
  color: var(--mute);
  border: var(--line-width) solid var(--line);
  cursor: not-allowed;
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  color: var(--ink-sub);
}
.btn-icon:hover { color: var(--ink); border-color: var(--ink); }
/* 文字按钮：朱红 13–14px / 600 · 无内边距。卡片内的轻行动。 */
.btn-text {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.btn-text:hover { color: var(--ink); }

:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

/* ── 表单（§6.4）── */
.field { display: flex; flex-direction: column; gap: 9px; }
.field__label,
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-sub);
}
.input,
.textarea,
.select,
.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: border-color var(--t-fast);
}
.textarea { height: auto; padding: 12px 14px; line-height: 1.8; resize: vertical; }
/* 占位色是 --mute，**不是** --ink-sub（§6.4 点名） */
.input::placeholder,
.textarea::placeholder,
.form-input::placeholder { color: var(--mute); }
/* 聚焦态：1px 墨色描边替换发丝线，**不加发光** */
.input:focus,
.textarea:focus,
.select:focus,
.form-input:focus { outline: none; border-color: var(--ink); }
.input--toolbar,
.form-input--toolbar { height: 40px; }
/* 错误态：1px 朱红描边 + 下方 12px 朱红说明文字 */
.input--error,
.form-input--error { border-color: var(--accent); }
.field__error,
.form-error { font-size: 12px; color: var(--accent); margin: 0; }

/* 勾选框：16 × 16 直角方框，选中态朱红填充 */
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink); }
.check input[type="checkbox"],
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  border: var(--line-width) solid var(--ink-sub);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
}
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 分段控件（§6.4）：高 36，选中项墨底纸白，未选中白底次色，项宽 56 */
.segmented {
  display: inline-flex;
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.segmented__item {
  min-width: 56px;
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-right: var(--line-width) solid var(--line);
  background: var(--surface);
  color: var(--ink-sub);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented__item:last-child { border-right: none; }
.segmented__item--active { background: var(--ink); color: var(--paper); }

/* ── 表格（§6.6）── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}
.table thead th {
  background: var(--band);
  color: var(--ink-sub);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 12px 22px;
  border-bottom: var(--line-width) solid var(--line);
  white-space: nowrap;
}
.table tbody td {
  padding: 15px 22px;
  border-bottom: var(--line-width) solid var(--line);
  color: var(--ink);
  text-align: left;           /* 一律左对齐，数字**不**右对齐 */
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }   /* 最后一行不画线 */
.table tbody tr:hover td { background: var(--paper); }
/* 空值写「—」，颜色 --mute。不要用空格。 */
.table .is-empty { color: var(--mute); }

/* ── 状态（§6.8）── */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 24px;
  gap: 12px;
}
/* 空态的「标记块」：一个直角色块，不是图标、不是插画 */
.state__mark {
  width: 40px;
  height: 40px;
  background: var(--band);
  border: var(--line-width) solid var(--line);
  margin-bottom: 8px;
}
.state__title { font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--ink); margin: 0; }
.state__sub { font-size: 14px; line-height: 1.9; color: var(--ink-sub); margin: 0; max-width: 440px; }
.state__action { margin-top: 12px; }
.state--error { border: var(--line-width) solid var(--accent); }
.state--error .state__mark { background: var(--accent); border-color: var(--accent); }
.state--error .state__title { color: var(--accent); }
/* 加载态：骨架色块（stage / band），**禁止转圈图标**，骨架**不得使用朱红** */
.skeleton { background: var(--stage); }
.skeleton--line { height: 12px; background: var(--band); }
.skeleton--block { background: var(--stage); }

/* ── Footer ──
   五栏：品牌 / 产品 / 条款与政策 / 开发与支持 / 小程序码。
   底色用 `--band`（比纸底深一档的信息带），**不用深色块** —— 深色只有
   机制区、登录展示侧、代码块三处。层级仍然只靠底色和 1px 发丝线，
   直角、无投影，和全站一致。
   小程序码那张白卡是页脚唯一的高饱和元素，它是 PC 上通往小程序的
   **唯一**入口，视觉重量该落在它身上。 */
.page-footer {
  border-top: var(--line-width) solid var(--line);
  background: var(--band);
  padding: 56px 0 24px;
  font-size: 13px;
  color: var(--ink-sub);
}
.page-footer__grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(104px, 0.7fr)) 196px;
  gap: 48px 40px;
  align-items: start;
}
.page-footer__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
/* 方块底色写死 #060606，和 logo 一致 —— 图还没解码出来时不会闪一块白。
   圆角由父层 overflow 裁（同 `.nav-brand-mark`）。 */
.page-footer__mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  overflow: hidden;
  background: #060606;
}
.page-footer__mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.page-footer__brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.page-footer__tagline {
  margin: 14px 0 0;
  max-width: 320px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-sub);
}
.page-footer__meta {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-sub);
}
.page-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.page-footer__col-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.page-footer__col a { padding: 4px 0; font-size: 13px; }
.page-footer__mp {
  padding: 10px 10px 12px;
  border: var(--line-width) solid var(--line);
  background: var(--surface);
  text-align: center;
}
.page-footer__qr img { display: block; width: 100%; height: auto; }
.page-footer__mp-title {
  margin: 10px 0 4px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.page-footer__mp-note { margin: 0; font-size: 12px; line-height: 1.7; color: var(--ink-sub); }
.page-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: var(--line-width) solid var(--line);
  font-size: 12px;
  color: var(--ink-sub);
}
.page-footer__copy { margin: 0; }
/* 只给导航栏里的链接上色，**别写成 `.page-footer a`** —— 那会连品牌链接
   一起压成次级色，而且 (0,1,1) 压得过 `.page-footer__brand-link` (0,1,0)，
   想再用一条同特异度的规则改回来是改不动的。 */
.page-footer__col a { color: var(--ink-sub); transition: color var(--t-fast); }
.page-footer__col a:hover { color: var(--accent); }

/* ── 返回顶部 ── */
.back-to-top {
  position: fixed;
  right: max(20px, var(--safe-right));
  bottom: calc(24px + var(--safe-bottom));
  z-index: var(--z-top);
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.back-to-top:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── Toast ──
   直角、无投影。语义只靠左侧那条 2px 竖线区分 —— 不做彩色气泡。 */
.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  z-index: var(--z-toast);
  padding: 13px 20px;
  background: var(--ink);
  color: var(--paper);
  border-left: 2px solid var(--accent);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  line-height: 1.6;
  max-width: 90vw;
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  pointer-events: none;
  transition: opacity var(--t-med), transform var(--t-med);
}
.toast:not([hidden]) { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-out { opacity: 0; transform: translateX(-50%) translateY(12px); }
.toast-icon { display: none; }
.toast-success { border-left-color: var(--dark-accent); }
.toast-error { border-left-color: var(--accent); }
.toast-warning { border-left-color: var(--mute); }
.toast-info { border-left-color: var(--dark-line); }
.toast-msg { line-height: 1.6; }

/* ── 确认框 ──
   没有圆底图标、没有投影。危险操作靠**朱红标题**说清楚，主按钮走朱红填充。 */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(23, 20, 18, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.16s var(--ease);
  cursor: pointer;
}
.modal-overlay.modal-out { animation: modal-out 0.16s var(--ease) forwards; }
@keyframes modal-out { to { opacity: 0; } }
.modal-card {
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 400px;
  width: 90vw;
  text-align: left;
  cursor: default;
  animation: modal-card-in 0.18s var(--ease);
}
@keyframes modal-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-icon { display: none; }
.modal-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.modal-card--danger .modal-title { color: var(--accent); }
.modal-message { margin: 0 0 24px; font-size: 14px; line-height: 1.8; color: var(--ink-sub); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── 动画 ── */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 骨架的呼吸。它不表示「正在进行」，只表示「这里会有东西」——
   所以是慢速的透明度起伏，不是转圈。 */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.is-loading .skeleton,
.skeleton--pulse { animation: skeleton-pulse 1.6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--mute); }

/* ── 窄屏（§4.2 的栅格在 1440 上定义，往下逐级收）──
   导航的左右内边距**在这三档里跟着 `.page-container` 一起收**，别写在别处：
   两个盒子的宽度已经对齐了（都是 1440 居中），内边距再各缩各的，边缘就会错开。
   唯一故意不同的是桌面端 —— 应用层导航 32、主内容 56（§4.2 的「应用外壳」），
   到 ≤1024 两者都是 32、自然重合。 */
@media (max-width: 1180px) {
  .page-footer__grid {
    grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(96px, 0.8fr)) 196px;
    gap: 40px 28px;
  }
}
@media (max-width: 1024px) {
  .page-container, .page-container--app { padding: 0 32px; }
  .nav-inner, .nav--marketing .nav-inner { padding: 0 32px; }
  /* 页脚收成两段：品牌占一整行，三栏导航 + 小程序码排一行
     —— 五栏在这个宽度下每栏只剩 ~180px，链接会折行。 */
  .page-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)) 196px; gap: 36px 28px; }
  .page-footer__brand { grid-column: 1 / -1; }
  .page-footer__tagline { max-width: none; }
}
@media (max-width: 768px) {
  :root { --nav-h-app: 64px; --nav-h-marketing: 64px; }
  .page-container, .page-container--app { padding: 0 16px; }
  .nav-inner, .nav--marketing .nav-inner { padding: 0 16px; }
  .section, .section--tight, .section--loose { padding: 56px 0; }
  .section-header { margin-bottom: 28px; }
  .t-display { font-size: 36px; }
  .t-h1, h1 { font-size: 28px; }
  .t-h2, .section-title, h2 { font-size: 24px; }
  .t-h3, h3 { font-size: 20px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .page-footer { padding: 40px 0 calc(20px + var(--safe-bottom)); }
  .page-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  /* 手机上二维码横过来占一整行：竖着那张白卡会占掉半屏，而这里只需要
     「它在、扫得动」—— 图缩到 104，说明文字排在右边。 */
  .page-footer__mp {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    text-align: left;
  }
  .page-footer__qr { flex: 0 0 104px; }
  .page-footer__mp-title { margin: 0 0 4px; }
  .page-footer__bottom { margin-top: 32px; }
  .toast {
    bottom: calc(20px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    max-width: none;
    width: auto;
    transform: translateX(0) translateY(12px);
  }
  .toast:not([hidden]) { transform: translateX(0) translateY(0); }
  .toast.toast-out { transform: translateX(0) translateY(12px); }
  .modal-overlay { padding: 16px; align-items: flex-end; }
  .modal-card { width: 100%; max-width: 100%; margin-bottom: var(--safe-bottom); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .nav-dropdown { right: 0; min-width: min(200px, calc(100vw - 32px)); }
  .nav-dropdown-item { min-height: 44px; padding: 12px 18px; }
  .state { padding: 56px 20px; }
  .table thead th, .table tbody td { padding: 12px 14px; }
}
