/* SN Pro：Supernotes 开源字体，OFL-1.1，许可证见 /assets/sn-pro-OFL.txt。中文走系统字体。 */
@font-face { font-family: "SN Pro"; font-weight: 400; font-display: swap; src: url("/assets/sn-pro-400.woff2") format("woff2"); }
@font-face { font-family: "SN Pro"; font-weight: 500; font-display: swap; src: url("/assets/sn-pro-500.woff2") format("woff2"); }

:root {
  --ink: #141517;
  --body: #5f626a;
  --faint: #9a9da5;
  --line: #e2e3e6;
  --surface: #f3f3f4;
  --surface-strong: #e7e8ea;
  --paper: #fbfbfa;
  --field: #ffffff;
  --button: #1d1e21;
  --button-ink: #fbfbfa;
  --button-hover: #35373b;
  --tab-on: #ffffff;
  --marker: #ffe48a;
  --ok: #2f7d4f;
  --bad: #b3261e;
  --sans: "SN Pro", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f2f3; --body: #a9abb2; --faint: #6e7078; --line: #303136; --surface: #1f2023; --surface-strong: #2c2d31;
    --paper: #121315; --field: #18191b; --button: #ececee; --button-ink: #121315; --button-hover: #ffffff; --tab-on: #34353a;
    --marker: #e8c74e; --ok: #6fc28f; --bad: #f2948c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f2f2f3; --body: #a9abb2; --faint: #6e7078; --line: #303136; --surface: #1f2023; --surface-strong: #2c2d31;
  --paper: #121315; --field: #18191b; --button: #ececee; --button-ink: #121315; --button-hover: #ffffff; --tab-on: #34353a;
  --marker: #e8c74e; --ok: #6fc28f; --bad: #f2948c; color-scheme: dark;
}

html { background: var(--paper); scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--body); font: 15px/28px var(--sans); -webkit-font-smoothing: antialiased; }
*, *::before, *::after { box-sizing: border-box; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:is(h1, h2, h3, p, figure, ul, ol, dl) { margin: 0; }
:is(h1, h2, h3) { color: var(--ink); font: 500 15px/28px var(--sans); }
:is(a, button, input, textarea, label):focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.halt { font-feature-settings: "halt"; }
.nw { white-space: nowrap; }
.chip.is-line-start { margin-left: 0; }
.theme-changing *, .theme-changing *::before, .theme-changing *::after { transition: none !important; }

/* 版心 */
.sheet { width: 100%; max-width: 584px; margin-inline: auto; padding: 40px 24px 96px; }
.is-home .sheet { padding-top: 56px; }

/* 顶栏 */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
.avatar { display: block; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--surface); }
.theme-toggle { position: relative; display: grid; place-items: center; width: 40px; height: 40px; margin-right: -11px; border: 0; border-radius: 2px; background: transparent; color: var(--body); }
.theme-toggle svg { position: absolute; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; transition: opacity .14s, transform .3s var(--ease); }
.theme-toggle .sun { opacity: 0; transform: rotate(-45deg) scale(.8); }
[data-dark] .theme-toggle .sun { opacity: 1; transform: none; }
[data-dark] .theme-toggle .moon { opacity: 0; transform: rotate(45deg) scale(.8); }

/* 正文 */
main { display: flex; flex-direction: column; gap: 40px; padding-top: 48px; }
main p { text-wrap: pretty; }
.prose { display: flex; flex-direction: column; gap: 16px; }
.is-home .prose { gap: 22px; }
.lead { color: var(--ink); }
.section { display: flex; flex-direction: column; gap: 16px; }
.section > h2 + p { margin-top: -8px; }
.note { color: var(--faint); font-size: 13px; line-height: 22px; }
.mark { background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 90%, transparent 90%); color: var(--ink); }
strong { color: var(--ink); font-weight: 500; }
code { font: 13px/1 var(--mono); padding: 2px 5px; background: var(--surface); color: var(--ink); border-radius: 2px; }

/* 两种链接：下划线 = 去别处；胶囊 = 我做的东西。→ 站内，↗ 站外 */
.link { text-decoration: underline 1px var(--line); text-underline-offset: 4px; transition: color .15s, text-decoration-color .15s; }
.link::after, .chip::after {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 3px; vertical-align: 1px; background: var(--faint);
  transition: transform .15s var(--ease), background-color .15s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M4 12 12 4M5.5 4H12v6.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M4 12 12 4M5.5 4H12v6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
[data-inside]::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E");
}
.link.plain::after, .chip.plain::after { display: none; }
.chip {
  position: relative; top: 3px; display: inline-block; height: 22px; margin: 0 4px; padding: 0 7px; vertical-align: top;
  background: var(--surface); color: var(--ink); font-size: 14px; line-height: 22px; white-space: nowrap; transition: background-color .15s;
}
.chip:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { color: var(--ink); background: var(--surface); }
  .link:hover { color: var(--ink); text-decoration-color: currentColor; }
  :is(.link, .chip):hover::after { transform: translate(1px, -1px); background: var(--ink); }
  :is(.link, .chip)[data-inside]:hover::after { transform: translateX(2px); }
  .chip:hover { background: var(--surface-strong); }
  .button:hover { background: var(--button-hover); }
  .ghost:hover { background: var(--surface-strong); color: var(--ink); }
}

/* 按钮 */
.button, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 4px 14px; border: 0; border-radius: 2px;
  font-size: 14px; line-height: 28px; white-space: nowrap; transition: background-color .15s, color .15s, transform .15s;
}
.button { background: var(--button); color: var(--button-ink); }
.ghost { background: var(--surface); color: var(--body); }
:is(.button, .ghost):active { transform: translateY(1px); }
:is(.button, .ghost)[disabled] { opacity: .5; cursor: default; transform: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* 分段控制器：滑动指示块 */
.segmented { position: relative; align-self: flex-start; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; background: var(--surface); border-radius: 2px; }
.segmented .indicator { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); background: var(--tab-on); border-radius: 2px; box-shadow: 0 1px 2px rgb(0 0 0 / .08); transform: translateX(calc(100% * var(--i, 0))); transition: transform .28s var(--ease); }
.segmented button, .segmented label { position: relative; z-index: 1; min-width: 96px; padding: 3px 14px; border: 0; background: transparent; color: var(--body); font-size: 14px; line-height: 28px; text-align: center; transition: color .15s; cursor: pointer; }
.segmented [aria-selected="true"], .segmented input:checked + span { color: var(--ink); }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:focus-visible) { outline: 1.5px solid var(--ink); outline-offset: 1px; }
[hidden] { display: none !important; }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--ink); font-size: 14px; line-height: 22px; }
.field > span small { color: var(--faint); font-size: 13px; margin-left: 6px; }
.input { width: 100%; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--field); color: var(--ink); font-size: 15px; line-height: 26px; transition: border-color .15s; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--ink); }
textarea.input { min-height: 112px; resize: vertical; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status:empty { display: none; }
.status { min-height: 22px; font-size: 14px; line-height: 22px; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }

/* 核对表 */
.checklist { display: flex; flex-direction: column; border-top: 1px solid var(--line); list-style: none; padding: 0; }
.checklist li { border-bottom: 1px solid var(--line); }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 12px 0; cursor: pointer; }
.check input { appearance: none; width: 16px; height: 16px; margin: 6px 0 0; border: 1px solid var(--faint); border-radius: 2px; background: var(--field); display: grid; place-items: center; transition: background-color .15s, border-color .15s; cursor: pointer; }
.check input::after { content: ""; width: 9px; height: 5px; border: solid var(--button-ink); border-width: 0 0 1.6px 1.6px; transform: translateY(-1px) rotate(-45deg) scale(.6); opacity: 0; transition: transform .15s var(--ease), opacity .1s; }
.check input:checked { background: var(--button); border-color: var(--button); }
.check input:checked::after { opacity: 1; transform: translateY(-1px) rotate(-45deg); }
.check b { display: block; color: var(--ink); font-weight: 500; }
.check span span { display: block; font-size: 14px; line-height: 24px; }
.check input:checked + span b { color: var(--faint); text-decoration: line-through 1px; }
.progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }

/* 平台说明 */
.spec { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.spec h3 { display: flex; align-items: baseline; justify-content: space-between; }
.spec dl { display: grid; grid-template-columns: 72px 1fr; gap: 4px 12px; font-size: 14px; line-height: 24px; }
.spec dt { color: var(--faint); }
.counter { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 22px; }
.counter .row { display: flex; justify-content: space-between; gap: 12px; }
.counter .over { color: var(--bad); }
.segmented.is-wide { align-self: stretch; }
.segmented.is-wide button { min-width: 0; padding-inline: 6px; }
.hits { font-size: 14px; line-height: 24px; }
.hits mark { background: var(--marker); color: var(--marker-ink, #141517); padding: 0 2px; }

/* 提示词块 */
.card { display: flex; flex-direction: column; gap: 12px; padding: 20px 0; border-top: 1px solid var(--line); }
.card h2 { display: flex; gap: 10px; }
.card h2 .num { color: var(--faint); font-weight: 400; font-variant-numeric: tabular-nums; }
.prompt { position: relative; margin: 0; font-family: var(--sans); padding: 12px 14px; padding-right: 64px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 24px; white-space: pre-wrap; border-radius: 2px; }
.copy { position: absolute; top: 8px; right: 8px; min-height: 28px; padding: 0 9px; border: 0; border-radius: 2px; background: var(--paper); color: var(--body); font-size: 13px; line-height: 28px; transition: color .15s, transform .15s; }
.copy:active { transform: translateY(1px); }
.copy.done { color: var(--ok); }

/* Agent 面板 */
.agent-list { display: flex; flex-direction: column; gap: 8px; padding: 0; list-style: none; font-size: 14px; line-height: 24px; }
.agent-list code { font-size: 13px; }

/* 页脚 */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 64px; padding-top: 20px; border-top: 1px dashed var(--line); font-size: 13px; line-height: 22px; color: var(--faint); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (hover: hover) and (pointer: fine) { .foot a:hover { color: var(--ink); } }

/* 法律页 */
.legal .prose h2 { margin-top: 12px; }
.legal ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 480px) {
  .sheet { padding: 24px 16px 72px; }
  .is-home .sheet { padding-top: 32px; }
  main { padding-top: 36px; gap: 36px; }
  .segmented button { min-width: 0; }
  .inline-form { flex-direction: column; }
  .spec dl { grid-template-columns: 64px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
