:root {
  --ink: #171512;
  --muted: #6e6962;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #ded9d1;
  --accent: #8f332d;
  --accent-soft: #f5e8e5;
  --gold: #a57a32;
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(143, 51, 45, .55);
}
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav {
  width: min(1180px, calc(100% - 40px));
  min-height: 64px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 5px;
  font-family: SimSun, serif;
}
.nav-links { display: flex; align-items: center; gap: 24px; color: #4f4a44; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 80px; }
.page-title { margin: 0; font-family: SimSun, "Songti SC", serif; font-size: 48px; line-height: 1.16; }
.page-lead { margin: 14px 0 0; color: var(--muted); line-height: 1.8; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 24px; }
.field { min-width: 220px; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.field:focus { border-color: var(--accent); }
.btn {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.btn { transition: transform 160ms ease-out, border-color 160ms ease-out, background-color 160ms ease-out; }
.btn:active { transform: scale(.98); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.status { min-height: 24px; color: var(--muted); line-height: 1.6; }
.footer { padding: 30px 20px 50px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.backtop { position: fixed; right: 24px; bottom: 24px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 160ms ease-out, transform 160ms ease-out; }
.backtop.is-visible { opacity: 1; pointer-events: auto; transform: none; }

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--accent); }
  .btn:hover { border-color: #aaa29a; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .topbar { background: #fbfaf7; }
}

@media (prefers-contrast: more) {
  :root { --muted: #4d4943; --line: #9d968c; }
}

@media (max-width: 720px) {
  .nav { width: min(100% - 28px, 1180px); gap: 12px; }
  .brand { flex: 0 0 auto; }
  .nav-links { min-width: 0; gap: 12px; font-size: 14px; white-space: nowrap; }
  .page-shell { width: min(100% - 28px, 1180px); padding-top: 34px; }
  .page-title { font-size: 38px; }
  .page-lead { overflow-wrap: anywhere; }
  .toolbar { display: grid; grid-template-columns: 1fr; }
  .toolbar > label { min-width: 0; }
  .field, .btn { width: 100%; }
}
