/* ============================================================
   WenZi — GitHub Pages Stylesheet
   Purple theme (#6C5CE7) · Responsive · Dark-mode aware
   ============================================================ */

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

:root {
  --purple: #6C5CE7;
  --purple-light: #a29bfe;
  --purple-dark: #5a4bd1;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --text: #2d3436;
  --text-secondary: #636e72;
  --card-bg: #ffffff;
  --card-border: #e0e0e0;
  --code-bg: #f1f2f6;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --max-width: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a2e;
    --bg-alt: #16213e;
    --text: #e0e0e0;
    --text-secondary: #b0b0b0;
    --card-bg: #1f1f38;
    --card-border: #2e2e4a;
    --code-bg: #2a2a40;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

section:nth-child(even) {
  background: var(--bg-alt);
}

/* Reset section styles inside doc pages */
.doc-container section {
  padding: 0;
  background: none;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-size: 1.1rem;
}

/* ---------- Fade-in animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(26, 26, 46, 0.85);
  }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--purple);
  text-decoration: none;
}

.lang-switch {
  font-size: 0.85rem;
  padding: 4px 12px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s;
}

.lang-switch:hover {
  border-color: var(--purple);
  color: var(--purple);
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: 140px;
  padding-bottom: 80px;
  text-align: center;
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero h1 span {
  color: var(--purple);
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
}

.btn-primary:hover {
  background: var(--purple-dark);
  color: #fff;
}

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

.btn-secondary:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.lite-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

.version-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-alt);
  color: var(--text-secondary);
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 16px;
}

/* ---------- Features grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}

.step {
  position: relative;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.step-arrow {
  display: none;
}

/* ---------- Screenshot ---------- */
.screenshot {
  margin-top: 56px;
  text-align: center;
}

.screenshot img {
  max-width: 720px;
  width: 100%;
}

.screenshot-caption {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ---------- ASR comparison table ---------- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.compare-table th,
.compare-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

.compare-table th {
  background: var(--purple);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table tr:hover td {
  background: var(--bg-alt);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--purple-light);
  color: #fff;
}

.badge-yes,
.badge-no {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-yes {
  background: #34c759;
  color: #fff;
}

.badge-no {
  font-weight: 500;
  background: var(--bg-alt);
  color: var(--text-muted);
}

.compare-table td:has(.badge-yes),
.compare-table td:has(.badge-no) {
  text-align: center;
}

.compare-table th:nth-last-child(2) {
  text-align: center;
}

/* ---------- Installation cards ---------- */
.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.install-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.install-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.install-card.install-featured {
  grid-column: 1 / -1;
  border-color: var(--purple-light);
  background: linear-gradient(135deg, var(--card-bg) 60%, color-mix(in srgb, var(--purple) 6%, var(--card-bg)));
}

/* -- Featured inner: two-column layout -- */
.install-featured-inner {
  display: flex;
  gap: 0;
}

.install-featured-left {
  flex: 0 0 40%;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--card-border);
}

.install-featured-right {
  flex: 1;
  padding: 32px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.install-badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--purple);
  background: color-mix(in srgb, var(--purple) 12%, transparent);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.install-featured-left h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.install-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.install-note {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--purple) 6%, var(--bg-alt));
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* -- Edition comparison table -- */
.edition-table-wrapper {
  max-width: 680px;
  margin: 0 auto;
}

.edition-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.edition-table th,
.edition-table td {
  padding: 14px 20px;
  text-align: center;
  font-size: 0.95rem;
}

.edition-table th:first-child,
.edition-table td:first-child {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 500;
}

.edition-table thead th {
  background: var(--purple);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 20px;
}

.edition-table thead th:first-child {
  background: var(--purple);
  color: transparent;
}

.edition-table tbody tr {
  border-bottom: 1px solid var(--card-border);
}

.edition-table tbody tr:last-child {
  border-bottom: none;
}

.edition-table tbody td {
  border-bottom: 1px solid var(--card-border);
}

.edition-table tbody tr:last-child td {
  border-bottom: none;
}

.edition-advantage {
  color: var(--purple);
  font-weight: 600;
}

.edition-download-row td {
  padding: 20px;
  border-bottom: none !important;
}

.edition-btn {
  display: inline-block;
  width: 100%;
  max-width: 180px;
  text-align: center;
  padding: 10px 16px;
}

/* -- Non-featured cards -- */
.install-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.install-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.install-header h3 {
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.install-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.install-body {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* -- Shared steps -- */
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.install-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.install-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.install-card code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
}

pre.code-block {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Documentation cards ---------- */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.doc-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.doc-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.doc-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.doc-card h3 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 6px;
}

.doc-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* ---------- Documentation list ---------- */
.docs-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 48px;
}

.docs-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--purple);
}

.doc-link {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s;
}

.doc-link:last-child {
  border-bottom: none;
}

.doc-link:hover {
  color: var(--purple);
  text-decoration: none;
}

.doc-link span {
  font-weight: 400;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .docs-list {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ---------- Clickable heading anchors ---------- */
.doc-container h2[id],
.doc-container h3[id],
.doc-container h4[id] {
  scroll-margin-top: 80px;
}

.heading-anchor {
  color: inherit;
  text-decoration: none;
}

.heading-anchor:hover {
  color: inherit;
  text-decoration: none;
}

.heading-anchor::after {
  content: " #";
  opacity: 0;
  color: var(--purple-light);
  font-weight: 400;
  transition: opacity 0.2s;
}

.heading-anchor:hover::after {
  opacity: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

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

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero .tagline {
    font-size: 1.05rem;
  }

  section {
    padding: 56px 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .features-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .edition-table th,
  .edition-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .edition-btn {
    max-width: 140px;
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .nav-links .nav-link-text {
    display: none;
  }

  .nav-links {
    gap: 16px;
  }
}

/* ---------- Tooltip ---------- */
.tooltip {
  position: relative;
  cursor: help;
  color: #e6a700;
}
.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.tooltip:hover::after {
  opacity: 1;
}
