/* korpzo.com：颜色、字、页面外框和每一页都用的零件（规范在 korpzo/DESIGN.md）。
   底子照 aidtext 的样式表：暖白的纸，白卡片浮在上面，靠阴影分层。颜色只有中性色和两种强调色：
   蓝是能点的和讲方法的，玫红是审稿意见和出错。界面是 Instrument Sans，作者的稿子（报告正文）是 Newsreader。 */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* 纸和字：中性色，带一点暖 */
  --canvas: #fbfaf6; /* 页面底 */
  --paper: #ffffff; /* 卡片、弹层、图表 */
  --paper-2: #f5f3ec; /* 下沉、悬停 */
  --paper-3: #ebe9df; /* 按下、分段切换的槽 */
  --stage: #f1efe8; /* 舞台 */
  --ink: #1b1b19; /* 正文、作者的稿子；白底 17.2:1 */
  --ink-2: #4b4a46; /* 次要文字；白底 8.9:1 */
  --ink-3: #66645e; /* 注、时间、表头；白底 5.9:1，最深的槽 4.9:1 */
  --line: rgb(27 27 25 / 0.1);
  --line-2: rgb(27 27 25 / 0.2);

  /* 蓝：能点的东西（主按钮、链接、焦点、选中）和讲方法的内容 */
  --blue: oklch(0.42 0.136 264); /* #254796，白底 8.7:1 */
  --blue-deep: oklch(0.36 0.13 264); /* 悬停、按下 */
  --blue-wash: oklch(0.955 0.018 264); /* #eaf0fd */

  /* 玫红：审稿意见、预审结论、结论翻转处、出错，logo 的下划线 */
  --rose: oklch(0.53 0.2 6); /* #c1195a，白底 5.9:1，舞台 5.1:1 */
  --rose-deep: oklch(0.47 0.18 6);
  --rose-wash: oklch(0.962 0.016 6); /* #fdeef1 */

  /* 方圆形看着比同半径的圆角更方，画得出它的浏览器里半径乘 --sq */
  --sq: 1;
  --q: calc(12px * var(--sq)); /* 按钮、输入框 */
  --q-l: calc(20px * var(--sq)); /* 卡片 */
  --q-xl: calc(26px * var(--sq)); /* 弹层、大卡 */
  --q-stage: calc(32px * var(--sq)); /* 舞台 */

  --shadow-1: 0 1px 2px rgb(27 27 25 / 0.04), 0 4px 12px rgb(27 27 25 / 0.04);
  --shadow-2: 0 2px 4px rgb(27 27 25 / 0.04), 0 8px 20px rgb(27 27 25 / 0.05), 0 20px 40px rgb(27 27 25 / 0.06);
  --shadow-3: 0 4px 6px rgb(27 27 25 / 0.04), 0 12px 24px rgb(27 27 25 / 0.06), 0 40px 64px rgb(27 27 25 / 0.1);
  --halo: 0 0 0 8px rgb(255 255 255 / 0.4);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* 界面 */
  --font: "Instrument Sans", system-ui, sans-serif;
  /* 作者的稿子 */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --page: 1200px;
  --gutter: 24px;
  --inset: 24px;
  --header: 72px;
}

@supports (corner-shape: squircle) {
  :root {
    --sq: 1.75;
  }
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header) + 16px);
  scrollbar-color: var(--line-2) transparent;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/26px var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--blue);
}

::selection {
  background: var(--blue-wash);
  color: var(--ink);
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 8px;
}

.icon {
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── 版面 ─────────────────────────────────────────────────────────── */

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  min-width: 0;
}

/* 第一页还没放上来时不出页尾，页面来的时候什么都不跳 */
.main:empty + .footer {
  display: none;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.page {
  padding-block: 48px 104px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-s {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 14px;
  line-height: 22px;
}

/* 作者稿子里的字：题目、正文、表 */
.paper {
  font-family: var(--serif);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* 统计量（M、SD、t、p、β、R²……）照 APA 用斜体 */
.stat {
  font-style: italic;
}

.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.nowrap {
  white-space: nowrap;
}

/* 统计式子、几个词的术语：整个换到下一行，不在中间断 */
.nb {
  white-space: nowrap;
}

/* 稿件的题目：一个词长过一行时才从中间断 */
:is(h1, h2, h3).paper,
.paper:is(.sample-row-title, .report-name) {
  overflow-wrap: break-word;
}

/* 审稿意见的颜色；出错的话也是它 */
.rose {
  color: var(--rose);
}

/* ── 字 ───────────────────────────────────────────────────────────── */

.display {
  font-size: clamp(34px, 5.2vw, 72px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.title {
  font-size: clamp(32px, 3.8vw, 52px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.024em;
}

.heading {
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.02em;
}

.subheading {
  font-size: 22px;
  font-weight: 500;
  line-height: 30px;
  letter-spacing: -0.01em;
}

.lead {
  max-width: 38rem;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 30px;
}

.hint {
  max-width: 68ch;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 22px;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 140ms var(--ease);
}

.link:hover {
  color: var(--blue-deep);
}

.link:disabled {
  color: var(--ink-3);
  cursor: not-allowed;
}

/* ── 按钮：要做的那一件蓝色实心，其余白底细边 ───────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--q);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    color 160ms var(--ease),
    transform 160ms var(--ease);
}

.btn:hover:not(:disabled) {
  background: var(--paper-2);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:focus-visible,
.btn:has(:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--q);
}

.btn:disabled {
  background: var(--paper-3);
  box-shadow: none;
  color: var(--ink-3);
  cursor: not-allowed;
}

/* 几个里按下的那一个 */
.btn[aria-pressed="true"],
.btn-primary {
  background: var(--blue);
  box-shadow: none;
  color: #fff;
}

.btn[aria-pressed="true"]:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: var(--blue-deep);
}

.btn-primary:disabled {
  background: var(--paper-3);
  color: var(--ink-3);
}

/* 舞台上的：一层白膜 */
.btn-film {
  background: rgb(255 255 255 / 0.66);
  box-shadow: none;
}

.btn-film:hover:not(:disabled) {
  background: var(--paper);
}

/* 深色底上的主按钮 */
.btn-light {
  background: var(--paper);
  box-shadow: none;
  color: var(--ink);
}

.btn-light:hover:not(:disabled) {
  background: var(--blue-wash);
}

/* 没有边，只有蓝字：并排时次要的那个 */
.btn-quiet {
  background: none;
  box-shadow: none;
  color: var(--blue);
}

.btn-quiet:hover:not(:disabled) {
  background: var(--blue-wash);
}

.btn-s {
  min-height: 36px;
  padding: 0 14px;
  border-radius: calc(10px * var(--sq));
  font-size: 14px;
}

.btn-l {
  min-height: 52px;
  padding: 0 24px;
  border-radius: calc(14px * var(--sq));
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* 等后端回话的按钮：字换成转圈 */
.btn.is-busy {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.is-busy > * {
  visibility: hidden;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn-primary.is-busy::after {
  border-color: #fff;
  border-right-color: transparent;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: calc(10px * var(--sq));
  corner-shape: squircle;
  background: none;
  color: var(--ink-2);
  transition:
    background-color 140ms var(--ease),
    color 140ms var(--ease);
}

.icon-btn:hover {
  background: rgb(27 27 25 / 0.07);
  color: var(--ink);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 输入 ─────────────────────────────────────────────────────────── */

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--q);
  corner-shape: squircle;
  background: var(--paper);
  color: var(--ink);
  line-height: 22px;
  transition:
    border-color 140ms var(--ease),
    box-shadow 140ms var(--ease);
}

.input::placeholder {
  color: var(--ink-3);
}

.input:hover {
  border-color: var(--ink-3);
}

.input:focus-visible {
  outline: none;
  border-color: var(--blue);
  border-radius: var(--q);
  box-shadow: 0 0 0 3px var(--blue-wash);
}

select.input {
  width: auto;
  max-width: 100%;
  padding-right: 38px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%234b4a46'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  cursor: pointer;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
}

.field-label small {
  margin-left: 8px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 400;
}

/* 开关：<input type="checkbox" class="switch" role="switch">，开着是蓝 */
.switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 13px;
  background: var(--line-2);
  cursor: pointer;
  transition: background-color 180ms var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 3px rgb(27 27 25 / 0.24);
  transition: transform 200ms var(--ease);
}

.switch:checked {
  background: var(--blue);
}

.switch:checked::after {
  transform: translateX(18px);
}

.switch:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.switch:focus-visible {
  border-radius: 13px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.option > .switch {
  margin-top: -2px;
}

/* 几个里选一个：一排按钮，按下的那个是浮起的白片 */
.segs {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  border-radius: calc(16px * var(--sq));
  corner-shape: squircle;
  background: var(--paper-3);
  scrollbar-width: none;
}

.seg {
  flex: none;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: calc(12px * var(--sq));
  corner-shape: squircle;
  background: none;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  transition:
    background-color 160ms var(--ease),
    color 160ms var(--ease);
}

.seg:hover {
  background: rgb(255 255 255 / 0.5);
  color: var(--ink);
}

.seg[aria-pressed="true"] {
  background: var(--paper);
  box-shadow: var(--shadow-1);
  color: var(--ink);
}

/* ── 小零件 ───────────────────────────────────────────────────────── */

/* 第几稿、Agent 一类 */
.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 24px;
}

.notice .icon {
  margin-top: 3px;
}

.notice-error {
  background: var(--rose-wash);
  color: var(--rose);
}

/* 空着的地方：一块纸色，一句话和一个按钮 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 88px 24px;
  border-radius: var(--q-xl);
  corner-shape: squircle;
  background: var(--stage);
  color: var(--ink-2);
  text-align: center;
}

/* ── 卡片 ─────────────────────────────────────────────────────────── */

.card {
  min-width: 0;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-1);
  color: var(--ink);
}

/* 放在舞台上的卡：外面多一圈半透明的白 */
.float {
  min-width: 0;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--halo), var(--shadow-3);
  color: var(--ink);
}

/* ── 记录单：名称、点线、值，一行一项（ui.js 的 record） ───────────── */

.record {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.record-row {
  display: grid;
  grid-template-columns: auto minmax(12px, 1fr) auto;
  align-items: baseline;
  column-gap: 12px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}

.record-row:last-child {
  border-bottom: 0;
}

.record dt {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 22px;
}

.record-dots {
  align-self: start;
  height: 3px;
  margin-top: 15px;
  background: radial-gradient(circle at 1.5px 1.5px, rgb(27 27 25 / 0.28) 1px, transparent 1.3px) 0 0 / 7px 3px;
}

.record dd {
  max-width: 22em;
  font-size: 17px;
  font-weight: 500;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.record dd b {
  font-weight: 600;
}

.record-note {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 20px;
  text-align: right;
}

/* ── 表：没有外框，表头不铺底，行间一道细线 ───────────────────────── */

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}

.table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
  overflow-wrap: break-word;
}

.table tr > :first-child {
  padding-left: 0;
}

.table tr > :last-child {
  padding-right: 0;
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

.table tbody tr:hover > td {
  background: var(--canvas);
}

.table .is-num {
  text-align: right;
  white-space: nowrap;
}

/* 按小数点对齐（ui.js 的 decimal()）：小数部分放进定宽格子，单元格右对齐 */
.dec {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dec-f {
  display: inline-block;
  min-width: var(--dec, 4ch);
  text-align: left;
}

/* ── 悬停说明卡（ui.js 的 hoverCard） ─────────────────────────────── */

/* 挂了说明卡的词：点线下划线，指上去变蓝 */
.term {
  text-decoration: underline dotted;
  text-decoration-color: var(--ink-3);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: help;
  transition: color 140ms var(--ease);
}

.term:hover,
.term[aria-describedby] {
  color: var(--blue);
  text-decoration-color: var(--blue);
}

.hovercard {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: max-content;
  max-width: min(340px, calc(100vw - 16px));
  padding: 16px 18px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--ink);
  box-shadow: var(--shadow-3);
  color: rgb(255 255 255 / 0.84);
  font: 400 14px/22px var(--font);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 160ms var(--ease),
    transform 200ms var(--ease);
}

.hovercard.is-on {
  opacity: 1;
  transform: none;
}

.hovercard b,
.hovercard strong {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}

.hovercard > * + * {
  margin-top: 6px;
}

.hovercard small {
  color: rgb(255 255 255 / 0.66);
}

/* ── 弹层（ui.js 的 modal）：白卡分段，直接淡入 ─────────────────────── */

.modal {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--q-xl);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-3);
  color: var(--ink);
  overflow: auto;
}

.modal[open] {
  animation: fade-up 200ms var(--ease);
}

.modal::backdrop {
  background: rgb(27 27 25 / 0.32);
  animation: fade-in 200ms var(--ease);
}

.modal-body {
  position: relative;
  padding: 32px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.modal-body .subheading {
  padding-right: 40px;
}

.modal-body > .subheading:first-of-type,
.modal-body > div > .subheading:first-child {
  margin-bottom: 12px;
}

.modal-text {
  color: var(--ink-2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 28px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ── 提示（ui.js 的 toast）：顶栏下面一句话 ─────────────────────────── */

#toasts {
  position: fixed;
  top: calc(var(--header) + 12px);
  left: 50%;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 18px;
  border-radius: calc(14px * var(--sq));
  corner-shape: squircle;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  line-height: 22px;
  box-shadow: var(--shadow-3);
  animation: fade-up 240ms var(--ease);
}

.toast .icon {
  margin-top: 2px;
}

.toast-error {
  background: var(--paper);
  color: var(--rose);
}

/* ── 舞台：大圆角的大面板，一角一张散点图（img/scatter.webp，ui.js 的 scatter） ─── */

.stage {
  position: relative;
  isolation: isolate;
  overflow: clip;
  max-width: 1680px;
  margin-inline: max(var(--inset), calc((100% - 1680px) / 2));
  border-radius: var(--q-stage);
  corner-shape: squircle;
  background: var(--stage);
}

.scatter {
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: min(560px, 46%);
  height: auto;
  max-width: none;
  pointer-events: none;
}

.stage-dark {
  background: var(--ink);
  color: #fff;
}

/* 舞台上的图：白底方圆块 */
.stage-pic {
  display: grid;
  flex: none;
  place-items: center;
  width: 136px;
  height: 136px;
  border-radius: calc(34px * var(--sq));
  corner-shape: squircle;
  background: rgb(255 255 255 / 0.9);
  box-shadow: var(--shadow-2);
}

/* 一页的页头 */
.strip {
  padding-block: 56px 52px;
}

.strip-in {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 32px;
}

.strip-in > .stage-pic {
  grid-row: span 2;
}

.strip-in > .title {
  align-self: end;
}

.strip-in > .lead {
  align-self: start;
  max-width: 46ch;
}

.strip-in > .title:last-child {
  grid-row: span 2;
  align-self: center;
}

/* ── 顶栏 ─────────────────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--canvas);
  transition: box-shadow 200ms var(--ease);
}

.header.is-stuck {
  box-shadow: 0 1px 0 var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header);
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: calc(var(--inset) + 12px);
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* 字标：图标 img/mark.webp，蓝字 Korpzo，后面灰色的 Stats */
.brand-mark {
  flex: none;
  width: auto;
  height: 34px;
}

.wordmark {
  color: var(--blue);
  white-space: nowrap;
}

.wordmark-sub {
  margin-left: 0.25em;
  color: var(--ink-2);
  font-weight: 400;
  letter-spacing: 0;
}

.header-side {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.header-side .btn {
  flex: none;
  margin-left: 8px;
}

.nav-item {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: calc(10px * var(--sq));
  corner-shape: squircle;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 140ms var(--ease);
}

.nav-item:hover,
.nav-item.is-current {
  background: var(--paper-3);
}

.only-narrow {
  display: none;
}

/* 窄屏上代替导航的一页 */
.sheet {
  position: fixed;
  inset: var(--header) 0 0 0;
  z-index: 39;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px var(--gutter) 48px;
  background: var(--canvas);
  animation: fade-up 240ms var(--ease);
}

.sheet-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-1);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: calc(10px * var(--sq));
  corner-shape: squircle;
  background: none;
  font-size: 16px;
  text-align: left;
  transition: background-color 140ms var(--ease);
}

.menu-item:hover {
  background: var(--paper-2);
}

.menu-item .icon {
  color: var(--ink-3);
}

/* ── 页尾 ─────────────────────────────────────────────────────────── */

.footer {
  margin-bottom: var(--inset);
}

.footer .scatter {
  width: min(520px, 40%);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 72px;
  padding-block: 112px 40px;
}

.footer-call {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-call h2 {
  max-width: 9em;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid rgb(255 255 255 / 0.14);
  font-size: 15px;
  line-height: 24px;
}

/* 页尾是墨色底：字反白，图标不变 */
.footer .wordmark {
  color: #fff;
}

.footer .wordmark-sub {
  color: rgb(255 255 255 / 0.66);
}

.footer-about {
  margin-top: 14px;
  color: rgb(255 255 255 / 0.66);
}

.footer-title {
  margin-bottom: 12px;
  color: rgb(255 255 255 / 0.66);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.footer-links li + li {
  margin-top: 6px;
}

.footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── 窄屏 ─────────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  :root {
    --inset: 16px;
  }

  .only-wide {
    display: none !important;
  }

  .only-narrow {
    display: inline-grid;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --inset: 8px;
    --header: 60px;
    --q-stage: calc(20px * var(--sq));
  }

  .header-inner {
    padding-inline: 16px 10px;
  }

  .page {
    padding-block: 32px 64px;
  }

  .lead {
    font-size: 17px;
    line-height: 28px;
  }

  .stage-pic {
    width: 84px;
    height: 84px;
  }

  .stage-pic img {
    width: 56px;
    height: 56px;
  }

  .strip {
    padding-block: 32px;
  }

  .strip-in {
    gap: 14px 16px;
  }

  .strip-in > .stage-pic {
    grid-row: auto;
  }

  .strip-in > .title {
    align-self: center;
  }

  .strip-in > .lead {
    grid-column: 1 / -1;
  }

  .scatter,
  .footer .scatter {
    width: 44%;
  }

  .modal-body {
    padding: 24px 20px;
  }

  .footer-inner {
    gap: 48px;
    padding-block: 64px 32px;
  }

  .footer-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

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