/* ==========================================================================
   五格 · 基础样式
   颜色、字体、通用组件都集中在这里
   ========================================================================== */

:root {
  --paper: #f4f1e9;
  --paper-deep: #ebe6da;
  --card: #fffdf8;
  --card-soft: #faf7ef;
  --ink: #171713;
  --ink-soft: #39372f;
  --muted: #7c776b;
  --muted-light: #a09a8d;
  --line: #ded8c9;
  --line-soft: #e9e4d8;
  --white: #ffffff;

  --amber: #c96a08;
  --amber-soft: #f8e3bf;
  --amber-bg: #fff7e8;
  --blue: #1e50c8;
  --blue-soft: #dbe5fb;
  --blue-bg: #f1f5fd;
  --green: #22743e;
  --green-soft: #d7ebdb;
  --green-bg: #f0f8f1;
  --violet: #6733b8;
  --violet-soft: #e7def8;
  --violet-bg: #f5f1fc;
  --rose: #b5264b;
  --rose-soft: #f6dce3;
  --rose-bg: #fdf2f5;

  --danger: #b42318;
  --danger-soft: #fee4e2;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;

  --shadow-sm: 0 2px 8px rgba(23, 23, 19, 0.04);
  --shadow-md: 0 14px 38px rgba(23, 23, 19, 0.07);
  --shadow-lg: 0 32px 80px rgba(23, 23, 19, 0.12);

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", Georgia,
    serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono",
    monospace;

  --ease: cubic-bezier(0.22, 0.72, 0.24, 1);
  --header-h: 74px;
}

[data-accent="amber"] {
  --accent: var(--amber);
  --accent-soft: var(--amber-soft);
  --accent-bg: var(--amber-bg);
}
[data-accent="blue"] {
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
  --accent-bg: var(--blue-bg);
}
[data-accent="green"] {
  --accent: var(--green);
  --accent-soft: var(--green-soft);
  --accent-bg: var(--green-bg);
}
[data-accent="violet"] {
  --accent: var(--violet);
  --accent-soft: var(--violet-soft);
  --accent-bg: var(--violet-bg);
}
[data-accent="rose"] {
  --accent: var(--rose);
  --accent-soft: var(--rose-soft);
  --accent-bg: var(--rose-bg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(rgba(23, 23, 19, 0.1) 0.55px, transparent 0.55px);
  background-size: 5px 5px;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

h1,
h2,
h3,
h4,
p,
figure,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--accent, var(--ink));
  outline-offset: 3px;
}

.container {
  width: min(1200px, calc(100% - 80px));
  margin-inline: auto;
}

.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;
}

/* ---------- 品牌 ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  width: 30px;
  height: 30px;
}

.brand-mark i {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: var(--ink);
}

.brand-mark i:nth-child(1),
.brand-mark i:nth-child(5) {
  height: 11px;
}
.brand-mark i:nth-child(2),
.brand-mark i:nth-child(4) {
  height: 19px;
}
.brand-mark i:nth-child(3) {
  height: 27px;
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand-en {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.brand--light .brand-mark i {
  background: var(--paper);
}
.brand--light .brand-name {
  color: var(--paper);
}
.brand--light .brand-en {
  color: rgba(244, 241, 233, 0.48);
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(222, 216, 201, 0.72);
  background: rgba(244, 241, 233, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: var(--header-h);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
}

.site-nav a {
  position: relative;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transition: right 0.3s var(--ease);
}

.site-nav a:hover::after {
  right: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.btn:active {
  transform: scale(0.985);
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: #2a2a24;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 23, 19, 0.18);
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink);
  background: var(--card);
}

.btn--accent {
  background: var(--accent, var(--ink));
  color: var(--white);
}

.btn--accent:hover {
  filter: brightness(0.94);
  transform: translateY(-1px);
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
  box-shadow: none !important;
}

.btn .arrow {
  transition: transform 0.25s var(--ease);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.link-arrow:hover {
  border-color: currentColor;
}

/* ---------- 通用图标 ---------- */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

.icon--lg {
  width: 30px;
  height: 30px;
}

/* ---------- 小标签 ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, var(--ink));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, var(--ink)) 12%, transparent);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-note {
  font-size: 12px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 12px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- 动画 ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fade-up {
  animation: fadeUp 0.7s var(--ease) both;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .container {
    width: min(1200px, calc(100% - 40px));
  }

  .site-nav {
    display: none;
  }
}

@media (max-width: 600px) {
  :root {
    --header-h: 64px;
  }

  .container {
    width: min(1200px, calc(100% - 32px));
  }

  .brand-name {
    font-size: 20px;
  }

  .header-actions .btn {
    min-height: 40px;
    padding: 0 16px;
    font-size: 12.5px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
}

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