/* Shared by every page. Colors, type and sizes come from the skill's tokens.css. */

/* Chinese display serif for official-site titles (--font-display): a subset of Noto Serif SC (SIL OFL 1.1,
   assets/fonts/OFL-noto-serif-sc.txt) holding only the characters the examples use; regenerate it with
   scripts/subset-display-font.py. Latin stays in New York, which comes first in --font-display. */
@font-face { font-family: "Noto Serif SC"; src: url("../assets/fonts/noto-serif-sc-600.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
:root {
  --rule: color-mix(in srgb, var(--ink) 14%, var(--surface));
  --frame: 1320px;
  --masthead: 56px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--masthead) + var(--space-4)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font-sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code, pre { font-family: var(--font-mono); }
h1, h2, h3 { margin: 0; font-family: var(--font-serif); font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
p { margin: 0; }

/* 键盘焦点环：鼠标点击不出现；输入类控件用自己的聚焦样式 */
:focus-visible { outline: var(--stroke-focus) solid var(--focus-ring); outline-offset: var(--focus-offset); }
:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="button"], [type="submit"], [type="reset"]), textarea, select, [contenteditable]):focus-visible { outline: none; }
.skip { position: absolute; left: var(--space-4); top: -100px; z-index: 10; padding: var(--space-2) var(--space-3); background: var(--accent); color: var(--on-accent); border-radius: var(--radius-sm); text-decoration: none; }
.skip:focus { top: var(--space-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* One slim scrollbar everywhere (skill: references/foundations/layout.md, 滚动条). */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { border: calc((var(--scrollbar-size) - var(--scrollbar-thumb-size)) / 2) solid transparent; border-radius: var(--radius-full); background: var(--line-control) padding-box; }
  ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--ink-tertiary); }
  ::-webkit-scrollbar-button { display: none; }
}
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--line-control) transparent; }
}

/* Tooltip for icon-only controls (skill: references/components/tooltip.md); site.js shows and places it. */
.tooltip {
  position: fixed;
  inset: auto;
  z-index: var(--z-tooltip);
  display: flex;
  align-items: center;
  width: max-content;
  max-width: min(var(--tooltip-max-width), 100vw - 2 * var(--space-2));
  min-height: var(--tooltip-height);
  margin: 0;
  padding: var(--space-1) var(--tooltip-padding-x);
  border: 0;
  border-radius: var(--tooltip-radius);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-float);
  font: var(--weight-regular) var(--tooltip-font-size)/var(--type-caption-line) var(--font-sans);
  overflow: visible;
  transition: opacity var(--duration-instant) var(--ease-enter), overlay var(--duration-instant) allow-discrete, display var(--duration-instant) allow-discrete;
}
.tooltip[hidden] { display: none; opacity: 0; transition-timing-function: var(--ease-exit); }
.tooltip[popover]:not(:popover-open) { display: none; opacity: 0; transition-timing-function: var(--ease-exit); }
@starting-style { .tooltip { opacity: 0; } }

/* The page is one sheet of paper with ruled edges, sitting on the canvas. */
.frame { max-width: var(--frame); margin: 0 auto; background: var(--surface); border-inline: 1px solid var(--rule); min-height: 100vh; }

@media (prefers-reduced-transparency: reduce) {
  .masthead { background: var(--surface-raised); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Masthead: the one piece of glass on the page, so content scrolls underneath it. */
.masthead { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--space-6); height: var(--masthead); padding: 0 var(--space-6); border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); }
.wordmark { font-family: var(--font-serif); font-size: 22px; font-weight: var(--weight-semibold); letter-spacing: -0.02em; text-decoration: none; line-height: 1; }
.wordmark span { color: var(--brand); }

/* A product's icon and name: the homepage product menu and the product page header use the same pair. */
.product-symbol { flex: 0 0 20px; width: 20px; height: 20px; fill: currentColor; stroke: none; }
.product-name { min-width: 0; font-size: 0.875rem; line-height: 1.25rem; font-weight: var(--weight-medium); overflow-wrap: anywhere; }
@media (pointer: coarse) {
  .product-name { font-size: 1.0625rem; line-height: 1.4375rem; }
}
.masthead-actions { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 0; margin-left: auto; }
.masthead-action {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--glass-button-size);
  width: var(--glass-button-size);
  height: var(--glass-button-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--ink-secondary);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s var(--ease);
}
/* Keep visible feedback smaller than the hit area, especially on touch screens. */
.masthead-action::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  width: calc(var(--glass-button-size) - 4px);
  height: calc(var(--glass-button-size) - 4px);
  margin: auto;
  border-radius: inherit;
  pointer-events: none;
  transition: background-color 0.12s var(--ease);
}
@media (hover: hover) {
  .masthead-action:hover { color: var(--ink); }
  .masthead-action:hover::before { background: var(--fill-hover); }
}
.masthead-action:active { color: var(--ink); }
.masthead-action:active::before { background: var(--fill-selected); }
.masthead-action svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow { font-family: var(--font-mono); font-size: 12px; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-tertiary); }

/* Colophon */
.colophon { border-top: 1px solid var(--rule); padding: var(--space-10) var(--space-6) var(--space-6); overflow: hidden; }
.colophon-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-secondary); }
.colophon-meta a { text-decoration-color: var(--line-control); text-underline-offset: 3px; }
@media (hover: hover) { .colophon-meta a:hover { text-decoration-color: currentColor; } }

@media (max-width: 760px) {
  .masthead { gap: var(--space-3); padding: 0 var(--space-4); }
  .colophon { padding: var(--space-8) var(--space-4) var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
:where(.site-filing) { padding: var(--space-2) var(--space-4); text-align: center; color: var(--ink-secondary); font: var(--type-caption); }
:where(.site-filing a) { color: inherit; }
