:root {
  color-scheme: light;
  --background: #fef9fb;
  --surface: #fff;
  --surface-soft: #fdf6f9;
  --foreground: #322b36;
  --muted: #6a6576;
  --primary: #a34570;
  --primary-soft: #faebf2;
  --border: #dbced9;
  --ring: #a34570;
  --page-width: 1376px;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--background); color: var(--foreground); font-size: 15px; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 78px; display: flex; align-items: center; gap: 38px; padding: 0 clamp(18px, 5vw, 56px); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand-icon { width: 39px; height: 42px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 22px; font-weight: 700; }
.brand-name { font-size: 16px; letter-spacing: .04em; color: var(--foreground); }
.primary-nav { align-self: stretch; display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); margin-left: 4px; color: var(--muted); }
.primary-nav a { position: relative; display: flex; align-items: center; height: 100%; white-space: nowrap; font-size: 13px; }
.primary-nav a:hover, .primary-nav .nav-active { color: var(--primary); }
.primary-nav .nav-active { font-weight: 600; }
.primary-nav .nav-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--primary); }
.top-tag { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.page-content { width: min(100% - 48px, var(--page-width)); flex: 1; margin: 0 auto; padding: 32px 0 64px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px clamp(18px, 5vw, 56px); border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .topbar { min-height: 70px; gap: 18px; padding-inline: 18px; }
  .brand { gap: 8px; }
  .brand-icon { width: 34px; height: 38px; font-size: 20px; }
  .brand-name { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .primary-nav { gap: 16px; margin-left: auto; overflow-x: auto; }
  .primary-nav a { font-size: 12px; }
  .top-tag { display: none; }
  .page-content { width: min(100% - 36px, var(--page-width)); padding-top: 24px; }
  .site-footer { flex-direction: column; gap: 5px; padding: 18px; }
}

@media (max-width: 430px) {
  .topbar { gap: 10px; padding-inline: 12px; }
  .brand-name { max-width: 26vw; font-size: 12px; }
  .primary-nav { gap: 12px; }
  .primary-nav a { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
