/* ============================================
   欣阅时光 - Global Styles
   Design: Minimalist tech, dual theme
   Primary: #165DFF | Font: Inter + JetBrains Mono
   ============================================ */

/* --- Seed Tokens (Light Theme - Default) --- */
:root {
  --seed-bg: #F7F8FA;
  --seed-fg: #0D1117;
  --seed-primary: #0958D9;
  --seed-accent: #07407F;
  --seed-surface: #FFFFFF;
  --seed-radius: 4px;

  /* Derived tokens - surfaces */
  --bg: var(--seed-bg);
  --bg-elevated: #FFFFFF;
  --bg-subtle: #EEF0F4;
  --bg-muted: #E1E4EA;
  --bg-code: #F1F3F7;
  --surface: var(--seed-surface);
  --surface-hover: #F5F6F9;

  /* Derived tokens - text */
  --fg: var(--seed-fg);
  --fg-secondary: #3D4351;
  --fg-muted: #6B7280;
  --fg-subtle: #9AA0AB;
  --fg-inverse: #F7F8FA;

  /* Derived tokens - accent */
  --primary: var(--seed-primary);
  --primary-hover: var(--seed-accent);
  --primary-soft: #E3EDFA;
  --primary-softer: #EDF2FB;
  --primary-glow: rgba(9, 88, 217, 0.12);

  /* Derived tokens - border */
  --border: #D8DCE4;
  --border-subtle: #E8EBF0;
  --border-hover: #B8BFC9;
  --border-strong: #C0C5CE;

  /* Semantic colors */
  --success: #10B981;
  --success-soft: #ECFDF5;
  --warning: #F59E0B;
  --warning-soft: #FFFBEB;
  --danger: #EF4444;
  --danger-soft: #FEF2F2;
  --info: #3B82F6;
  --info-soft: #EFF6FF;

  /* Category accents */
  --category-ai: #165DFF;
  --category-cloud: #165DFF;
  --category-ops: #10B981;
  --category-tools: #F59E0B;
  --category-enterprise: #EF4444;

  /* Hero gradient */
  --gradient-hero: linear-gradient(135deg, #0958D9, #07407F);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 3px 10px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.09);
  --shadow-glow: 0 0 24px var(--primary-glow);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radius scale - sharp technical geometry */
  --radius-sm: 2px;
  --radius-md: var(--seed-radius);
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-pill: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
}

/* --- Dark Theme Tokens Overrides --- */
[data-theme="dark"] {
  --seed-bg: #0B0E14;
  --seed-fg: #D4D7DE;
  --seed-surface: #141821;

  --bg: var(--seed-bg);
  --bg-elevated: #11151C;
  --bg-subtle: #1A1F2B;
  --bg-muted: #252B38;
  --bg-code: #0D1117;
  --surface: var(--seed-surface);
  --surface-hover: #1C2230;

  --fg: var(--seed-fg);
  --fg-secondary: #9CA3B0;
  --fg-muted: #6B7385;
  --fg-subtle: #4A5263;
  --fg-inverse: #0B0E14;

  --primary: #3B82F6;
  --primary-hover: #5B9BFA;
  --primary-soft: #14233D;
  --primary-softer: #0F1A2E;
  --primary-glow: rgba(59, 130, 246, 0.15);

  --border: rgba(255,255,255,0.07);
  --border-subtle: rgba(255,255,255,0.035);
  --border-hover: rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.18);

  --success: #34D399;
  --success-soft: #0D2E23;
  --warning: #FBBF24;
  --warning-soft: #2E2510;
  --danger: #F87171;
  --danger-soft: #2E1414;
  --info: #60A5FA;
  --info-soft: #132040;

  /* Hero gradient */
  --gradient-hero: linear-gradient(135deg, #0D1520, #0B0E14);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px var(--primary-glow);
}

/* --- Base Reset & Typography --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg);
}

h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.015em; }
h3 { font-size: 1.375rem; letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; font-weight: 500; }
h6 { font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }

p { max-width: 65ch; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--primary-hover); }

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

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* --- Navigation Bar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 17, 23, 0.85);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-6);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.navbar-brand svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.navbar-nav a {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--fg-secondary);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--fg);
  background: var(--bg-subtle);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  min-width: 180px;
}

.navbar-search:hover {
  border-color: var(--border-hover);
}

.navbar-search input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--fg);
  width: 100%;
}

.navbar-search input::placeholder {
  color: var(--fg-subtle);
}

.navbar-search kbd {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  padding: 1px 5px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  white-space: nowrap;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: var(--fg);
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  color: var(--fg-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--border-hover);
  background: var(--bg-subtle);
}

.theme-toggle svg { width: 18px; height: 18px; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* --- User Avatar / Login Button --- */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.user-menu {
  position: relative;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: 200;
}

.user-dropdown.show { display: block; }

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  color: var(--fg-secondary);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.user-dropdown a:hover {
  background: var(--bg-subtle);
  color: var(--fg);
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-2) 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-secondary);
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--fg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
}

.btn svg { width: 16px; height: 16px; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card-body { padding: var(--space-6); }
.card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
}

/* Article card */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.article-card-thumb .ph-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-soft), var(--bg-subtle));
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-card-thumb .ph-img svg {
  width: 40px;
  height: 40px;
  color: var(--fg-subtle);
  opacity: 0.5;
}

.article-card-content {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin-bottom: var(--space-3);
}

.article-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.article-card-title a {
  color: var(--fg);
}
.article-card-title a:hover {
  color: var(--primary);
}

.article-card-excerpt {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* --- Tags / Pills --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-secondary);
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.tag:hover {
  background: var(--bg-muted);
  color: var(--fg);
}

.tag-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag-primary:hover {
  background: var(--primary);
  color: white;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --- Alert / Callout Boxes --- */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border-left: 3px solid;
  margin: var(--space-5) 0;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.alert-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.alert-title svg { width: 16px; height: 16px; }

.alert-info {
  background: var(--info-soft);
  border-left-color: var(--info);
}
.alert-info .alert-title { color: var(--info); }

.alert-warning {
  background: var(--warning-soft);
  border-left-color: var(--warning);
}
.alert-warning .alert-title { color: var(--warning); }

.alert-success {
  background: var(--success-soft);
  border-left-color: var(--success);
}
.alert-success .alert-title { color: var(--success); }

.alert-danger {
  background: var(--danger-soft);
  border-left-color: var(--danger);
}
.alert-danger .alert-title { color: var(--danger); }

/* --- Code Blocks --- */
pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  overflow-x: auto;
  margin: var(--space-5) 0;
  position: relative;
  font-size: 0.875rem;
  line-height: 1.6;
}

[data-theme="dark"] pre {
  background: #141722;
  border-color: rgba(255,255,255,0.06);
}

pre code {
  display: block;
  color: var(--fg);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  color: var(--primary);
}

pre code {
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: inherit;
}

/* Code block header */
.code-block {
  position: relative;
  margin: var(--space-5) 0;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

.code-block-header + pre {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.code-copy-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.code-copy-btn:hover {
  color: var(--fg);
  background: var(--surface);
  border-color: var(--border-hover);
}

.code-copy-btn svg { width: 12px; height: 12px; }

/* Collapsible code */
.code-collapsible {
  max-height: 300px;
  overflow: hidden;
  position: relative;
}

.code-collapsible.expanded {
  max-height: none;
}

.code-collapse-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-subtle));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--space-2);
}

.code-collapse-btn {
  font-size: 0.75rem;
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--fg-secondary);
  cursor: pointer;
}

/* Prism.js theme overrides for dark mode */
[data-theme="dark"] .token.comment,
[data-theme="dark"] .token.prolog,
[data-theme="dark"] .token.doctype,
[data-theme="dark"] .token.cdata { color: #5C6478; }

[data-theme="dark"] .token.punctuation { color: #8890A4; }
[data-theme="dark"] .token.property,
[data-theme="dark"] .token.tag,
[data-theme="dark"] .token.constant,
[data-theme="dark"] .token.symbol { color: #F87171; }

[data-theme="dark"] .token.boolean,
[data-theme="dark"] .token.number { color: #FBBF24; }

[data-theme="dark"] .token.selector,
[data-theme="dark"] .token.attr-name,
[data-theme="dark"] .token.string,
[data-theme="dark"] .token.char,
[data-theme="dark"] .token.builtin { color: #34D399; }

[data-theme="dark"] .token.operator,
[data-theme="dark"] .token.entity,
[data-theme="dark"] .token.url { color: #60A5FA; }

[data-theme="dark"] .token.atrule,
[data-theme="dark"] .token.attr-value,
[data-theme="dark"] .token.keyword { color: #A78BFA; }

[data-theme="dark"] .token.function,
[data-theme="dark"] .token.class-name { color: #4D8AFF; }

/* --- Table of Contents (TOC Sidebar) --- */
.toc-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: var(--space-4);
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: var(--space-3);
}

.toc-list {
  list-style: none;
  border-left: 1px solid var(--border);
}

.toc-list li {
  position: relative;
}

.toc-list a {
  display: block;
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.45;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: all var(--duration-fast);
}

.toc-list a:hover {
  color: var(--fg-secondary);
}

.toc-list a.active {
  color: var(--primary);
  border-left-color: var(--primary);
}

.toc-list .toc-h3 {
  padding-left: var(--space-8);
  font-size: 0.8125rem;
}

/* --- Forms --- */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--fg-subtle);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.55;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: var(--space-1);
}

/* Password strength bar */
.password-strength {
  height: 4px;
  background: var(--bg-muted);
  border-radius: 2px;
  margin-top: var(--space-2);
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  border-radius: 2px;
  transition: width var(--duration-normal), background var(--duration-normal);
}

.strength-weak { width: 33%; background: var(--danger); }
.strength-medium { width: 66%; background: var(--warning); }
.strength-strong { width: 100%; background: var(--success); }

/* --- Section Layout --- */
.section {
  padding: var(--space-16) 0;
}

.section-header {
  margin-bottom: var(--space-10);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-3);
}

.section-desc {
  font-size: 1rem;
  color: var(--fg-secondary);
  max-width: 600px;
}

/* --- Hero Section --- */
.hero {
  padding: var(--space-20) 0 var(--space-16);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: var(--space-5);
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--fg-secondary);
  line-height: 1.55;
  max-width: 560px;
  margin-bottom: var(--space-8);
}

/* Featured articles carousel */
.hero-carousel {
  display: flex;
  gap: var(--space-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
}

.hero-carousel::-webkit-scrollbar { display: none; }

.hero-card {
  flex: 0 0 calc(50% - var(--space-3));
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.hero-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

/* --- Category Cards --- */
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.category-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border-radius: var(--radius-lg);
  color: var(--primary);
}

.category-icon svg { width: 22px; height: 22px; }

.category-name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.category-desc {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  line-height: 1.5;
}

.category-count {
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

/* --- Footer --- */
.footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.footer-brand {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.55;
  max-width: 280px;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  transition: color var(--duration-fast);
}

.footer-links a:hover { color: var(--fg); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--fg-muted);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.footer-social a:hover {
  color: var(--fg);
  background: var(--bg-subtle);
}

.footer-social svg { width: 18px; height: 18px; }

/* --- Subscribe Section --- */
.subscribe-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  text-align: center;
}

[data-theme="dark"] .subscribe-section {
  background: #161925;
}

.subscribe-title {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.subscribe-desc {
  font-size: 0.9375rem;
  color: var(--fg-secondary);
  margin-bottom: var(--space-6);
}

.subscribe-form {
  display: flex;
  gap: var(--space-3);
  max-width: 440px;
  margin: 0 auto;
}

.subscribe-form input {
  flex: 1;
}

/* --- Column/Series Cards --- */
.column-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--duration-normal) var(--ease-out);
}

.column-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.column-progress {
  width: 100%;
  height: 4px;
  background: var(--bg-muted);
  border-radius: 2px;
  margin-top: var(--space-4);
  overflow: hidden;
}

.column-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width var(--duration-normal) var(--ease-out);
}

/* --- Comparison Tables --- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.comparison-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.comparison-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--fg-secondary);
}

.comparison-table tr:hover td {
  background: var(--surface-hover);
}

/* --- Resource Cards --- */
.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: all var(--duration-normal) var(--ease-out);
}

.resource-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.resource-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  color: var(--fg-muted);
}

.resource-icon svg { width: 20px; height: 20px; }

.resource-info { flex: 1; min-width: 0; }

.resource-name {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.resource-desc {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.45;
  margin-bottom: var(--space-3);
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.75rem;
  color: var(--fg-subtle);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-10);
}

.pagination button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-2);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--fg-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.pagination button:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin-bottom: var(--space-6);
}

.breadcrumb a {
  color: var(--fg-muted);
}
.breadcrumb a:hover { color: var(--primary); }

.breadcrumb-sep {
  color: var(--fg-subtle);
}

/* --- Comment Section --- */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.comment-item {
  display: flex;
  gap: var(--space-4);
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.comment-body { flex: 1; }

.comment-author {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.comment-date {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-left: var(--space-2);
  font-weight: 400;
}

.comment-text {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  line-height: 1.55;
}

.comment-actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.comment-actions button {
  font-size: 0.75rem;
  color: var(--fg-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
}

.comment-actions button:hover { color: var(--primary); }

/* --- Search Page --- */
.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration-fast);
}

.search-box:focus-within {
  border-color: var(--primary);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  color: var(--fg);
}

.search-box input::placeholder { color: var(--fg-subtle); }
.search-box svg { width: 20px; height: 20px; color: var(--fg-muted); }

.search-filters {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-5) 0;
}

.search-result {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}

.search-result-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.search-result-title mark {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0 2px;
  border-radius: 2px;
}

.search-result-excerpt {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  line-height: 1.5;
}

/* --- Admin Panel --- */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: var(--space-6) 0;
  flex-shrink: 0;
}

.admin-sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0 var(--space-3);
}

.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  color: var(--fg-secondary);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.active {
  background: var(--bg-subtle);
  color: var(--fg);
}

.admin-sidebar-nav a.active { color: var(--primary); }

.admin-sidebar-nav svg { width: 18px; height: 18px; }

.admin-main {
  flex: 1;
  padding: var(--space-8);
  overflow-y: auto;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin-top: var(--space-1);
}

/* --- Markdown Editor (Publish) --- */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.editor-toolbar button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--fg-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all var(--duration-fast);
}

.editor-toolbar button:hover {
  background: var(--surface);
  color: var(--fg);
}

.editor-toolbar .separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 var(--space-1);
}

.editor-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  min-height: 400px;
}

.editor-pane-edit {
  border-right: 1px solid var(--border);
}

.editor-pane-edit textarea {
  width: 100%;
  height: 100%;
  min-height: 400px;
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--fg);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
}

.editor-pane-preview {
  padding: var(--space-5);
  overflow-y: auto;
  background: var(--surface);
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--fg-subtle);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-info {
  background: var(--info-soft);
  color: var(--info);
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--fg-muted);
}

/* --- Skeleton Loading --- */
.skeleton {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Lazy Loading --- */
.lazy-img {
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.lazy-img.loaded {
  opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .hero-card { flex: 0 0 80%; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }

  .hero-title { font-size: 2rem; }

  .navbar-nav { display: none; }
  .navbar-search { display: none; }
  .nav-toggle { display: flex; }

  /* Mobile nav drawer */
  .mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 99;
    padding: var(--space-6);
    overflow-y: auto;
  }

  .mobile-nav.open { display: block; }

  .mobile-nav a {
    display: block;
    padding: var(--space-3) 0;
    font-size: 1rem;
    color: var(--fg);
    border-bottom: 1px solid var(--border);
  }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  .hero-card { flex: 0 0 90%; }
  .hero-carousel { gap: var(--space-4); }

  .toc-sidebar {
    display: none;
  }

  .editor-pane {
    grid-template-columns: 1fr;
  }

  .editor-pane-edit { border-right: none; border-bottom: 1px solid var(--border); }

  .admin-sidebar {
    display: none;
  }

  .admin-main { padding: var(--space-4); }

  .section { padding: var(--space-10) 0; }

  .subscribe-form { flex-direction: column; }

  .comparison-table { display: block; overflow-x: auto; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .hero { padding: var(--space-10) 0; }
  .hero-title { font-size: 1.75rem; }
  .hero-card { flex: 0 0 95%; }
}

/* ============================================
   Technical Utilities - 科技风增强
   ============================================ */

/* Mono label - uppercase technical labels */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Mono metadata - technical metadata text */
.mono-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--fg-muted);
  letter-spacing: 0.01em;
}

/* Code chip - inline technical badge */
.code-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--fg-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Status dot - technical status indicator */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
  flex-shrink: 0;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--success);
  opacity: 0.3;
}

.status-dot.warning { background: var(--warning); }
.status-dot.warning::after { border-color: var(--warning); }
.status-dot.danger { background: var(--danger); }
.status-dot.danger::after { border-color: var(--danger); }

/* Tech grid background - subtle grid pattern */
.tech-grid-bg {
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Tech dotted divider */
.tech-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: var(--space-6) 0;
}

/* Terminal style block */
.terminal-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-dot.red { background: #FF5F56; }
.terminal-dot.yellow { background: #FFBD2E; }
.terminal-dot.green { background: #27C93F; }

.terminal-body {
  padding: 12px 16px;
  color: var(--fg-secondary);
  line-height: 1.6;
}

.terminal-body .prompt { color: var(--primary); }
.terminal-body .output { color: var(--fg-muted); }

/* Technical card - sharper edges with top accent line */
.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  border-top: 2px solid var(--primary);
  transition: all var(--duration-normal) var(--ease-out);
}

.tech-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

/* Glowing focus ring for tech feel */
.tech-focus:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}

/* Section number - technical section counter */
.section-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.05em;
}

/* Tag with mono font - more technical pill */
.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--fg-secondary);
  letter-spacing: 0.02em;
  transition: all var(--duration-fast) var(--ease-out);
}

.tech-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-softer);
}

/* Navbar technical accent line */
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.2;
}

/* Hero technical pattern */
.hero-tech-pattern {
  position: relative;
}

.hero-tech-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 20%, var(--primary-glow) 0%, transparent 40%),
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  opacity: 0.5;
  pointer-events: none;
}
