/* ==============================================================
   Web666 · 设计系统
   --------------------------------------------------------------
   规则：
   1. 颜色、圆角、阴影、间距全部走 CSS 变量，换主题只改一组变量。
   2. 明暗双主题，跟随系统 + 手动覆盖（data-theme="light|dark|auto"）。
   3. 移动优先：默认单列，min-width 断点向上叠加。
   4. 不做"炫技动画"——只保留有意义的过渡（150~250ms）。
   ============================================================== */

:root {
  --brand-1: #6366f1;
  --brand-2: #06b6d4;
  --brand-grad: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --brand-soft: rgba(99, 102, 241, .10);

  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px;

  --wrap: 1200px;
  --header-h: 68px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans KR", "Noto Sans JP", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-fast: .15s ease;
  --t: .22s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 浅色 ---------- */
html[data-theme="light"], html[data-theme="auto"] {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --text: #0c1222;
  --text-2: #414b60;
  --muted: #6b7488;
  --border: rgba(12, 18, 34, .10);
  --border-strong: rgba(12, 18, 34, .18);
  --shadow-sm: 0 1px 2px rgba(12, 18, 34, .05);
  --shadow: 0 8px 28px rgba(12, 18, 34, .08);
  --shadow-lg: 0 24px 60px rgba(12, 18, 34, .14);
  --header-bg: rgba(255, 255, 255, .82);
  --code-bg: #f2f4f8;
}

/* ---------- 深色 ---------- */
html[data-theme="dark"] {
  --bg: #080c17;
  --bg-soft: #0d1322;
  --surface: #111829;
  --surface-2: #151d31;
  --text: #eaeefb;
  --text-2: #c3cbe0;
  --muted: #8e9ab5;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 34px rgba(0, 0, 0, .45);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
  --header-bg: rgba(8, 12, 23, .78);
  --brand-soft: rgba(99, 102, 241, .16);
  --code-bg: #0b1120;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #080c17; --bg-soft: #0d1322; --surface: #111829; --surface-2: #151d31;
    --text: #eaeefb; --text-2: #c3cbe0; --muted: #8e9ab5;
    --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .18);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 10px 34px rgba(0,0,0,.45);
    --shadow-lg: 0 30px 70px rgba(0,0,0,.6);
    --header-bg: rgba(8, 12, 23, .78);
    --brand-soft: rgba(99, 102, 241, .16);
    --code-bg: #0b1120;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 var(--sp-3); color: var(--text-2); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 820px; }
.wrap-article { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); font-weight: 400; font-size: .88em; }
.mono { font-family: var(--mono); font-size: .85em; }
.empty { color: var(--muted); padding: var(--sp-4) 0; }
.empty.big { font-size: 1.05rem; text-align: center; padding: var(--sp-8) 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brand-1); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ================= 头部 ================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-5);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.06rem; letter-spacing: -.01em; }
.brand-text em { font-style: normal; font-size: .68rem; color: var(--muted); }

.nav { display: none; gap: 2px; margin-left: var(--sp-4); }
.nav-link {
  padding: 8px 14px; border-radius: 999px; font-size: .93rem;
  color: var(--text-2); transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-link.active { color: var(--brand-1); background: var(--brand-soft); font-weight: 600; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* ⚠️ 必须带 .header-actions 前缀：.btn { display:inline-flex } 在后面，
   单写 .header-cta { display:none } 会被它盖掉 —— 手机上 CTA 就会挤爆头部 */
.header-actions .header-cta { display: none; }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; color: var(--text-2); transition: var(--t-fast);
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="light"] .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .ico-sun { display: none; }
  html[data-theme="auto"] .ico-moon { display: block; }
}
@media (prefers-color-scheme: light) {
  html[data-theme="auto"] .ico-sun { display: block; }
  html[data-theme="auto"] .ico-moon { display: none; }
}

/* 语言切换 */
.lang-switch { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 11px;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; font-size: .88rem; color: var(--text-2);
  white-space: nowrap; flex-shrink: 0;
}
.lang-btn > span { white-space: nowrap; }
.lang-btn:hover { background: var(--bg-soft); }
.lang-btn .chev { transition: transform var(--t-fast); }
.lang-switch.open .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 178px; padding: 6px; margin: 0; list-style: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: var(--t); z-index: 120;
}
.lang-switch.open .lang-menu { opacity: 1; visibility: visible; transform: none; }
.lang-menu a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 12px; border-radius: 9px; font-size: .92rem;
}
.lang-menu a:hover { background: var(--bg-soft); }
.lang-menu a small { color: var(--muted); font-size: .76rem; }
.lang-menu a.is-current { color: var(--brand-1); font-weight: 600; background: var(--brand-soft); }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
  font-size: .94rem; font-weight: 600; cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand-grad); color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, .32);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(99, 102, 241, .45); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.btn-ghost { border-color: var(--border-strong); background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-soft { background: var(--bg-soft); border-color: var(--border); color: var(--text); }
.btn-soft:hover { border-color: var(--border-strong); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: .85rem; border-radius: 10px; }
.link-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: .85rem; padding: 2px 4px; border-radius: 6px;
}
.link-btn:hover { color: var(--brand-1); }

/* ================= Hero ================= */
.hero { position: relative; padding: var(--sp-8) 0 var(--sp-7); overflow: hidden; }
.hero-glow {
  position: absolute; inset: -40% -10% auto -10%; height: 620px;
  background:
    radial-gradient(46% 60% at 22% 32%, rgba(99,102,241,.28), transparent 70%),
    radial-gradient(42% 56% at 78% 20%, rgba(6,182,212,.22), transparent 70%);
  filter: blur(10px); pointer-events: none;
}
.hero-inner { position: relative; display: grid; gap: var(--sp-7); }
.hero-copy { max-width: 640px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  color: var(--brand-1); background: var(--brand-soft);
  border: 1px solid rgba(99, 102, 241, .22); margin-bottom: var(--sp-4);
}
.hero h1 { margin-bottom: var(--sp-4); }
.hero-sub { font-size: 1.08rem; color: var(--text-2); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-5) 0 var(--sp-3); }
.hero-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .86rem; }
.hero-note svg { color: var(--ok); flex-shrink: 0; }

.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.stat-card {
  padding: var(--sp-4); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-num {
  display: block; font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em;
  background: var(--brand-grad); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.stat-label { font-size: .8rem; color: var(--muted); }

/* ================= 区块 ================= */
.section { padding: var(--sp-7) 0; }
.section-alt { background: var(--bg-soft); }
.section-head { max-width: 720px; margin-bottom: var(--sp-6); }
.section-head h2 { margin-bottom: var(--sp-2); }
.section-head p { color: var(--muted); }
.section-foot { margin-top: var(--sp-5); text-align: center; }

/* ================= 合成工作台 ================= */
.studio {
  display: grid; gap: var(--sp-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: var(--sp-5);
  box-shadow: var(--shadow);
}
.field { display: block; margin-bottom: var(--sp-4); }
.field-label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.field-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px; font-size: .8rem; color: var(--muted);
}
.hint { display: block; margin-top: 5px; font-size: .78rem; color: var(--muted); line-height: 1.5; }

.textarea, .input, .select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast);
  resize: vertical;
}
.textarea:focus, .input:focus, .select:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.textarea { min-height: 130px; line-height: 1.6; }
.select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 36px;
}
.row-2 { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
.row-3 { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
.range { width: 100%; accent-color: var(--brand-1); }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand-1); }

.advanced {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
  background: var(--surface-2);
}
.advanced summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text-2); }
.advanced-body { padding-top: var(--sp-4); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip {
  padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-family: var(--mono);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; transition: var(--t-fast);
}
.tag-chip:hover { border-color: var(--brand-1); color: var(--brand-1); }

.studio-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

.result-card {
  padding: var(--sp-4); border-radius: var(--radius-lg);
  background: var(--surface-2); border: 1px solid var(--border);
}
.result-card h3 { margin-bottom: var(--sp-3); font-size: .98rem; }
.result-card audio { width: 100%; margin: var(--sp-3) 0; }
/* 还没合成时别露出一个空播放器 —— 看起来像坏了 */
.result-card audio:not([src]) { display: none; }
.result-meta { font-size: .8rem; color: var(--muted); min-height: 20px; margin-bottom: var(--sp-3); }
.result-meta .badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; margin-right: 6px;
  background: var(--brand-soft); color: var(--brand-1); font-weight: 600;
}
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.wave { display: flex; align-items: flex-end; gap: 3px; height: 36px; opacity: .35; }
.wave span {
  flex: 1; background: var(--brand-grad); border-radius: 3px; height: 20%;
  animation: wave 1.1s ease-in-out infinite;
}
.wave.playing span { opacity: 1; }
.wave span:nth-child(2n) { animation-delay: .12s; }
.wave span:nth-child(3n) { animation-delay: .24s; }
.wave span:nth-child(5n) { animation-delay: .36s; }
@keyframes wave { 0%,100% { height: 18%; } 50% { height: 92%; } }

.side-note {
  margin-top: var(--sp-4); padding: var(--sp-4);
  border-radius: var(--radius); background: var(--brand-soft);
  border: 1px solid rgba(99, 102, 241, .16);
}
.side-note h4 { font-size: .92rem; margin-bottom: var(--sp-2); }
.side-note ul { margin: 0; padding-left: 18px; }
.side-note li { font-size: .85rem; color: var(--text-2); margin-bottom: 5px; }

/* ================= 特性卡 ================= */
.feature-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
.feature {
  padding: var(--sp-5); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: var(--t);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-ico {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; background: var(--brand-soft); color: var(--brand-1);
  margin-bottom: var(--sp-3);
}
.feature h3 { margin-bottom: 6px; font-size: 1rem; }
.feature p { font-size: .88rem; margin: 0; color: var(--muted); }

/* ================= 关键词卡 ================= */
.kw-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.kw-card {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .86rem; color: var(--text-2);
  transition: var(--t-fast);
}
.kw-card:hover {
  border-color: var(--brand-1); color: var(--brand-1);
  background: var(--brand-soft); transform: translateY(-2px);
}
.kw-ico { color: var(--brand-1); font-weight: 700; opacity: .6; }
.kw-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= 文章 ================= */
.post-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
.post-card {
  border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: var(--t); overflow: hidden;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-link { display: block; padding: var(--sp-5); height: 100%; }
.post-card h3 { font-size: 1.04rem; margin-bottom: var(--sp-2); }
.post-card p {
  font-size: .88rem; color: var(--muted); margin-bottom: var(--sp-3);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta { font-size: .78rem; color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-3); }
.chip {
  font-size: .74rem; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--border);
}
a.chip:hover { color: var(--brand-1); border-color: var(--brand-1); }

.search-bar { display: flex; gap: 8px; margin-top: var(--sp-4); max-width: 460px; }
.search-bar input {
  flex: 1; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  outline: none;
}
.search-bar input:focus { border-color: var(--brand-1); box-shadow: 0 0 0 3px var(--brand-soft); }

.pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); margin-top: var(--sp-6); }
.pager-now { font-size: .88rem; color: var(--muted); }

/* 文章详情 */
.article { padding: var(--sp-7) 0 var(--sp-5); }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: var(--sp-4); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--brand-1); }
.article-head { margin-bottom: var(--sp-6); padding-bottom: var(--sp-5); border-bottom: 1px solid var(--border); }
.article-head h1 { margin-bottom: var(--sp-3); }
.article-summary { font-size: 1.05rem; color: var(--text-2); }
.article-meta { font-size: .82rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.article-body { font-size: 1.02rem; line-height: 1.85; color: var(--text-2); }
.article-body h2 { margin: var(--sp-6) 0 var(--sp-3); font-size: 1.4rem; color: var(--text); }
.article-body h3 { margin: var(--sp-5) 0 var(--sp-2); font-size: 1.12rem; color: var(--text); }
.article-body p { margin-bottom: var(--sp-4); }
.article-body ul, .article-body ol { margin: 0 0 var(--sp-4); padding-left: 22px; }
.article-body li { margin-bottom: 7px; }
.article-body a { color: var(--brand-1); text-decoration: underline; text-underline-offset: 3px; }
.article-body code { background: var(--code-bg); padding: 2px 6px; border-radius: 6px; font-family: var(--mono); font-size: .88em; }
.article-body blockquote {
  margin: var(--sp-4) 0; padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--brand-1); background: var(--bg-soft);
  border-radius: 0 10px 10px 0; color: var(--text-2);
}
.article-body hr { border: none; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }

.article-cta {
  display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center;
  justify-content: space-between; margin: var(--sp-7) 0 var(--sp-5);
  padding: var(--sp-5); border-radius: var(--radius-lg);
  background: var(--brand-soft); border: 1px solid rgba(99, 102, 241, .18);
}
.article-cta h3 { margin-bottom: 4px; }
.article-cta p { margin: 0; font-size: .88rem; color: var(--muted); }
.back-link { display: inline-block; font-size: .9rem; color: var(--muted); }
.back-link:hover { color: var(--brand-1); }

/* ================= 克隆页 ================= */
.page-hero { padding: var(--sp-7) 0 var(--sp-5); background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.page-hero h1 { margin-bottom: var(--sp-3); }
.page-sub { color: var(--muted); font-size: 1.02rem; max-width: 640px; }

.clone-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
.clone-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: var(--sp-5); box-shadow: var(--shadow);
}
.step-block { padding-bottom: var(--sp-5); margin-bottom: var(--sp-5); border-bottom: 1px solid var(--border); }
.step-block:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.step-block h3 { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-4); font-size: 1rem; }
.step-no {
  display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 8px; background: var(--brand-grad); color: #fff;
  font-size: .78rem; font-weight: 700; flex-shrink: 0;
}

.recorder { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.rec-timer { font-family: var(--mono); font-size: .88rem; color: var(--muted); min-width: 52px; }
.rec-canvas { flex: 1; min-width: 160px; height: 48px; border-radius: 10px; background: var(--surface-2); }

.upload-row { margin-bottom: var(--sp-4); }
.file-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--sp-5); border-radius: var(--radius);
  border: 2px dashed var(--border-strong); cursor: pointer;
  color: var(--muted); font-size: .9rem; transition: var(--t-fast); text-align: center;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--brand-1); background: var(--brand-soft); color: var(--brand-1); }
.file-drop small { font-size: .76rem; opacity: .8; }
.ref-player { width: 100%; margin-bottom: var(--sp-3); }

.voice-lib {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: var(--sp-5); box-shadow: var(--shadow-sm);
  align-self: start;
}
.lib-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
.voice-list { display: grid; gap: 10px; }
.voice-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.voice-item .vi-main { flex: 1; min-width: 0; }
.voice-item b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-item small { color: var(--muted); font-size: .76rem; }
.voice-item .vi-actions { display: flex; gap: 6px; flex-shrink: 0; }
.voice-del { color: var(--bad); border: none; background: none; cursor: pointer; font-size: .8rem; }

/* ================= 看板 ================= */
.kpi-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, 1fr); margin-bottom: var(--sp-5); }
.kpi {
  padding: var(--sp-4); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.kpi-label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.kpi-num { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }

.panel-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
.panel {
  padding: var(--sp-5); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  min-width: 0;
}
.panel h3 { font-size: .98rem; margin-bottom: var(--sp-4); }
.panel-wide { grid-column: 1 / -1; }

.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { display: grid; grid-template-columns: 84px 1fr 48px; gap: 10px; align-items: center; margin-bottom: 10px; }
.bar-label { font-size: .82rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }
.bar-val { font-size: .8rem; color: var(--muted); text-align: right; font-family: var(--mono); }

.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--bg-soft); }
.table a { color: var(--brand-1); }

.engine-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.engine-row:last-child { border-bottom: none; }
.engine-row b { min-width: 76px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }

.trend { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 160px; padding-top: var(--sp-4); }
.trend .bar-col { flex: 1; min-width: 0; max-width: 72px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.trend .bar-col i {
  display: block; width: 100%; border-radius: 6px 6px 0 0;
  background: var(--brand-grad); min-height: 3px; transition: height .4s ease;
}
.trend .bar-col span { font-size: .66rem; color: var(--muted); white-space: nowrap; }

/* ================= 后台 ================= */
.admin-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.engine-box { font-size: .86rem; color: var(--text-2); }
.engine-config { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.ops-log { max-height: 420px; overflow: auto; font-size: .84rem; }
.ops-log .op { padding: 10px 0; border-bottom: 1px solid var(--border); }
.ops-log .op b { color: var(--brand-1); }
.ops-log .op.fail b { color: var(--bad); }
.login-card {
  max-width: 380px; margin: 0 auto; padding: var(--sp-6);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 4px; }

/* ================= FAQ ================= */
.faq-list { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.faq-item summary {
  padding: 15px 18px; cursor: pointer; font-weight: 600; font-size: .95rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand-1); font-size: 1.2rem; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 18px 16px; margin: 0; font-size: .9rem; color: var(--muted); }

/* ================= 错误页 ================= */
.error-page { padding: var(--sp-8) 0; }
.error-code {
  font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; line-height: 1;
  background: var(--brand-grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; margin-bottom: var(--sp-3);
}

/* ================= 底部 ================= */
.site-footer {
  margin-top: var(--sp-7); padding: var(--sp-7) 0 var(--sp-5);
  background: var(--bg-soft); border-top: 1px solid var(--border);
}
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
.footer-brand p { font-size: .87rem; color: var(--muted); margin: var(--sp-3) 0 0; max-width: 320px; }
.footer-notice { font-size: .78rem !important; opacity: .8; }
.footer-col h4 { font-size: .84rem; margin-bottom: var(--sp-3); color: var(--text); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: .87rem; color: var(--muted); }
.footer-col a:hover { color: var(--brand-1); }
.footer-col a.is-current { color: var(--brand-1); font-weight: 600; }
.footer-bottom {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  justify-content: space-between; align-items: center;
}
.footer-bottom p { font-size: .8rem; color: var(--muted); margin: 0; }
.footer-bottom a { color: var(--muted); }

/* ================= Toast ================= */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  padding: 11px 20px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: .88rem;
  opacity: 0; visibility: hidden; transition: var(--t); z-index: 300;
  max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(239,68,68,.4); color: var(--bad); }
.toast.ok { border-color: rgba(22,163,74,.4); }

/* ================= 移动端导航 ================= */
/* 窄屏：语言按钮只留图标，别把头部挤爆 */
@media (max-width: 430px) {
  .lang-btn > span, .lang-btn .chev { display: none; }
  .lang-btn { padding: 8px; }
  .brand-text em { display: none; }
  .header-inner { gap: var(--sp-3); }
}

@media (max-width: 899px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    display: grid; gap: 4px; padding: var(--sp-4) 20px var(--sp-5);
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: var(--t); margin: 0; z-index: 99;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav-link { padding: 12px 14px; border-radius: 10px; font-size: 1rem; }
}

/* ================= 断点 ================= */
@media (min-width: 640px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
  .row-3 { grid-template-columns: 1fr 1fr 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .kw-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .panel-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (min-width: 900px) {
  .nav { display: flex; }
  .burger { display: none; }
  .header-cta { display: inline-flex; }
  .hero-inner { grid-template-columns: 1.15fr .85fr; align-items: center; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .studio { grid-template-columns: 1.5fr 1fr; padding: var(--sp-6); }
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .clone-grid { grid-template-columns: 1.5fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(6, 1fr); }
  .kw-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 2.2fr 1fr 1fr 1fr .9fr; }
}

@media (min-width: 1200px) {
  .post-grid.post-grid-lg { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ==============================================================
   合成工作台 2.0
   --------------------------------------------------------------
   目标是"三步就出结果"：输入文字 → 选音色 → 挑语气。
   所有技术参数（引擎、CFG、timesteps）都不出现在第一屏。
   ============================================================== */

.studio-step {
  display: flex; align-items: center; gap: 9px;
  margin: var(--sp-4) 0 var(--sp-2);
}
.studio-step:first-child { margin-top: 0; }
.step-badge {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 20px;
  background: var(--primary-soft); color: var(--primary);
  font-size: .7rem; font-weight: 700;
}
.studio-step-title { font-size: .9rem; font-weight: 600; }
.step-optional {
  font-size: .7rem; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 5px; padding: 0 5px;
}

/* ---- 输入区 ---- */
.textarea-wrap {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.textarea-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea-wrap .textarea {
  border: 0; background: transparent; border-radius: 0;
  resize: vertical; min-height: 132px;
}
.textarea-wrap .textarea:focus { box-shadow: none; }
.textarea-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 7px 12px;
  border-top: 1px solid var(--border); font-size: .76rem;
}
.textarea-foot .counter { color: var(--text-3); }
.textarea-foot .counter b { color: var(--text-2); }
.ta-tools { display: flex; gap: 12px; }

/* ---- 音色卡片 ---- */
.voice-picker {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.voice-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  cursor: pointer; text-align: left; font-family: inherit;
  color: var(--text-2); position: relative;
  transition: border-color .15s, background .15s, transform .12s;
}
.voice-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.voice-card.is-active {
  border-color: var(--primary); background: var(--primary-soft); color: var(--text);
}
.vc-avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--primary);
  border: 1px solid var(--border);
}
.vc-body { display: flex; flex-direction: column; min-width: 0; }
.vc-body b {
  font-size: .86rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vc-body small { font-size: .7rem; color: var(--text-3); }
.vc-check {
  margin-left: auto; opacity: 0; color: var(--primary);
  font-weight: 700; font-size: .85rem;
}
.voice-card.is-active .vc-check { opacity: 1; }
.voice-more {
  display: inline-block; margin-top: 8px;
  font-size: .8rem; color: var(--primary);
}

/* ---- 通用 chip ---- */
.chip-row {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  margin-bottom: 10px;
}
.chip-row-sm { gap: 6px; }
.chip-label {
  font-size: .78rem; color: var(--text-3);
  flex: 0 0 auto; margin-right: 2px;
}
.chip {
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: .82rem; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  transition: all .14s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-active {
  background: var(--primary); border-color: var(--primary);
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 10px -2px var(--primary);
}

/* ---- 加语气（本地化标签） ---- */
.tone-row {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--border);
  margin: 4px 0 var(--sp-4);
}
.tone-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tone-chip {
  padding: 5px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: .8rem; cursor: pointer;
  font-family: inherit; transition: all .14s;
}
.tone-chip:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-soft);
}
.tone-chip:active { transform: scale(.96); }

.btn-block-sm { width: 100%; }
.studio-note {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: .76rem; color: var(--text-3);
}

/* ---- 合成历史 ---- */
.synth-history { display: flex; flex-direction: column; gap: 4px; }
.hist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; font-size: .78rem;
  transition: background .14s;
}
.hist-item:hover { background: var(--surface-2); }
.hist-play {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 22px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--primary); cursor: pointer; font-size: .6rem;
  display: grid; place-items: center; padding: 0;
}
.hist-play:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.hist-text {
  flex: 1; min-width: 0; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-time { color: var(--text-3); font-size: .7rem; flex: 0 0 auto; }

/* ==============================================================
   主题聚合页（SEO 长尾入口）
   ============================================================== */
.topic-cloud {
  display: flex; flex-wrap: wrap; gap: 9px;
}
.topic-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: .85rem;
  transition: all .15s;
}
.topic-pill:hover {
  border-color: var(--primary); color: var(--primary);
  transform: translateY(-1px);
}
.topic-pill em {
  font-style: normal; font-size: .7rem; color: var(--text-3);
  background: var(--surface-2); border-radius: 999px; padding: 1px 7px;
}
.kw-count {
  margin-left: auto; font-size: .7rem; color: var(--text-3);
  background: var(--surface-2); border-radius: 999px; padding: 1px 7px;
}

/* ---- 文章目录 ---- */
.article-toc {
  margin: var(--sp-4) 0; padding: var(--sp-3) var(--sp-4);
  border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border);
}
.article-toc summary {
  cursor: pointer; font-weight: 600; font-size: .88rem;
  list-style: none;
}
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc ol { margin: 10px 0 0; padding-left: 20px; }
.article-toc li { margin: 5px 0; font-size: .86rem; }
.article-toc a { color: var(--text-2); }
.article-toc a:hover { color: var(--primary); }

.article-foot-links {
  display: flex; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: var(--sp-5);
}

/* ---- 文章里的关键词内链 ---- */
.chip-link { text-decoration: none; }
.chip-link:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-soft);
}

/* ---- 页脚管理入口（低调） ---- */
.footer-admin {
  margin-left: 10px; font-size: .72rem; color: var(--text-3);
  opacity: .55; transition: opacity .15s;
}
.footer-admin:hover { opacity: 1; color: var(--primary); }

@media (max-width: 640px) {
  .voice-picker { grid-template-columns: 1fr; }
  .textarea-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tone-row { flex-direction: column; align-items: flex-start; }
}
