/* ============================================================
   CLAUDE CODE 解密 — Minimal Editorial Design System
   ============================================================ */

:root {
  --ink: #0d0d0d;
  --paper: #faf9f7;
  --accent: #c8382e;
  --accent-muted: #e8ccc9;
  --mid: #6b6b6b;
  --line: #e2e0da;
  --code-bg: #f0ede6;

  --font-serif: 'Lora', 'Georgia', 'Times New Roman', serif;
  --font-sans: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Menlo', monospace;

  --max-w: 828px;
  --gutter: 24px;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.75;
  min-height: 100vh;
}

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Masthead ── */
.masthead {
  border-bottom: 2px solid var(--ink);
  padding: 32px 0 20px;
}

.masthead-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.masthead-series {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.masthead-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mid);
  letter-spacing: 0.05em;
}

/* ── Chapter Nav ── */
.chapter-nav {
  background: var(--paper);
  overflow: hidden;
}

.chapter-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  gap: 0;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chapter-nav-inner::-webkit-scrollbar {
  display: none;
}

.chapter-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--mid);
  flex-shrink: 0;
  scroll-margin-inline: var(--gutter);
  position: relative;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.chapter-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.chapter-link.is-current {
  color: var(--accent);
  font-weight: 600;
  border-color: var(--accent);
}

/* thin vertical dividers between links */
.chapter-link + .chapter-link {
  margin-left: 32px;
}

.chapter-link + .chapter-link::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 2px;
  bottom: 2px;
  width: 0;
  border-left: 1px solid var(--line);
}

/* ── Article header ── */
.article-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}

.article-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 600;
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--ink);
}

.article-subtitle {
  font-size: 18px;
  color: var(--mid);
  line-height: 1.6;
  max-width: 780px;
  margin-bottom: 24px;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mid);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

/* ── Body copy ── */
.article-body {
  padding: 48px 0 64px;
}

.article-body p {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 780px;
}

.article-body p:last-child { margin-bottom: 0; }

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin: 48px 0 16px;
  color: var(--ink);
}

.article-body h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin: 36px 0 12px;
  color: var(--mid);
}

/* ── Pullquote ── */
.pullquote {
  border-left: 3px solid var(--accent);
  margin: 40px 0;
  padding: 4px 0 4px 24px;
}

.pullquote p {
  font-family: var(--font-serif);
  font-size: 20px !important;
  line-height: 1.6 !important;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 0 !important;
}

.pullquote cite {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mid);
  margin-top: 8px;
  font-style: normal;
}

/* ── Blockquote (markdown >) ── */
.article-body blockquote {
  border-left: 3px solid var(--line);
  margin: 32px 0;
  padding: 4px 0 4px 24px;
}

.article-body blockquote p {
  font-size: 16px !important;
  line-height: 1.75 !important;
  color: var(--mid);
}

/* ── Code ── */
pre, code {
  font-family: var(--font-mono);
}

code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px;
  color: var(--ink);
}

pre {
  background: var(--ink);
  color: #e8e6e0;
  padding: 24px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 32px 0;
  font-size: 13px;
  line-height: 1.7;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Callout boxes ── */
.callout {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 24px;
  margin: 32px 0;
}

.callout-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.callout p {
  font-size: 15px !important;
  color: var(--mid);
  margin-bottom: 0 !important;
}

/* ── Rule divider ── */
.rule,
.article-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}

.rule-bold {
  border-top: 2px solid var(--ink);
}

/* ── Payload (ending) ── */
.payload {
  border-top: 2px solid var(--ink);
  margin-top: 64px;
  padding-top: 32px;
}

.payload-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.payload p {
  font-size: 17px !important;
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 0 !important;
}

/* ── Navigation ── */
.nav-series {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 0;
}

.nav-series-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 20px;
  font-weight: 600;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mid);
  min-width: 20px;
}

.nav-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  min-width: 3em;
}

.nav-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.5;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.nav-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-list li.current a {
  font-weight: 600;
  color: var(--accent);
  border-color: var(--accent-muted);
}

/* ── Index page ── */
.index-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}

.index-tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 20px;
}

.index-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
  color: var(--ink);
}

.index-intro {
  font-size: 18px;
  line-height: 1.75;
  color: var(--mid);
  max-width: 780px;
  margin-bottom: 0;
}

.series-list {
  padding: 48px 0;
}

.series-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: none;
}

.series-item:first-child { border-top: 1px solid var(--line); }

.series-item:hover .series-item-title { color: var(--accent); }

.series-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mid);
  padding-top: 4px;
}

.series-item-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 600;
}

.series-item-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.series-item-desc {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.6;
}

/* ── Footer ── */
.footer {
  border-top: 2px solid var(--ink);
  padding: 24px 0;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mid);
}

.footer a { color: var(--mid); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ── Strong / em ── */
strong { font-weight: 700; }
em { font-style: italic; }

/* ── Responsive ── */
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .article-title { font-size: 28px; }
  .index-title { font-size: 30px; }
  .pullquote p { font-size: 18px !important; }
}

/* ── Print ── */
@media print {
  body { background: white; }
  .chapter-nav, .nav-series, .footer { display: none; }
}
