/* Glimbench shared base styles. Variable and class names are a shared contract. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --fg: #1b1a17;
  --muted: #6b675e;
  --border: #e8e4da;
  --accent: #e8a317;
  --accent-ink: #1b1a17;
  --accent-soft: #fdf1d4;
  --accent-deep: #8a5a00;
  --radius: 14px;
  --maxw: 1120px;
  --shadow: 0 1px 2px rgba(27, 26, 23, .05), 0 8px 24px rgba(27, 26, 23, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
a { color: var(--accent-deep); text-underline-offset: 3px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.stack > * + * { margin-top: var(--stack-gap, 1rem); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; background: var(--fg); color: #fff;
  padding: 8px 14px; border-radius: 8px; z-index: 100; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  border: 1.5px solid var(--fg); background: transparent; color: var(--fg);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); color: var(--fg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 rgba(27,26,23,.9); }
.btn-primary:hover { background: #f1b232; box-shadow: 0 3px 0 rgba(27,26,23,.9); }
.btn-ghost { border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: var(--fg); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; transform: none; box-shadow: none;
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}

/* Header */
.site-header { background: rgba(251,250,247,.92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--fg); text-decoration: none; }
.brand::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe08a, var(--accent) 60%, #c98500);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-header nav a { color: var(--fg); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.site-header nav a:hover { background: var(--accent-soft); }
.site-header nav a[aria-current="page"] { background: var(--accent-soft); font-weight: 700; }
.site-header nav { align-items: center; }

/* Language switcher (EN | 中文) */
.lang-switch { display: inline-flex; margin-left: 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 2px; }
.lang-switch button {
  appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600;
  min-width: 44px; min-height: 36px; padding: 0 10px; border-radius: 999px; cursor: pointer; line-height: 1;
}
.lang-switch button:hover { color: var(--fg); }
.lang-switch button[aria-pressed="true"] { background: var(--fg); color: var(--bg, #fbfaf7); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .lang-switch { margin-left: 0; } }

/* Footer */
.site-footer { margin-top: 80px; border-top: 1px solid var(--border); background: #f4f1e8; padding: 40px 0 32px; color: var(--muted); font-size: .95rem; }
.site-footer .container { display: grid; gap: 20px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: var(--fg); display: inline-block; padding: 6px 0; }
.site-footer .privacy-line { font-weight: 600; color: var(--fg); margin: 0; }
.site-footer small { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .btn:hover { transform: none; }
}
