/* ============================================================
   Pucoding Download Page — style.css
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  --font-display: 'Syne', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body:    'DM Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', monospace;

  --bg:           #F1F3F8;
  --surface:      #FFFFFF;
  --surface-2:    #E9ECF4;
  --border:       rgba(12, 18, 48, 0.08);
  --border-mid:   rgba(12, 18, 48, 0.12);

  --text:         #0D1524;
  --text-2:       #485270;
  --text-muted:   #8A94AE;

  --accent:       #D97706;
  --accent-h:     #B45309;
  --accent-bg:    rgba(217, 119, 6, 0.08);

  --green:        #059669;
  --green-bg:     rgba(5, 150, 105, 0.09);
  --green-border: rgba(5, 150, 105, 0.25);

  --shadow-sm: 0 1px 3px rgba(10,16,44,0.07), 0 0 1px rgba(10,16,44,0.04);
  --shadow-md: 0 4px 20px rgba(10,16,44,0.08), 0 1px 4px rgba(10,16,44,0.04);
  --shadow-lg: 0 12px 48px rgba(10,16,44,0.10), 0 3px 12px rgba(10,16,44,0.05);

  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;

  --nav-h: 58px;
  --container: 1100px;
}

[data-theme="dark"] {
  --bg:           #080B14;
  --surface:      #0E1220;
  --surface-2:    #161C2E;
  --border:       rgba(180, 200, 255, 0.07);
  --border-mid:   rgba(180, 200, 255, 0.12);

  --text:         #DFE6F5;
  --text-2:       #8695B5;
  --text-muted:   #4E5C7A;

  --accent:       #F59E0B;
  --accent-h:     #FBBF24;
  --accent-bg:    rgba(245, 158, 11, 0.10);

  --green:        #34D399;
  --green-bg:     rgba(52, 211, 153, 0.09);
  --green-border: rgba(52, 211, 153, 0.22);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.28);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.32);
  --shadow-lg: 0 16px 56px rgba(0,0,0,0.45);
}

/* ---------- Base ---------- */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s, color 0.2s;
}

/* ---------- Container ---------- */
.container {
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
}

.brand-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.06em;
  color: var(--text);
}
.brand-name em { font-style: normal; color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 4px; }

.nav-link {
  font-size: 13px; font-weight: 500; color: var(--text-2);
  padding: 6px 12px; border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }

.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-mid);
  background: var(--surface);
  color: var(--text-2);
  transition: color 0.15s, background 0.15s;
}
.theme-btn:hover { color: var(--text); background: var(--surface-2); }
.theme-btn .icon { width: 15px; height: 15px; }

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

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 64px;
}

.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 80% 20%, var(--accent-bg), transparent 60%),
    repeating-linear-gradient(var(--border) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 40px);
  opacity: 0.55;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: center;
}

/* Hero left */
.hero-left { display: flex; flex-direction: column; gap: 20px; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 5.5vw, 64px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.05em;
  color: var(--text);
}
.hero-title .accent { color: var(--accent); }

.hero-desc {
  font-size: 15px; line-height: 1.8;
  color: var(--text-2);
}

.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.meta-tag {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: var(--surface);
}

/* OS Banner */
.os-banner {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  font-size: 13px; font-weight: 500; color: var(--green);
  width: fit-content;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.os-banner.visible { opacity: 1; transform: translateY(0); }

.os-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--green); flex-shrink: 0;
  animation: pulse 2s ease infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* Hero Widget */
.hero-widget {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px;
  animation: hero-widget-in 0.6s 0.15s ease both;
}
@keyframes hero-widget-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.hw-os {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.hw-os-icon { width: 20px; height: 20px; color: var(--text-2); flex-shrink: 0; }
.hw-os-name { flex: 1; }
.hw-os-chip {
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
  color: var(--accent); background: var(--accent-bg);
  padding: 2px 8px; border-radius: 999px; letter-spacing: 0.05em;
}

/* Widget chip tabs */
.hw-chips {
  position: relative;
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  padding: 3px; gap: 2px;
}
.hw-chips[hidden] { display: none; }

.hw-chips-slider {
  position: absolute; top: 3px; left: 3px;
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-mid);
  pointer-events: none;
  transition: left 0.22s cubic-bezier(0.34,1.56,0.64,1), width 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

.hw-chip-tab {
  position: relative; z-index: 1;
  flex: 1; padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s;
  text-align: center;
}
.hw-chip-tab[aria-selected="true"] { color: var(--text); }
.hw-chip-tab:hover:not([aria-selected="true"]) { color: var(--text-2); }

.hw-all {
  font-size: 12px; color: var(--text-muted);
  text-align: center;
  transition: color 0.15s;
}
.hw-all:hover { color: var(--accent); }

.hw-divider { height: 1px; background: var(--border); }

.hw-info { display: flex; flex-direction: column; gap: 10px; }

.hw-info-row {
  display: flex; justify-content: space-between; align-items: center;
}
.hw-info-row dt { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.hw-info-row dd { font-size: 12px; font-weight: 600; color: var(--text-2); list-style: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px; height: 42px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-block { width: 100%; height: 46px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-primary:hover {
  background: var(--accent-h);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 38%, transparent);
}

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

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 64px 0; }
.section-alt { background: color-mix(in srgb, var(--surface) 50%, transparent); }

.section-header { margin-bottom: 32px; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 800; letter-spacing: -0.05em;
  color: var(--text); margin-bottom: 8px;
}

.section-sub { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ============================================================
   DOWNLOAD CARDS
   ============================================================ */
.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 22px;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); }

.card-coming-soon { opacity: 0.85; }

.card-head { display: flex; flex-direction: column; gap: 8px; }

.card-kicker-row { display: flex; align-items: center; gap: 10px; }

.card-kicker {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}

.soon-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  padding: 2px 8px; border-radius: 999px;
}

.card-title-text {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800; letter-spacing: -0.04em;
  color: var(--text);
}

.card-desc-text { font-size: 13px; line-height: 1.7; color: var(--text-2); }

/* Platform blocks */
.platform-block { display: flex; flex-direction: column; gap: 12px; }

.platform-row { display: flex; align-items: center; gap: 8px; }

.platform-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text);
  flex: 1;
}

.picon { width: 16px; height: 16px; color: var(--text-2); flex-shrink: 0; }

.recommend-badge {
  font-size: 11px; font-weight: 700;
  color: var(--green); background: var(--green-bg);
  border: 1px solid var(--green-border);
  padding: 2px 8px; border-radius: 999px;
}
.recommend-badge[hidden] { display: none; }

/* Chip Tabs */
.chip-tabs {
  position: relative;
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  padding: 3px; gap: 2px;
  width: fit-content;
}

.chip-slider {
  position: absolute; top: 3px; left: 3px;
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  transition: left 0.22s cubic-bezier(0.34,1.56,0.64,1), width 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

.chip-tab {
  position: relative; z-index: 1;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  transition: color 0.15s; white-space: nowrap;
}
.chip-tab[aria-selected="true"] { color: var(--text); }
.chip-tab:hover:not([aria-selected="true"]) { color: var(--text-2); }

.btn-dl { font-size: 13px; }

.alt-hint { font-size: 12px; color: var(--text-muted); margin-top: -4px; }
.alt-hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.platform-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Feature list */
.feature-list {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.feature-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
}
.feature-list li::before {
  content: "";
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent); flex-shrink: 0;
}

/* 文件不存在时的禁用态 */
.btn-unavailable {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.5);
}
.card-body-cli { display: flex; flex-direction: column; gap: 14px; }

/* Install command row */
.cli-cmd-row {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.cli-cmd-block { flex: 1; padding: 10px 14px; overflow: hidden; }
.cli-cmd-text {
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}

.btn-copy-cmd {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px;
  height: 100%;
  min-height: 42px;
  border-left: 1px solid var(--border-mid);
  background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.btn-copy-cmd svg { width: 13px; height: 13px; }
.btn-copy-cmd:hover { color: var(--accent); background: var(--accent-bg); }

/* Usage steps */
.cli-usage {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.cli-usage-title {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  margin-bottom: 10px; letter-spacing: 0.02em;
}
.cli-steps {
  list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: step;
}
.cli-steps li {
  display: flex; gap: 10px;
  font-size: 13px; line-height: 1.65; color: var(--text-2);
  counter-increment: step;
  align-items: flex-start;
}
/* 让 li 内的 span 本身也 flex，kbd 和文字在同一行对齐 */
.cli-steps li > span,
.cli-steps li > * { display: inline; }
.cli-steps li::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
  margin-top: 1px;
}
.cli-steps code {
  font-family: var(--font-mono); font-size: 12px;
  background: color-mix(in srgb, var(--border-mid) 60%, transparent);
  padding: 1px 5px; border-radius: 4px; color: var(--text);
}
.cli-steps kbd {
  display: inline-flex; align-items: center; justify-content: center;
  height: 20px; padding: 0 6px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  border-radius: 5px;
  border: 1px solid var(--border-mid);
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 0 var(--border-mid);
  vertical-align: middle;
  flex-shrink: 0;
}

/* npm link */
.btn-npm-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: color 0.15s;
}
.btn-npm-link svg { width: 12px; height: 12px; }
.btn-npm-link:hover { color: var(--accent); }

.terminal {
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.terminal-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tbar-dot { width: 11px; height: 11px; border-radius: 999px; flex-shrink: 0; }
.tbar-dot.red    { background: #FF5F57; }
.tbar-dot.yellow { background: #FFBE2E; }
.tbar-dot.green  { background: #27C840; }
.tbar-title { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

.terminal-body {
  padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.9;
  display: flex; flex-direction: column; gap: 2px;
}
.tline { display: flex; align-items: baseline; gap: 8px; }
.tprompt { color: var(--accent); font-weight: 500; user-select: none; }
.tcmd { color: var(--text); }
.toutput { color: var(--text-muted); }
.tcursor { color: var(--accent); animation: blink 1.2s step-start infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.coming-soon-notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  font-size: 13px; line-height: 1.6; color: var(--text-2);
}
.coming-soon-notice svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--text-muted); }

/* ============================================================
   STEPS
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.step-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.step-no {
  font-family: var(--font-display);
  font-size: 38px; font-weight: 800; letter-spacing: -0.06em;
  color: color-mix(in srgb, var(--accent) 20%, transparent);
  line-height: 1; margin-bottom: 14px;
}

.step-card h3 {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); margin-bottom: 8px;
}

.step-card p { font-size: 13px; line-height: 1.75; color: var(--text-2); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.faq-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.faq-card h3 {
  font-size: 14px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 10px;
}

.faq-card p {
  font-size: 13px; line-height: 1.75; color: var(--text-2);
}

.faq-card code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px;
}

/* Inline command */
.inline-cmd {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
}
.inline-cmd code {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--text); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: none; padding: 0;
}

.mini-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 6px; color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.mini-copy-btn svg { width: 13px; height: 13px; }
.mini-copy-btn:hover { color: var(--accent); background: var(--accent-bg); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
}

.footer-links { display: flex; gap: 16px; }
.footer-links a {
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }

.footer-copy { margin-left: auto; font-size: 12px; color: var(--text-muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-grid       { grid-template-columns: 1fr; }
  .hero-widget     { max-width: 440px; }
  .download-grid   { grid-template-columns: 1fr; }
  .steps-grid      { grid-template-columns: 1fr; }
  .faq-grid        { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero { padding: 48px 0 40px; }
  .section { padding: 48px 0; }
  .hero-title { font-size: 40px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-copy  { margin-left: 0; }
  .container { width: min(calc(100% - 24px), var(--container)); }
}
