/* AI 自习室 layout mapped to the pinned Aurora semantic roles. */
:root {
  --bg: var(--bgColor-muted);
  --hero: var(--bgColor-accent-muted);
  --ink: var(--fgColor-default);
  --muted: var(--fgColor-muted);
  --line: var(--borderColor-default);
  --surface: var(--bgColor-default);
  --blue: var(--fgColor-accent);
  --blue-hover: var(--fgColor-link);
  --on-blue: var(--fgColor-onEmphasis);
  --paper-tint: var(--control-transparent-bgColor-selected);
  --teal-ink: var(--fgColor-success);
  --teal-edge: var(--borderColor-success-emphasis);
  --stripe: var(--bgColor-inset);
  --focus-green: var(--fgColor-success);
  --sans: var(--ku-family-sans);
  --mono: var(--ku-family-mono);
  --max: var(--ku-measure-wide);
}

body { font-family: var(--gh-font-body, var(--ku-family-sans)); }
:is(h1, h2, h3) { font-family: var(--gh-font-heading, var(--ku-family-sans)); }
body.gh-font-body-noto-sans,
.gh-font-heading-noto-sans :is(h1, h2, h3) { font-family: var(--ku-family-sans); }
:focus-visible { outline-color: var(--focus-outlineColor); }
.site-header { background: var(--surface); }
.meta :is(time, span:last-child), .ghost-content table { font-variant-numeric: tabular-nums; }
.cover { aspect-ratio: var(--ku-cover-ratio-card); object-position: var(--ku-cover-position); }

.article-page {
  --article-toc-width: 175px;
  --article-reading-gap: 42px;
  --article-reading-width: calc(var(--article-toc-width) + var(--article-reading-gap) + var(--measure));
  --article-title: var(--ku-display);
  --article-toc-offset: var(--ku-space-6);
}
.article-page:has(> .ghost-reading > .toc[hidden]) {
  --article-reading-width: var(--measure);
}
.article-page > :is(.article-head, .ghost-reading) {
  max-inline-size: var(--article-reading-width);
  margin-inline: auto;
}
.article-page > .article-head > h1 {
  font: var(--article-title);
  letter-spacing: normal;
}
.ghost-reading .toc nav {
  max-block-size: calc(100dvh - 2 * var(--article-toc-offset));
  overflow-y: auto;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}
@media (width > 760px) {
  .ghost-reading [data-article-toc] {
    position: sticky;
    inset-block-start: var(--article-toc-offset);
  }
}
.article-page .article-cover { aspect-ratio: var(--ku-cover-ratio-article); }
/* Ghost themes the comments itself. Match its iframe document's default color
   scheme so browsers composite the frame over the article background. */
.ghost-comments iframe[title="comments-frame"] { color-scheme: only light; }

.focus {
  --focus-edge: var(--line);
  --focus-panel: var(--surface);
  --focus-accent: var(--blue);
  color: var(--ink);
  border-radius: var(--ku-radius-panel);
}
.focus .hero.ku-aurora-feature { color: var(--ink); }
.focus .hero-copy > p { color: var(--muted); }
.focus .hero-copy::before {
  background: radial-gradient(circle, color-mix(in srgb, var(--blue) 28%, transparent) 1px, transparent 1.2px) 0 0 / 15px 15px;
}
.focus .feature-kicker {
  color: var(--focus-accent);
  background: var(--hero);
  border-color: var(--line);
}
.focus-board { background: var(--surface); }
.focus .ku-button,
.card-dock .ku-button {
  --ku-aurora-edge-surface: var(--surface);
  color: var(--blue);
}
.focus-tabs .ku-button[aria-pressed="true"] {
  --ku-aurora-edge-surface: var(--paper-tint);
  --ku-aurora-edge-muted: var(--teal-edge);
  color: var(--teal-ink);
  box-shadow: inset 0 -2px var(--teal-edge);
}
.card-dock .credit:hover { color: var(--ku-aurora-fgColor-mint); }
.card-dock :focus-visible { outline-color: var(--ku-aurora-fgColor-mint); }
.focus-controls [data-ku-focus-rotation] { font-size: var(--ku-space-3); white-space: nowrap; }
.focus .hero .button { color: var(--blue); }
.aurora-settings { display: flex; justify-content: flex-end; margin-top: var(--ku-space-2); }
.aurora-settings button { min-height: var(--ku-control-touch); }
.head-actions .icon { padding: 0; }


/* The mobile menu and carousel retain their existing touch target sizes. */
@media (max-width: 760px) {
  .focus .hero-image .cover { aspect-ratio: var(--ku-cover-ratio-hero); }
  .article-page {
    --article-reading-width: var(--measure);
    --article-title: var(--ku-heading);
    --article-toc-offset: var(--ku-space-2);
  }
  .article-page:has(> .ghost-reading > .toc:not([hidden])) {
    --article-anchor-margin: calc(var(--ku-control-touch) + var(--article-toc-offset));
  }
  .ghost-reading > .toc {
    position: sticky;
    inset-block-start: var(--article-toc-offset);
    align-self: start;
    z-index: 2;
  }
  .ghost-reading [data-article-toc] > summary {
    inline-size: fit-content;
  }
  .ghost-reading .toc nav {
    position: absolute;
    inset: 100% 0 auto;
    max-block-size: calc(100dvh - var(--ku-control-touch) - 3 * var(--article-toc-offset));
  }
  .article-page .article-cover { aspect-ratio: var(--ku-cover-ratio-article-narrow); }
}
