:root {
  --ink: #101815;
  --ink-2: #16211d;
  --surface: #1a2721;
  --surface-2: #22302a;
  --line: rgba(243, 239, 230, 0.09);
  --line-strong: rgba(243, 239, 230, 0.18);
  --paper: #f3efe6;
  --text: #e8e4da;
  --text-2: #a9b2ab;
  --text-3: #77837c;
  --seal: #a8362c;
  --seal-soft: rgba(168, 54, 44, 0.14);
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 18px;
  --gap: 8px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-num: "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
  --ease: cubic-bezier(0.32, 0.06, 0.24, 1);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0;
}

img { max-width: 100%; display: block; height: auto; }

a { color: var(--text); text-decoration: none; }

a:hover { color: var(--paper); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 16px; }

ul, ol { margin: 0 0 16px; padding-left: 20px; }

li { margin-bottom: 8px; }

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

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-strong);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--paper);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.topnav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav a {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-2);
  border-radius: var(--radius-s);
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}

.topnav a:hover { color: var(--paper); background: var(--surface); }

.topnav a.is-active { color: var(--paper); background: var(--surface-2); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 1.5px;
  background: currentColor;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 48px;
  padding: 40px 0 64px;
  align-items: start;
}

.index-rail {
  position: sticky;
  top: 92px;
  border-left: 2px solid var(--seal);
  padding-left: 20px;
}

.rail-title {
  font-size: 12px;
  color: var(--text-3);
  margin: 0 0 12px;
  letter-spacing: 0.04em;
}

.rail-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.rail-list li { margin: 0 0 2px; }

.rail-list a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 1px dashed var(--line);
  transition: color 150ms var(--ease);
}

.rail-list a:hover,
.rail-list a.is-active { color: var(--paper); }

.rail-list .count {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.rail-note {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.7;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin: 0;
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: end;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.hero-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--seal);
  border: 1px solid var(--seal);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  color: var(--paper);
  margin-bottom: 20px;
  max-width: 18ch;
}

.hero-lead {
  font-size: 16px;
  color: var(--text-2);
  max-width: 46ch;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: var(--radius-s);
  font-size: 14px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  white-space: nowrap;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}

.btn-primary {
  background: var(--seal);
  border-color: var(--seal);
  color: #fbf7ef;
}

.btn-primary:hover { background: #8f2c24; color: #fbf7ef; }

.btn:hover { border-color: var(--line-strong); }

.hero-figure {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  aspect-ratio: 4 / 3;
}

.hero-figure img { width: 100%; height: 100%; object-fit: cover; }

.hero-figure figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 16px 12px;
  font-size: 12px;
  color: var(--paper);
  background: linear-gradient(to top, rgba(16, 24, 21, 0.86), rgba(16, 24, 21, 0));
}

/* ---------- section ---------- */
.section { padding: 48px 0 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.section-head h2 {
  font-size: 20px;
  color: var(--paper);
}

.section-head .more {
  font-size: 13px;
  color: var(--text-2);
}

/* ---------- checklist table ---------- */
.check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.check-table th,
.check-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.check-table th {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--surface);
}

.check-table td:first-child { color: var(--text); font-weight: 500; width: 30%; }

.check-table td { color: var(--text-2); }

.check-table tr:hover td { background: rgba(243, 239, 230, 0.02); }

.mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--seal);
  margin-right: 10px;
  vertical-align: 1px;
}

/* ---------- media band (2-col) ---------- */
.media-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.media-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 150ms var(--ease);
}

.media-card:hover { border-color: var(--line-strong); }

.media-card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }

.media-body { padding: 20px; }

.media-body h3 {
  font-size: 17px;
  color: var(--paper);
  margin-bottom: 8px;
}

.media-body p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0;
}

/* ---------- narrow card strip ---------- */
.strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 20px;
}

.strip-item {
  padding: 20px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--line);
}

.strip-item h3 {
  font-size: 15.5px;
  margin-bottom: 10px;
  color: var(--paper);
}

.strip-item p { font-size: 13.5px; color: var(--text-2); margin: 0; }

/* ---------- list rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; }

.rows li {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.rows a {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
}

.rows .date {
  font-family: var(--font-num);
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.rows .title { font-size: 15.5px; color: var(--text); }

.rows a:hover .title { color: var(--paper); }

.rows .cat { font-size: 12.5px; color: var(--seal); }

/* ---------- article ---------- */
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.breadcrumb {
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--text-3); }

.breadcrumb a:hover { color: var(--text-2); }

.breadcrumb span { margin: 0 8px; }

.post-head { margin-bottom: 28px; }

.post-head h1 {
  font-size: clamp(24px, 3.2vw, 34px);
  color: var(--paper);
  margin-bottom: 16px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.post-meta .author { color: var(--text-2); }

.post-lead {
  margin-top: 12px;
  font-size: 15px;
}

.post-body figure {
  margin: 28px 0;
}

.post-body figure img {
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  width: 100%;
}

.post-body figcaption {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 8px;
}

.post-body h2 {
  font-size: 21px;
  color: var(--paper);
  margin: 36px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--seal);
}

.post-body h3 {
  font-size: 17px;
  color: var(--text);
  margin: 24px 0 10px;
}

.post-body p {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.85;
}

.post-body p.has-mark { padding-left: 18px; position: relative; }

.post-body p.has-mark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  background: var(--seal);
}

.post-body a { color: var(--paper); border-bottom: 1px solid var(--seal); }

.post-body ul, .post-body ol { color: var(--text-2); font-size: 15.5px; }

.post-body strong { color: var(--text); font-weight: 600; }

.faq { margin: 36px 0 0; }

.faq h2 { margin-top: 0; }

.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.faq-item h3 { margin: 0 0 8px; font-size: 16px; color: var(--paper); }

.faq-item p { margin: 0; font-size: 14.5px; }

.post-foot {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-3);
}

/* ---------- aside ---------- */
.aside-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px;
  background: var(--surface);
  margin-bottom: 20px;
}

.aside-block h2 {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}

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

.related li {
  margin: 0;
  border-bottom: 1px dashed var(--line);
}

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

.related a {
  display: block;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

.related a:hover { color: var(--paper); }

.related .r-meta {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.aside-block p {
  font-size: 13.5px;
  color: var(--text-2);
  margin: 0;
}

.aside-block a.inline { color: var(--paper); border-bottom: 1px solid var(--seal); }

/* ---------- category page ---------- */
.cat-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.cat-head h1 {
  font-size: clamp(24px, 3vw, 32px);
  color: var(--paper);
  margin-bottom: 12px;
}

.cat-head p {
  font-size: 15px;
  color: var(--text-2);
  max-width: 62ch;
  margin: 0;
}

.cat-list { display: grid; gap: 0; }

.cat-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.cat-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
}

.cat-item h2 { font-size: 18px; margin-bottom: 8px; }

.cat-item h2 a { color: var(--paper); }

.cat-item p { font-size: 14px; color: var(--text-2); margin: 0 0 8px; }

.cat-item .c-meta {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- pager ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.pager a {
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 6px 12px;
}

.pager a:hover { border-color: var(--line-strong); color: var(--paper); }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding: 40px 0 28px;
  margin-top: 24px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}

.foot-grid h2 {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 12px;
}

.foot-grid p { font-size: 13px; color: var(--text-2); margin: 0 0 6px; }

.foot-grid a { color: var(--text-2); }

.foot-grid a:hover { color: var(--paper); }

.foot-bottom {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 12.5px;
  color: var(--text-3);
}

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .index-rail { position: static; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .rail-list { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 16px; }
  .rail-list li { margin: 0; }
  .rail-list a { border-bottom: 0; padding: 4px 0; }
  .rail-note { display: none; }
  .article-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-figure { aspect-ratio: 16 / 9; }
  .strip { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .topnav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 68px;
    flex-direction: column;
    align-items: stretch;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 16px;
    gap: 0;
  }
  .topnav.is-open { display: flex; }
  .topnav a { padding: 12px 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 15px; }
  .nav-toggle { display: flex; }
  .topbar-inner { position: relative; }
  .media-band { grid-template-columns: 1fr; }
  .strip { grid-template-columns: 1fr; }
  .check-table th:nth-child(3), .check-table td:nth-child(3) { display: none; }
  .check-table td:first-child { width: 38%; }
  .cat-item { grid-template-columns: 1fr; gap: 12px; }
  .rows a { grid-template-columns: 1fr; gap: 4px; }
  .rows .cat { display: none; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .wrap { padding: 0 16px; }
  .post-body { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
