/* WrionROMs 样式：基于 DESIGN-cal.md（Cal.com 设计规范） */
:root {
  --primary: #111111;
  --primary-active: #242424;
  --primary-disabled: #e5e7eb;
  --ink: #111111;
  --body: #374151;
  --muted: #6b7280;
  --muted-soft: #898989;
  --hairline: #e5e7eb;
  --hairline-soft: #f3f4f6;
  --canvas: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-card: #f5f5f5;
  --surface-strong: #e5e7eb;
  --surface-dark: #101010;
  --on-primary: #ffffff;
  --on-dark-soft: #a1a1aa;
  --brand-accent: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --badge-orange: #fb923c;
  --badge-violet: #8b5cf6;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;

  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 48px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  --font-display: "Cal Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --maxw: 1200px;

  --t-new: var(--badge-violet);
  --t-opt: var(--brand-accent);
  --t-fix: var(--success);
  --t-known: var(--badge-orange);

  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--surface-soft);
  color: var(--body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
.container { width: 100%; max-width: calc(var(--maxw) + 32px); margin: 0 auto; padding: 0 var(--s-md); }
@media (min-width: 768px) { .container { max-width: calc(var(--maxw) + 64px); padding: 0 var(--s-xl); } }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.caption { font-size: 13px; font-weight: 500; line-height: 1.4; }
.title-lg { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.3px; color: var(--ink); }
.title-md { font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--ink); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-xs);
  height: 40px; padding: 0 20px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:active { background: var(--primary-active); border-color: var(--primary-active); }
.btn:disabled { background: var(--primary-disabled); border-color: var(--primary-disabled); color: var(--muted); cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--error); }

/* ---------- 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-card); color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; white-space: nowrap;
}
.badge.latest { background: var(--primary); color: var(--on-primary); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-soft); flex: none; }
.dot.ok { background: var(--success); }
.dot.warn { background: var(--warning); }
.dot.t-new { background: var(--t-new); }
.dot.t-opt { background: var(--t-opt); }
.dot.t-fix { background: var(--t-fix); }
.dot.t-known { background: var(--t-known); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; color: var(--muted); padding: 1px 8px; border: 1px solid var(--hairline); border-radius: var(--r-pill); }

/* ---------- 分段切换 ---------- */
.pill-group {
  display: inline-flex; gap: 2px; padding: 4px; max-width: 100%;
  background: var(--surface-soft); border: 1px solid var(--hairline-soft); border-radius: var(--r-pill);
}
.pill-group button {
  padding: 6px 14px; border-radius: var(--r-pill); border: 0; background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.4; cursor: pointer; white-space: nowrap;
}
.pill-group button.on { background: var(--primary); color: var(--on-primary); }

/* ---------- 顶栏 + 筛选 ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--canvas); border-bottom: 1px solid var(--hairline); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-md); height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.5px; color: var(--ink); }
.wordmark img { width: 26px; height: 26px; }
.qq-menu { position: relative; display: flex; align-items: center; gap: var(--s-sm); }
@media (max-width: 520px) {
  .nav-inner { height: auto; min-height: 60px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .qq-menu { margin-left: auto; }
}
.qq-current { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.qq-current .lbl { color: var(--muted); }
.qq-current .mono { color: var(--ink); font-weight: 600; }
.qq-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 360px; max-width: calc(100vw - 32px);
  display: grid; gap: 4px; padding: var(--s-xs);
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.qq-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm); padding: var(--s-sm); border-radius: var(--r-md); }
.qq-row.current { background: var(--surface-soft); }
.qq-row .info { display: grid; gap: 2px; min-width: 0; }
.qq-row .name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qq-row .name b { font-size: 14px; font-weight: 600; color: var(--ink); }
.qq-row .name .badge { padding: 1px 8px; font-size: 12px; background: var(--canvas); border: 1px solid var(--hairline); }
.qq-row .info .mono { font-size: 13px; color: var(--muted); }
.qq-row .acts { display: flex; gap: 6px; flex: none; }
.qq-empty { padding: var(--s-sm); font-size: 14px; color: var(--muted); }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-xs) var(--s-lg); padding-bottom: var(--s-sm); }
.filter { display: flex; align-items: center; gap: var(--s-xs); min-width: 0; max-width: 100%; }
.filter .label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.filter .pill-group { overflow-x: auto; scrollbar-width: none; }
.filter .pill-group::-webkit-scrollbar { display: none; }
.result-count { margin-left: auto; font-size: 13px; color: var(--muted); }
@media (max-width: 767px) {
  .nav { position: static; }
  .qq-current { display: none; }
  .filters { flex-direction: column; align-items: stretch; gap: var(--s-xs); }
  .filter .label { width: 28px; flex: none; }
  .result-count { margin-left: 0; }
}

.announce { background: var(--primary); color: var(--on-primary); font-size: 14px; text-align: center; padding: 9px var(--s-md); }

/* ---------- 瀑布流 ---------- */
body[data-page="home"], body[data-page="guide"] { min-height: 100vh; display: flex; flex-direction: column; }
body[data-page="home"] main, body[data-page="guide"] main { flex: 1; width: 100%; }
.feed-wrap { padding-top: var(--s-lg); padding-bottom: var(--s-xxl); }
.feed { display: flex; gap: var(--s-md); align-items: flex-start; }
.feed-col { flex: 1; min-width: 0; display: grid; gap: var(--s-md); }

.log { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--s-lg); scroll-margin-top: 140px; transition: box-shadow .3s; }
.log.flash { box-shadow: 0 0 0 3px var(--ink); }
.log-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.log-title { margin-top: var(--s-sm); }
.log-meta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.log-meta .mono { font-size: 12px; }
.log .chips { margin-top: var(--s-sm); }
.log-groups { margin-top: var(--s-md); padding-top: var(--s-md); border-top: 1px solid var(--hairline-soft); display: grid; gap: var(--s-md); }
.log-group h4 { display: flex; align-items: center; gap: var(--s-xs); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.log-group li { position: relative; padding: 2px 0 2px 15px; font-size: 14px; color: var(--body); }
.log-group li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 5px; height: 1.5px; background: var(--muted-soft); }
.log-note { margin-top: var(--s-md); padding: 10px var(--s-sm); border-radius: var(--r-md); background: var(--surface-soft); font-size: 13px; color: var(--body); white-space: pre-line; }
@media (max-width: 767px) { .log { padding: var(--s-md) var(--s-md) var(--s-lg); scroll-margin-top: 16px; } }

.empty { flex: 1; padding: var(--s-xxl) var(--s-md); text-align: center; color: var(--muted); background: var(--canvas); border: 1px dashed var(--surface-strong); border-radius: var(--r-lg); }

/* ---------- 页脚 ---------- */
.footer { background: var(--surface-dark); color: var(--on-dark-soft); padding: var(--s-lg) 0; font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: var(--s-xs) var(--s-lg); flex-wrap: wrap; }
.footer .mono { color: #fff; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: var(--s-lg); transform: translate(-50%, 12px); opacity: 0;
  padding: 10px var(--s-md); border-radius: var(--r-md); background: var(--primary); color: var(--on-primary);
  font-size: 14px; z-index: 100; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: var(--shadow-md);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 上车文档 ---------- */
.doc-page { background: var(--canvas); }
.doc-page .nav { position: sticky; }
.doc { max-width: 792px; margin: 0 auto; padding: 0 var(--s-md) var(--s-xxl); color: var(--body); }
.doc a:not(.btn) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--surface-strong); }
.doc b { color: var(--ink); font-weight: 600; }
.doc p + p { margin-top: var(--s-sm); }
.doc code { font-family: var(--mono); font-size: 0.9em; padding: 1px 6px; border-radius: var(--r-xs); background: var(--surface-card); color: var(--ink); }
.display-md, .display-sm { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.display-md { font-size: 36px; line-height: 1.15; letter-spacing: -1px; }
.display-sm { font-size: 28px; line-height: 1.2; letter-spacing: -0.5px; }
.body-sm { font-size: 14px; }
@media (max-width: 767px) { .display-md { font-size: 28px; letter-spacing: -0.5px; } .display-sm { font-size: 24px; } }

.doc-head { padding: var(--s-xxl) 0 var(--s-lg); }
.doc-head h1 { margin-top: var(--s-md); text-wrap: balance; }
.toc { margin-top: var(--s-lg); display: flex; flex-wrap: wrap; gap: var(--s-xs); }
.doc .toc a { text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 14px; border-radius: var(--r-pill); border: 1px solid var(--hairline); color: var(--ink); }
.doc-sec { padding-top: var(--s-xxl); margin-top: var(--s-lg); border-top: 1px solid var(--hairline-soft); scroll-margin-top: 64px; }
.doc-sec > h2 { margin-bottom: var(--s-lg); }
.doc-h3 { margin: var(--s-xxl) 0 var(--s-sm); scroll-margin-top: 80px; }

.plan-card { background: var(--surface-card); border-radius: var(--r-lg); padding: var(--s-lg); display: grid; gap: var(--s-md); }
.plan-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-sm); }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.progress-bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-strong); overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.timeline { display: grid; gap: var(--s-xs); padding: var(--s-sm) var(--s-md); background: var(--canvas); border-radius: var(--r-md); }
.timeline li { display: flex; gap: var(--s-sm); font-size: 14px; }
.timeline time { flex: none; color: var(--muted); }

.callout { margin-top: var(--s-md); padding: var(--s-md) var(--s-md) var(--s-md) 20px; border-radius: var(--r-md); border: 1px solid var(--hairline); border-left: 3px solid var(--ink); font-size: 15px; }
.callout.warn { background: #fffbeb; border-color: #fde68a; border-left-color: var(--warning); }
.callout > b { display: block; margin-bottom: 4px; }

.doc .check-list li { position: relative; padding: 4px 0 4px 28px; }
.doc .check-list li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 11px; height: 6px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); }
.table-wrap { margin-top: var(--s-lg); overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.table th, .table td { padding: var(--s-sm) var(--s-md); text-align: left; vertical-align: top; }
.table th { background: var(--surface-soft); font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--hairline); }
.table th .muted { font-weight: 400; }
.table td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.table td:nth-child(2) { white-space: nowrap; }
ul.plain li + li { margin-top: 4px; }

.steps { counter-reset: step; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-md); }
.step { counter-increment: step; position: relative; padding: var(--s-lg) var(--s-lg) var(--s-lg) 72px; border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.step::before {
  content: counter(step); position: absolute; left: var(--s-lg); top: 22px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: 14px; font-weight: 600;
}
.step > h3 { padding-top: 3px; }
.step > * + * { margin-top: var(--s-sm); }
@media (max-width: 767px) {
  .step { padding: 64px var(--s-md) var(--s-lg); }
  .step::before { left: var(--s-md); top: var(--s-md); }
  .step > h3 { position: absolute; left: 60px; top: 19px; right: var(--s-md); padding: 0; }
}
.group-row { display: flex; align-items: center; gap: var(--s-sm); flex-wrap: wrap; padding: var(--s-sm) var(--s-md); background: var(--surface-card); border-radius: var(--r-md); }
.group-row .lbl { font-size: 13px; color: var(--muted); }
.group-row .num { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: 1px; margin-right: auto; }

.pay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-md); max-width: 440px; }
.pay-grid figure { margin: 0; border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; background: var(--canvas); }
.pay-grid img { width: 100%; height: auto; }
.pay-grid figcaption { padding: 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink); border-top: 1px solid var(--hairline-soft); }
@media (max-width: 520px) {
  .pay-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .pay-grid figure { scroll-snap-align: start; }
}

.dash li { position: relative; padding: 3px 0 3px 16px; }
.dash li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 6px; height: 1.5px; background: var(--muted-soft); }
.sub-label { font-size: 14px; }
.code { position: relative; margin: var(--s-sm) 0; background: var(--surface-dark); border-radius: var(--r-md); }
.code pre { margin: 0; padding: var(--s-md); padding-right: 76px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: #f4f4f5; }
.code .btn { position: absolute; top: 8px; right: 8px; height: 28px; background: var(--surface-dark); color: var(--on-dark-soft); border-color: #3f3f46; }

.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-md); margin: var(--s-md) 0; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }
.mini-card { padding: var(--s-md); background: var(--surface-card); border-radius: var(--r-md); font-size: 15px; }
.mini-card > b { display: block; margin-bottom: 4px; }
.num-list { counter-reset: n; margin: var(--s-sm) 0; display: grid; gap: 6px; }
.num-list[start="2"] { counter-reset: n 1; }
.num-list[start="3"] { counter-reset: n 2; }
.num-list[start="4"] { counter-reset: n 3; }
.num-list > li { counter-increment: n; position: relative; padding-left: 28px; }
.num-list > li::before { content: counter(n) "."; position: absolute; left: 0; width: 20px; text-align: right; font-family: var(--mono); font-size: 14px; color: var(--muted); }

.figs { display: grid; grid-auto-flow: column; grid-auto-columns: calc(50% - 6px); gap: var(--s-sm); overflow-x: auto; scroll-snap-type: x mandatory; margin: var(--s-md) 0; padding-bottom: 4px; }
.figs.one { grid-auto-columns: 100%; }
.figs.phone { grid-auto-columns: 180px; }
.figs figure { margin: 0; scroll-snap-align: start; }
.figs img { width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--hairline); }
@media (max-width: 600px) { .figs { grid-auto-columns: 85%; } .figs.phone { grid-auto-columns: 46%; } }

.method { margin-top: var(--s-md); padding: var(--s-lg); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.method h4 { font-size: 16px; font-weight: 600; margin-bottom: var(--s-xs); }
@media (max-width: 767px) { .method { padding: var(--s-md); } }
.terms .num-list { gap: var(--s-sm); font-size: 14px; color: var(--muted); }

/* ---------- 上车文档入口（首页） ---------- */
.guide-links { display: flex; flex-wrap: wrap; gap: var(--s-sm); margin-bottom: var(--s-md); }
.guide-link {
  flex: 1 1 320px; display: flex; align-items: center; gap: var(--s-md);
  padding: var(--s-md) var(--s-lg); background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.guide-link .txt { flex: 1; min-width: 0; }
.guide-link .txt b { display: block; color: var(--ink); font-weight: 600; }
.guide-link .txt span { font-size: 13px; color: var(--muted); }
.guide-link .btn { flex: none; }
@media (max-width: 767px) { .guide-link { padding: var(--s-md); } }
