/* Shared website design. Load after page layout styles; never load in /app/. */
:root {
  color-scheme: light;
  --site-bg: #f5f6f2;
  --site-surface: #fff;
  --site-ink: #171b19;
  --site-muted: #626963;
  --site-accent: #c5f566;
  --site-green: #365e2f;
  --site-border: #dfe3db;
  --site-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --site-radius: 16px;
  --site-header-height: 76px;
  /* Scale: radius 16 cards / 10 controls; one type ramp; restrained elevation. */
  --radius-card: 16px; --radius-control: 10px;
  --text-xs: 12px; --text-sm: 14px; --text-body: 15px; --text-lede: 17px; --text-lg: 20px; --text-xl: 26px;
  --text-h2: clamp(28px, 3vw, 36px); --text-h1: clamp(34px, 4vw, 48px); --text-h1-lg: clamp(40px, 4.6vw, 64px); --text-display: clamp(48px, 5.6vw, 76px);
  --shadow-sm: 0 1px 2px rgba(23,27,25,.04);
  --shadow-md: 0 1px 2px rgba(23,27,25,.04), 0 12px 32px -16px rgba(23,27,25,.16);
  /* Compatibility aliases keep existing forms and runtime states on one palette. */
  --bg: var(--site-bg); --raise: var(--site-surface); --sink: #ecefe7;
  --paper: var(--site-bg); --paper-raise: var(--site-surface); --paper-sink: var(--sink);
  --ink: var(--site-ink); --dim: #424b44; --muted: var(--site-muted);
  --ink-950: var(--site-bg); --ink-900: var(--site-surface); --ink-800: var(--sink); --ink-700: #dfe5d8;
  --bone: var(--site-ink); --bone-dim: var(--dim); --bone-mute: var(--site-muted);
  --ink2: var(--dim); --ink3: var(--site-muted);
  --green: var(--site-green); --green-deep: #284524;
  --gold: var(--site-green); --gold-lite: #497640; --gold-deep: var(--green-deep);
  --b: var(--site-green); --b-hov: var(--green-deep); --b-weak: #eaf2df;
  --jade: #30754d; --ember: #a14b29; --ember-deep: #823b20; --red: #b43838;
  --line: var(--site-border); --line-soft: #e8ebe4; --l1: var(--line-soft); --l2: var(--site-border);
  --sans: var(--site-font); --serif: var(--site-font); --display: var(--site-font); --frau: var(--site-font);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2,.7,.3,1);
}

html { scroll-padding-top: calc(var(--site-header-height) + 16px); }
body { margin: 0; background: var(--site-bg); color: var(--site-ink); font-family: var(--site-font); -webkit-font-smoothing: antialiased; }
*, *::before, *::after { box-sizing: border-box; }
button, input, textarea, select { font-family: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, [role="button"], summary { touch-action: manipulation; }
a { text-underline-offset: 4px; }
img, video { max-width: 100%; }
input, textarea, select { accent-color: var(--site-green); }
::selection { background: #dfe3db; color: var(--site-ink); }
:focus-visible { outline: 2px solid var(--site-green); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, .brand { font-family: var(--site-font); }
h1, h2 { letter-spacing: -.045em; text-wrap: balance; }
p { text-wrap: pretty; }
body > .paper, body > .bg, body > .grain { display: none; }
.reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
.kicker, .eyebrow { font-family: var(--site-font); font-style: normal; }
.em { font-family: inherit; font-style: normal; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font-family: var(--site-font); font-size: .875rem; font-weight: 600; line-height: 1.5; letter-spacing: 0; text-decoration: none; cursor: pointer; }
.btn-gold, .btn.pri { background: var(--site-ink); color: #fff; box-shadow: none; }
.btn-gold:hover, .btn.pri:hover { background: #2b332e; color: #fff; box-shadow: none; transform: none; }
.btn-ghost { border: 1px solid var(--site-border); background: var(--site-surface); color: var(--site-ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: #edf1e7; border-color: #bac5b4; color: var(--site-ink); }
.btn:disabled, button:disabled { cursor: not-allowed; }
.seed { animation: none; box-shadow: none; background: var(--site-ink); }
.gate { line-height: 1.8; }
.feed-empty, .empty { line-height: 1.75; }

/* A stable global shell: the same routes stay visible before and after login. */
body > .site-header.nav { position: sticky; top: 0; z-index: 100; width: 100%; background: rgba(245,246,242,.86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--site-border); }
.site-header .site-bar.nav-inner { display: flex; align-items: center; gap: 24px; width: 100%; max-width: 1248px; height: var(--site-header-height); min-height: var(--site-header-height); margin: 0 auto; padding: 0 32px; }
.site-header .site-brand { display: inline-flex; align-items: center; flex-shrink: 0; gap: 10px; margin: 0 auto 0 0; color: var(--site-ink); font: 700 18px/1 var(--site-font); letter-spacing: -.04em; text-decoration: none; white-space: nowrap; }
.site-mark { display: inline-block; width: 30px; height: 30px; background: url("/zero-mark.svg?v=zw6") center / contain no-repeat; }
.site-header .site-links { display: flex; align-items: center; gap: 28px; }
.site-header .site-mobile-discover, .site-header .site-share-short { display: none; }
.site-header .site-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--site-muted); font: 500 14px/1.5 var(--site-font); text-decoration: none; white-space: nowrap; }
.site-header .site-links a:hover, .site-header .site-links a[aria-current="page"] { color: var(--site-ink); }
.site-header .site-links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.site-header .site-share { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 0 16px; min-height: 44px; flex-shrink: 0; border: 1px solid var(--site-ink); border-radius: var(--radius-control); color: #fff; background: var(--site-ink); font: 600 13px/1.4 var(--site-font); text-decoration: none; white-space: nowrap; }
.site-header .site-share:hover { background: #2b332e; }
.site-header #authBtn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 44px; padding: 9px 0; min-height: 44px; border: 0; background: transparent; color: var(--site-ink); box-shadow: none; font: 500 14px/1.4 var(--site-font); text-decoration: none; }
.site-header .zwu-topcluster { margin: 0; gap: 14px; }
.site-header #authSlot:empty { display: none; }
.site-header .zwu-enter { background: transparent; color: var(--site-muted); padding: 8px 0; border-radius: 0; font-size: 12px; }
.site-header .zwu-enter:hover { background: transparent; color: var(--site-ink); }
.site-header .zwu-avbtn { width: 34px; height: 34px; box-shadow: none; background: #e3eadb; color: var(--site-ink); border: 1px solid var(--site-border); }
.site-header .site-menu-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 10px; background: transparent; color: var(--site-ink); border: 1px solid var(--site-border); border-radius: 9px; cursor: pointer; }
.site-menu-toggle svg { width: 18px; height: 18px; }
.site-skip { position: fixed; left: 16px; top: -80px; z-index: 1000; background: var(--site-ink); color: #fff; padding: 10px 18px; border-radius: 8px; text-decoration: none; }
.site-skip:focus { top: 12px; }

/* Account menu is shared with the workbench, so theme changes are website-scoped. */
.site-header .zwu-menu { background: var(--site-surface); color: var(--site-ink); border-color: var(--site-border); border-radius: 14px; box-shadow: 0 16px 48px #171b191a; }
.site-header .zwu-menu a, .site-header .zwu-menu button { color: var(--site-ink); }
.site-header .zwu-menu a:hover, .site-header .zwu-menu button:hover { background: var(--site-bg); }
.site-header .zwu-menu .zwu-danger { color: var(--red); }
.site-header .zwu-menu .zwu-pts { background: var(--site-bg); }
.site-header .zwu-menu progress { accent-color: var(--site-green); }
footer { color: var(--site-muted); border-top-color: var(--site-border); }
footer a { text-decoration: none; }
footer .brand { color: var(--site-ink); font-size: 1rem; }
footer .brand small { font-family: var(--site-font); font-style: normal; }
footer .site-footer-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--site-ink); font: 700 16px/1.4 var(--site-font); letter-spacing: -.035em; }
footer .site-footer-brand .site-mark { width: 24px; height: 24px; flex-shrink: 0; }
footer .foot-grid, footer .foot-cols { gap: 32px; }
footer .foot-cols a { display: flex; align-items: center; min-height: 36px; margin-bottom: 0; }
footer .foot-cols h4 { margin-bottom: 8px; }
.site-redirect { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.site-redirect main { width: min(100%, 460px); padding: 40px; background: var(--site-surface); border: 1px solid var(--site-border); border-radius: 20px; }
.site-redirect h1 { font-size: 28px; margin: 0 0 16px; }
.site-redirect p { color: var(--site-muted); margin: 0 0 24px; line-height: 1.7; }

@media (max-width: 1000px) {
  .site-header .site-bar.nav-inner { gap: 20px; padding: 0 24px; }
  .site-header .site-links { gap: 18px; }
  .site-header .zwu-enter { display: none; }
}
@media (max-width: 760px) {
  :root { --site-header-height: 64px; }
  .site-header .site-bar.nav-inner { gap: 8px; padding: 0 18px; }
  .site-header .site-brand { font-size: 16px; gap: 8px; }
  .site-mark { width: 26px; height: 26px; }
  .site-header .site-mobile-discover { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--site-muted); font-size: 13px; text-decoration: none; flex-shrink: 0; }
  .site-header .site-mobile-discover:hover, .site-header .site-mobile-discover[aria-current] { color: var(--site-ink); }
  .site-header .site-mobile-discover[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
  .site-header .site-share { padding: 9px 12px; font-size: 13px; }
  .site-header .site-share .site-share-label { display: none; }
  .site-header .site-share .site-share-short { display: inline; }
  .site-header .site-menu-toggle { display: inline-flex; order: 4; width: 44px; height: 44px; flex-shrink: 0; }
  .site-header .site-links { display: none; position: absolute; top: var(--site-header-height); left: 0; right: 0; padding: 12px 18px 18px; gap: 4px; max-height: calc(100dvh - var(--site-header-height)); overflow-y: auto; border-bottom: 1px solid var(--site-border); background: var(--site-bg); }
  .site-header.site-menu-open .site-links { display: grid; grid-template-columns: 1fr 1fr; }
  .site-header .site-links a { padding: 13px 14px; border-radius: 8px; font-size: 14px; }
  .site-header .site-links a:hover, .site-header .site-links a[aria-current="page"] { background: #e9ede2; text-decoration: none; }
  .site-header .zwu-topcluster { gap: 0; }
  .site-header .zwu-avbtn { width: 44px; height: 44px; border: 6px solid transparent; background-clip: padding-box; }
  .site-header .zwu-avbtn img { border-radius: 50%; }
  .site-header .zwu-menu { top: 70px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]), textarea, select { font-size: 16px; }
  footer .foot-cols a, footer .foot-links a, footer nav a { min-height: 44px; display: inline-flex; align-items: center; }
  footer .foot-cols a { display: flex; }
  .site-redirect main { padding: 28px; }
}
@media (max-width: 370px) {
  .site-header .site-bar.nav-inner { padding: 0 12px; gap: 4px; }
  .site-header .site-brand { font-size: 14px; }
  .site-header .site-share { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
