/* ==========================================================================
   Spotube 中文网 — 独立设计系统
   音乐流媒体气质 · 青绿主色 · 声波律动母题
   与站群其他站点（如 ppsspp）设计完全独立，不共用模板
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  /* 品牌色：青绿（Spotube 官方为绿色系，此处独立调色） */
  --brand: #00b894;
  --brand-strong: #007057;
  --brand-soft: #e6f7f1;
  --cta-start: #007057;
  --cta-end: #008066;
  --accent: #00d9a5;
  --accent-2: #48c78e;

  /* 中性色 */
  --ink: #16211d;
  --ink-soft: #5b6b64;
  --ink-faint: #647269;

  /* 浅色主题表面 */
  --bg: #f6faf8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-muted: #eef5f1;
  --border: #e2ece7;
  --border-strong: #c9dcd3;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(20, 45, 36, 0.06), 0 1px 2px rgba(20, 45, 36, 0.04);
  --shadow-md: 0 6px 24px rgba(20, 45, 36, 0.08);
  --shadow-lg: 0 18px 48px rgba(20, 45, 36, 0.14);

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  /* 字体 */
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;

  /* 布局 */
  --maxw: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* 深色主题 */
html[data-theme="dark"] {
  --ink: #e9f4ee;
  --ink-soft: #a8bdb2;
  --ink-faint: #7e9789;

  --bg: #0b1412;
  --bg-elev: #0f1b17;
  --surface: #13201b;
  --surface-muted: #0e1a16;
  --border: #20352c;
  --border-strong: #2c463a;

  --brand-strong: #00c9a0;
  --brand-soft: #0e2b22;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.6);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(72px + env(safe-area-inset-top)); }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; height: auto; display: block; }

code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "JetBrains Mono", monospace;
  font-size: 0.9em;
  color: var(--brand-strong);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 { line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.5em; color: var(--ink); overflow-wrap: anywhere; }

h1 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
  /* 刘海屏安全区（配合 viewport-fit=cover） */
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.nav { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent-2)); box-shadow: var(--shadow-sm); flex: none; }
.brand .logo svg { width: 20px; height: 20px; }

.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a {
  color: var(--ink-soft); font-weight: 600; font-size: 0.95rem;
  padding: 7px 13px; border-radius: 999px; transition: all 0.18s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-muted); text-decoration: none; }
.nav-links a.active { color: var(--brand-strong); background: var(--brand-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 999px; width: 44px; height: 44px; cursor: pointer;
  font-size: 1.05rem; line-height: 1; transition: all 0.18s ease;
}
.theme-toggle:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.nav-toggle {
  display: none; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 10px; width: 44px; height: 44px; cursor: pointer; font-size: 1.1rem;
}

/* ---------- 主按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  border: none; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--cta-start), var(--cta-end)); color: #fff; box-shadow: 0 8px 22px rgba(0, 184, 148, 0.32); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(0, 184, 148, 0.42); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-lg { padding: 16px 32px; font-size: 1.08rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 7vw, 80px);
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 55%),
    var(--bg-elev);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 700;
  color: var(--brand-strong); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent);
  margin-bottom: 18px;
}
.hero h1 { margin-bottom: 16px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--brand), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(1.02rem, 1.8vw, 1.2rem); color: var(--ink-soft); max-width: 56ch; margin-bottom: 26px; }
.hero .hero-lead-intro { margin-bottom: 16px; }
.hero-callout { background: var(--brand-soft); border: 1px solid var(--border-strong); border-left: 3px solid var(--brand); border-radius: var(--r-sm); padding: 14px 18px; margin-bottom: 26px; }
.hero-callout p, .hero-callout li { color: var(--brand-strong); font-size: clamp(0.98rem, 1.6vw, 1.1rem); }
.hero-callout p { margin: 0 0 10px; }
.hero .hero-steps { font-size: clamp(0.98rem, 1.6vw, 1.1rem); color: var(--brand-strong); max-width: 68ch; margin: 0 0 10px; padding-left: 1.5em; }
.hero .hero-steps li { margin-bottom: 6px; }
.hero .hero-steps li::marker { color: var(--brand); font-weight: 700; }
.hero-callout-tail { margin-bottom: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.86rem; color: var(--ink-faint); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* 声波律动装饰 */
.hero-visual { position: relative; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.wave {
  display: flex; align-items: center; gap: 7px; height: 120px;
}
.wave i {
  width: 8px; border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--accent-2));
  animation: bounce 1.1s ease-in-out infinite;
}
.wave i:nth-child(1) { height: 22%; animation-delay: 0s; }
.wave i:nth-child(2) { height: 48%; animation-delay: 0.1s; }
.wave i:nth-child(3) { height: 78%; animation-delay: 0.2s; }
.wave i:nth-child(4) { height: 100%; animation-delay: 0.05s; }
.wave i:nth-child(5) { height: 62%; animation-delay: 0.25s; }
.wave i:nth-child(6) { height: 88%; animation-delay: 0.15s; }
.wave i:nth-child(7) { height: 40%; animation-delay: 0.3s; }
@keyframes bounce {
  0%, 100% { transform: scaleY(0.5); opacity: 0.7; }
  50% { transform: scaleY(1); opacity: 1; }
}
.hero-visual .orb {
  position: absolute; inset: 0; margin: auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--brand) 34%, transparent), color-mix(in srgb, var(--brand) 8%, transparent));
  filter: blur(2px);
}

/* ---------- 分区 ---------- */
.section { padding: clamp(40px, 7vw, 80px) 0; }
.section-alt { background: var(--surface-muted); }
.section-head { max-width: 720px; margin-bottom: clamp(24px, 4vw, 40px); }
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-strong); margin-bottom: 10px;
}
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 22px; }
.grid > * { min-width: 0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 26px 24px;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 13px; font-size: 1.4rem;
  background: var(--brand-soft); margin-bottom: 14px;
}
.card h3 { margin-bottom: 8px; }
.card h2 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0; }
.card ul { margin: 0; padding-left: 18px; }
.card ul li { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 7px; }
.card ul li:last-child { margin-bottom: 0; }

/* ---------- 特性对比表 ---------- */
.compare {
  width: 100%; border-collapse: collapse; font-size: 0.95rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden;
}
.compare th, .compare td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); }
.compare thead th { background: var(--surface-muted); font-weight: 800; }
.compare tr:last-child td { border-bottom: none; }
.compare .yes { color: var(--brand-strong); font-weight: 700; }
.compare .no { color: var(--ink-faint); }

/* 表格横向滚动（移动端窄屏） */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .compare { min-width: 460px; }

/* ---------- 下载区 ---------- */
.dl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow-sm);
}
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 44px); align-items: center; }
.dl-qr {
  width: 220px; max-width: 100%; margin-inline: auto; padding: 14px;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-md);
}
.dl-qr img { border-radius: 12px; width: 100%; }
.dl-note {
  margin-top: 20px; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--surface-muted); border: 1px dashed var(--border-strong);
  font-size: 0.86rem; color: var(--ink-soft);
}

.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 28px; }
.platform-chip {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px; border-radius: var(--r-md); background: var(--surface-muted);
  border: 1px solid var(--border); font-weight: 700; font-size: 0.9rem; text-align: center;
  color: var(--ink);
}
.platform-chip:hover { border-color: var(--brand); text-decoration: none; }
.platform-chip .pf { font-size: 1.6rem; }

/* ---------- 教程步骤 ---------- */
.steps { counter-reset: step; display: grid; gap: 18px; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 22px 22px 22px 74px;
}
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 20px; top: 20px;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cta-start), var(--cta-end)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 12px; max-width: 820px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 20px; font-size: 1rem; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; font-family: inherit;
}
.faq-q .plus { font-size: 1.4rem; color: var(--brand); font-weight: 400; transition: transform 0.2s ease; }
.faq-item.open .plus { transform: rotate(45deg); }
.faq-a { overflow: hidden; transition: max-height 0.3s ease; }
html.js .faq-a { max-height: 0; }
.faq-a-inner { padding: 0 20px 18px; color: var(--ink-soft); font-size: 0.95rem; }
.faq-item.open .faq-a { max-height: 400px; }

/* ---------- 文章 ---------- */
.article-body { max-width: 760px; margin-inline: auto; }
.article-body h2 { margin-top: 1.6em; }
.article-body p, .article-body li { color: var(--ink-soft); font-size: 1.02rem; }
.article-body blockquote {
  margin: 1.4em 0; padding: 16px 20px; border-left: 4px solid var(--brand);
  background: var(--surface-muted); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink-soft);
}
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 20px; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 面包屑 ---------- */
.breadcrumb { padding: 16px 0 0; font-size: 0.88rem; color: var(--ink-faint); }
.breadcrumb a {
  color: var(--ink-soft);
  display: inline-block;
  padding: 10px 4px;
  margin: -10px -4px;
}
.breadcrumb .sep { margin: 0 8px; color: var(--ink-faint); }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--surface-muted); border-top: 1px solid var(--border); padding: clamp(40px, 6vw, 64px) 0 28px; margin-top: 40px; }
.site-footer {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.footer-title { font-size: 0.9rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 12px; }
.footer-grid a { display: block; color: var(--ink-soft); padding: 4px 0; font-size: 0.9rem; }
.footer-grid a:hover { color: var(--brand-strong); text-decoration: none; }
.footer-desc { color: var(--ink-soft); max-width: 34ch; font-size: 0.92rem; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--ink-faint);
}

/* ---------- 提示条 ---------- */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 18px; border-radius: var(--r-sm); font-size: 0.92rem;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  color: var(--ink-soft); margin: 18px 0;
}
.callout.warn {
  background: color-mix(in srgb, #f0a500 10%, var(--surface));
  border-color: color-mix(in srgb, #f0a500 30%, transparent);
}
.callout b { color: var(--ink); }

/* ---------- 404 ---------- */
.err-wrap { text-align: center; padding: clamp(60px, 12vw, 120px) 0; }
.err-code { font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1; background: linear-gradient(120deg, var(--brand), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- 相关阅读 ---------- */
.related { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.3rem; margin-bottom: 16px; }
.related ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0; margin: 0; }
.related li a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 18px 16px; text-decoration: none; transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease; }
.related li a:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.related li a h3 { font-size: 1.02rem; margin: 0 0 6px; color: var(--ink); }
.related li a p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { min-height: 180px; order: -1; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related ul { grid-template-columns: 1fr; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px var(--gutter) 14px;
  }
  html.js .nav-links { display: none; }
  html.js .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 14px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
}
@media (max-width: 360px) {
  .btn { white-space: normal; text-align: center; }
}

/* ---------- 移动端触摸体验 ---------- */
a, button, [role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 184, 148, 0.18);
}
.btn, .theme-toggle, .nav-toggle, .faq-q, .platform-chip {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 触屏设备：禁用 hover 增强，避免点击后 sticky hover 残留（上移/阴影卡住） */
@media (hover: none) {
  .btn:hover, .card:hover, .related li a:hover { transform: none; }
  .btn-primary:hover { box-shadow: 0 8px 22px rgba(0, 184, 148, 0.32); }
  .btn-ghost:hover, .theme-toggle:hover { border-color: var(--border-strong); box-shadow: none; }
  .platform-chip:hover { border-color: var(--border); }
  .card:hover, .related li a:hover { box-shadow: none; border-color: var(--border); }
  .nav-links a:hover { color: var(--ink-soft); background: transparent; }
  .footer-grid a:hover { color: var(--ink-soft); }
  .btn:active { transform: scale(0.97); }
  .btn-primary:active { box-shadow: 0 4px 12px rgba(0, 184, 148, 0.35); }
  .btn-ghost:active { background: var(--surface-muted); }
}

/* ---------- 无障碍增强 ---------- */
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 700; }
.skip-link:focus { left: 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
