:root {
  --y-mist: #e8f1eb;
  --y-forest: #125847;
  --y-lime: #a6d633;
  --y-ink: #182a22;
  --y-panel: #fff;
  --y-edge: #b9cfc2;
}

:root:not(.dark):has(body.y-public) {
  background: var(--y-mist);
}

:root:not(.dark) body.y-public {
  --background: var(--y-mist);
  --foreground: var(--y-ink);
  --primary: var(--y-forest);
  --primary-foreground: #fff;
  --ring: var(--y-forest);
  --accent: #d5e7dc;
  --accent-foreground: var(--y-ink);
}

.dark body.y-public {
  --primary: #a7dcc0;
  --primary-foreground: #14291e;
  --ring: #a7dcc0;
  --accent: #274436;
  --accent-foreground: #effaf2;
}

:root:not(.dark) body.y-console {
  --background: #f5f6f7;
  --foreground: #1c2227;
  --card: #fff;
  --muted: #edf0f2;
  --border: #d9dfe2;
  --success: #087647;
  --warning: #8a5400;
  --destructive: #b4232b;
}

.dark body.y-console {
  --background: #1b1d21;
  --card: #24272c;
  --muted: #2d3036;
  --border: #41464d;
  --success: #70d6a0;
  --warning: #ffd080;
  --destructive: #ff8990;
}

html:has(body > header .word) {
  background: var(--y-mist);
  color: var(--y-ink);
}

body > header .button, main.reading .button {
  background: var(--y-forest);
}

/* Keep Latin and Chinese typography consistent across the public app and static pages. */
:root {
  --y-font: Inter, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

html body,
html body button,
html body input,
html body textarea,
html body select {
  font-family: var(--y-font);
}

html .reading h1,
html .reading h2,
html .prose:has(img[alt*="鹿鸣云团"]) > h1,
html .prose:has(img[alt*="鹿鸣云团"]) > h2,
html .prose:has(img[alt*="鹿鸣云团"]) > p:last-child,
html .prose:has(img[alt*="鹿鸣云团"]) > h2:first-of-type + p > strong {
  font-family: var(--y-font);
}

html .reading h1,
html .prose:has(img[alt*="鹿鸣云团"]) > h1 {
  margin: 0 0 .45em;
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.2;
}

html .reading h2 {
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 650;
  line-height: 1.4;
}

html .reading p,
html .prose:has(img[alt*="鹿鸣云团"]) > p {
  font-size: 1rem;
  line-height: 1.8;
}

.y-public .y-actions a:first-child,
body > header .button,
main.reading .button {
  box-shadow: inset 0 -2px var(--y-lime);
}

.y-initial-content {
  max-width: 55rem;
  margin: 4rem auto;
  padding: 1.5rem;
}

.y-initial-content h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
.y-initial-content a { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  body.y-public .landing-animate-fade-up { animation: none !important; opacity: 1 !important; transform: none !important; }
}

#root:not(:empty) + .y-initial-content { display: none; }
