:root {
  --bg: #fbfaf7;
  --bg-soft: #f3f1ec;
  --fg: #16171a;
  --fg-soft: #5d6068;
  --line: #e2ded5;
  --accent: #e8502a;
  --accent-soft: rgba(232, 80, 42, 0.1);
  --card: #ffffff;
  --radius: 14px;
  --max: 860px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-title: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC",
    "SimSun", serif;
}

[data-theme="dark"] {
  --bg: #0d0e10;
  --bg-soft: #14161a;
  --fg: #eceae4;
  --fg-soft: #9b9fa8;
  --line: #262a31;
  --accent: #ff6a44;
  --accent-soft: rgba(255, 106, 68, 0.12);
  --card: #121419;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.brand {
  font-family: var(--font-title);
  font-size: 19px;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.brand .dot {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14.5px;
}

.nav a {
  color: var(--fg-soft);
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--fg);
}

.nav a[aria-current="page"] {
  position: relative;
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-soft);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg-soft);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- hero ---------- */
.hero {
  padding: 96px 0 72px;
}

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--font-title);
  font-size: clamp(40px, 8vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  font-weight: 600;
}

.hero p.lead {
  font-size: 18px;
  color: var(--fg-soft);
  max-width: 560px;
  margin: 0 0 34px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  border: 1px solid var(--line);
  color: var(--fg);
  transition: transform 0.15s ease, border-color 0.15s ease,
    background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--fg-soft);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--accent);
  filter: brightness(1.05);
}

.hero-note {
  margin: 26px 0 0;
  font-size: 13.5px;
  color: var(--fg-soft);
  border-left: 2px solid var(--line);
  padding-left: 12px;
}

/* ---------- cards ---------- */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding-bottom: 40px;
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.35);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--fg-soft);
}

.card .more {
  display: inline-block;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--accent);
}

/* ---------- sections / pages ---------- */
.page {
  padding: 72px 0 24px;
}

.page h1 {
  font-family: var(--font-title);
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.15;
  margin: 0 0 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page .sub {
  color: var(--fg-soft);
  margin: 0 0 44px;
  font-size: 16.5px;
}

section.block {
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
}

section.block:first-of-type {
  border-top: 0;
}

h2.section-title {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin: 0 0 20px;
  font-weight: 600;
}

p {
  margin: 0 0 16px;
}

ul.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.plain li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: baseline;
}

ul.plain li:last-child {
  border-bottom: 0;
}

ul.plain .meta {
  color: var(--fg-soft);
  font-size: 13.5px;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg-soft);
  margin-left: 8px;
  vertical-align: 1px;
}

.tag.live {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft);
}

/* ---------- links page ---------- */
.link-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.link-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.link-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.link-card span {
  font-size: 13px;
  color: var(--fg-soft);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--fg-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.site-footer a {
  color: var(--fg-soft);
  border-bottom: 1px solid transparent;
}

.site-footer a:hover {
  color: var(--fg);
  border-color: var(--line);
}

/* ---------- 404 ---------- */
.center-page {
  min-height: 62vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 60px 0;
}

.center-page .code {
  font-family: var(--font-title);
  font-size: clamp(72px, 18vw, 140px);
  line-height: 1;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .hero {
    padding: 64px 0 48px;
  }
  .nav {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 16px;
    display: none;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 10px 0;
    width: 100%;
  }
  .nav a[aria-current="page"]::after {
    display: none;
  }
  .nav-toggle {
    display: inline-block;
  }
  .nav .theme-toggle {
    margin-top: 10px;
  }
}
