:root {
  --amber: #f59e0b;
  --amber-deep: #d97706;
  --amber-dark: #b45309;
  --gold: #fbbf24;
  --gold-light: #fde68a;
  --gold-pale: #fef3c7;
  --honey: #92400e;
  --honey-deep: #78350f;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --ink-muted: #78716c;
  --bg: #0c0a09;
  --bg-panel: #1c1917;
  --bg-hex: #292524;
  --hex-border: rgba(251, 191, 36, 0.35);
  --hex-glow: rgba(245, 158, 11, 0.25);
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", serif;
  --hex-w: 280px;
  --hex-h: 320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: #e7e5e4;
  background: var(--bg);
  line-height: 1.82;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

.hex-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(245, 158, 11, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 80%, rgba(251, 191, 36, 0.08) 0%, transparent 50%),
    var(--bg);
  overflow: hidden;
}

.hex-bg::before {
  content: "";
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 0 L56 16 L56 50 L28 66 L0 50 L0 16 Z' fill='none' stroke='%23f59e0b' stroke-width='0.4' opacity='0.08'/%3E%3Cpath d='M28 34 L56 50 L56 84 L28 100 L0 84 L0 50 Z' fill='none' stroke='%23fbbf24' stroke-width='0.4' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  animation: hex-drift 60s linear infinite;
}

@keyframes hex-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(56px, 100px); }
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: var(--gold-light);
  text-shadow: 0 0 12px var(--hex-glow);
}

.container { width: min(1140px, 92vw); margin-inline: auto; }

/* ── Hex cell utility ── */
.hex-cell {
  position: relative;
  background: linear-gradient(145deg, var(--bg-panel) 0%, var(--bg-hex) 100%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  padding: 3.5rem 2.5rem 2.75rem;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.hex-cell::before {
  content: "";
  position: absolute;
  inset: 2px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hex-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 1px solid var(--hex-border);
  pointer-events: none;
}

.hex-cell-inner { position: relative; z-index: 1; }

.hex-cell-gold {
  background: linear-gradient(145deg, #422006 0%, var(--honey-deep) 50%, #1c1917 100%);
}

.hex-cell-amber {
  background: linear-gradient(145deg, #292524 0%, #44403c 100%);
}

/* ── Honeycomb grid ── */
.honeycomb {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  padding: 1.5rem 0 3rem;
}

.honey-row {
  display: flex;
  justify-content: center;
  margin-top: calc(var(--hex-h) * -0.25 + 8px);
}

.honey-row:first-child { margin-top: 0; }

.honey-row.offset { padding-left: calc(var(--hex-w) / 2); }

.honey-item {
  width: var(--hex-w);
  height: var(--hex-h);
  flex-shrink: 0;
}

.honey-item .hex-cell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.honey-item.wide {
  width: calc(var(--hex-w) * 2);
  clip-path: none;
}

.honey-item.wide .hex-cell {
  clip-path: polygon(8% 0%, 92% 0%, 100% 50%, 92% 100%, 8% 100%, 0% 50%);
  padding: 2.5rem 3rem;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(12, 10, 9, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hex-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--gold-light);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.brand img {
  border: 2px solid var(--amber);
  border-radius: 8px;
  box-shadow: 0 0 12px var(--hex-glow);
}

.brand b { color: var(--amber); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--hex-border);
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 0.45rem 0.85rem;
  font-size: 0.92rem;
  color: #d6d3d1;
  border-radius: 4px;
  border: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--gold-light);
  border-color: var(--hex-border);
  background: rgba(245, 158, 11, 0.08);
  text-shadow: none;
}

/* ── Ads bar ── */
.ads-top-bar {
  background: linear-gradient(90deg, #1c1917, #292524, #1c1917);
  border-bottom: 1px solid var(--hex-border);
  padding: 0.65rem 0;
}

#applist { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.applist-title {
  font-size: 0.82rem;
  color: var(--amber);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

#ads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 1;
}

.ads-item figure { margin: 0; text-align: center; }

.ads-item img {
  width: 65px;
  height: 65px;
  border-radius: 12px;
  border: 1px solid var(--hex-border);
  object-fit: cover;
}

.ads-item .caption {
  font-size: 0.68rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Hero hex cluster ── */
.hero-honey {
  padding: 2.5rem 0 1rem;
}

.hero-hex-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-hex-text .hex-cell {
  min-height: 340px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--amber);
  border: 1px solid var(--hex-border);
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--gold-light);
  line-height: 1.35;
}

h1 { font-size: clamp(1.45rem, 3.5vw, 2rem); margin: 0 0 1rem; }

.lead { color: #d6d3d1; margin: 0; font-size: 0.98rem; }

.hero-visual img {
  border-radius: 12px;
  border: 2px solid var(--hex-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--hex-glow);
}

/* ── Partner hex strip ── */
.partner-hex {
  padding: 1rem 0 2rem;
}

.partner-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.partner-row a {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.4rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.05));
  border: 1px solid var(--hex-border);
  clip-path: polygon(8% 0%, 92% 0%, 100% 50%, 92% 100%, 8% 100%, 0% 50%);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 180px;
  justify-content: center;
  text-align: center;
}

.partner-row a:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(251, 191, 36, 0.12));
}

/* ── Anchor pills ── */
.anchor-hex {
  padding: 0.5rem 0 2rem;
  overflow-x: auto;
}

.pill-scroll {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pill-scroll a {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border: 1px solid var(--hex-border);
  background: rgba(28, 25, 23, 0.8);
  clip-path: polygon(6% 0%, 94% 0%, 100% 50%, 94% 100%, 6% 100%, 0% 50%);
  white-space: nowrap;
}

.pill-scroll a:hover { background: rgba(245, 158, 11, 0.12); }

/* ── Content sections ── */
.section-mosaic { padding: 1rem 0 3rem; }

.mosaic-panel {
  margin-bottom: calc(var(--hex-h) * -0.15);
}

.mosaic-panel .hex-cell {
  min-height: auto;
  margin-bottom: 2rem;
}

.prose h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  margin: 0 0 1rem;
  color: var(--gold);
}

.prose p { margin: 0 0 1rem; color: #d6d3d1; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.4rem; color: #d6d3d1; }
.prose li { margin-bottom: 0.4rem; }

.split-hex {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.split-hex.reverse { direction: rtl; }
.split-hex.reverse > * { direction: ltr; }

.split-hex img {
  border-radius: 10px;
  border: 1px solid var(--hex-border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

/* ── Column hex cards ── */
.hex-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.hex-card {
  background: var(--bg-panel);
  border: 1px solid var(--hex-border);
  clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0% 50%);
  padding: 1.5rem 1.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hex-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--hex-glow);
}

.hex-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.85rem;
}

.hex-card h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--amber);
}

.hex-card p {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── FAQ hex ── */
.faq-hex { display: grid; gap: 1rem; margin-top: 1rem; }

.faq-item {
  background: rgba(28, 25, 23, 0.9);
  border: 1px solid var(--hex-border);
  padding: 1.25rem 1.5rem;
  clip-path: polygon(2% 0%, 98% 0%, 100% 50%, 98% 100%, 2% 100%, 0% 50%);
}

.faq-item h3 {
  font-size: 1rem;
  margin: 0 0 0.6rem;
  color: var(--gold);
}

.faq-item p { margin: 0; font-size: 0.92rem; color: #d6d3d1; }

/* ── Subpages ── */
.page-hero { padding: 2rem 0 1rem; }

.page-hero-inner {
  clip-path: polygon(3% 0%, 97% 0%, 100% 50%, 97% 100%, 3% 100%, 0% 50%);
  background: linear-gradient(135deg, #422006, #1c1917);
  border: 1px solid var(--hex-border);
  padding: 2rem 2.5rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a { color: var(--amber); }

.section-stack { padding-bottom: 3rem; }

.section-stack .hex-cell,
.section-stack .mosaic-panel .hex-cell {
  clip-path: polygon(2% 0%, 98% 0%, 100% 50%, 98% 100%, 2% 100%, 0% 50%);
  padding: 2rem 2.25rem;
  margin-bottom: 1.5rem;
}

.related-reading h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  color: var(--gold);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

.related-grid a {
  display: block;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid var(--hex-border);
  clip-path: polygon(4% 0%, 96% 0%, 100% 50%, 96% 100%, 4% 100%, 0% 50%);
}

/* ── Error pages ── */
.error-wrap { padding: 4rem 0; }

.error-block {
  text-align: center;
  clip-path: polygon(5% 0%, 95% 0%, 100% 50%, 95% 100%, 5% 100%, 0% 50%);
  background: linear-gradient(145deg, #422006, #1c1917);
  border: 1px solid var(--hex-border);
  padding: 3rem 2rem;
}

.error-block .code {
  font-size: 4rem;
  font-weight: 700;
  color: var(--amber);
  margin: 0;
  line-height: 1;
  text-shadow: 0 0 30px var(--hex-glow);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--hex-border);
  background: #0a0908;
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-links a { font-size: 0.9rem; color: var(--ink-muted); }
.footer-links a:hover { color: var(--gold); }

.site-footer p {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-hex-wrap,
  .split-hex { grid-template-columns: 1fr; }

  .split-hex.reverse { direction: ltr; }

  .honey-row.offset { padding-left: 0; }

  .honey-item { width: min(var(--hex-w), 88vw); }

  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(12, 10, 9, 0.98);
    border-bottom: 1px solid var(--hex-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
  }

  .site-nav.is-open { max-height: 320px; }

  .site-nav ul {
    flex-direction: column;
    padding: 1rem;
  }

  .site-header { position: relative; }
  .site-header .container { position: relative; }
}

@media (max-width: 520px) {
  :root { --hex-w: 260px; --hex-h: 300px; }

  .hex-cell { padding: 2.5rem 1.75rem 2rem; }

  .partner-row a { min-width: 140px; font-size: 0.82rem; }
}
