/* 「曜光」共享设计令牌。外层网关与独立页面使用同一套色彩、字体和状态。 */
:root,
html[data-theme-preset] {
  --yao-bg: #f8f7f3;
  --yao-bg-soft: #f0eee7;
  --yao-surface: #fffefa;
  --yao-surface-2: #f4f2eb;
  --yao-text: #25251f;
  --yao-muted: #636659;
  --yao-quiet: #636659;
  --yao-border: #e5e3d9;
  --yao-border-strong: #cecec0;
  --yao-accent: #e96835;
  --yao-accent-2: #c84722;
  --yao-accent-3: #eea569;
  --yao-accent-ink: #aa3f1d;
  --yao-accent-soft: #fbede4;
  --yao-button-warm: #aa3f1d;
  --yao-button-warm-ink: #ffffff;
  --yao-button-warm-hover: #c84722;
  --yao-glow: rgba(233, 104, 53, .16);
  --yao-ok: #44735b;
  --yao-ok-soft: #e8f1e9;
  --yao-warning: #956419;
  --yao-warning-soft: #fbf1d8;
  --yao-danger: #b64539;
  --yao-danger-soft: #fae9e4;
  --yao-night: #25291f;
  --yao-shadow: 0 12px 34px -22px rgba(41, 44, 31, .24);
  --yao-shadow-float: 0 24px 70px -26px rgba(36, 38, 26, .32);
  --yao-radius: 16px;
  --yao-font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --yao-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
html.dark, html[data-theme="dark"], [data-theme="dark"] {
  --yao-bg: #191d18;
  --yao-bg-soft: #20251f;
  --yao-surface: #242923;
  --yao-surface-2: #2a3028;
  --yao-text: #f0f0e8;
  --yao-muted: #b3b6a7;
  --yao-quiet: #b3b6a7;
  --yao-border: #373e32;
  --yao-border-strong: #515a49;
  --yao-accent: #ee8655;
  --yao-accent-2: #ed7443;
  --yao-accent-ink: #ffb38e;
  --yao-accent-soft: #3b2b22;
  --yao-button-warm: #ee8655;
  --yao-button-warm-ink: #25251f;
  --yao-button-warm-hover: #ed7443;
  --yao-ok: #9dc4a6;
  --yao-ok-soft: #26372a;
  --yao-warning: #e0bd72;
  --yao-warning-soft: #393220;
  --yao-danger: #eea096;
  --yao-danger-soft: #402923;
  --yao-night: #101610;
  --yao-shadow: 0 12px 34px -22px rgba(0, 0, 0, .6);
  --yao-shadow-float: 0 24px 70px -26px rgba(0, 0, 0, .65);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--yao-font); color: var(--yao-text); background: var(--yao-bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
/* 只在静态页生效（静态页 <body data-yao-page>）。SPA 页里这条 unlayered 规则会盖掉
   Tailwind 的 .text-primary-foreground，导致黑底按钮上的黑字彻底看不见。 */
:where(body[data-yao-page]) a { color: inherit; }
img, svg { max-width: 100%; }
code, pre, kbd { font-family: var(--yao-mono); }
::selection { background: var(--yao-accent-soft); color: var(--yao-accent-ink); }
:focus-visible { outline: 2px solid var(--yao-accent); outline-offset: 4px; }
.yao-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.yao-skip { position: fixed; z-index: 9999; left: 12px; top: 12px; padding: 12px 18px; background: var(--yao-night); color: #fff; border-radius: 10px; transform: translateY(-150%); }
.yao-skip:focus { transform: none; }
.yao-icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.yao-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--yao-muted); font: 11px/1.5 var(--yao-mono); letter-spacing: .13em; text-transform: uppercase; }
.yao-eyebrow::before { content: ""; display: block; width: 22px; height: 1px; background: var(--yao-accent); }
.yao-muted { color: var(--yao-muted); }
.yao-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 11px 18px; border: 1px solid var(--yao-border-strong); border-radius: 9px; background: var(--yao-surface); color: var(--yao-text); font-size: 13px; line-height: 1.4; font-weight: 600; text-decoration: none; transition: background .16s, transform .16s, border-color .16s; }
.yao-btn:hover { background: var(--yao-bg-soft); border-color: var(--yao-muted); }
.yao-btn:active { transform: translateY(1px); }
.yao-btn-primary { background: var(--yao-button-warm); border-color: transparent; color: var(--yao-button-warm-ink); }
.yao-btn-primary:hover { background: var(--yao-button-warm-hover); border-color: transparent; }
.yao-btn-dark { background: var(--yao-night); border-color: var(--yao-night); color: #f8f7f3; }
.yao-btn-dark:hover { background: #3a4134; border-color: #3a4134; }
.yao-btn-quiet { border-color: transparent; background: transparent; color: var(--yao-muted); }
.yao-btn-small { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.yao-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: transparent; border: 1px solid var(--yao-border); border-radius: 9px; color: var(--yao-muted); }
.yao-icon-btn:hover { background: var(--yao-bg-soft); color: var(--yao-text); }
.yao-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; background: var(--yao-bg-soft); color: var(--yao-muted); border-radius: 5px; font-size: 11px; line-height: 1.5; }
.yao-tag-warm { background: var(--yao-accent-soft); color: var(--yao-accent-ink); }
.yao-tag-ok { background: var(--yao-ok-soft); color: var(--yao-ok); }
.yao-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.yao-input { width: 100%; min-height: 44px; padding: 11px 13px; background: var(--yao-surface); color: var(--yao-text); border: 1px solid var(--yao-border); border-radius: 9px; font-size: 13px; }
.yao-input::placeholder { color: var(--yao-quiet); }
.yao-input:focus { outline: 2px solid var(--yao-accent); outline-offset: 2px; }
select.yao-input { padding-right: 30px; }
.yao-panel { border: 1px solid var(--yao-border); border-radius: var(--yao-radius); background: var(--yao-surface); }
.yao-empty { padding: 70px 24px; text-align: center; border: 1px dashed var(--yao-border-strong); border-radius: 16px; color: var(--yao-muted); }
.yao-empty h2 { color: var(--yao-text); font-size: 20px; margin: 20px 0 8px; }
.yao-empty p { max-width: 420px; margin: 0 auto 20px; font-size: 13px; line-height: 1.8; }
.yao-empty .yao-empty-symbol { margin: auto; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--yao-bg-soft); color: var(--yao-accent); font-size: 22px; }
.yao-toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 16px); max-width: calc(100vw - 32px); padding: 12px 20px; background: var(--yao-night); color: #fff; border: 1px solid #53614c; border-radius: 10px; font-size: 13px; box-shadow: var(--yao-shadow-float); opacity: 0; visibility: hidden; z-index: 10000; transition: .2s; }
.yao-toast[data-open] { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.yao-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; overflow: auto; background: var(--yao-surface); color: var(--yao-text); border: 1px solid var(--yao-border); border-radius: 18px; box-shadow: var(--yao-shadow-float); }
.yao-dialog::backdrop { background: rgba(22, 29, 20, .48); backdrop-filter: blur(4px); }
.yao-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 26px 28px 20px; border-bottom: 1px solid var(--yao-border); gap: 18px; position: sticky; top: 0; z-index: 1; background: var(--yao-surface); }
.yao-dialog-head > div { min-width: 0; }
.yao-dialog-head > button { flex-shrink: 0; }
.yao-dialog h2 { font-size: 22px; letter-spacing: -.04em; margin: 10px 0 6px; }
.yao-dialog p { margin: 0; color: var(--yao-muted); font-size: 13px; line-height: 1.8; }
.yao-dialog-body { padding: 24px 28px 28px; }
.yao-contact-block { min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.yao-contact-block > .yao-contact-line { margin: 0; color: var(--yao-text); font-size: 13px; line-height: 2; overflow-wrap: anywhere; }
.yao-contact-block > .yao-contact-line + .yao-contact-line { margin-top: 4px; }
.yao-dialog p.yao-contact-note { margin-top: 20px; font-size: 12px; padding-top: 18px; border-top: 1px solid var(--yao-border); }
.yao-station-dialog { width: min(720px, calc(100vw - 32px)); }
.yao-popup-topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.yao-popup-topic { min-width: 0; padding: 0 16px 0 0; border-right: 1px solid var(--yao-border); display: flex; flex-direction: column; align-items: flex-start; }
.yao-popup-topic:last-child { padding-right: 0; border-right: 0; }
.yao-popup-topic h3, .yao-popup-contact h3 { font-size: 14px; font-weight: 600; margin: 0 0 9px; }
.yao-popup-topic p { font-size: 12px; flex: 1; }
.yao-popup-topic a { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--yao-accent-ink); text-underline-offset: 3px; }
.yao-popup-contact { padding-top: 22px; border-top: 1px solid var(--yao-border); }
.yao-popup-contact > p { margin-bottom: 16px; font-size: 12px; }
@media (max-width: 560px) {
  .yao-dialog { max-height: calc(100dvh - 24px); width: calc(100vw - 24px); border-radius: 14px; }
  .yao-dialog-head { padding: 20px 20px 16px; gap: 12px; }
  .yao-dialog-body { padding: 20px; }
  .yao-dialog h2 { font-size: 20px; }
  .yao-popup-topics { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .yao-popup-topic { border-right: 0; border-bottom: 1px solid var(--yao-border); padding: 0 0 16px; }
  .yao-popup-topic:last-child { border-bottom: 0; padding-bottom: 0; }
}
.yao-command-search { padding: 18px; border-bottom: 1px solid var(--yao-border); display: flex; align-items: center; gap: 12px; }
.yao-command-search input { border: 0; background: transparent; width: 100%; color: var(--yao-text); font-size: 15px; outline: 0; min-height: 36px; }
.yao-command-results { display: grid; gap: 3px; padding: 12px; max-height: 420px; overflow: auto; }
.yao-command-results a { padding: 12px 14px; border-radius: 8px; display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 13px; }
.yao-command-results a:hover, .yao-command-results a:focus-visible { background: var(--yao-accent-soft); color: var(--yao-accent-ink); }
.yao-command-results a span { margin-left: auto; color: var(--yao-muted); font-size: 11px; }
.yao-command-foot { padding: 12px 20px; border-top: 1px solid var(--yao-border); color: var(--yao-muted); font-size: 11px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}
