/* ══════════════════════════════════════════════
   vike AI 技术站 — Linear Dark Design System
   Based on Linear.app DESIGN.md tokens
   ══════════════════════════════════════════════ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

/* ── Design Tokens ── */
:root {
  /* Colors */
  --primary: #5e6ad2;
  --primary-hover: #828fff;
  --primary-focus: #5e69d1;
  --on-primary: #ffffff;

  --canvas: #010102;
  --surface-1: #0f1011;
  --surface-2: #141516;
  --surface-3: #18191a;
  --surface-4: #191a1b;

  --hairline: #23252a;
  --hairline-strong: #34343a;
  --hairline-tertiary: #3e3e44;

  --ink: #f7f8f8;
  --ink-muted: #d0d6e0;
  --ink-subtle: #8a8f98;
  --ink-tertiary: #62666d;

  --success: #27a644;

  /* Fonts */
  --font-display: 'Inter', 'Noto Sans SC', -apple-system, system-ui, sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-section: 96px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-pill: 9999px;

  /* Layout */
  --max-width: 1120px;
  --content-width: 760px;
  --nav-height: 56px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.05px;
  color: var(--ink-muted);
  background: var(--canvas);
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -1px;
}

h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.1; letter-spacing: -1.8px; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -1px; }
h3 { font-size: clamp(20px, 3vw, 28px); line-height: 1.2; letter-spacing: -0.6px; }
h4 { font-size: 22px; line-height: 1.25; letter-spacing: -0.4px; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: var(--space-lg);
}

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

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
}

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

/* ── Navigation ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.brand span {
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-subtle);
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
}

/* ── Hero ── */
.hero {
  padding: 120px 0 80px;
  border-bottom: 1px solid var(--hairline);
}

.hero .eyebrow {
  color: var(--primary);
}

.hero h1 {
  margin-bottom: var(--space-xl);
  max-width: 720px;
}

.hero-lead {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 600px;
  margin-bottom: var(--space-3xl);
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

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

.btn-secondary {
  background: var(--surface-1);
  color: var(--ink);
  border-color: var(--hairline);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--hairline-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--ink);
}

/* ── Cards ── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all 0.15s ease;
}

.card:hover {
  background: var(--surface-2);
  border-color: var(--hairline-strong);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-subtle);
  margin-bottom: var(--space-md);
}

.card h3 {
  margin-bottom: var(--space-md);
}

.card h3 a {
  color: var(--ink);
  transition: color 0.15s ease;
}

.card h3 a:hover {
  color: var(--primary-hover);
}

.card p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-subtle);
}

/* ── Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

/* ── Section Headers ── */
.section-head {
  margin-bottom: var(--space-3xl);
}

.section-head h2 {
  margin-bottom: var(--space-lg);
}

.section-head p {
  font-size: 16px;
  color: var(--ink-subtle);
  max-width: 560px;
}

.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.text-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  transition: color 0.15s ease;
}

.text-link:hover {
  color: var(--primary-hover);
}

/* ── Article List ── */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.article-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-xl);
  background: var(--surface-1);
  transition: background 0.15s ease;
}

.article-row:hover {
  background: var(--surface-2);
}

.article-row h3 {
  font-size: 16px;
  margin-bottom: var(--space-xs);
}

.article-row h3 a {
  color: var(--ink);
}

.article-row h3 a:hover {
  color: var(--primary-hover);
}

.article-row .card-meta {
  margin-bottom: 0;
}

.article-row p {
  font-size: 14px;
  color: var(--ink-subtle);
  margin-top: var(--space-xs);
}

/* ── Article Page ── */
.article-page {
  padding: 80px 0;
}

.article-header {
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--hairline);
}

.article-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: var(--space-lg);
}

.article-header .card-meta {
  font-size: 13px;
}

.article-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-muted);
}

.article-body h2 {
  font-size: 28px;
  margin: 48px 0 20px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

.article-body h3 {
  font-size: 22px;
  margin: 36px 0 16px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 2px 6px;
  color: var(--ink);
}

.article-body pre {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  overflow-x: auto;
  margin-bottom: 24px;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

.article-body blockquote {
  border-left: 3px solid var(--primary);
  padding: var(--space-lg) var(--space-xl);
  background: var(--surface-1);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-bottom: 16px;
}

.article-body blockquote p {
  color: var(--ink-muted);
  margin-bottom: 0;
}

.article-body strong {
  color: var(--ink);
  font-weight: 600;
}

.article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.article-body a:hover {
  color: var(--primary-hover);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--hairline);
}

.article-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-subtle);
  transition: color 0.15s ease;
}

.article-back:hover {
  color: var(--ink);
}

/* ── Project Cards ── */
.project-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  transition: all 0.15s ease;
}

.project-card:hover {
  background: var(--surface-2);
  border-color: var(--hairline-strong);
}

.project-card h3 {
  font-size: 22px;
  margin-bottom: var(--space-lg);
}

.project-card p {
  color: var(--ink-subtle);
  margin-bottom: var(--space-xl);
}

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

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ink-subtle);
}

.tag-primary {
  background: rgba(94, 106, 210, 0.15);
  border-color: rgba(94, 106, 210, 0.3);
  color: var(--primary-hover);
}

/* ── Tool Cards ── */
.tool-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.tool-card h3 {
  font-size: 18px;
  margin-bottom: 0;
}

.tool-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-subtle);
}

.tool-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-tertiary);
}

.tool-status.is-ready::before {
  background: var(--success);
}

/* ── About Page ── */
.about-section {
  margin-bottom: var(--space-3xl);
}

.about-section h2 {
  font-size: 22px;
  margin-bottom: var(--space-lg);
}

.about-list {
  list-style: none;
  padding: 0;
}

.about-list li {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
  color: var(--ink-muted);
}

.about-list li:last-child {
  border-bottom: none;
}

/* ── Footer ── */
.site-footer {
  padding: var(--space-3xl) 0 var(--space-2xl);
  border-top: 1px solid var(--hairline);
}

.site-footer p {
  font-size: 13px;
  color: var(--ink-subtle);
  line-height: 1.6;
}

.site-footer p:last-child {
  margin-top: var(--space-sm);
  color: var(--ink-tertiary);
}

/* ── 404 Page ── */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 200px);
  text-align: center;
  padding: var(--space-section) 0;
}

.page-404 h1 {
  font-size: 80px;
  letter-spacing: -3px;
  color: var(--primary);
  margin-bottom: var(--space-lg);
}

.page-404 p {
  font-size: 18px;
  color: var(--ink-subtle);
  margin-bottom: var(--space-3xl);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-section: 64px;
    --nav-height: 48px;
  }

  .container {
    padding: 0 var(--space-lg);
  }

  .hero {
    padding: 80px 0 56px;
  }

  h1 { letter-spacing: -1px; }

  .card-grid,
  .card-grid-2 {
    grid-template-columns: 1fr;
  }

  .article-row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .section-head-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .project-card {
    padding: var(--space-xl);
  }

  .article-body h2 {
    font-size: 22px;
  }

  .nav {
    gap: var(--space-lg);
  }

  .nav a {
    font-size: 13px;
  }

  .page-404 h1 {
    font-size: 56px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 28px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
