:root {
  --ink: #141515;
  --paper: #f3f1ea;
  --surface: #ffffff;
  --muted: #66665e;
  --line: #d7d0bd;
  --accent: #c4962d;
  --accent-dark: #8d6814;
  --teal: #146873;
  --yellow: #f2d27e;
  --danger-bg: #fff0eb;
  --info-bg: #eaf4f3;
  --max: 1160px;
  --reading: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 99; padding: 10px 14px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid #30302c; background: rgba(20,21,21,.97); color: #f7f4eb; backdrop-filter: blur(12px); }
.nav-wrap { max-width: var(--max); min-height: 72px; margin: auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--accent); color: #141515; font-size: 18px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(242,210,126,.45), 0 0 18px rgba(196,150,45,.24); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { position: relative; color: #e8e5da; text-decoration: none; font-size: 14px; font-weight: 700; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -8px; height: 2px; background: var(--accent); transition: right .2s ease; }
.nav-links a:hover { color: var(--yellow); }
.nav-links a:hover::after { right: 0; }
.menu-button { display: none; width: 44px; height: 44px; border: 1px solid #59574f; background: #262724; color: #f7f4eb; border-radius: 4px; cursor: pointer; font-size: 20px; }

.container { width: min(calc(100% - 48px), var(--max)); margin-inline: auto; }
.hero { border-bottom: 1px solid #30302c; overflow: hidden; background: #191a19; color: #f7f4eb; position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .25; pointer-events: none; background-image: linear-gradient(#40413b 1px, transparent 1px), linear-gradient(90deg, #40413b 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 78%); }
.hero .container { position: relative; z-index: 1; }
.hero-grid { min-height: 610px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 72px; padding-block: 70px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; color: var(--accent-dark); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero .eyebrow { color: var(--yellow); }
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: 0; }
h1 { max-width: 760px; font-size: clamp(40px, 6vw, 76px); font-weight: 900; }
h2 { font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: 21px; }
.hero-copy { max-width: 690px; margin: 24px 0 0; color: #d1d0c7; font-size: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #141515; font-weight: 900; text-decoration: none; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.button:hover { transform: translateY(-2px); background: var(--yellow); color: #141515; box-shadow: 0 7px 18px rgba(196,150,45,.2); }
.button.secondary { border-color: #75746b; background: transparent; color: var(--ink); }
.button.secondary:hover { background: var(--ink); color: #f7f4eb; }
.hero .button.secondary { border-color: #8c8c81; color: #f7f4eb; }
.hero .button.secondary:hover { background: #f7f4eb; color: var(--ink); }
.hero-art { position: relative; }
.hero-art::before { content: "SYSTEM / RANDOMNESS / RISK"; position: absolute; inset: -18px 22px 22px -18px; padding: 14px; border: 1px solid var(--accent); border-radius: 6px; z-index: -1; color: var(--accent); font-size: 10px; letter-spacing: .14em; }
.hero-art img { width: 100%; border: 1px solid #6e5a2d; border-radius: 6px; box-shadow: 18px 18px 0 var(--accent); }

.section { padding-block: 84px; }
.section.white { background: var(--surface); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 34px; }
.section-head p { max-width: 520px; margin: 0; color: var(--muted); }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.topic { min-height: 260px; padding: 30px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--surface); text-decoration: none; transition: background .2s ease, transform .2s ease; }
.topic:hover { background: #fff3d0; color: var(--ink); transform: translateY(-3px); }
.topic-num { color: var(--accent-dark); font-size: 13px; font-weight: 900; }
.topic h3 { margin-top: 54px; font-size: 28px; }
.topic p { margin: 14px 0 0; color: var(--muted); }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.article-card { display: flex; min-height: 310px; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; transition: border .2s ease, transform .2s ease; }
.article-card:hover { border-color: var(--accent-dark); transform: translateY(-3px); color: var(--ink); box-shadow: 0 10px 28px rgba(20,21,21,.08); }
.article-card .meta { color: var(--accent-dark); font-size: 13px; font-weight: 800; }
.article-card h3 { margin-top: 30px; }
.article-card p { color: var(--muted); }
.article-card .read { margin-top: auto; font-size: 14px; font-weight: 800; }
.notice { padding: 28px; border-left: 5px solid var(--accent); background: var(--danger-bg); }
.notice.info { border-color: var(--teal); background: var(--info-bg); }
.notice h2, .notice h3 { margin-bottom: 8px; }
.notice p:last-child { margin-bottom: 0; }
.faq { border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); background: var(--surface); }
.faq summary { min-height: 64px; padding: 18px 54px 18px 0; position: relative; display: flex; align-items: center; font-weight: 800; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 8px; font-size: 25px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { max-width: 820px; margin: 0; padding: 0 48px 22px 0; color: var(--muted); }

.article-header { padding-block: 62px 44px; border-bottom: 1px solid var(--line); }
.breadcrumbs { margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; color: #aaa89e; }
.article-header h1 { max-width: 900px; font-size: clamp(34px, 5vw, 62px); }
.dek { max-width: 800px; margin: 22px 0; color: #474740; font-size: 19px; }
.byline { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 14px; }
.article-layout { display: grid; grid-template-columns: minmax(0, var(--reading)) 260px; justify-content: space-between; gap: 64px; padding-block: 54px 90px; }
.prose h2 { margin: 46px 0 18px; padding-top: 8px; font-size: 31px; }
.prose h3 { margin: 32px 0 12px; }
.prose p, .prose li { color: #33332e; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose figure { margin: 34px 0; }
.prose figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }
.prose table { width: 100%; border-collapse: collapse; margin: 26px 0; background: var(--surface); }
.prose th, .prose td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: #eeede6; }
.callout { margin: 28px 0; padding: 22px; border-left: 4px solid var(--teal); background: var(--info-bg); }
.callout.warning { border-color: var(--accent); background: var(--danger-bg); }
.sidebar { align-self: start; position: sticky; top: 100px; }
.sidebar-box { padding: 20px; border-top: 4px solid var(--ink); background: var(--surface); }
.sidebar-box + .sidebar-box { margin-top: 22px; }
.sidebar h2 { font-size: 18px; }
.sidebar ul { margin: 14px 0 0; padding: 0; list-style: none; }
.sidebar li + li { margin-top: 10px; }
.sidebar a { font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; text-decoration: none; }
.related { margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--ink); }
.related ul { padding-left: 20px; }

.listing-header { padding-block: 64px 44px; border-bottom: 1px solid var(--line); }
.listing-header h1 { font-size: clamp(36px, 5vw, 64px); }
.listing-header p { max-width: 720px; color: var(--muted); font-size: 18px; }
.list-stack { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.list-item { display: grid; grid-template-columns: 140px 1fr auto; gap: 24px; align-items: center; padding: 24px; background: var(--surface); text-decoration: none; }
.list-item:hover { background: #fff3d0; color: var(--ink); }
.list-item .type { color: var(--accent-dark); font-size: 13px; font-weight: 800; }
.list-item h2 { font-size: 22px; }
.list-item .arrow { font-size: 24px; }
.policy { max-width: 820px; padding-block: 60px 90px; }
.policy h2 { margin-top: 42px; font-size: 28px; }
.policy h3 { margin-top: 28px; }

.site-footer { padding-block: 52px 28px; border-top: 1px solid var(--accent); background: #171817; color: #efeee8; }
.footer-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 40px; }
.footer-brand { font-size: 22px; font-weight: 900; }
.footer-copy { max-width: 400px; color: #bdbdb5; }
.site-footer h2 { font-size: 15px; }
.site-footer ul { margin: 14px 0 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: 7px; }
.site-footer a { color: #d8d7d0; font-size: 14px; }
.copyright { margin-top: 44px; padding-top: 22px; border-top: 1px solid #3c3c37; color: #aaa9a2; font-size: 13px; }

@media (max-width: 900px) {
  .menu-button { display: grid; place-items: center; }
  .nav-links { display: none; position: absolute; top: 72px; left: 0; right: 0; padding: 16px 24px 24px; flex-direction: column; align-items: stretch; gap: 0; border-bottom: 1px solid #30302c; background: #191a19; }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 48px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
  .hero-grid { min-height: auto; grid-template-columns: 1fr; gap: 54px; padding-block: 52px 74px; }
  .hero-art { max-width: 600px; }
  .topic-grid, .article-grid { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .container { width: min(calc(100% - 32px), var(--max)); }
  .nav-wrap { padding-inline: 16px; }
  .brand { font-size: 15px; }
  h1 { font-size: 42px; }
  .hero-copy { font-size: 17px; }
  .section { padding-block: 60px; }
  .section-head { align-items: start; flex-direction: column; }
  .topic-grid, .article-grid, .footer-grid { grid-template-columns: 1fr; }
  .topic { min-height: 220px; }
  .list-item { grid-template-columns: 1fr auto; gap: 8px 18px; }
  .list-item .type { grid-column: 1 / -1; }
  .article-header { padding-top: 42px; }
  .article-header h1 { font-size: 38px; }
  .article-layout { padding-top: 34px; }
  .prose h2 { font-size: 27px; }
}

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