/* Tower 的样式：「撞色 · 新野兽派」。
   白纸方格底 + 2.5px 墨线 + 硬投影 + 亮色色块；只有浅色一套（靠白纸黑墨，不跟随系统深色）。
   颜色、线宽、圆角、投影都是下面的变量。色块上的字一律墨色（对比度都在 6:1 以上）。
   不引用外部字体、图片或任何别的网站的文件：图标是内联 SVG 或 data: 地址（CSP 允许 img-src data:）。 */

:root {
  color-scheme: light;
  /* 纸和墨 */
  --paper: #ffffff;
  --grid: #efefef;
  --ink: #111111;
  --ink-2: #333333; /* 次要文字：白底 12.6:1 */
  --muted: #4d4d4d; /* 说明文字：只用在白、黄、草绿、薄荷底上（≥5:1）；别的色块上用墨色 */
  --soft: #f5f5f3; /* 代码区、引用的浅底 */
  --disabled-bg: #ededed;
  --disabled-ink: #6b6b6b;
  /* 色块 */
  --yellow: #ffd84d;
  --pink: #ff7eb6;
  --blue: #5b8cff;
  --mint: #48e0a4;
  --lilac: #c3a6ff;
  --orange: #ff9150;
  --cyan: #5ed3f3;
  --lime: #c9f06b;
  /* 语义色：成功 薄荷、提醒 黄、错误 粉、信息 青（文字仍是墨色，另配图标和描边） */
  --ok: var(--mint);
  --warn: var(--yellow);
  --err: var(--pink);
  --info: var(--cyan);
  /* 线、圆角、投影 */
  --bw: 2.5px;
  --bw-thin: 2px;
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --sh-xs: 3px 3px 0 var(--ink);
  --sh-sm: 4px 4px 0 var(--ink);
  --sh: 5px 5px 0 var(--ink);
  --sh-md: 6px 6px 0 var(--ink);
  --sh-lg: 8px 8px 0 var(--ink);
  /* 焦点：链接、按钮是墨色外框；输入框是带墨边的黄色硬投影 */
  --focus-ring: 3px solid var(--ink);
  --focus-field: 4px 4px 0 0 var(--yellow), 4px 4px 0 var(--bw) var(--ink);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* 版心 */
  --gutter: 16px;
  --page: 1200px;
  /* 图标（墨色描边，data: 地址） */
  --i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --i-check-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='m7.5 12.3 3 3 6-6.3'/%3E%3C/svg%3E");
  --i-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7v6.2M12 16.6v.1'/%3E%3C/svg%3E");
  --i-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2 2.6 20.2h18.8z'/%3E%3Cpath d='M12 9.6v4.6M12 17.2v.1'/%3E%3C/svg%3E");
  --i-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11m-5-5 5 5 5-5M5 20h14'/%3E%3C/svg%3E");
  --i-doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 2.8h8.2L18.4 7v14.2H6z'/%3E%3Cpath d='M14 2.8v4.4h4.4M9 12h6M9 16h6'/%3E%3C/svg%3E");
  --i-sort: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 6 4-4 4 4M2 10l4 4 4-4'/%3E%3C/svg%3E");
  --i-sort-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16' fill='none' stroke='%23ffd84d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 6 4-4 4 4M6 2v12'/%3E%3C/svg%3E");
  --i-sort-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16' fill='none' stroke='%23ffd84d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 10 4 4 4-4M6 14V2'/%3E%3C/svg%3E");
}
/* 英文页面（base.html 的 <html lang="en">）：拉丁字母的系统字体在前，中文字体垫后（页面上的中文照样显示）。
   中文字体排在前面时，英文里的弯引号、撇号（‘ ’ “ ”）用的是它的全角字形，显得特别宽。中文页面还是上面那一套。 */
:root:lang(en) {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans",
    "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}
@media (min-width: 760px) {
  :root { --gutter: 28px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 40px; }
}
@media (max-width: 599.98px) {
  :root { --sh-lg: 6px 6px 0 var(--ink); }
}

/* 每个场景固定一种颜色（首页卡片、工具页色带、对话里的气泡和标签） */
[data-scenario="school"] { --scene: var(--blue); }
[data-scenario="apply"] { --scene: var(--orange); }
[data-scenario="tutor"] { --scene: var(--mint); }
[data-scenario="compare"] { --scene: var(--yellow); }
[data-scenario="store"] { --scene: var(--pink); }
[data-scenario="interview"] { --scene: var(--mint); }
[data-scenario="literature"] { --scene: var(--lilac); }
[data-scenario="document"] { --scene: var(--orange); }
[data-scenario="industry"] { --scene: var(--cyan); }
[data-scenario="overseas"] { --scene: var(--lime); }
[data-scenario="video"] { --scene: var(--pink); }
[data-scenario="board"] { --scene: var(--lilac); }
[data-scenario="apply_check"] { --scene: var(--orange); }
[data-scenario="jobs"] { --scene: var(--lime); }
[data-scenario="job_apply"] { --scene: var(--lime); }
[data-scenario="job_search"] { --scene: var(--cyan); }

/* ---------------------------------------------------------------- 基础 */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* 顶栏是粘住的：跳到锚点、输入框获得焦点时都留出顶栏的高度，不被挡住 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; scroll-padding-bottom: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper);
  /* 浅方格纸：1px #EFEFEF 线，24px 一格（只在页面背景上） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath fill='%23efefef' d='M0 0h24v1H0zM0 0h1v24H0z'/%3E%3C/svg%3E");
  background-size: 24px 24px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 .6em; font-weight: 900; line-height: 1.28; letter-spacing: -0.005em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + .9vw, 1.875rem); }
h3 { font-size: 1.2rem; margin-top: 1.4em; }
p { margin: .6em 0; }
img, svg { max-width: 100%; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
strong, b { font-weight: 800; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .9em; background: var(--soft); border: 1px solid #d4d4d0; border-radius: 6px; padding: .08em .38em; overflow-wrap: anywhere; }
hr { border: 0; border-top: var(--bw) solid var(--ink); margin: 2em 0; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 50;
  padding: 10px 16px;
  background: var(--yellow); color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm); box-shadow: var(--sh-sm);
  font-weight: 900; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--muted); font-size: .92rem; }
.small, .small-text { font-size: .875rem; }
.back { margin: 0 0 18px; }
.back a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 16px 0 14px;
  border: var(--bw-thin) solid var(--ink); border-radius: 999px;
  background: var(--paper); font-size: 14px; font-weight: 800; text-decoration: none;
}
.back a:hover { background: var(--yellow); }

form.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack > button, .stack > .button { align-self: flex-start; min-width: 160px; }
.auth .stack > button { align-self: stretch; }
@media (max-width: 599.98px) { .stack > button, .stack > .button { align-self: stretch; } }
.row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin: 14px 0; }
.row > input { flex: 1 1 180px; min-width: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form > button.wide { justify-self: start; min-width: 200px; }
@media (min-width: 600px) { .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- 版心、顶栏、页脚 */
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
main.wrap { flex: 1 0 auto; max-width: var(--page); padding-top: 24px; padding-bottom: 72px; }
@media (min-width: 760px) { main.wrap { padding-top: 36px; } }
.page-chat { --page: 1040px; }
.page-account { --page: 1040px; }
.page-form { --page: 880px; }
.page-auth { --page: 560px; }
.narrow-form { max-width: 460px; }

.topbar { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: var(--bw) solid var(--ink); }
.topbar-inner { position: relative; display: flex; align-items: center; gap: 10px; min-height: 64px; }
@media (min-width: 900px) { .topbar-inner { min-height: 76px; gap: 18px; } }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; margin-right: auto;
  color: var(--ink); text-decoration: none;
  font-size: 1.35rem; font-weight: 900; letter-spacing: -0.01em; white-space: nowrap;
}
.brand-mark {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px;
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  background: var(--yellow); box-shadow: var(--sh-xs);
  font-size: 1.3rem; font-weight: 900; line-height: 1;
}
.nav { display: flex; align-items: center; gap: 4px; }
@media (min-width: 900px) {
  .brand { margin-right: 0; }
  .nav { margin-inline: auto; }
}
.nav-link, .nav button.linkish {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 14px;
  border: var(--bw) solid transparent; border-radius: 999px;
  background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 800; text-decoration: none; white-space: nowrap;
  box-shadow: none;
}
.nav-link:hover, .nav button.linkish:hover { border-color: var(--ink); text-decoration: none; transform: none; box-shadow: none; }
.nav-link[aria-current="page"] { border-color: var(--ink); background: var(--paper); box-shadow: var(--sh-xs); }
.nav-sep { width: var(--bw-thin); height: 24px; margin: 0 6px; background: var(--ink); }
.acct-pill {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 46vw;
  min-height: 44px; padding: 0 16px 0 12px;
  border: var(--bw) solid var(--ink); border-radius: 999px;
  background: var(--lime); color: var(--ink);
  font-size: 14px; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.acct-pill svg { flex: none; }
.acct-pill:hover { box-shadow: var(--sh-xs); text-decoration: none; }
.acct-pill[aria-current="page"] { box-shadow: var(--sh-xs); }
.acct-pill.is-low { background: var(--err); }
.acct-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acct-balance { font-weight: 900; font-variant-numeric: tabular-nums; }
.acct-pill .acct-balance:not(:first-child) { padding-left: 8px; border-left: var(--bw-thin) solid var(--ink); }
.nav-toggle { display: none; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

/* 900–1100 像素宽时导航正好挤：链接收窄一点，不换行 */
@media (min-width: 900px) and (max-width: 1099.98px) {
  .topbar-inner { gap: 12px; }
  .nav { gap: 0; }
  .nav-link, .nav button.linkish { padding: 0 7px; font-size: 14px; }
  .nav-sep { margin: 0 3px; }
  .acct-pill { max-width: 24vw; }
}
@media (max-width: 899.98px) {
  .topbar-inner { flex-wrap: wrap; }
  /* 没有脚本时导航排在下面一行；有脚本时收进「菜单」按钮 */
  .nav { order: 5; width: 100%; flex-wrap: wrap; padding-bottom: 10px; }
  .nav-sep { display: none; }
  .js .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 44px; min-height: 44px; padding: 0;
    border-radius: var(--r-sm); box-shadow: var(--sh-xs);
  }
  .js .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    margin-top: var(--bw);
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 14px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: var(--bw) solid var(--ink);
  }
  .js .nav-open .nav { display: flex; }
  .js .nav .nav-link, .js .nav button.linkish {
    justify-content: flex-start; width: 100%; min-height: 50px; padding: 0 18px;
    border-color: var(--ink); border-radius: var(--r); font-size: 16px;
  }
  .js .nav form.inline { display: block; }
  .js .nav-link[aria-current="page"] { background: var(--yellow); }
}
@media (max-width: 420px) {
  .brand { font-size: 1.2rem; gap: 8px; }
  .brand-mark { width: 36px; height: 36px; font-size: 1.15rem; }
  .acct-pill { padding: 0 12px 0 10px; gap: 6px; font-size: 13px; }
  .acct-pill .acct-name:not(:only-of-type) { display: none; } /* 有余额时窄屏只显示余额 */
  .acct-pill .acct-balance:not(:first-child) { padding-left: 0; border-left: 0; }
}

.footer { border-top: var(--bw) solid var(--ink); background: var(--paper); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 20px; padding-bottom: 28px; }
.footer .brand-mark { width: 26px; height: 26px; border-width: var(--bw-thin); border-radius: 8px; box-shadow: none; font-size: 14px; }

/* ---------------------------------------------------------------- 按钮
   主按钮：墨底白字 + 黄色硬投影；次按钮：白底墨字 + 墨色硬投影；危险操作：白底 + 粉色投影。
   悬停上移、投影加大；按下时移到投影的位置（投影收回）。 */
button, .button {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  max-width: 100%;
  min-height: 48px; padding: 0 20px;
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: 16px; font-weight: 900; line-height: 1.2;
  text-align: center; text-decoration: none; white-space: nowrap;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
button svg, .button svg { flex: none; }
button:hover, .button:hover { box-shadow: var(--sh-md); text-decoration: none; }
button:active, .button:active { box-shadow: 0 0 0 var(--ink); }
.primary, button.primary, .button.primary { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--yellow); }
.primary:hover { box-shadow: 6px 6px 0 var(--yellow); }
.primary:active { box-shadow: 0 0 0 var(--yellow); }
button.danger, .button.danger { box-shadow: 4px 4px 0 var(--pink); }
button.danger:hover, .button.danger:hover { box-shadow: 6px 6px 0 var(--pink); }
button.danger:active, .button.danger:active { box-shadow: 0 0 0 var(--pink); }
button.small, .button.small { min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 800; box-shadow: var(--sh-xs); }
button.small:hover, .button.small:hover { box-shadow: 5px 5px 0 var(--ink); }
button.small.danger { box-shadow: 3px 3px 0 var(--pink); }
button.small.danger:hover { box-shadow: 5px 5px 0 var(--pink); }
button.small.primary { box-shadow: 3px 3px 0 var(--yellow); }
button.small.primary:hover { box-shadow: 5px 5px 0 var(--yellow); }
.button.big, button.big { min-height: 56px; padding: 0 26px; border-radius: 16px; font-size: 17px; box-shadow: var(--sh); }
.button.big:hover { box-shadow: 7px 7px 0 var(--ink); }
.button.big.primary, button.big.primary { box-shadow: 5px 5px 0 var(--yellow); }
.button.big.primary:hover, button.big.primary:hover { box-shadow: 7px 7px 0 var(--yellow); }
/* 不能点的按钮：灰底、没有投影（压过上面各种按钮的投影） */
button:disabled {
  background: var(--disabled-bg) !important; color: var(--disabled-ink) !important; border-color: #8a8a8a !important;
  box-shadow: none !important; transform: none !important; cursor: not-allowed;
}
button.linkish { min-height: 44px; padding: 0 12px; border-color: transparent; background: transparent; box-shadow: none; font-size: 15px; font-weight: 800; }
button.linkish:hover { border-color: var(--ink); box-shadow: none; }

/* ---------------------------------------------------------------- 表单 */
/* 标签包着输入框：标题一行（必填的 * 跟在后面），输入框和说明各占一行 */
label { display: block; font-size: 15px; font-weight: 800; color: var(--ink); }
label > input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), label > select, label > textarea { display: block; margin-top: 8px; }
label > small { display: block; margin-top: 6px; }
label small, fieldset small, .help { font-size: 13px; font-weight: 500; line-height: 1.55; color: var(--muted); }
.req { color: var(--ink); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-width: 0;
  min-height: 48px; padding: 10px 14px;
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  background-color: var(--paper); color: var(--ink);
  font-family: inherit; font-size: 16px; font-weight: 500; line-height: 1.5;
  box-shadow: none;
  transition: box-shadow .12s ease;
}
textarea { resize: vertical; min-height: 112px; }
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 42px;
  background-image: var(--i-chevron); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
  text-overflow: ellipsis; cursor: pointer;
}
input::placeholder, textarea::placeholder { color: var(--disabled-ink); opacity: 1; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, select:focus, textarea:focus { outline: none; box-shadow: var(--focus-field); }
input:not([type="checkbox"]):not([type="radio"]):disabled, select:disabled, textarea:disabled { background-color: var(--disabled-bg); color: var(--disabled-ink); border-color: #8a8a8a; cursor: not-allowed; }
/* 填错了（浏览器自带的检查，用户动过以后才显示）：粉色硬投影 */
input:user-invalid, select:user-invalid, textarea:user-invalid { box-shadow: 4px 4px 0 0 var(--pink), 4px 4px 0 var(--bw) var(--ink); }

input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 22px; height: 22px; margin: 0;
  border: var(--bw) solid var(--ink); border-radius: 6px;
  background: var(--paper) center / 15px no-repeat;
  cursor: pointer;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked { background-color: var(--ink); background-image: var(--i-check-white); }
input[type="radio"]:checked { background-color: var(--ink); box-shadow: inset 0 0 0 4px var(--paper); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { border-color: #8a8a8a; background-color: var(--disabled-bg); cursor: not-allowed; }
input[type="checkbox"]:checked:disabled { background-color: #8a8a8a; }
input[type="radio"]:checked:disabled { background-color: #8a8a8a; box-shadow: inset 0 0 0 4px var(--disabled-bg); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

input[type="file"] {
  width: 100%; max-width: 100%; min-height: 56px; padding: 8px 10px;
  border: var(--bw) dashed var(--ink); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: 14px; font-weight: 600;
}
input[type="file"]::file-selector-button {
  min-height: 40px; margin-right: 12px; padding: 0 14px;
  border: var(--bw-thin) solid var(--ink); border-radius: 10px;
  background: var(--yellow); color: var(--ink);
  font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
input[type="file"]:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

label.check { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 700; cursor: pointer; }
label.check input { margin: 0; }

fieldset.choices { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
fieldset.choices legend { padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 800; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
label.choice {
  display: inline-flex; flex-direction: row; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 16px 0 12px;
  border: var(--bw-thin) solid var(--ink); border-radius: 999px;
  background: var(--paper);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: box-shadow .12s ease, background-color .12s ease;
}
label.choice input[type="checkbox"], label.choice input[type="radio"] { width: 20px; height: 20px; }
label.choice:hover { box-shadow: var(--sh-xs); }
label.choice:has(input:checked) { background: var(--scene, var(--yellow)); box-shadow: var(--sh-xs); }
label.choice:has(input:focus-visible) { outline: var(--focus-ring); outline-offset: 3px; }
label.choice:has(input:focus-visible) input { outline: none; }

/* ---------------------------------------------------------------- 标签、胶囊 */
.tag, .badge {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 11px;
  border: var(--bw-thin) solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-size: 13px; font-weight: 800; line-height: 1.25; white-space: nowrap;
  vertical-align: middle;
}
.badge + .badge { margin-left: 2px; }
.badge.succeeded, .badge.done, .badge.paid { background: var(--ok); }
.badge.running, .badge.queued, .badge.pending { background: var(--warn); }
.badge.failed { background: var(--err); }
.badge.closed { border-style: dashed; }
.badge.admin { background: var(--lilac); }
.badge.scenario { background: var(--scene, var(--cyan)); }
.badge.free { background: var(--yellow); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.plus, .minus { font-weight: 900; }
.plus { display: inline-block; padding: 0 8px; border: var(--bw-thin) solid var(--ink); border-radius: 999px; background: var(--ok); }
.minus { display: inline-block; padding: 0 8px; border: var(--bw-thin) solid var(--ink); border-radius: 999px; background: var(--err); }
span.minus.small-text { padding: 0 6px; border-width: 1.5px; border-radius: 6px; font-weight: 700; }

/* ---------------------------------------------------------------- 提示（闪现消息、页面里的提醒）
   成功 薄荷、提醒 黄、错误 粉；左边有图标，不只靠颜色区分。 */
.notice {
  position: relative;
  margin: 0 0 22px; padding: 12px 16px 12px 48px;
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  background: var(--ok); color: var(--ink);
  font-weight: 700; line-height: 1.6;
  box-shadow: var(--sh-sm);
}
.notice::before {
  content: ""; position: absolute; left: 14px; top: 13px;
  width: 22px; height: 22px;
  background: var(--i-ok) center / contain no-repeat;
}
.notice.error { background: var(--err); }
.notice.error::before { background-image: var(--i-error); }
.notice.warn { background: var(--warn); }
.notice.warn::before { background-image: var(--i-warn); }
.notice.info { background: var(--info); }
.notice a { color: var(--ink); font-weight: 900; }
.notice .muted { color: var(--ink); }

/* ---------------------------------------------------------------- 卡片、分区 */
.card {
  margin: 0 0 28px; padding: 22px 18px;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}
@media (min-width: 760px) { .card { padding: 30px 34px; } }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.narrow { position: relative; max-width: 480px; margin: 36px auto 32px; }
.card.attention { box-shadow: 8px 8px 0 var(--yellow), 8px 8px 0 var(--bw) var(--ink); }
.card h2 { margin-bottom: .5em; }
.card h3 { font-size: 1.05rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0 0 20px; }
.section-head > * { margin: 0; }
.section-head p { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.page-title { margin-bottom: 24px; }

/* 只显示一次的秘密（新 token、邀请码、临时密码）：黄色块 */
.secret { background: var(--yellow); }
div.secret { margin: 16px 0; padding: 14px 16px; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh-sm); }
.secret .muted, .secret p { color: var(--ink); }
.secret code, .secret pre {
  display: block; margin: 10px 0 12px; padding: 12px 14px;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  font-size: 15px; font-weight: 700; line-height: 1.6;
  word-break: break-all; white-space: pre-wrap;
}

/* 列表 */
.plain { list-style: none; margin: 12px 0; padding: 0; border: var(--bw) solid var(--ink); border-radius: var(--r); background: var(--paper); overflow: hidden; }
.plain li { padding: 12px 16px; }
.plain li + li { border-top: var(--bw-thin) solid var(--ink); }
.plain.small li { padding: 8px 14px; }
.plain .muted { font-size: 13px; }

/* 色块插画式的空状态 */
.empty {
  display: grid; justify-items: center; gap: 8px;
  padding: 34px 20px 30px; text-align: center;
  background: var(--paper);
  border: var(--bw) dashed var(--ink); border-radius: var(--r-xl);
}
.empty-art { position: relative; width: 150px; height: 104px; margin-bottom: 6px; }
.empty-art i { position: absolute; display: block; border: var(--bw) solid var(--ink); box-shadow: var(--sh-sm); }
.empty-art i:nth-child(1) { left: 4px; top: 22px; width: 70px; height: 62px; border-radius: 16px 16px 16px 4px; background: var(--cyan); transform: rotate(-6deg); }
.empty-art i:nth-child(2) { left: 58px; top: 2px; width: 50px; height: 50px; border-radius: 50%; background: var(--yellow); }
.empty-art i:nth-child(3) { right: 2px; bottom: 4px; width: 66px; height: 46px; border-radius: 14px 14px 4px 14px; background: var(--pink); transform: rotate(5deg); }
.empty-title { margin: 6px 0 0; font-size: 20px; font-weight: 900; }
.empty p { margin: 0; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; margin-top: 12px !important; }

/* ---------------------------------------------------------------- 首页 */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; padding: 12px 0 56px; }
@media (min-width: 980px) { .hero { grid-template-columns: minmax(0, 1fr) 236px; gap: 40px; padding: 40px 0 92px; } }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; min-width: 0; }
.hero-tag { background: var(--cyan); min-height: 32px; padding: 0 14px; font-size: 14px; }
.hero-title { margin: 0; font-size: clamp(2.5rem, 1.1rem + 5.8vw, 5.375rem); line-height: 1.14; font-weight: 900; letter-spacing: -0.01em; }
.hero-mark {
  display: inline-block; margin-left: .14em; padding: 0 .16em;
  background: var(--yellow);
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  box-shadow: var(--sh);
  transform: rotate(-2deg);
}
.hero-lead { margin: 0; max-width: 40em; font-size: clamp(1rem, .95rem + .35vw, 1.19rem); line-height: 1.8; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 18px; }
.sticker {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: var(--bw) solid var(--ink); border-radius: 50%;
  background: var(--pink); box-shadow: var(--sh-md);
  font-weight: 900; line-height: 1.35;
  transform: rotate(9deg);
  pointer-events: none; user-select: none;
}
.hero .sticker { display: none; width: 220px; height: 220px; margin-top: 18px; font-size: 26px; }
@media (min-width: 980px) { .hero .sticker { display: flex; } }

.tools { margin-bottom: 72px; }
.tool-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 560px) { .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 980px) { .tool-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }
.tool-cards > li { min-width: 0; }
.tool-card {
  display: flex; flex-direction: column; gap: 6px;
  height: 100%; min-height: 168px; padding: 16px 18px 16px;
  background: var(--scene, var(--paper)); color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
@media (min-width: 560px) { .tool-card { min-height: 212px; padding: 20px 20px 18px; gap: 8px; } }
.tool-card:hover { text-decoration: none; box-shadow: var(--sh-lg); }
.tool-num { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@media (min-width: 560px) { .tool-num { font-size: 44px; } }
.tool-title { margin-top: 4px; font-size: 21px; font-weight: 900; line-height: 1.3; }
@media (min-width: 560px) { .tool-title { margin-top: 8px; font-size: 23px; } }
.tool-example { flex: 1; font-size: 14px; font-weight: 500; line-height: 1.65; color: var(--ink); }
/* 档位标签靠左、预计价格靠右；放不下时价格换到下一行，仍然靠右 */
.tool-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; margin-top: 6px; white-space: nowrap; font-size: 16px; font-weight: 900; line-height: 30px; font-variant-numeric: tabular-nums; }
.tool-meta .badge { margin-right: auto; }
.tool-card .badge.scenario { background: var(--paper); }
/* 没登录时的介绍页（landing.html）：三件事一行三张；不是链接的卡片悬停不变 */
@media (min-width: 980px) { .landing-three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.landing-three .tool-card { min-height: 0; }
.landing-three > li:nth-child(1) .tool-card { --scene: var(--cyan); }
.landing-three > li:nth-child(2) .tool-card { --scene: var(--yellow); }
.landing-three > li:nth-child(3) .tool-card { --scene: var(--mint, var(--ok)); }
.landing-three .tool-card:hover { box-shadow: var(--sh-md); }
.landing-experiment h3 { margin: 12px 0 6px; font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); }
.landing-about { display: flex; gap: 18px; align-items: flex-start; }
.landing-about .brand-mark { flex: none; width: 56px; height: 56px; font-size: 28px; }
.landing-about h3 { margin: 4px 0 6px; }
.landing-about p { margin: 0 0 8px; }
/* 更多调研工具：小一号的卡片，没有序号（首页第一屏留给留学这一路） */
.more-tools .section-head h2 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); }
.tool-cards.compact { gap: 14px; }
@media (min-width: 560px) { .tool-cards.compact { gap: 16px; } }
.tool-cards.compact .tool-card { min-height: 0; padding: 14px 16px 12px; gap: 4px; border-radius: var(--r); box-shadow: var(--sh-sm); }
.tool-cards.compact .tool-card:hover { box-shadow: var(--sh-md); }
.tool-cards.compact .tool-title { margin-top: 0; font-size: 18px; }
.tool-cards.compact .tool-example { font-size: 13px; line-height: 1.6; }
.tool-cards.compact .tool-meta { margin-top: 4px; font-size: 14px; line-height: 26px; }

.ask { margin-bottom: 72px; }
.ask h1 { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem); margin: 0 0 20px; }
.ask-note { margin: 16px 0 0; }
.convs { margin-bottom: 24px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 900px) { .list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
.list > li { min-width: 0; }
.list-item {
  display: flex; flex-direction: column; gap: 10px;
  height: 100%; min-height: 64px; padding: 16px 18px;
  background: var(--paper); color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.list-item:hover { text-decoration: none; box-shadow: var(--sh); }
.list-title { font-size: 17px; font-weight: 800; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 18px; }

/* ---------------------------------------------------------------- 发消息的输入框（首页、对话页共用） */
.composer { margin: 0; }
.composer-box {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 14px 14px;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  transition: box-shadow .12s ease;
}
@media (min-width: 760px) { .composer-box { padding: 18px 20px 16px; } }
.composer-box:focus-within { box-shadow: 8px 8px 0 0 var(--yellow), 8px 8px 0 var(--bw) var(--ink); }
.composer textarea {
  min-height: 104px; padding: 4px 4px;
  border: 0; border-radius: 0; background: transparent;
  font-size: 17px; line-height: 1.7;
}
.composer textarea:focus { box-shadow: none; }
.composer textarea:disabled { background: transparent; }
.composer-box:has(textarea:disabled) { background: var(--disabled-bg); box-shadow: var(--sh-sm); }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.composer-spacer { flex: 1 1 0; min-width: 0; }
.pick {
  display: inline-flex; flex-direction: row; align-items: center; gap: 0;
  min-width: 0; max-width: 100%; min-height: 44px; padding-left: 12px;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  font-size: 13px; font-weight: 800; white-space: nowrap;
  transition: box-shadow .12s ease;
}
.pick:hover { background-color: var(--yellow); }
.pick:focus-within { box-shadow: var(--focus-field); }
.pick .model-hint { margin-left: 4px; font-size: 12px; font-weight: 700; color: var(--ink); }
.pick select {
  width: auto; min-width: 0; max-width: 100%; min-height: 44px; margin: 0;
  padding: 6px 34px 6px 8px;
  border: 0; border-radius: var(--r-sm); background-color: transparent; background-position: right 10px center; background-size: 14px;
  font-size: 14px; font-weight: 800;
}
.pick select:focus { box-shadow: none; }
@media (min-width: 760px) { .pick select { max-width: 320px; } }
.pick:has(select:disabled) { background: var(--disabled-bg); border-color: #8a8a8a; color: var(--disabled-ink); }
.pick select:disabled { background-color: transparent; }
.composer .check { font-size: 14px; }
.composer .send { min-width: 104px; min-height: 50px; padding: 0 18px; border-radius: var(--r); box-shadow: 4px 4px 0 var(--pink); }
.composer .send:hover { box-shadow: 6px 6px 0 var(--pink); }
.composer .send:active { box-shadow: 0 0 0 var(--pink); }
.composer .send:disabled { box-shadow: none; }
.composer-note { margin: 14px 0 0; font-size: 13px; line-height: 1.6; }
@media (max-width: 759.98px) {
  .composer-spacer { display: none; }
  .composer .pick { flex: 1 1 100%; }
  /* 16px：iPhone（包括微信里）点开小于 16px 的下拉框会把整个页面放大，放大了还不会自己缩回去 */
  .composer .pick select { flex: 1 1 auto; font-size: 16px; }
  .composer .send { flex: 1 1 auto; }
}

/* 附件按钮和已选附件（app.js 列出选中的文件：名字 · 大小 · 移除） */
.attach-btn {
  position: relative;
  display: inline-flex; flex-direction: row; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  font-size: 14px; font-weight: 800; white-space: nowrap; cursor: pointer;
}
.attach-btn:hover { background: var(--yellow); }
.attach-btn:focus-within { outline: var(--focus-ring); outline-offset: 3px; }
.attach-btn:has(input:disabled) { background: var(--disabled-bg); border-color: #8a8a8a; color: var(--disabled-ink); cursor: not-allowed; }
.attach-btn input[type="file"] { width: auto; min-height: 0; padding: 0; border: 0; background: transparent; font-size: 13px; }
.attach-btn input[type="file"]::file-selector-button { min-height: 32px; }
/* 有脚本时把原生的文件框藏起来（还能用键盘选中），选中的文件列成胶囊；没有脚本时照常显示原生的文件框 */
.js .attach-btn input[type="file"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0;
  border: 0; opacity: 0; cursor: pointer;
}
.js .attach-btn input[type="file"]:disabled { cursor: not-allowed; }
.attach-btn input[type="file"]:focus-visible { outline: none; }
.file-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%;
  min-height: 44px; padding: 0 0 0 14px;
  background: var(--yellow);
  border: var(--bw-thin) solid var(--ink); border-radius: 999px;
  font-size: 13px; font-weight: 800;
}
.file-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-size { flex: none; font-weight: 600; white-space: nowrap; }
.file-chip-size::before { content: "· "; }
/* 移除按钮：44px 的点击区域（上下压在胶囊的描边上，胶囊不会因此变高） */
.file-chip-remove {
  flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: -2px -2px -2px 0;
  border: 0; border-radius: 50%; background: transparent; box-shadow: none;
}
.file-chip-remove:hover { background: var(--paper); box-shadow: none; }
.file-chip-remove:active { transform: none; }
.file-chip-remove:focus-visible { outline-offset: 0; }
.tool-files { display: flex; flex-direction: column; gap: 10px; }
.tool-files .attach-btn { align-self: flex-start; }
/* 没加上的附件（太大、超出个数）：胶囊下面一行粉底的说明 */
.file-note {
  margin: 0; padding: 6px 12px;
  background: var(--err); border: var(--bw-thin) solid var(--ink); border-radius: var(--r-xs);
  font-size: 13px; font-weight: 700; line-height: 1.6;
}
/* 用脚本提交被拒绝时的原因（app.js 的 showProblem）：发消息的在输入框上面，场景工具的在「开始」按钮上面 */
.composer > .form-problem { margin: 0 0 16px; }
.tool-form .form-problem, .upgrade .form-problem { margin: 0; }
/* 拖着文件经过页面时：附件区域虚线框 + 黄底，松手就加进去 */
.drop-target { outline: 3px dashed var(--ink); outline-offset: 6px; border-radius: var(--r-sm); }
.composer-box.drop-target { background: var(--yellow); border-radius: var(--r-xl); }

/* ---------------------------------------------------------------- 场景工具页 */
.tool-hero {
  margin: 0 0 28px; padding: 24px 20px 22px;
  background: var(--scene, var(--yellow));
  border: var(--bw) solid var(--ink); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}
@media (min-width: 760px) { .tool-hero { padding: 34px 36px 30px; } }
.tool-hero h1 { margin: 0 0 10px; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); line-height: 1.15; }
.tool-lead { margin: 0 0 18px; font-size: 17px; font-weight: 600; line-height: 1.7; }
.tool-hero .tag { min-height: 32px; padding: 0 14px; font-size: 14px; }
.card.tool { padding-top: 26px; }
.tool .estimate {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%;
  margin: 0; padding: 10px 16px;
  background: var(--yellow);
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  box-shadow: var(--sh-sm);
  font-size: 17px; font-weight: 900; line-height: 1.45;
}
.tool-notes { display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }
.tool-notes p { margin: 0; }
.tier-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 600px) { .tier-row { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
label.tier-choice {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 12px;
  min-height: 88px; padding: 16px 18px;
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
  background: var(--paper);
}
label.tier-choice input { grid-row: 1 / span 2; margin-top: 3px; width: 22px; height: 22px; }
.tier-name { font-size: 19px; font-weight: 900; line-height: 1.3; }
label.tier-choice small { grid-column: 2; font-size: 13px; font-weight: 600; color: var(--ink); }
label.tier-choice:hover { box-shadow: var(--sh-sm); }
label.tier-choice:has(input:checked) { background: var(--scene, var(--yellow)); box-shadow: var(--sh); }
.tool-form > button.primary { align-self: flex-start; min-width: 200px; min-height: 56px; font-size: 18px; box-shadow: 5px 5px 0 var(--yellow); }
@media (max-width: 599.98px) { .tool-form > button.primary { align-self: stretch; } }
details.advanced { border: var(--bw) solid var(--ink); border-radius: var(--r-lg); background: var(--paper); }
details.advanced > summary,
details.more-prices > summary,
details.danger-zone > summary,
details.user > summary { list-style: none; cursor: pointer; }
details.advanced > summary::-webkit-details-marker,
details.more-prices > summary::-webkit-details-marker,
details.danger-zone > summary::-webkit-details-marker,
details.user > summary::-webkit-details-marker { display: none; }
details.advanced > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 54px; padding: 0 18px;
  font-size: 16px; font-weight: 900; border-radius: var(--r-lg);
}
details.advanced > summary::after,
details.more-prices > summary::after,
details.user > summary::after {
  content: ""; flex: none; width: 18px; height: 18px;
  background: var(--i-chevron) center / contain no-repeat;
  transition: transform .15s ease;
}
details[open] > summary::after { transform: rotate(180deg); }
details.advanced > summary:hover { background: var(--yellow); }
details.advanced[open] > summary { border-bottom: var(--bw-thin) solid var(--ink); border-radius: var(--r-lg) var(--r-lg) 0 0; }
details.advanced > .stack { padding: 18px 18px 20px; gap: 16px; }

/* ---------------------------------------------------------------- 对话页 */
.conv-head { margin: 0 0 26px; }
.conv-title { margin: 0 0 14px; word-break: break-word; }
.scenario-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0; }
.scenario-bar .badge.scenario { min-height: 32px; padding: 0 14px; font-size: 14px; }
.scenario-bar .upgrade button { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--yellow); }
.scenario-bar .upgrade button:hover { box-shadow: 5px 5px 0 var(--yellow); }
.scenario-bar .upgrade button:disabled { background: var(--disabled-bg); color: var(--disabled-ink); box-shadow: none; }
.thread { display: flex; flex-direction: column; gap: 24px; margin-bottom: 36px; }
.msg { min-width: 0; }
.msg-user {
  align-self: flex-end;
  max-width: min(88%, 720px);
  padding: 14px 18px;
  background: var(--scene, var(--cyan));
  border: var(--bw) solid var(--ink); border-radius: 20px 20px 6px 20px;
  box-shadow: var(--sh-sm);
}
@media (max-width: 559.98px) { .msg-user { max-width: 100%; } }
.msg-user .msg-body { font-size: 16px; font-weight: 500; }
/* 用户自己打的换行照原样显示（Markdown 里单个换行会被并成一行：「1、…↵2、…」就挤成一行了） */
.msg-user .msg-body p { white-space: pre-line; }
.msg-user a, .msg-user .muted { color: var(--ink); }
.msg-user code { background: var(--paper); }
.msg-assistant {
  padding: 22px 18px;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}
@media (min-width: 760px) { .msg-assistant { padding: 34px 40px; } }
/* 还在生成：虚线框；失败：粉色投影 */
.msg-assistant.msg-queued, .msg-assistant.msg-running { border-style: dashed; box-shadow: var(--sh-sm); }
.msg-assistant.msg-failed { box-shadow: 8px 8px 0 0 var(--err), 8px 8px 0 var(--bw) var(--ink); }
.msg-assistant.msg-failed .notice { margin-bottom: 0; box-shadow: none; }
@media (min-width: 760px) {
  .msg-assistant.msg-queued, .msg-assistant.msg-running, .msg-assistant.msg-failed { padding: 24px 28px; }
}
.msg-body { overflow-wrap: anywhere; }
.msg-body > :first-child { margin-top: 0; }
.msg-body > :last-child { margin-bottom: 0; }
.msg-user .msg-body ul, .msg-user .msg-body ol { padding-left: 1.3em; margin: .4em 0; }

/* 回复的底部：型号 · 思考 · 联网搜索 N 次 · 费用（一个小标签），下载和复制按钮 */
.msg-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 28px; padding-top: 18px; border-top: var(--bw-thin) solid var(--ink); }
.msg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.msg-meta {
  display: inline-block; max-width: 100%;
  padding: 5px 12px;
  border: var(--bw-thin) solid var(--ink); border-radius: var(--r-sm);
  background: var(--lime);
  font-size: 13px; font-weight: 800; line-height: 1.55; font-variant-numeric: tabular-nums;
}
.tool-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 12px;
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink);
  font-size: 14px; font-weight: 800; text-decoration: none; white-space: nowrap;
  box-shadow: var(--sh-xs);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tool-link::before { content: ""; flex: none; width: 18px; height: 18px; background: var(--i-download) center / contain no-repeat; }
.tool-link:hover { text-decoration: none; box-shadow: 5px 5px 0 var(--ink); }
.danger-zone { margin: 30px 0 8px; font-size: 14px; }
details.danger-zone > summary {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: var(--bw-thin) dashed var(--ink); border-radius: 999px;
  background: var(--paper);
  font-weight: 800;
}
details.danger-zone > summary:hover { border-style: solid; }
details.danger-zone[open] > summary { margin-bottom: 14px; }
.compose { margin: 0; }
.compose-wait { margin: 0 0 14px; font-weight: 700; }
.retry { margin: 16px 0 0; }

/* 还在生成：三个色块轮流跳 + 已用时间（减少动画时静止） */
.progress { display: flex; align-items: center; gap: 18px; }
.progress p { margin: 0; }
.progress p + p { margin-top: 6px; }
.progress-text { min-width: 0; }
.progress-text p:first-child { font-weight: 700; }
#elapsed { font-weight: 900; font-variant-numeric: tabular-nums; }
.loader { display: inline-flex; align-items: flex-end; gap: 7px; flex: none; height: 40px; padding-top: 12px; }
.loader i { display: block; width: 16px; height: 16px; border: var(--bw-thin) solid var(--ink); border-radius: 5px; background: var(--yellow); animation: tower-hop 1.2s ease-in-out infinite; }
.loader i:nth-child(2) { background: var(--pink); animation-delay: .16s; }
.loader i:nth-child(3) { background: var(--blue); animation-delay: .32s; }
@keyframes tower-hop {
  0%, 55%, 100% { transform: translateY(0); }
  25% { transform: translateY(-12px); }
}

/* 用户消息里的附件 */
.attachments { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attachment {
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%;
  min-height: 44px; padding: 6px 14px 6px 10px;
  background: var(--paper);
  border: var(--bw-thin) solid var(--ink); border-radius: var(--r);
  font-size: 14px; font-weight: 800; line-height: 1.4;
}
.attachment:not(.attachment-image)::before { content: ""; flex: none; width: 22px; height: 22px; background: var(--i-doc) center / contain no-repeat; }
.attachment .muted { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.attachment-name { min-width: 0; overflow-wrap: anywhere; }
.attachment { position: relative; }
.attachment a { display: block; line-height: 0; }
.attachment-name a { display: inline; line-height: inherit; }
.attachment-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* PDF：整个胶囊都能点 */
.thumb { display: block; width: 52px; height: 52px; object-fit: cover; border: var(--bw-thin) solid var(--ink); border-radius: var(--r-xs); }

/* ---------------------------------------------------------------- 回复正文（报告） */
.report { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
@media (min-width: 760px) { .report { font-size: 17px; line-height: 1.9; } }
.report h1 { font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.4rem); line-height: 1.25; margin: 0 0 .7em; }
.report h2 { font-size: clamp(1.25rem, 1.1rem + .7vw, 1.55rem); margin: 1.9em 0 .6em; }
.report h2::before {
  content: ""; display: inline-block; flex: none;
  width: .62em; height: .62em; margin-right: .45em; vertical-align: .02em;
  background: var(--yellow); border: var(--bw-thin) solid var(--ink); border-radius: 4px;
}
.report h3 { font-size: 1.12em; margin: 1.6em 0 .5em; }
.report h4, .report h5, .report h6 { font-size: 1em; margin: 1.4em 0 .4em; }
.report p { margin: .75em 0; }
.report ul, .report ol { padding-left: 1.5em; margin: .7em 0; }
.report li { margin: .3em 0; }
.report li::marker { font-weight: 900; }
.report blockquote { margin: 1.1em 0; padding: 8px 16px; border-left: 6px solid var(--ink); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--soft); color: var(--ink-2); }
.report blockquote > :first-child { margin-top: 0; }
.report blockquote > :last-child { margin-bottom: 0; }
.report pre { margin: 1em 0; padding: 14px 16px; border: var(--bw) solid var(--ink); border-radius: var(--r); background: var(--soft); overflow-x: auto; font-size: .88em; line-height: 1.6; }
.report pre code { padding: 0; border: 0; background: none; font-size: inherit; }

/* 表格：墨色表头白字，2px 墨色内线；宽表格在自己的框里横向滚动（render.py 包了 .table-wrap） */
.table-wrap, .table-scroll {
  position: relative; /* 里面绝对定位的东西（.vh）也只在这个框里，不撑宽页面 */
  max-width: 100%; margin: 1.1em 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.55; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; }
th { background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 800; white-space: nowrap; }
td { border-top: var(--bw-thin) solid var(--ink); background: var(--paper); }
thead + tbody tr:first-child td { border-top: 0; }
td a { font-weight: 700; }
.report table { font-size: 15px; }
.report th, .report td { min-width: 6.5em; padding: 12px 14px; }
.report td:first-child { font-weight: 700; }
/* 点表头排序（app.js 给有两行以上数据的表加 sortable）；当前排序的列箭头和字是黄色 */
.report th.sortable { position: relative; padding-right: 34px; cursor: pointer; user-select: none; }
.report th.sortable::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 11px; height: 15px; margin-top: -7.5px;
  background: var(--i-sort) center / contain no-repeat; opacity: .75;
}
.report th.sortable:hover { background: #2b2b2b; }
.report th[aria-sort="ascending"], .report th[aria-sort="descending"] { color: var(--yellow); }
.report th[aria-sort="ascending"]::after { background-image: var(--i-sort-up); opacity: 1; }
.report th[aria-sort="descending"]::after { background-image: var(--i-sort-down); opacity: 1; }
.report th.sortable:focus-visible { outline: 3px solid var(--yellow); outline-offset: -6px; }
/* 宽表格左右滑动时，第一列（学校、产品、公司这种行名）固定在左边，滑过之后它右边出现一条分隔线；
   右边还有没露出来的列时，表格框右边缘渐隐，提示可以往左滑（app.js 按滚动位置加 is-scrolled / is-more）。 */
.report .table-wrap th:first-child, .report .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; }
.report .table-wrap th:first-child { z-index: 2; }
.report .table-wrap.is-scrolled td:first-child { box-shadow: inset calc(-1 * var(--bw-thin)) 0 0 var(--ink); }
.report .table-wrap.is-scrolled th:first-child { box-shadow: inset calc(-1 * var(--bw-thin)) 0 0 var(--muted); }
.report .table-wrap.is-more {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), rgba(0, 0, 0, .18));
          mask-image: linear-gradient(to right, #000 calc(100% - 36px), rgba(0, 0, 0, .18));
}
@media (max-width: 599.98px) {
  /* 手机上第一列固定 7.5 个字宽（宽表格里各列都缩到最小宽度，不给宽度它会被挤得很窄），长名字换行 */
  .report .table-wrap th:first-child, .report .table-wrap td:first-child { width: 7.5em; min-width: 7.5em; max-width: 9em; white-space: normal; overflow-wrap: break-word; }
}

/* 目录：一排带序号黑圆点的胶囊 */
nav.toc { margin: 0 0 26px; }
nav.toc .toc-title { margin: 0 0 10px; font-size: 13px; font-weight: 900; letter-spacing: .12em; }
nav.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; counter-reset: toc; }
nav.toc li { margin: 0; min-width: 0; max-width: 100%; counter-increment: toc; }
nav.toc a {
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%;
  min-height: 44px; padding: 4px 16px 4px 7px;
  background: var(--paper);
  border: var(--bw-thin) solid var(--ink); border-radius: 999px;
  font-size: 14px; font-weight: 800; line-height: 1.35; text-decoration: none;
}
nav.toc a::before {
  content: counter(toc); flex: none;
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--ink); color: var(--paper);
  font-size: 12px; font-weight: 900;
}
nav.toc a:hover { background: var(--lime); }

/* 引用角标：墨色小圆片白字 */
sup.cite { vertical-align: baseline; font-size: 1em; line-height: 0; }
sup.cite a {
  display: inline-grid; place-items: center;
  min-width: 19px; height: 19px; margin-left: 2px; padding: 0 5px;
  position: relative; top: -.5em;
  border-radius: 999px; background: var(--ink); color: var(--paper);
  font-size: 11px; font-weight: 800; line-height: 1; text-decoration: none;
  font-variant-numeric: tabular-nums;
}
sup.cite a:hover { background: var(--blue); color: var(--ink); }

/* 来源：描边小卡片 + 彩色序号方块 */
.sources { margin-top: 34px; font-size: 15px; }
.sources h3 { margin: 0 0 12px; font-size: 18px; }
.sources ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: src; }
.sources li {
  counter-increment: src;
  display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; column-gap: 14px; row-gap: 2px;
  min-height: 64px; margin: 0; padding: 12px 14px;
  background: var(--paper);
  border: var(--bw-thin) solid var(--ink); border-radius: var(--r);
  line-height: 1.45; overflow-wrap: anywhere;
}
.sources li::before {
  content: counter(src); grid-row: 1 / span 2;
  display: grid; place-items: center; width: 38px; height: 38px;
  border: var(--bw-thin) solid var(--ink); border-radius: 10px;
  background: var(--blue); font-weight: 900; font-variant-numeric: tabular-nums;
}
.sources li:nth-child(8n+2)::before { background: var(--orange); }
.sources li:nth-child(8n+3)::before { background: var(--mint); }
.sources li:nth-child(8n+4)::before { background: var(--pink); }
.sources li:nth-child(8n+5)::before { background: var(--lilac); }
.sources li:nth-child(8n+6)::before { background: var(--yellow); }
.sources li:nth-child(8n+7)::before { background: var(--cyan); }
.sources li:nth-child(8n)::before { background: var(--lime); }
.sources li { position: relative; }
.sources li > a { grid-column: 2; font-weight: 800; }
.sources li > a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* 整张小卡片都能点 */
.sources li:has(> a:hover) { box-shadow: var(--sh-xs); }
.sources li > .muted { grid-column: 2; font-size: 13px; color: var(--ink-2); }
.sources li:target { box-shadow: 5px 5px 0 0 var(--yellow), 5px 5px 0 var(--bw-thin) var(--ink); }

/* 生成的文件（运行代码写到 outputs/ 的）：图片直接显示，其他文件一行：类型色块 + 文件名 + 大小 + 下载 */
.outputs { margin-top: 30px; font-size: 15px; }
.outputs h3 { margin: 0 0 12px; font-size: 18px; }
.output-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.output {
  margin: 0; overflow: hidden;
  background: var(--paper);
  border: var(--bw-thin) solid var(--ink); border-radius: var(--r);
}
.output-preview { display: block; border-bottom: var(--bw-thin) solid var(--ink); background: var(--soft); }
.output-preview img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; height: auto; }
.output-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 56px; padding: 10px 14px; }
.output-tag {
  flex: none; padding: 3px 9px;
  border: var(--bw-thin) solid var(--ink); border-radius: 8px;
  background: var(--lilac); font-size: 13px; font-weight: 900; line-height: 1.3;
}
.output-image .output-tag { background: var(--mint); }
.output-ppt .output-tag { background: var(--orange); }
.output-word .output-tag { background: var(--blue); }
.output-excel .output-tag, .output-csv .output-tag { background: var(--lime); }
.output-pdf .output-tag { background: var(--pink); }
.output-name { flex: 1 1 12em; min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.output-row .muted { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.output-row .tool-link { margin-left: auto; }
.output-video .output-tag, .output-audio .output-tag { background: var(--pink); }
.output audio { display: block; width: 100%; border-bottom: var(--bw-thin) solid var(--ink); }
details.outputs-more { margin-top: 16px; font-size: 15px; }
details.outputs-more > summary { cursor: pointer; font-weight: 800; }
details.outputs-more .output-list { margin-top: 10px; }

/* 成片：播放器（竖屏视频不撑满屏幕）+ 文件名和下载 + 「调整剪辑」 */
.videos { margin-top: 26px; display: grid; gap: 22px; }
.video-card {
  margin: 0; overflow: hidden; background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.video-card video { display: block; width: 100%; max-height: 78vh; background: var(--ink); }
.video-card figcaption { border-top: var(--bw-thin) solid var(--ink); }
.video-card .output-tag { background: var(--pink); }
details.knobs { border-top: var(--bw-thin) solid var(--ink); }
details.knobs > summary { cursor: pointer; padding: 14px 16px; font-weight: 900; background: var(--soft); }
details.knobs > summary .muted { font-weight: 600; font-size: 14px; margin-left: 6px; }
.knobs-form { padding: 6px 16px 16px; }
.knob-group { margin-top: 12px; border: var(--bw-thin) solid var(--ink); border-radius: var(--r); background: var(--paper); }
.knob-group > summary { cursor: pointer; padding: 10px 14px; font-weight: 800; }
.knob-group[open] > summary { border-bottom: var(--bw-thin) solid var(--ink); }
.knob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; padding: 12px 14px; }
.knob { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 14px; font-weight: 700; }
.knob-wide { grid-column: 1 / -1; }
.knob input[type=text], .knob input[type=number], .knob select { min-height: 40px; font-size: 15px; }
.knob input[type=color] { width: 64px; height: 36px; padding: 2px; }
.knob input[type=checkbox] { width: 22px; height: 22px; }
.knob-slider { display: flex; align-items: center; gap: 8px; }
.knob-slider input { flex: 1; }
.knob-slider output { min-width: 3.5em; font-variant-numeric: tabular-nums; }
.clip-list { list-style: none; margin: 0; padding: 8px 14px 4px; display: grid; gap: 10px; counter-reset: clip; }
.clip-row { border: var(--bw-thin) solid var(--ink); border-radius: var(--r-sm); background: var(--paper); }
.clip-row.clip-off { opacity: .55; }
.clip-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; }
.clip-head::before { counter-increment: clip; content: counter(clip); font-weight: 900; min-width: 1.4em; }
.clip-head input[type=checkbox] { width: 22px; height: 22px; }
.clip-name { font-weight: 800; flex: 1 1 8em; min-width: 0; overflow-wrap: anywhere; }
.clip-where { font-size: 13px; flex: 1 1 10em; }
.clip-head button.small { min-height: 36px; padding: 0 10px; }
.clip-more { border-top: var(--bw-thin) dashed var(--ink); }
.clip-more > summary { cursor: pointer; padding: 6px 10px; font-size: 14px; font-weight: 700; }
.clip-add { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 12px; margin: 0; }
.clip-add select { flex: 1 1 12em; min-height: 40px; }
.card-list { list-style: none; margin: 0; padding: 10px 14px; display: grid; gap: 10px; }
.material-card { border: var(--bw-thin) solid var(--ink); border-radius: var(--r-sm); padding: 10px 12px; background: var(--soft); }
.material-card p { margin: 6px 0 0; font-size: 14px; }
.material-card .highlight { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.cue-list { padding: 6px 14px 12px; display: grid; gap: 8px; }
.cue-source { margin: 8px 0 0; font-weight: 800; }
.knobs-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 0; }

/* ---------------------------------------------------------------- 账户、充值、付款 */
.account-head .row { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.stats > div {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 14px 16px;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
}
.stats > div:first-child { background: var(--lime); box-shadow: var(--sh-sm); }
.stats > div:has(.minus) { background: var(--err); }
.stat-label { font-size: 13px; font-weight: 800; }
.stat-value { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-value.minus { display: block; padding: 0; border: 0; border-radius: 0; background: none; }

.custom-amount { max-width: 300px; }
.amounts label.choice { min-width: 96px; justify-content: center; min-height: 52px; font-size: 18px; font-weight: 900; border-width: var(--bw); }
.amounts label.choice:has(input:checked) { background: var(--lime); box-shadow: var(--sh-sm); }

.pay { text-align: center; }
.pay > h1 { margin-bottom: 8px; }
.pay-meta { margin: 0 0 22px; }
#pay-waiting { text-align: center; }
/* 二维码：白框、粗描边、硬投影；在任何设置下都是白底黑码，扫码软件才认得出 */
.pay .qr {
  display: inline-block; margin: 8px 0 14px; padding: 14px;
  background: #ffffff; line-height: 0;
  border: 3px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
}
.pay .qr svg { width: 232px; height: 232px; shape-rendering: crispEdges; }
@media (max-width: 400px) { .pay .qr svg { width: 200px; height: 200px; } }
.pay-big { margin: 14px 0 4px; font-size: clamp(2.25rem, 1.8rem + 2vw, 3rem); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pay-hint { font-size: 1.1rem; margin: 8px 0; }
.pay-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 18px; margin: 14px 0 6px; }
.pay-facts > div { min-width: 150px; padding: 10px 18px 12px; border: var(--bw) solid var(--ink); border-radius: var(--r-lg); background: var(--paper); }
.pay-facts > div:first-child { background: var(--lime); box-shadow: var(--sh-sm); }
.pay-facts dt { font-size: 13px; font-weight: 800; }
.pay-facts dd { margin: 2px 0 0; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); font-weight: 900; letter-spacing: .03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pay-facts dd button { margin-left: 6px; vertical-align: 6px; letter-spacing: normal; }
.pay-steps { text-align: left; max-width: 34em; margin: 18px auto; }
.pay form.inline { display: inline-block; margin: 6px 6px; }
.pay .row { justify-content: center; }
#pay-countdown { display: inline-block; padding: 0 8px; border: var(--bw-thin) solid var(--ink); border-radius: 8px; background: var(--yellow); font-weight: 900; font-variant-numeric: tabular-nums; }
.reference { font-size: 1rem; font-weight: 800; letter-spacing: .04em; }

/* 步骤：带序号的黑圆点 */
ol.steps { list-style: none; margin: 16px 0; padding: 0; counter-reset: step; }
ol.steps > li { position: relative; counter-increment: step; margin: 14px 0; padding-left: 46px; min-height: 32px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 900;
}
.bind-command {
  display: inline-block; margin: 8px 8px 6px 0; padding: 6px 14px;
  background: var(--yellow);
  border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  box-shadow: var(--sh-xs);
  font-size: 1.2rem; font-weight: 900; letter-spacing: .04em;
}

/* ---------------------------------------------------------------- 价格 */
.search-price {
  margin: 16px 0; padding: 12px 16px;
  background: var(--cyan);
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  box-shadow: var(--sh-sm);
  font-weight: 800;
}
.prices th, .prices td { white-space: nowrap; }
.prices td:first-child { white-space: normal; min-width: 190px; }
.prices tr.sub td { white-space: normal; padding-top: 0; border-top: 0; font-size: 12.5px; color: var(--muted); }
.prices td strong { font-family: var(--mono); font-size: 14px; }
details.more-prices { margin-top: 16px; }
details.more-prices > summary {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 16px;
  border: var(--bw-thin) solid var(--ink); border-radius: 999px;
  background: var(--paper);
  font-weight: 800;
}
details.more-prices > summary:hover { background: var(--yellow); }

/* ---------------------------------------------------------------- 登录、注册、错误页、绑定微信 */
.auth h1 { padding-right: 76px; }
.auth .sticker { position: absolute; top: -30px; right: -10px; width: 104px; height: 104px; font-size: 15px; }
@media (min-width: 600px) { .auth .sticker { top: -40px; right: -34px; width: 128px; height: 128px; font-size: 18px; } }
.auth .sticker.yellow { background: var(--yellow); transform: rotate(-8deg); }
.auth button.primary { min-height: 54px; font-size: 17px; }
.auth-foot { margin: 18px 0 0; }
.error-card { text-align: left; }
.err-code {
  display: inline-block; margin: 6px 0 22px; padding: 2px 22px;
  background: var(--yellow);
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  font-size: clamp(3.5rem, 2.6rem + 4vw, 5.5rem); font-weight: 900; line-height: 1.15; letter-spacing: .02em;
  transform: rotate(-2deg);
}
.err-5xx .err-code { background: var(--pink); }
.bind .progress { margin-top: 18px; padding: 14px 16px; border: var(--bw) dashed var(--ink); border-radius: var(--r); }

/* ---------------------------------------------------------------- 管理页 */
.agent-payment { margin: 14px 0; padding: 14px 16px; border: var(--bw-thin) solid var(--ink); border-radius: var(--r); background: var(--paper); }
.agent-payment > p:first-child { margin-top: 0; }
.agent-payment .row { margin-bottom: 0; }
.agent-payment .row > form.row { flex: 1 1 280px; min-width: 0; margin: 0; }
.agent-payment .row > select { flex: 1 1 240px; min-width: 0; width: auto; margin: 0; }
td.actions { white-space: nowrap; }
td.actions form + form { margin-left: 8px; }
details.user { margin: 10px 0; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: var(--r); }
details.user > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  min-height: 54px; padding: 8px 16px;
  border-radius: var(--r);
}
details.user > summary:hover { background: var(--soft); }
details.user[open] { box-shadow: var(--sh-sm); }
details.user[open] > summary { border-bottom: var(--bw-thin) solid var(--ink); border-radius: var(--r) var(--r) 0 0; }
.user-name { font-weight: 900; }
.user-quota { margin-left: auto; font-variant-numeric: tabular-nums; }
.user-body { padding: 6px 16px 14px; }

/* ---------------------------------------------------------------- 私教：主页的状态、题型、问题清单；练习页的题目和录音 */
.tutor-facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .tutor-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tutor-facts li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: var(--bw) solid var(--ink); border-radius: var(--r-sm); background: var(--paper); }
.tutor-facts li:first-child { background: var(--scene, var(--mint)); box-shadow: var(--sh-xs); }
.fact-num { font-size: 30px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fact-label { font-size: 13px; font-weight: 700; }
.tutor-today { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 800; }
.task-list, .issue-list, .trend-list, .practice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-top: var(--bw-thin) solid var(--ink); }
.task-row:first-child { border-top: 0; padding-top: 0; }
.task-row:last-child { padding-bottom: 0; }
.task-main { min-width: 0; }
.task-main p { margin: 0 0 4px; }
.task-title { font-size: 17px; font-weight: 800; }
.task-row .button { flex: none; }
.issue-list li, .trend-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 10px 0; border-top: 1.5px dashed var(--ink); }
.issue-list li:first-child, .trend-list li:first-child { border-top: 0; }
.issue-name, .trend-name { font-weight: 800; }
.issue-count { padding: 0 8px; border: var(--bw-thin) solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 13px; font-weight: 800; }
.trend-scores { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.trend-score { padding: 0 8px; border: var(--bw-thin) solid var(--ink); border-radius: var(--r-xs); font-weight: 800; font-variant-numeric: tabular-nums; }
.trend-score:last-of-type { background: var(--scene, var(--mint)); }
.practice-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0; border-top: 1.5px dashed var(--ink); color: var(--ink); text-decoration: none; }
.practice-list li:first-child .practice-row { border-top: 0; }
a.practice-row:hover { text-decoration: none; }
a.practice-row:hover .practice-name { text-decoration: underline; }
.practice-day { flex: none; width: 3.2em; font-weight: 800; font-variant-numeric: tabular-nums; }
.practice-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.practice-rule { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.7; }
.question { padding: 16px 18px; border: var(--bw) solid var(--ink); border-radius: var(--r-sm); background: var(--soft); font-size: 16px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.practice-meter { margin: -8px 0 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.practice-meter.is-over [data-elapsed] { padding: 0 6px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--pink); }
.parts { list-style: none; margin: 0; padding: 0; counter-reset: part; display: flex; flex-direction: column; gap: 14px; }
.part { counter-increment: part; padding: 14px 16px; border: var(--bw) solid var(--ink); border-radius: var(--r-sm); background: var(--paper); }
.part.is-recording { box-shadow: 4px 4px 0 var(--pink); }
.part.is-recorded { background: var(--soft); }
.part-text { margin: 0 0 10px; font-size: 16px; font-weight: 700; line-height: 1.6; }
.practice-form[data-mode="speak"] .part-text::before { content: counter(part) ". "; }
.recorder { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.recorder audio { height: 40px; max-width: 100%; }
.rec-time { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rec-file { font-size: 13px; font-weight: 700; }
.record-gate { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.practice-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0 0; font-weight: 800; }
.tutor-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* ---------------------------------------------------------------- 申请看板：概况、每个项目一张卡片（截止、材料清单、状态、核对） */
.board-start { margin: 0 0 18px; padding-left: 1.4em; display: flex; flex-direction: column; gap: 10px; line-height: 1.75; }
.board-start-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 0; }
.board-remind { margin: 0; }
.board-remind p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.9; }
.board-remind button.linkish { min-height: 36px; padding: 0 8px; vertical-align: middle; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.board-check-all { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 16px 0 0; padding-top: 16px; border-top: 1.5px dashed var(--ink); }
.board-check-all small { flex: 1 1 260px; font-size: 13px; font-weight: 500; line-height: 1.55; color: var(--muted); }
@media (max-width: 599.98px) { .board-check-all > button { flex: 1 1 100%; } }
.board-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.board-entry {
  min-width: 0; padding: 18px 16px 14px;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  scroll-margin-top: 96px;
}
@media (min-width: 760px) { .board-entry { padding: 24px 28px 18px; } }
.board-entry.is-soon { box-shadow: 6px 6px 0 var(--pink), 6px 6px 0 var(--bw) var(--ink); }
.board-entry.is-closed { background: var(--soft); box-shadow: var(--sh-xs); }
.entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.entry-name { min-width: 0; }
.entry-school { margin: 0; font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem); line-height: 1.3; overflow-wrap: anywhere; }
.entry-program { margin: 2px 0 0; font-size: 15px; font-weight: 700; color: var(--ink-2); overflow-wrap: anywhere; }
.entry-status { flex: none; margin-top: 2px; }
.entry-status.status-preparing { background: var(--yellow); }
.entry-status.status-submitted { background: var(--cyan); }
.entry-status.status-admitted { background: var(--mint); }
.entry-status.status-waitlisted { background: var(--lilac); }
.entry-status.status-withdrawn { border-style: dashed; }
.entry-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 4px; }
.entry-date { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.entry-left { padding: 0 10px; border: var(--bw-thin) solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 14px; font-weight: 900; line-height: 28px; font-variant-numeric: tabular-nums; }
.is-soon .entry-left { background: var(--pink); }
.entry-round { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.entry-source { margin: 0 0 12px; }
.entry-changes { margin: 0 0 12px; padding: 8px 12px; border: var(--bw-thin) solid var(--ink); border-radius: var(--r-sm); background: var(--cyan); font-size: 14px; font-weight: 600; line-height: 1.6; }
.entry-notes { margin: 0 0 12px; white-space: pre-wrap; color: var(--ink-2); }
.materials { margin: 0; padding: 10px 14px 8px; border: var(--bw-thin) solid var(--ink); border-radius: var(--r); background: var(--paper); }
.materials-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 2px; }
.materials-count { font-weight: 900; font-variant-numeric: tabular-nums; }
.materials-state { font-weight: 600; color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 18px; }
@media (min-width: 640px) { .checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.checklist label.check { align-items: flex-start; min-height: 40px; padding: 8px 0; font-weight: 600; line-height: 1.45; }
.checklist label.check span { min-width: 0; overflow-wrap: anywhere; }
.checklist label.check:has(input:checked) span { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.materials-save { margin: 4px 0 6px; }
.materials.is-autosave .materials-save { display: none; }
.entry-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 0; }
.entry-status-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.entry-status-form select { width: auto; min-height: 44px; padding-top: 6px; padding-bottom: 6px; font-size: 15px; font-weight: 700; }
details.entry-edit { margin-top: 12px; padding-top: 6px; border-top: 1.5px dashed var(--ink); }
details.entry-edit > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; font-size: 14px; font-weight: 800; }
details.entry-edit > summary::-webkit-details-marker { display: none; }
details.entry-edit > summary::after { content: ""; width: 16px; height: 16px; background: var(--i-chevron) center / contain no-repeat; transition: transform .15s ease; }
details.entry-edit > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
details.entry-edit > .grid-form { margin-top: 10px; }
.entry-delete { margin: 16px 0 6px; }

/* ---------------------------------------------------------------- 求职投递：和申请看板同一套卡片，状态颜色、AI 没答案的问题、这次填的内容 */
.job-status-queued, .job-status-applying { background: var(--yellow); }
.job-status-suggested { background: var(--cyan); }
.job-status-needs_you, .job-status-review { background: var(--pink); }
.job-status-submitted, .job-status-interview { background: var(--mint); }
.job-status-offer { background: var(--lime); }
.job-status-failed { background: var(--err); }
.job-status-rejected, .job-status-withdrawn { border-style: dashed; }
.job-entry .entry-delete { margin: 0; }
.job-entry .entry-actions form.inline { margin: 0; }
.job-search { margin: 18px 0 0; padding-top: 16px; border-top: 1.5px dashed var(--ink); }
.job-search p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; }
.job-search small { flex: 1 1 240px; font-size: 13px; line-height: 1.55; }
.job-queue-all { margin: 0 0 14px; }
.job-questions { margin: 0 0 12px; padding: 10px 14px; border: var(--bw-thin) solid var(--ink); border-radius: var(--r); background: var(--paper); }
.job-questions ul { margin: 0; padding-left: 1.3em; line-height: 1.6; overflow-wrap: anywhere; }
.job-questions p { margin: 0; }
details.job-answers { margin: 4px 0 0; }
details.job-answers > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; font-size: 14px; font-weight: 800; }
details.job-answers > summary::-webkit-details-marker { display: none; }
details.job-answers > summary::after { content: ""; width: 16px; height: 16px; background: var(--i-chevron) center / contain no-repeat; }
details.job-answers .table-wrap { max-width: 100%; overflow-x: auto; }
details.job-answers table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
details.job-answers th, details.job-answers td { padding: 6px 8px; border: var(--bw-thin) solid var(--ink); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
details.job-answers td:first-child { width: 42%; font-weight: 700; }
.job-group .grid-form { margin-top: 4px; }
.job-profile-form fieldset.choices { min-width: 0; }
#profile > details > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; list-style: none; cursor: pointer; }
#profile > details > summary::-webkit-details-marker { display: none; }
#profile .inline-heading { display: inline; margin: 0; }

/* ---------------------------------------------------------------- 动效：悬停上移、按下回弹；减少动画时全部关掉 */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  button:not(:disabled):hover, .button:hover, .tool-link:hover { transform: translate(-1px, -1px); }
  .tool-card:hover, .list-item:hover { transform: translate(-2px, -2px); }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  button:not(:disabled):active, .button:active, .tool-link:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
  button.small:not(:disabled):active, .button.small:active { transform: translate(3px, 3px); }
  .primary:not(:disabled):active { box-shadow: 0 0 0 var(--yellow); }
  .tool-card:active, .list-item:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
  button.file-chip-remove:active, button.file-chip-remove:hover, button.linkish:active, button.nav-toggle:active { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 接管 AI 留下的网页：投递看板上的提示框、/jobs/<id>/live 的实时画面和操作区 */
.job-live-call { margin: 0 0 12px; padding: 12px 14px; border: var(--bw) solid var(--ink); border-radius: var(--r); background: var(--yellow); box-shadow: var(--sh-xs); }
.job-live-call p { margin: 0 0 10px; font-weight: 600; line-height: 1.6; }
.conv-head .job-live-call { margin: 16px 0 0; }
.job-live-call .button + .button { margin-left: 8px; }

/* 核对并提交（/jobs/<id>/review）：表上每一项的实际值，要你回答的在最上面 */
.review-form { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
.review-section h2 { margin: 0 0 6px; }
.review-missing { background: var(--yellow); }
.review-missing .muted { color: var(--ink); }
.review-field { display: flex; flex-direction: column; gap: 8px; padding: 14px 0 4px; min-width: 0; }
.review-section > .review-field + .review-field { border-top: var(--bw-thin) dashed var(--ink); }
.review-label { margin: 0; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
.review-error { margin: 0; padding: 6px 10px; border: var(--bw-thin) solid var(--ink); border-radius: var(--r-sm); background: var(--pink); font-weight: 700; }
.review-value, .review-text { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.6; }
.review-list { list-style: none; margin: 8px 0 0; padding: 0; }
.review-list > li + li { border-top: var(--bw-thin) solid var(--grid); }
/* 每一行：题目 | 值 | 「改」；点开是输入框 */
.review-item > summary {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; grid-template-areas: "label text edit";
  gap: 14px; align-items: start; padding: 12px 0; cursor: pointer; list-style: none;
}
.review-item > summary::-webkit-details-marker { display: none; }
.review-item > summary .review-label { grid-area: label; font-weight: 700; color: var(--ink-2); }
.review-item > summary .review-text { grid-area: text; }
.review-item > summary::after, .review-more > summary::after {
  content: "改"; grid-area: edit; padding: 2px 12px; border: var(--bw-thin) solid var(--ink); border-radius: 999px;
  background: var(--paper); font-size: 13px; font-weight: 800; line-height: 1.6; white-space: nowrap;
}
.review-item[open] > summary::after, .review-more[open] > summary::after { content: "收起"; background: var(--yellow); }
.review-item > summary:hover .review-label { text-decoration: underline; }
.review-item[open] > summary .review-text { color: var(--muted); }
.review-fixed { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 14px; padding: 12px 0; }
.review-fixed .review-label { font-weight: 700; color: var(--ink-2); }
.review-fixed > button { align-self: start; }
.review-blocked { margin-top: 18px; }
.review-item > .review-field { padding-top: 0; padding-bottom: 14px; }
/* 选填空着的：标题一行，右边「展开」 */
.review-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.review-more > summary::-webkit-details-marker { display: none; }
.review-more > summary::after { content: "展开"; }
.review-more > summary h2 { margin: 0; }
.review-actions .choice-row { align-items: center; }
@media (max-width: 640px) {
  .review-item > summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label edit" "text text"; gap: 4px 10px; }
  .review-fixed { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
.live-tips { margin: 8px 0 0; padding-left: 1.3em; line-height: 1.7; color: var(--muted); }
.live { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.live-status { margin: 0; padding: 8px 12px; border: var(--bw-thin) solid var(--ink); border-radius: var(--r-sm); background: var(--paper); font-weight: 700; line-height: 1.5; }
.live-status.is-error { background: var(--pink); }
.live-status.is-ok { background: var(--mint); }
.live-frame { max-width: 100%; overflow: auto; border: var(--bw) solid var(--ink); border-radius: var(--r-sm); background: var(--paper); box-shadow: var(--sh-sm); -webkit-overflow-scrolling: touch; }
.live-frame img { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
.live-frame.is-zoomed { max-height: 80vh; }
.live-frame.is-zoomed img { width: 1280px; max-width: none; }
.live-controls .live-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.live-controls input[type=text] { flex: 1 1 220px; min-width: 0; }
.live-end { display: flex; flex-wrap: wrap; gap: 8px; }
.live.is-finished .live-controls, .live.is-finished .live-frame img { opacity: .55; pointer-events: none; }
