/* 回潮 HUICHAO — 标识提案 */

:root{
  --ink:#14110F;
  --paper:#F4EEE2;
  --red:#B23A26;
  --bg:#EFE7D8;
  --panel:#FAF5EA;
  --fg:#1A1613;
  --muted:#6B6157;
  --rule:rgba(20,17,15,.14);
  --rule-soft:rgba(20,17,15,.07);
  --sans:"PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Source Han Sans SC","Microsoft YaHei",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
  --pad:clamp(1rem,4.5vw,3.5rem);
  --maxw:1120px;
  color-scheme:light dark;
}

@media (prefers-color-scheme:dark){
  :root{
    --bg:#12100E;
    --panel:#1B1815;
    --fg:#F0E8DA;
    --muted:#9C9083;
    --rule:rgba(240,232,218,.18);
    --rule-soft:rgba(240,232,218,.09);
    --red:#E2664A;
  }
}

*{box-sizing:border-box}

html,body{margin:0;padding:0}

body{
  background:var(--bg);
  color:var(--fg);
  font-family:var(--sans);
  font-size:16px;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}

img{max-width:100%;height:auto;display:block}

h1,h2,h3{margin:0;line-height:1.15;font-weight:700;letter-spacing:-.01em}

p{margin:0}

main{width:100%;max-width:var(--maxw);margin:0 auto;padding:0 var(--pad) 4rem}

/* ── 顶栏 ───────────────────────────────────────────── */
.topbar{
  display:flex;justify-content:space-between;align-items:baseline;gap:1rem;
  max-width:var(--maxw);margin:0 auto;
  padding:1.1rem var(--pad);
  border-bottom:1px solid var(--rule);
}
.tag{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.2em;
  text-transform:uppercase;color:var(--fg);
}
.tag--muted{color:var(--muted);letter-spacing:.14em}

/* ── 首屏 ───────────────────────────────────────────── */
.hero{padding:clamp(2rem,7vw,4.5rem) 0 clamp(1.6rem,5vw,3rem)}

.eyebrow{
  font-family:var(--mono);font-size:.7rem;letter-spacing:.22em;
  color:var(--muted);text-transform:uppercase;margin-bottom:1.1rem;
}

.hero h1{
  font-size:clamp(3.1rem,15vw,7rem);
  letter-spacing:.02em;
  line-height:.92;
  display:flex;align-items:flex-end;gap:.5rem;flex-wrap:wrap;
}
.h1-latin{
  font-family:var(--mono);
  font-size:clamp(.72rem,2.4vw,.95rem);
  letter-spacing:.28em;font-weight:400;
  color:var(--muted);
  padding-bottom:.5rem;
}

.lede{
  margin-top:1.4rem;max-width:36rem;
  font-size:clamp(.95rem,2.6vw,1.06rem);
  line-height:1.85;color:var(--muted);
}

.hero-index{
  list-style:none;margin:2rem 0 0;padding:1rem 0 0;
  border-top:1px solid var(--rule);
  display:grid;grid-template-columns:1fr 1fr;gap:1rem;
}
.hero-index li{display:flex;align-items:baseline;gap:.6rem;flex-wrap:wrap}
.hero-index b{font-family:var(--mono);font-size:.7rem;letter-spacing:.1em;color:var(--red)}
.hero-index span{font-size:1.05rem;font-weight:700;letter-spacing:.04em}
.hero-index em{font-style:normal;font-size:.78rem;color:var(--muted);letter-spacing:.06em}

/* ── 看板 ───────────────────────────────────────────── */
.board{
  margin-top:clamp(1.5rem,4vw,2.5rem);
  border:1px solid var(--rule);
  background:var(--panel);
}

.board-head{padding:1.15rem 1.15rem 1.05rem;border-bottom:1px solid var(--rule)}
.board-head p{font-size:.8rem;color:var(--muted);line-height:1.5;margin-top:.35rem}

.kicker{
  display:block;font-family:var(--mono);font-size:.62rem;letter-spacing:.22em;
  text-transform:uppercase;color:var(--red);margin-bottom:.45rem;
}
.block-head h2{font-size:clamp(1.25rem,4.4vw,1.7rem);letter-spacing:-.01em;line-height:1.3}
.block-head p{font-size:.88rem;color:var(--muted);line-height:1.7;margin-top:.5rem;max-width:34rem}

.board-grid{display:grid;grid-template-columns:minmax(0,1fr)}

/* 预览台 */
.stage{
  position:relative;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:1.2rem;
  min-height:clamp(300px,58vw,460px);
  padding:clamp(1.6rem,5vw,2.6rem) clamp(1rem,4vw,2rem);
  background:#F4EEE2;
  background-image:
    repeating-linear-gradient(to right,rgba(20,17,15,.055) 0 1px,transparent 1px 28px),
    repeating-linear-gradient(to bottom,rgba(20,17,15,.055) 0 1px,transparent 1px 28px);
  transition:background-color .3s ease;
  overflow:hidden;
}
.stage[data-ground="ink"]{
  background-color:#14110F;
  background-image:
    repeating-linear-gradient(to right,rgba(244,238,226,.07) 0 1px,transparent 1px 28px),
    repeating-linear-gradient(to bottom,rgba(244,238,226,.07) 0 1px,transparent 1px 28px);
}

.stage-art{position:relative;width:var(--logo-w,200px);max-width:100%}
.stage-art img{width:100%;height:auto}

.guides{position:absolute;inset:0;width:100%;height:100%;opacity:0;transition:opacity .25s ease;pointer-events:none}
.guides circle,.guides line{fill:none;stroke:#B23A26;stroke-width:.7;vector-effect:non-scaling-stroke}
.guides circle:nth-child(2){stroke-dasharray:3 5;stroke-opacity:.55}
.guides line{stroke-dasharray:2 6;stroke-opacity:.5}
#stage.show-guides .guides{opacity:1}
#stage[data-ground="ink"] .guides circle,
#stage[data-ground="ink"] .guides line{stroke:#E2664A}
#stage[data-form="logo"] .guides{opacity:0}

.stage-caption{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.16em;
  color:#6B6157;text-transform:uppercase;text-align:center;
}
.stage[data-ground="ink"] .stage-caption{color:rgba(244,238,226,.6)}

.tick{position:absolute;width:12px;height:12px;border:1px solid rgba(20,17,15,.3)}
.tick--tl{top:9px;left:9px;border-right:0;border-bottom:0}
.tick--tr{top:9px;right:9px;border-left:0;border-bottom:0}
.tick--bl{bottom:9px;left:9px;border-right:0;border-top:0}
.tick--br{bottom:9px;right:9px;border-left:0;border-top:0}
.stage[data-ground="ink"] .tick{border-color:rgba(244,238,226,.32)}

/* 控件 */
.controls{
  display:flex;flex-direction:column;gap:1.15rem;
  padding:1.25rem 1.15rem 1.4rem;
  border-top:1px solid var(--rule);
  min-width:0;
}
.field{display:flex;flex-direction:column;gap:.5rem;min-width:0}
.field--row{flex-direction:row;gap:.5rem;flex-wrap:wrap}

.label{
  font-family:var(--mono);font-size:.62rem;letter-spacing:.18em;
  text-transform:uppercase;color:var(--muted);
  display:flex;justify-content:space-between;align-items:baseline;gap:.5rem;
}
.label output{color:var(--fg);letter-spacing:.06em}

.tabs{display:grid;grid-template-columns:1fr 1fr;gap:.4rem}
.tabs button{
  display:flex;align-items:baseline;gap:.4rem;
  min-height:44px;
  padding:.5rem .7rem;
  font:inherit;font-size:.9rem;font-weight:700;letter-spacing:.06em;
  color:var(--fg);background:transparent;
  border:1px solid var(--rule);border-radius:0;
  cursor:pointer;text-align:left;
  transition:background-color .18s ease,color .18s ease,border-color .18s ease;
}
.tabs button b{font-family:var(--mono);font-size:.62rem;letter-spacing:.1em;color:var(--muted);font-weight:400}
.tabs button:hover{border-color:rgba(178,58,38,.5)}
.tabs button.is-on{background:#14110F;color:#F4EEE2;border-color:#14110F}
.tabs button.is-on b{color:rgba(244,238,226,.6)}
@media (prefers-color-scheme:dark){
  .tabs button.is-on{background:#F4EEE2;color:#14110F;border-color:#F4EEE2}
  .tabs button.is-on b{color:rgba(20,17,15,.55)}
}

.seg{display:flex;border:1px solid var(--rule)}
.seg button{
  flex:1;min-height:44px;
  padding:.5rem .5rem;
  font:inherit;font-size:.82rem;letter-spacing:.04em;
  color:var(--muted);background:transparent;
  border:0;border-right:1px solid var(--rule);
  cursor:pointer;
  transition:background-color .18s ease,color .18s ease;
}
.seg button:last-child{border-right:0}
.seg button:hover{color:var(--fg)}
.seg button.is-on{background:var(--red);color:#FBF6EC}
.seg button.is-on:hover{color:#FBF6EC}

input[type="range"]{
  -webkit-appearance:none;appearance:none;
  width:100%;height:44px;background:transparent;cursor:pointer;margin:0;
}
input[type="range"]::-webkit-slider-runnable-track{height:2px;background:var(--rule)}
input[type="range"]::-moz-range-track{height:2px;background:var(--rule)}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;
  width:16px;height:16px;margin-top:-7px;border-radius:50%;
  background:var(--fg);border:0;
}
input[type="range"]::-moz-range-thumb{
  width:16px;height:16px;border:0;border-radius:50%;background:var(--fg);
}
input[type="range"]:focus-visible{outline:2px solid var(--red);outline-offset:4px}

.ghost{
  font:inherit;font-family:var(--mono);font-size:.68rem;letter-spacing:.14em;text-transform:uppercase;
  min-height:44px;padding:.5rem .85rem;
  color:var(--fg);background:transparent;border:1px solid var(--rule);
  cursor:pointer;transition:border-color .18s ease,background-color .18s ease;
}
.ghost:hover{border-color:var(--fg)}
.ghost[aria-pressed="true"]{background:var(--red);border-color:var(--red);color:#FBF6EC}
.ghost[disabled]{opacity:.38;cursor:not-allowed}
.ghost[disabled]:hover{border-color:var(--rule)}

.hint{font-size:.74rem;line-height:1.65;color:var(--muted);border-top:1px solid var(--rule-soft);padding-top:.8rem}

:focus-visible{outline:2px solid var(--red);outline-offset:3px}

/* ── 分区通用 ─────────────────────────────────────── */
.block{margin-top:clamp(3rem,9vw,5.5rem)}
.block-head{margin-bottom:1.6rem;padding-bottom:1.1rem;border-bottom:1px solid var(--rule)}

/* ── 缩放检验 ─────────────────────────────────────── */
.scale-grid{display:grid;gap:1rem;grid-template-columns:minmax(0,1fr)}

.scale-card{
  border:1px solid var(--rule);background:var(--panel);
  padding:1.5rem 1.15rem 1.1rem;
  display:flex;flex-direction:column;gap:1.2rem;
  min-width:0;
}
.avatars{display:flex;align-items:flex-end;gap:clamp(.7rem,3vw,1.5rem);flex-wrap:wrap}
.av{display:flex;flex-direction:column;align-items:center;gap:.5rem;margin:0}
.av-disc{background:#F4EEE2;border-radius:50%;overflow:hidden;display:grid;place-items:center;box-shadow:0 0 0 1px rgba(20,17,15,.1)}
.av-disc img{width:82%;height:auto}
.av--96 .av-disc{width:96px;height:96px}
.av--64 .av-disc{width:64px;height:64px}
.av--40 .av-disc{width:40px;height:40px}
.av--28 .av-disc{width:28px;height:28px}
.av figcaption{font-family:var(--mono);font-size:.6rem;letter-spacing:.12em;color:var(--muted)}
.scale-note{font-size:.8rem;line-height:1.75;color:var(--muted);border-top:1px solid var(--rule-soft);padding-top:.9rem}
.scale-note b{color:var(--fg);font-weight:700}

.profile{
  border:1px solid var(--rule);background:var(--panel);
  padding:1.15rem;display:flex;flex-direction:column;gap:.85rem;min-width:0;
}
.profile-top{display:flex;align-items:center;gap:.8rem}
.profile-avatar{width:68px;height:68px;flex:0 0 68px;border-radius:50%;background:#F4EEE2;overflow:hidden;display:grid;place-items:center;box-shadow:0 0 0 1px rgba(20,17,15,.1)}
.profile-avatar img{width:82%;height:auto}
.profile-id{display:flex;flex-direction:column;min-width:0}
.profile-id strong{font-size:1.05rem;letter-spacing:.06em}
.profile-id span{font-size:.72rem;color:var(--muted);letter-spacing:.04em}
.pill{
  margin-left:auto;flex:0 0 auto;
  font-size:.72rem;letter-spacing:.1em;padding:.3rem .9rem;
  border:1px solid var(--red);color:var(--red);border-radius:999px;
}
.profile-bio{font-size:.82rem;line-height:1.7;color:var(--fg);opacity:.85}
.profile-tabs{display:flex;gap:1.2rem;border-top:1px solid var(--rule-soft);padding-top:.7rem}
.profile-tabs span{font-size:.72rem;color:var(--muted);letter-spacing:.08em}
.mock-note{font-family:var(--mono);font-size:.58rem;letter-spacing:.14em;color:var(--muted);text-transform:uppercase}

/* ── 上手 ─────────────────────────────────────────── */
.uses{display:grid;gap:1rem;grid-template-columns:repeat(2,minmax(0,1fr))}
@media (min-width:900px){.uses{grid-template-columns:repeat(3,minmax(0,1fr))}}
.use{margin:0;display:flex;flex-direction:column;gap:.7rem;min-width:0}
.use figcaption{display:flex;flex-wrap:wrap;gap:.2rem .6rem;align-items:baseline}
.use figcaption b{font-size:.82rem;letter-spacing:.06em}
.use figcaption span{font-size:.72rem;color:var(--muted)}

.sleeve{
  position:relative;aspect-ratio:1/1;width:100%;
  display:grid;place-items:center;
  border:1px solid rgba(20,17,15,.16);
  overflow:hidden;
}
.sleeve--kraft{
  background-color:#C6AC85;
  background-image:
    repeating-linear-gradient(90.5deg,rgba(122,94,55,.10) 0 1px,transparent 1px 4px),
    repeating-linear-gradient(4deg,rgba(122,94,55,.07) 0 1px,transparent 1px 6px),
    linear-gradient(160deg,rgba(255,255,255,.16),rgba(120,92,52,.14));
  box-shadow:inset 0 0 40px rgba(88,64,32,.22);
}
.sleeve--kraft::before{
  content:"";position:absolute;left:0;right:0;top:7%;height:1px;
  background:rgba(88,64,32,.25);box-shadow:0 2px 0 rgba(255,255,255,.16);
}
.sleeve--dark{
  background:#12100F;
  background-image:linear-gradient(150deg,rgba(255,255,255,.05),transparent 55%);
  border-color:rgba(240,232,218,.2);
}
.sleeve-mark{width:52%;height:auto}
.sleeve-meta{
  position:absolute;bottom:8%;left:0;right:0;text-align:center;
  font-family:var(--mono);font-size:.52rem;letter-spacing:.34em;
  color:rgba(244,238,226,.55);
}

.sticker{
  width:66%;aspect-ratio:1/1;border-radius:50%;
  background:#F7F2E7;
  display:grid;place-items:center;
  box-shadow:0 1px 3px rgba(60,40,15,.35),inset 0 0 0 1px rgba(20,17,15,.12);
}
.sticker img{width:76%;height:auto}
.sticker--sm{width:34%}
.sleeve--plain{box-shadow:inset 0 0 40px rgba(88,64,32,.16)}

/* ── 文件 ─────────────────────────────────────────── */
.file-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))}
.file{
  border:1px solid var(--rule);background:var(--panel);
  padding:.9rem;display:flex;flex-direction:column;gap:.45rem;min-width:0;
}
.file-thumb{
  background:#F4EEE2;border:1px solid rgba(20,17,15,.1);
  display:grid;place-items:center;padding:1rem;
  aspect-ratio:16/11;margin-bottom:.55rem;
}
.file-thumb img{width:64%;height:auto;max-height:100%;object-fit:contain}
.file-thumb--ink{background:#14110F;border-color:rgba(240,232,218,.16)}
.file-thumb--wide img{width:92%}
.file h3{font-size:.9rem;letter-spacing:.04em}
.file-meta{font-family:var(--mono);font-size:.6rem;letter-spacing:.08em;color:var(--muted);line-height:1.6}
.file-acts{display:flex;gap:.4rem;margin-top:auto;padding-top:.7rem;flex-wrap:wrap}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:40px;padding:.4rem .9rem;
  font:inherit;font-size:.76rem;letter-spacing:.06em;
  text-decoration:none;color:#FBF6EC;background:#14110F;
  border:1px solid #14110F;cursor:pointer;flex:1 1 auto;
  transition:background-color .18s ease,color .18s ease,border-color .18s ease;
}
.btn:hover{background:#B23A26;border-color:#B23A26;color:#FBF6EC}
.btn--ghost{color:var(--fg);background:transparent;border-color:var(--rule)}
.btn--ghost:hover{background:transparent;color:var(--red);border-color:var(--red)}
@media (prefers-color-scheme:dark){
  .btn{background:#F4EEE2;border-color:#F4EEE2;color:#14110F}
  .btn:hover{background:#E2664A;border-color:#E2664A;color:#14110F}
}

/* ── 说明 ─────────────────────────────────────────── */
.notes{display:grid;gap:1px;background:var(--rule-soft);border-top:1px solid var(--rule-soft)}
@media (min-width:760px){.notes{grid-template-columns:1fr 1fr}}
.note{background:var(--bg);padding:1.1rem 0 .3rem;display:flex;flex-direction:column;gap:.35rem}
@media (min-width:760px){.note{padding:1.3rem 1.4rem}}
.note--wide{grid-column:1/-1}
.note-n{font-family:var(--mono);font-size:.6rem;letter-spacing:.18em;color:var(--red)}
.note h3{font-size:.95rem;letter-spacing:.03em}
.note p{font-size:.82rem;line-height:1.8;color:var(--muted)}
.note p b{color:var(--fg)}
.note code{font-family:var(--mono);font-size:.78em;background:rgba(20,17,15,.06);padding:.1em .35em}
@media (prefers-color-scheme:dark){.note code{background:rgba(244,238,226,.09)}}

/* ── 页脚 ─────────────────────────────────────────── */
.foot{
  border-top:1px solid var(--rule);
  display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;
  max-width:var(--maxw);margin:0 auto;
  padding:1.4rem var(--pad) 3rem;
  font-family:var(--mono);font-size:.62rem;letter-spacing:.14em;color:var(--muted);
  text-transform:uppercase;
}
.foot-mark{color:var(--fg);letter-spacing:.2em}

/* ── 源码对话框 ───────────────────────────────────── */
.code-dialog{
  width:min(720px,calc(100vw - 2rem));
  max-height:min(80vh,720px);
  padding:0;border:1px solid var(--rule);
  background:var(--panel);color:var(--fg);
}
.code-dialog::backdrop{background:rgba(12,10,9,.62)}
/* 不支持 showModal 时的兜底 */
.code-dialog[open]{display:block;position:fixed;inset:0;margin:auto;z-index:50;box-shadow:0 20px 60px rgba(0,0,0,.45)}
.code-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.9rem 1rem;border-bottom:1px solid var(--rule)}
.code-head h2{font-size:.8rem;font-family:var(--mono);letter-spacing:.16em;text-transform:uppercase}
.code-x{
  font:inherit;font-size:1.3rem;line-height:1;
  width:40px;height:40px;display:grid;place-items:center;
  background:transparent;color:var(--fg);border:1px solid var(--rule);cursor:pointer;
}
.code-x:hover{border-color:var(--fg)}
.code-note{font-size:.74rem;line-height:1.7;color:var(--muted);padding:.9rem 1rem 0}
.code-note code{font-family:var(--mono);font-size:.9em}
.code-body{
  margin:.8rem 1rem 0;padding:.8rem;
  max-height:44vh;overflow:auto;
  background:rgba(20,17,15,.05);
  font-family:var(--mono);font-size:.62rem;line-height:1.7;
  white-space:pre;tab-size:2;
}
@media (prefers-color-scheme:dark){.code-body{background:rgba(0,0,0,.35)}}
.code-body code{display:block}
.code-acts{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.9rem 1rem 1rem}
.code-acts .btn{flex:0 1 auto;min-width:110px}
.code-status{font-family:var(--mono);font-size:.62rem;letter-spacing:.1em;color:var(--red)}

@media (min-width:820px){
  .board-grid{grid-template-columns:minmax(0,1fr) 300px}
  .controls{border-top:0;border-left:1px solid var(--rule)}
  .stage{min-height:440px}
  .scale-grid{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr)}
}

@media (prefers-reduced-motion:reduce){
  *{transition-duration:.01ms !important;animation-duration:.01ms !important}
}
