/* 有声书工坊 — 移动端优先设计系统 */
:root {
  --brand: #1677ff;
  --brand-dark: #0958d9;
  --ink: #1f2329;
  --muted: #86909c;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e5e6eb;
  --ok: #389e0d;
  --danger: #d4380d;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(31,35,41,.06);
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
}
main { max-width: 1080px; margin: 0 auto; padding: 0 16px 60px; }
h2 { font-size: 22px; margin-bottom: 6px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12px; }
.err { color: var(--danger); font-size: 13px; }
.mono { font-family: Consolas, monospace; font-size: 12px; }

/* ---------- 头部 / 页脚 ---------- */
.site-header {
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.site-header nav a { color: var(--ink); text-decoration: none; font-size: 14px; }
.site-header nav a:hover { color: var(--brand); }
.balance { background: #e8f3ff; color: var(--brand); border-radius: 12px; padding: 2px 10px; font-size: 12px; }

.site-footer {
  border-top: 1px solid var(--line); background: #fff;
  padding: 28px 16px 40px; text-align: center; font-size: 13px;
}
.site-footer p { margin: 3px 0; }

/* ---------- 按钮 ---------- */
.btn, .btn-a, button {
  display: inline-block; padding: 9px 18px; font-size: 14px; border: 0;
  border-radius: 10px; background: #eef1f5; color: var(--ink); cursor: pointer;
  text-decoration: none; text-align: center; transition: filter .15s;
}
.btn:hover, button:hover { filter: brightness(.96); }
.btn.primary, button.primary { background: var(--brand); color: #fff; font-weight: 600; }
button:disabled, .btn:disabled { background: #eef1f5; color: #9aa3af; cursor: not-allowed; }
button.primary:disabled, .btn.primary:disabled { background: #d6e4f7; color: #6d87ab; }
.btn.primary:hover, button.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; border: 1px solid var(--line); }
.btn.big, button.big { width: 100%; padding: 13px; font-size: 16px; }
.btn.small, button.small { padding: 5px 12px; font-size: 13px; }
button.danger { background: #fff1f0; color: var(--danger); }
.btn { margin-top: 8px; }

/* ---------- 首页营销页 ---------- */
.hero { text-align: center; padding: 64px 8px 44px; }
.hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.25; font-weight: 800; }
.hero h1 b { color: var(--brand); }
.hero .sub { margin: 16px auto 26px; max-width: 560px; font-size: 15px; color: #4e5969; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn.big, .hero-cta button.big { width: auto; padding: 12px 34px; }
.hero-stats { display: flex; justify-content: center; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats div { text-align: center; }
.hero-stats b { display: block; font-size: 26px; color: var(--brand); }
.hero-stats span { font-size: 12px; color: var(--muted); }

.section { padding: 46px 4px; }
.section.alt { background: #fff; margin: 0 -16px; padding: 46px 20px; }
.steps { display: grid; gap: 14px; margin-top: 18px; grid-template-columns: 1fr; }
.step { background: var(--bg); border-radius: var(--radius); padding: 20px; }
.step-no {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px;
}
@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .section.alt { border-radius: 20px; }
}

.voice-demo { display: grid; gap: 10px; margin-top: 16px; grid-template-columns: 1fr; }
.vcard { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.vcard audio { width: 100%; height: 34px; margin-top: 6px; }
@media (min-width: 640px) { .voice-demo { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .voice-demo { grid-template-columns: repeat(4, 1fr); } }

.pricing { display: grid; gap: 14px; margin-top: 18px; grid-template-columns: 1fr; }
.plan {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 20px; text-align: center; box-shadow: var(--shadow);
}
.plan.featured { border: 2px solid var(--brand); }
.plan .price { font-size: 34px; font-weight: 800; color: var(--brand); margin: 8px 0; }
.plan .ribbon {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: 12px; padding: 3px 12px; border-radius: 12px;
}
@media (min-width: 760px) { .pricing { grid-template-columns: repeat(3, 1fr); } }

details {
  background: var(--card); border-radius: 12px; padding: 14px 18px; margin: 10px 0;
  box-shadow: var(--shadow);
}
details summary { font-weight: 600; cursor: pointer; font-size: 15px; }
details p { margin-top: 10px; color: #4e5969; font-size: 14px; }

.cta-band { text-align: center; padding: 56px 0 20px; }
.cta-band h2 { margin-bottom: 18px; }
.cta-band .btn.big { width: auto; padding: 13px 40px; }

/* ---------- 功能页通用 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  margin: 12px 0; box-shadow: var(--shadow);
}
.card.auth { max-width: 400px; margin: 8vh auto 0; text-align: center; }
.card.auth h2 { margin-bottom: 2px; }
.card.auth .muted { margin-bottom: 14px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab { flex: 1; padding: 10px; background: none; border: 0; font-size: 15px; color: var(--muted); border-radius: 0; }
.tab.active { color: var(--brand); border-bottom: 2px solid var(--brand); font-weight: 600; }

input, select, textarea {
  width: 100%; padding: 10px 12px; margin: 6px 0; font-size: 14px;
  border: 1px solid #d9dce1; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid #bcd9ff; border-color: var(--brand); }
textarea { font-family: Consolas, monospace; }
.row { display: flex; gap: 8px; align-items: center; }
.row label { font-size: 13px; color: #555; white-space: nowrap; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #555; margin: 8px 0; }
.check input { width: auto; margin: 3px 0 0; }

.sec { margin: 22px 0 8px; }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 10px; }
.s-pending, .s-queued { background: #fff7e6; color: #d48806; }
.s-ready { background: #e6fffb; color: #08979c; }
.s-running { background: #e8f3ff; color: var(--brand); }
.s-done { background: #f0ffe6; color: var(--ok); }
.s-failed { background: #fff1f0; color: var(--danger); }

.book-head, .role-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.book-head .badge { margin-left: auto; }
.job-link { display: block; text-decoration: none; color: inherit; }
.tag { font-size: 11px; background: #f0f2f5; border-radius: 8px; padding: 1px 8px; color: #666; }
.role .line { color: #666; font-size: 13px; margin: 6px 0; }

.lib-bar { margin-bottom: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.chip { flex: none; padding: 5px 12px; font-size: 13px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.voices { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .voices { grid-template-columns: 1fr 1fr; } }

.progress { height: 10px; background: #eceef2; border-radius: 6px; overflow: hidden; margin: 12px 0 6px; }
.bar { height: 100%; background: var(--brand); transition: width .5s; }

.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 1080px; margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
}

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: 12px; width: 100%; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }

.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 99;
  background: #333; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; max-width: 86vw; }
.toast.ok { background: var(--ok); }

/* ---------- 功能页组件 ---------- */
.page-head { padding: 26px 0 6px; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-head .spacer { margin-left: auto; }

.auth-logo { font-size: 42px; line-height: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { font-size: 22px; display: block; }
.stat span { font-size: 12px; color: var(--muted); }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.empty { text-align: center; padding: 44px 0; color: var(--muted); }
.empty .ico { font-size: 44px; display: block; margin-bottom: 8px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #e8f3ff; color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none;
}
.avatar.f { background: #fff0f6; color: #d4380d; }
.role-row { display: flex; gap: 12px; align-items: flex-start; }
.role-row .grow { flex: 1; min-width: 0; }
.tune-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tune-row input[type="range"] { width: 170px; margin: 0; padding: 0; flex: none; }
.tune-row .pv { min-width: 3ch; text-align: center; color: var(--brand); }
.lib-box { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 16px 14px; }
.lib-box summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0 10px; }
.lib-box[open] summary { border-bottom: 1px solid #f0f0f0; margin-bottom: 12px; }
.clips { margin-top: 8px; }
.clip { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.clip-text { color: #666; flex: 1; min-width: 120px; }
.clip audio { height: 32px; flex: none; }

.spin { display: inline-block; animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.steps-bar { display: flex; gap: 6px; align-items: center; margin: 4px 0 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.steps-bar .dot { padding: 3px 10px; border-radius: 10px; background: #eef1f5; }
.steps-bar .dot.on { background: var(--brand); color: #fff; }
.steps-bar .dot.done { background: #f0ffe6; color: var(--ok); }
.steps-bar .arr { color: #c9cdd4; }

.book-actions { display: flex; gap: 8px; margin-top: 10px; }
.book-actions .btn, .book-actions button { margin-top: 0; }
.sticky .cost-note { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
