/* Pure Read 官网 — 重设计版 */

:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e2e8f0;
  --color-card-hover: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 150ms ease;
  --max-width: 896px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-border: #334155;
    --color-card-hover: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.15);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-slogan {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.site-nav a:hover {
  color: var(--color-accent);
  background: var(--color-card-hover);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.site-nav .icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Hero */
.hero {
  padding: 3rem 0 3.5rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-subtitle {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 42rem;
}

.hero-cta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-card-hover);
  border-color: var(--color-text-muted);
}

/* Sections */
.section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--color-border);
}

.section-head {
  margin-bottom: 1.5rem;
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section .section-desc {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Feature cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.card {
  display: block;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

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

.card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.card .card-icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-accent);
}

.card-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.card-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Install steps */
.steps {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.steps .step-num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 50%;
}

.steps .step-text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.steps .step-text code {
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--color-card-hover);
}

/* Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--color-card-hover);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

/* Link cards */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.link-card:hover {
  background: var(--color-card-hover);
  border-color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
}

.link-card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.link-card .icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--color-accent);
}

.link-card span {
  font-weight: 600;
  font-size: 0.9375rem;
}

.link-card small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Misc */
.section h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.section p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.section code {
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--color-card-hover);
}

.section kbd {
  font-size: 0.8125em;
  padding: 0.2em 0.45em;
  border-radius: 4px;
  background: var(--color-card-hover);
  border: 1px solid var(--color-border);
  font-family: inherit;
}

.section a {
  color: var(--color-accent);
  text-decoration: none;
  cursor: pointer;
}

.section a:hover {
  text-decoration: underline;
}

.env-note {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--color-card-hover);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
}

.back-top {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.back-top:hover {
  color: var(--color-accent);
  background: var(--color-card-hover);
}

.back-top .icon {
  width: 1rem;
  height: 1rem;
}

/* Responsive */
@media (max-width: 640px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

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

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

  .link-grid {
    grid-template-columns: 1fr;
  }
}
