/* 星屿光年 · 访客页组件层（/resources/brand/site.css）。访客页先引 tokens.css，再引这一份，最后是页面自己的版面。
   类名与旧的 brand.css 一一对应（.xy 刊头、栏目、栏目印、标题、按钮、标签、目录、正文、页脚），页面换一行 <link> 就迁过来，
   DOM 与脚本不动。--xy-* 变量留作页面 CSS 的别名，指到新设计层；页面逐步改用 tokens 的名字后删掉别名。 */

:root {
  /* 这些值与 tokens.css 相同，但写成字面值而不是 var(--ink) 之类：
     还没迁完的页面会把 --ink/--paper/--accent/--sans 重新接到 --xy-* 上，两边都用变量就成环、整体失效。 */
  --xy-paper: #f8f8fa;
  --xy-paper-2: #f1f2f5;
  --xy-sheet: #ffffff;
  --xy-sheet-2: #fbfbfc;
  --xy-ink: #0b0d12;
  --xy-ink-2: #464a55;
  --xy-ink-3: #727784;
  --xy-ink-4: #a6aab4;
  --xy-rule: rgba(11, 13, 18, .14);
  --xy-rule-soft: rgba(11, 13, 18, .08);
  /* 旧层的"朱砂"是强调色：现在由本页色相 --h 算出 */
  --xy-red: oklch(0.55 0.15 var(--h));
  --xy-red-ink: oklch(0.55 0.15 var(--h));
  --xy-red-wash: oklch(0.80 0.15 var(--h) / .12);
  --xy-ok: oklch(0.52 0.13 150);  --xy-ok-wash: oklch(0.96 0.03 150);
  --xy-warn: oklch(0.55 0.13 65); --xy-warn-wash: oklch(0.96 0.035 80);
  /* 衬线退场：标题一律 Geist + 本机中文字体，层级靠字号和字重 */
  --xy-sans: "Geist", "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --xy-sans-stack: var(--xy-sans);
  --xy-serif: var(--xy-sans);
  --xy-mono: "Geist Mono", "PingFang SC", "Microsoft YaHei", ui-monospace, monospace;
  --xy-t-display: clamp(34px, 4.6vw + 10px, 64px);
  --xy-t-h1: clamp(28px, 2.6vw + 16px, 44px);
  --xy-t-h2: clamp(21px, .9vw + 16px, 28px);
  --xy-t-h3: 18px;
  --xy-t-body: 17px;
  --xy-t-ui: 15px;
  --xy-t-small: 13px;
  --xy-t-micro: 12px;
  --xy-1: 4px; --xy-2: 8px; --xy-3: 12px; --xy-4: 16px; --xy-5: 20px;
  --xy-6: 24px; --xy-7: 32px; --xy-8: 44px; --xy-9: 64px; --xy-10: 96px;
  --xy-r: 16px;
  --xy-r-sm: 10px;
  --xy-page: 1200px;
  --xy-measure: 36em;
  --xy-gutter: 20px;
  --xy-ease: var(--ease);
}
@supports not (color: oklch(0 0 0)) {
  :root { --xy-ok: #2f7a4b; --xy-ok-wash: #eaf5ee; --xy-warn: #9a6512; --xy-warn-wash: #fbf2e1; --xy-red: hsl(var(--h) 55% 44%); --xy-red-ink: hsl(var(--h) 55% 44%); --xy-red-wash: hsl(var(--h) 80% 72% / .12); }
}
@media (min-width: 760px) { :root { --xy-gutter: 32px; } }

.xy { margin: 0; background: var(--ambient), var(--xy-paper); background-repeat: no-repeat; color: var(--xy-ink); font: var(--xy-t-ui)/1.65 var(--xy-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; text-autospace: normal; }
.xy *, .xy *::before, .xy *::after { box-sizing: border-box; }
.xy :focus-visible { outline: 2px solid var(--xy-red); outline-offset: 3px; border-radius: 4px; }
.xy ::selection { background: var(--xy-red-wash); }
.xy [hidden] { display: none !important; }
.xy-skip { position: absolute; left: -9999px; top: 0; z-index: 99; padding: 10px 14px; border-radius: 10px; background: var(--xy-ink); color: var(--on-ink); }
.xy-skip:focus { left: 10px; top: 10px; }
.xy-page { width: min(100% - 2 * var(--xy-gutter), var(--xy-page)); margin-inline: auto; }

/* ---------- 刊头：毛玻璃 + 发丝线；品牌行 + 栏目 ---------- */
.xy-mast { position: sticky; top: 0; z-index: 20; background: var(--glass); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); border-bottom: 1px solid var(--xy-rule-soft); }
.xy-mast-row { display: flex; align-items: center; gap: var(--xy-3); min-height: 56px; }
.xy-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--xy-ink); text-decoration: none; white-space: nowrap; }
.xy-logo img, .xy-logo svg { width: 22px; height: 22px; flex: none; }
.xy-logo b { font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.xy-mast-tag { color: var(--xy-ink-3); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xy-mast-tag::before { content: "/"; margin: 0 8px 0 0; color: var(--xy-ink-4); }
.xy-mast-aux { margin-left: auto; display: inline-flex; align-items: center; gap: var(--xy-3); }
.xy-mast-aux a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--xy-sheet); box-shadow: var(--highlight), var(--shadow-1); color: var(--xy-ink); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: box-shadow var(--t) var(--ease); }
.xy-mast-aux a:hover { box-shadow: var(--highlight), var(--shadow-2); }

.xy-sections { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--xy-gutter)); padding: 0 calc(var(--xy-gutter) - 11px) 6px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.xy-sections::-webkit-scrollbar { display: none; }
.xy-sections a { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 11px; border-radius: 8px; color: var(--xy-ink-2); font-size: 14px; text-decoration: none; white-space: nowrap; transition: color var(--t-fast), background var(--t-fast); }
.xy-sections a:hover { color: var(--xy-ink); background: var(--xy-paper-2); }
.xy-sections a[aria-current] { color: var(--xy-ink); font-weight: 500; }
.xy-sections a[aria-current]::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: -6px; height: 1.5px; background: var(--xy-ink); }
.xy-sections a:last-child { margin-right: 28px; }
@media (min-width: 900px) {
  /* 桌面：栏目并进品牌行，一行放下 */
  .xy-mast .xy-page { display: flex; align-items: center; gap: 12px; min-height: 60px; }
  .xy-mast-row { display: contents; }
  .xy-mast-aux { order: 2; margin-left: 12px; }
  .xy-sections { order: 1; margin: 0 0 0 auto; padding: 0; -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .xy-sections a[aria-current]::after { bottom: -12px; }
  .xy-sections a:last-child { margin-right: 0; }
}

/* ---------- 栏目印 + 日期：光点 + 等宽小字 ---------- */
.xy-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--xy-2) var(--xy-3); margin: 0 0 var(--xy-5); font-size: var(--xy-t-small); line-height: 1.3; }
.xy-seal { display: inline-flex; align-items: center; gap: 8px; min-height: 26px; padding: 0 11px 0 9px; border-radius: 999px; background: var(--xy-red-wash); color: var(--xy-red); font-family: var(--xy-mono); font-size: 11.5px; font-weight: 500; letter-spacing: var(--ls-meta); }
.xy-seal::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--xy-red); box-shadow: 0 0 10px oklch(0.80 0.15 var(--h)); }
.xy-kicker time, .xy-kicker .xy-when { color: var(--xy-ink-3); font-family: var(--xy-mono); font-size: 12px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* ---------- 字：大字号、收紧字距，层级靠字号和字重 ---------- */
.xy-display { margin: 0; font-size: var(--xy-t-display); line-height: 1.1; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; }
.xy-h1 { margin: 0; font-size: var(--xy-t-h1); line-height: 1.18; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.xy-h2 { margin: 0; font-size: var(--xy-t-h2); line-height: 1.28; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.xy-standfirst { margin: 0; color: var(--xy-ink-2); font-size: clamp(17px, .5vw + 15px, 19px); line-height: 1.75; text-wrap: pretty; }
.xy-label { margin: 0; color: var(--xy-ink-3); font-family: var(--xy-mono); font-size: 11.5px; font-weight: 500; letter-spacing: var(--ls-meta); text-transform: uppercase; }
.xy-num { font-family: var(--xy-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- 动作：墨色胶囊 / 白纸胶囊 ---------- */
.xy-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--xy-2); min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--xy-ink); color: var(--on-ink); font: 500 var(--xy-t-ui)/1.2 var(--xy-sans); text-decoration: none; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 1px var(--xy-ink), 0 1px 2px rgba(11,13,18,.2), 0 10px 24px -10px rgba(11,13,18,.45); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.xy-btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 1px var(--xy-ink), 0 2px 4px rgba(11,13,18,.2), 0 18px 34px -12px oklch(0.45 0.15 var(--h) / .55); }
.xy-btn:active { transform: scale(.98); }
.xy-btn--ghost { background: var(--xy-sheet); color: var(--xy-ink); box-shadow: var(--highlight), var(--shadow-1); }
.xy-btn--ghost:hover { box-shadow: var(--highlight), var(--shadow-2); }
.xy-btn[disabled], .xy-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.xy-link { color: var(--xy-ink); text-decoration: underline; text-decoration-color: var(--xy-rule); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color var(--t-fast); }
.xy-link:hover { text-decoration-color: var(--xy-ink); }
.xy-arrow::after { content: " →"; }

.xy-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--xy-sheet); box-shadow: inset 0 0 0 1px var(--xy-rule); color: var(--xy-ink-2); font-size: 14px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: box-shadow var(--t-fast), color var(--t-fast), background var(--t-fast); }
.xy-chip:hover { color: var(--xy-ink); box-shadow: inset 0 0 0 1px var(--xy-ink-3); }
.xy-chip[aria-pressed="true"], .xy-chip[aria-current] { background: var(--xy-ink); color: var(--on-ink); box-shadow: none; }

.xy-card { background: var(--xy-sheet); border-radius: var(--xy-r); box-shadow: var(--highlight), var(--shadow-2); }
.xy-rule { height: 0; margin: 0; border: 0; border-top: 1px solid var(--xy-rule-soft); }
.xy-rule--double { border-top: 1px solid var(--xy-rule); }

/* ---------- 本文目录 ---------- */
.xy-toc { margin: 0; padding: 0; list-style: none; counter-reset: xytoc; border-top: 1px solid var(--xy-rule); }
.xy-toc li { counter-increment: xytoc; border-bottom: 1px solid var(--xy-rule-soft); }
.xy-toc a { display: grid; grid-template-columns: 2.4em 1fr; align-items: baseline; gap: var(--xy-2); min-height: 44px; padding: 11px 6px; border-radius: 8px; color: var(--xy-ink); font-size: 15.5px; line-height: 1.45; text-decoration: none; transition: background var(--t-fast); }
.xy-toc a::before { content: counter(xytoc, decimal-leading-zero); color: var(--xy-red); font: 500 12.5px/1 var(--xy-mono); }
.xy-toc a:hover { background: var(--xy-paper-2); }

/* ---------- 读的正文 ---------- */
.xy-prose { max-width: var(--xy-measure); font-size: var(--xy-t-body); line-height: 1.9; letter-spacing: .01em; color: var(--xy-ink); overflow-wrap: break-word; }
.xy-prose > :first-child { margin-top: 0; }
.xy-prose p { margin: 0 0 1.1em; }
.xy-prose h2 { margin: 2.2em 0 .7em; font-size: var(--xy-t-h2); line-height: 1.3; font-weight: 700; letter-spacing: -.02em; scroll-margin-top: 80px; }
.xy-prose h3 { margin: 1.8em 0 .5em; font-size: var(--xy-t-h3); line-height: 1.4; font-weight: 600; }
.xy-prose h4 { margin: 1.4em 0 .4em; font-size: 16px; line-height: 1.45; font-weight: 600; color: var(--xy-ink-2); }
.xy-prose ul, .xy-prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.xy-prose li { margin: 0 0 .45em; padding-left: .15em; }
.xy-prose li::marker { color: var(--xy-red); }
.xy-prose strong { font-weight: 600; background: linear-gradient(transparent 62%, var(--xy-red-wash) 62%); }
.xy-prose a { color: var(--xy-ink); text-decoration: underline; text-decoration-color: var(--xy-rule); text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.xy-prose a:hover { text-decoration-color: var(--xy-ink); }
.xy-prose code { padding: 1px 6px; border-radius: 6px; background: var(--xy-paper-2); font: .84em/1.5 var(--xy-mono); overflow-wrap: anywhere; }
.xy-prose pre { margin: 0 0 1.1em; padding: var(--xy-4); border-radius: 12px; background: var(--xy-paper-2); overflow-x: auto; font-size: 14px; line-height: 1.6; }
.xy-prose pre code { padding: 0; background: none; overflow-wrap: normal; }
.xy-prose blockquote { margin: 1.4em 0; padding: 0 0 0 1em; border-left: 2px solid var(--xy-red); font-size: 18px; line-height: 1.75; color: var(--xy-ink); }
.xy-prose blockquote p { margin: 0; }
.xy-prose hr { margin: 2.2em 0; border: 0; border-top: 1px solid var(--xy-rule-soft); }
.xy-prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.xy-prose th, .xy-prose td { padding: 10px; border-bottom: 1px solid var(--xy-rule-soft); text-align: left; vertical-align: top; }
.xy-prose th { border-bottom: 1px solid var(--xy-rule); color: var(--xy-ink-3); font-family: var(--xy-mono); font-size: 11.5px; font-weight: 500; letter-spacing: var(--ls-meta); white-space: nowrap; }

/* ---------- 页脚 ---------- */
.xy-foot { margin-top: var(--xy-10); border-top: 1px solid var(--xy-rule-soft); color: var(--xy-ink-3); font-size: var(--xy-t-small); }
.xy-foot-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--xy-3) var(--xy-6); padding: 40px 0 48px; }
.xy-foot b { color: var(--xy-ink); font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.xy-foot nav { display: flex; flex-wrap: wrap; gap: 0 var(--xy-4); }
.xy-foot nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--xy-ink-2); text-decoration: none; transition: color var(--t-fast); }
.xy-foot nav a:hover { color: var(--xy-ink); }
.xy-foot p { flex-basis: 100%; margin: 0; line-height: 1.7; }

@media (prefers-reduced-motion: reduce) { .xy *, .xy *::before, .xy *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
