/* 星屿光年 · 访客站品牌层（旧）——只剩书籍 Skill 页与造镜台工坊、本机发布还引着（见同目录 README.md），
   它们换到 tokens.css + site.css / admin.css 后删掉这份。下面是旧版说明。
   资源站、Skill 榜、案例库、领取页共用这一份：同一张纸、同一支墨、同一方朱砂印。
   各站自己的 CSS 只写版面，颜色/字体/字号/间距一律取这里的变量。

   气质：给普通人看的一份 AI 生活报。暖白纸 + 墨黑字 + 一方朱砂；衬线只给"编辑部的话"
   （标题、导语、大数字），正文与界面用无衬线；双线刊头、细线分栏、少圆角、不堆阴影。
   朱砂只标"今天、名次、我们的印"：栏目印、当前栏目、排名前三。按钮和链接用墨色。

   来人多在手机上：正文 17px、行高 1.85、每行不超过 36 字；点按目标不小于 44px。
   字体只用本机字体（外网字体在国内不可达，会白屏等待）。 */

:root {
  color-scheme: light;

  --xy-paper: #f4efe6;
  --xy-paper-2: #ebe4d6;
  --xy-sheet: #fffdf8;
  --xy-sheet-2: #faf6ee;
  --xy-ink: #17130e;
  --xy-ink-2: #474137;
  --xy-ink-3: #6b6458;
  --xy-ink-4: #a39b8c;
  --xy-rule: #dcd3c3;
  --xy-rule-soft: #e8e1d4;

  --xy-red: #c4321d;
  --xy-red-ink: #9c2414;
  --xy-red-wash: #f8e7e1;
  --xy-ok: #2d6a43;
  --xy-ok-wash: #e4efe5;
  --xy-warn: #8f5a0b;
  --xy-warn-wash: #f6ecd8;

  /* 衬线只在有中文衬线的设备上出现（iOS/macOS 宋体、Windows 宋体、装了思源宋体的机器）。
     多数国产安卓机没有中文衬线：这时整条落到无衬线，免得拉丁衬线夹着中文黑体。层级靠字重和字号撑。 */
  --xy-serif: "Palatino Linotype", Palatino, "Iowan Old Style", "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, "Noto Serif CJK SC", SimSun, Georgia, var(--xy-sans-stack);
  --xy-sans-stack: -apple-system, BlinkMacSystemFont, Inter, "PingFang SC", "HarmonyOS Sans SC", MiSans, "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --xy-sans: var(--xy-sans-stack);
  --xy-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* 字号阶梯：展示 / 标题 / 小标题 / 正文 / 界面 / 注释 / 最小 */
  --xy-t-display: clamp(32px, 5.2vw + 12px, 60px);
  --xy-t-h1: clamp(27px, 2.6vw + 17px, 42px);
  --xy-t-h2: clamp(21px, .8vw + 17px, 27px);
  --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: 10px;
  --xy-r-sm: 6px;
  --xy-page: 1200px;
  --xy-measure: 36em;
  --xy-gutter: 20px;
  --xy-ease: cubic-bezier(.2, .7, .2, 1);
}
@media (min-width: 760px) { :root { --xy-gutter: 32px; } }

.xy { margin: 0; background: var(--xy-paper); color: var(--xy-ink); font: var(--xy-t-ui)/1.65 var(--xy-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.xy *, .xy *::before, .xy *::after { box-sizing: border-box; }
.xy :focus-visible { outline: 2px solid var(--xy-ink); outline-offset: 3px; border-radius: 2px; }
.xy [hidden] { display: none !important; }
.xy-skip { position: absolute; left: -9999px; top: 0; z-index: 99; padding: var(--xy-2) var(--xy-4); background: var(--xy-ink); color: var(--xy-sheet); }
.xy-skip:focus { left: 0; }
.xy-page { width: min(100% - 2 * var(--xy-gutter), var(--xy-page)); margin-inline: auto; }

/* ---------- 刊头：品牌行 + 栏目索引，底部一条双线 ---------- */
.xy-mast { background: var(--xy-sheet); border-bottom: 3px double var(--xy-ink); position: relative; z-index: 20; }
.xy-mast-row { display: flex; align-items: center; gap: var(--xy-3); min-height: 54px; }
.xy-logo { display: inline-flex; align-items: center; gap: 9px; color: var(--xy-ink); text-decoration: none; white-space: nowrap; }
.xy-logo svg { width: 24px; height: 24px; color: var(--xy-red); flex: none; }
.xy-logo b { font: 700 19px/1 var(--xy-serif); letter-spacing: .04em; }
.xy-mast-tag { padding-left: var(--xy-3); border-left: 1px solid var(--xy-rule); color: var(--xy-ink-3); font-size: var(--xy-t-micro); letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xy-mast-aux { margin-left: auto; display: inline-flex; align-items: center; gap: var(--xy-4); }
.xy-mast-aux a { display: inline-flex; align-items: center; min-height: 44px; color: var(--xy-ink-2); font-size: var(--xy-t-small); text-decoration: none; white-space: nowrap; }
.xy-mast-aux a:hover { color: var(--xy-ink); text-decoration: underline; text-underline-offset: 4px; }

.xy-sections { display: flex; gap: var(--xy-1) var(--xy-5); overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--xy-rule-soft); margin-inline: calc(-1 * var(--xy-gutter)); padding-inline: var(--xy-gutter);
  -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: 44px; padding: 0 2px; color: var(--xy-ink-2); font-size: 14px; text-decoration: none; white-space: nowrap; }
.xy-sections a:hover { color: var(--xy-ink); }
.xy-sections a[aria-current] { color: var(--xy-ink); font-weight: 650; }
.xy-sections a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--xy-red); }
.xy-sections a:last-child { margin-right: 28px; }
@media (min-width: 900px) {
  .xy-sections { margin-inline: 0; padding-inline: 0; -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .xy-sections a:last-child { margin-right: 0; }
  .xy-logo b { font-size: 21px; }
  .xy-mast-row { min-height: 62px; }
}

/* ---------- 栏目印 + 日期：告诉刚点进来的人"你在哪一栏、这是哪一期" ---------- */
.xy-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--xy-2) var(--xy-3); margin: 0 0 var(--xy-4); font-size: var(--xy-t-small); line-height: 1.3; }
.xy-seal { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 3px 8px 3px; background: var(--xy-red); color: #fff; font-weight: 700; letter-spacing: .12em; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), inset 0 0 0 3px var(--xy-red); }
.xy-kicker time, .xy-kicker .xy-when { color: var(--xy-ink-3); letter-spacing: .06em; font-variant-numeric: tabular-nums; }

/* ---------- 字 ---------- */
.xy-display { margin: 0; font: 700 var(--xy-t-display)/1.14 var(--xy-serif); letter-spacing: -.01em; text-wrap: balance; }
.xy-h1 { margin: 0; font: 700 var(--xy-t-h1)/1.22 var(--xy-serif); letter-spacing: -.005em; text-wrap: balance; }
.xy-h2 { margin: 0; font: 700 var(--xy-t-h2)/1.3 var(--xy-serif); text-wrap: balance; }
.xy-standfirst { margin: 0; color: var(--xy-ink-2); font-size: clamp(17px, .5vw + 15px, 20px); line-height: 1.7; }
.xy-label { margin: 0; color: var(--xy-ink-3); font-size: var(--xy-t-micro); font-weight: 600; letter-spacing: .14em; }
.xy-num { font-family: var(--xy-serif); font-variant-numeric: lining-nums tabular-nums; }

/* ---------- 动作 ---------- */
.xy-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--xy-2); min-height: 46px; padding: 0 var(--xy-5); border: 1px solid var(--xy-ink); border-radius: var(--xy-r-sm); background: var(--xy-ink); color: var(--xy-sheet); font: 600 var(--xy-t-ui)/1.2 var(--xy-sans); text-decoration: none; cursor: pointer; transition: background .18s var(--xy-ease), transform .18s var(--xy-ease); }
.xy-btn:hover { background: #2c261d; }
.xy-btn:active { transform: translateY(1px); }
.xy-btn--ghost { background: transparent; color: var(--xy-ink); }
.xy-btn--ghost:hover { background: var(--xy-sheet); }
.xy-btn[disabled], .xy-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.xy-link { color: var(--xy-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.xy-link:hover { color: var(--xy-red-ink); }
.xy-arrow::after { content: " →"; }

.xy-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--xy-3); border: 1px solid var(--xy-rule); border-radius: 999px; background: var(--xy-sheet); color: var(--xy-ink-2); font-size: 14px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.xy-chip:hover { border-color: var(--xy-ink-3); color: var(--xy-ink); }
.xy-chip[aria-pressed="true"], .xy-chip[aria-current] { background: var(--xy-ink); border-color: var(--xy-ink); color: var(--xy-sheet); }

.xy-card { background: var(--xy-sheet); border: 1px solid var(--xy-rule); border-radius: var(--xy-r); }
.xy-rule { height: 0; margin: 0; border: 0; border-top: 1px solid var(--xy-rule); }
.xy-rule--double { border-top: 3px double var(--xy-ink); }

/* ---------- 本文目录：长文首屏就让人看到"这页讲了哪几件事"，点哪跳哪 ---------- */
.xy-toc { margin: 0; padding: 0; list-style: none; counter-reset: xytoc; border-top: 1px solid var(--xy-ink); }
.xy-toc li { counter-increment: xytoc; border-bottom: 1px solid var(--xy-rule); }
.xy-toc a { display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline; gap: var(--xy-2); min-height: 44px; padding: 10px 0; color: var(--xy-ink); font-size: 16px; line-height: 1.45; text-decoration: none; }
.xy-toc a::before { content: counter(xytoc, decimal-leading-zero); color: var(--xy-red); font: 700 14px/1 var(--xy-serif); font-variant-numeric: lining-nums; }
.xy-toc a:hover { color: var(--xy-red-ink); }

/* ---------- 读的正文 ---------- */
.xy-prose { max-width: var(--xy-measure); font-size: var(--xy-t-body); line-height: 1.85; color: var(--xy-ink); overflow-wrap: break-word; }
.xy-prose > :first-child { margin-top: 0; }
.xy-prose p { margin: 0 0 1.05em; }
.xy-prose h2 { margin: 2.2em 0 .7em; font: 700 var(--xy-t-h2)/1.3 var(--xy-serif); scroll-margin-top: 16px; }
.xy-prose h3 { margin: 1.8em 0 .5em; font: 650 var(--xy-t-h3)/1.4 var(--xy-sans); }
.xy-prose h4 { margin: 1.4em 0 .4em; font: 650 16px/1.45 var(--xy-sans); 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: 700; background: linear-gradient(transparent 62%, rgba(196, 50, 29, .14) 62%); }
.xy-prose a { color: var(--xy-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.xy-prose a:hover { color: var(--xy-red-ink); }
.xy-prose code { padding: 1px 5px; border-radius: 4px; 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: 1px solid var(--xy-rule); border-radius: var(--xy-r-sm); background: var(--xy-sheet-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: 3px solid var(--xy-red); font: 400 19px/1.7 var(--xy-serif); 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); }
.xy-prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.xy-prose th, .xy-prose td { padding: 9px 10px; border-bottom: 1px solid var(--xy-rule-soft); text-align: left; vertical-align: top; }
.xy-prose th { border-bottom: 1px solid var(--xy-ink); font-weight: 650; white-space: nowrap; }

/* ---------- 页脚 ---------- */
.xy-foot { margin-top: var(--xy-9); border-top: 3px double var(--xy-ink); background: var(--xy-sheet); 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: var(--xy-6) 0 var(--xy-7); }
.xy-foot b { color: var(--xy-ink); font: 700 16px/1 var(--xy-serif); letter-spacing: .04em; }
.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; }
.xy-foot nav a:hover { color: var(--xy-ink); text-decoration: underline; text-underline-offset: 4px; }
.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; } }
