/*! 365Lab 音频工作室 - 全站设计系统：主题令牌 / 壳层导航 / 首页 / 工具 / 帮助 / FAQ */

/* ================= 主题令牌 ================= */
:root {
  color-scheme: dark;
  --bg: #0b0e15;
  --bg-soft: #10141d;
  --panel: #161d29;
  --panel-2: #1e2735;
  --panel-3: #26314380;
  --border: #2a3549;
  --border-soft: #222c3d;
  --text: #eaf0f9;
  --muted: #8d9ab0;
  --accent: #5b9dff;
  --accent-2: #8c6cff;
  --accent-soft: rgba(91, 157, 255, 0.14);
  --grad: linear-gradient(135deg, #5b9dff, #8c6cff);
  --ok: #35c07f;
  --warn: #e2b23c;
  --error: #ef5f5f;
  --radius: 14px;
  --radius-sm: 9px;
  /* 头部单排高度（.header-inner min-height 62 + 下边框 1）：工具页右栏 sticky 的落点要减去它 */
  --head-h: 64px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);
  --glow: 0 0 0 1px rgba(91, 157, 255, 0.25), 0 6px 22px rgba(91, 157, 255, 0.18);
  --ring: 0 0 0 3px rgba(91, 157, 255, 0.35);
  /* 第39轮：补齐此前只被引用、从未定义的标记；字号阶梯显式化 */
  --text-dim: #8492a8;
  --panel-soft: #121923;
  --line: #2a3549;
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 12.5px;
  --fs-md: 13px;
  --fs-lg: 14.5px;
  --fs-title: 15px;
  --wave-bg: #0d121b;
  --wave-grid: rgba(255, 255, 255, 0.07);
  --wave-text: #8d9ab0;
  --wave-color: #5b9dff;
  --wave-rms: rgba(91, 157, 255, 0.42);
  --wave-sel: rgba(91, 157, 255, 0.2);
  --wave-sel-edge: #5b9dff;
  --wave-play: #ff5c7a;
  --wave-cursor: #eef2ff;
  --wave-mark: rgba(226, 178, 60, 0.16);
  --wave-mark-edge: #e2b23c;
  --wave-line: var(--wave-color);
  --wave-mid: var(--wave-grid);
  --sel: var(--wave-sel);
  --playhead: var(--wave-play);
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #eef2f9;
  --panel-3: #e4eaf4;
  --border: #d9e1ee;
  --border-soft: #e5ebf4;
  --text: #1b2432;
  --muted: #5e6a84;
  --accent: #2f6fed;
  --accent-2: #7a52e0;
  --accent-soft: rgba(47, 111, 237, 0.12);
  --grad: linear-gradient(135deg, #2f6fed, #7a52e0);
  --shadow: 0 10px 28px rgba(23, 38, 64, 0.12);
  --shadow-sm: 0 3px 10px rgba(23, 38, 64, 0.08);
  --glow: 0 0 0 1px rgba(47, 111, 237, 0.18), 0 6px 18px rgba(47, 111, 237, 0.12);
  --ring: 0 0 0 3px rgba(47, 111, 237, 0.28);
  --text-dim: #6a7488;
  --panel-soft: #eef1f6;
  --line: #d9e1ee;
  --wave-bg: #f8fafd;
  --wave-grid: rgba(27, 36, 50, 0.08);
  --wave-text: #64708a;
  --wave-color: #2f6fed;
  --wave-rms: rgba(47, 111, 237, 0.38);
  --wave-sel: rgba(47, 111, 237, 0.16);
  --wave-sel-edge: #2f6fed;
  --wave-play: #e2542d;
  --wave-cursor: #141d2b;
  --wave-mark: rgba(210, 150, 20, 0.14);
  --wave-mark-edge: #c2861a;
}

/* ================= 基础 ================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
/* hidden 属性必须赢过组件级 display 规则（.field/.tag-form 等） */
[hidden] { display: none !important; }

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(91, 157, 255, 0.1), transparent 60%),
    radial-gradient(900px 460px at -10% 12%, rgba(140, 108, 255, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

::selection { background: rgba(91, 157, 255, 0.35); }

* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #40506c; background-clip: content-box; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-2); text-decoration: none; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.3; letter-spacing: 0.01em; }
p { margin: 0 0 10px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 18px; }

.visually-hidden, .hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}

/* ================= 站点头部 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--border-soft);
}

.site-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 157, 255, 0.55), rgba(140, 108, 255, 0.55), transparent);
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 8px 0;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--text); }
.brand:hover { color: var(--text); }

.brand-logo {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(91, 157, 255, 0.4);
}

.brand-name { font-size: 16.5px; font-weight: 700; white-space: nowrap; }
.brand-name small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }

.main-nav { display: flex; gap: 4px; margin-left: auto; }

.main-nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 99px;
  transition: color 0.15s ease, background 0.15s ease;
}

.main-nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }

.main-nav a.active {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 3px 12px rgba(91, 157, 255, 0.35);
}

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 12px; }

/* ================= 首页英雄区 ================= */
.site-hero { padding: 72px 0 56px; text-align: center; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 99px;
  padding: 5px 14px;
  margin-bottom: 18px;
}

.hero-kicker::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 8px var(--accent);
}

.site-hero h1 {
  font-size: clamp(30px, 5.2vw, 52px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.site-hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text);
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(14.5px, 2vw, 17px);
  max-width: 640px;
  margin: 0 auto 26px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
  margin-top: 38px;
  color: var(--muted);
  font-size: 13px;
}

.hero-stats b { color: var(--text); font-size: 16px; }

/* ================= 区块 ================= */
.page-section { padding: 44px 0; }
.page-section > .wrap > h2 { font-size: 24px; }
.page-section > .wrap > .sec-sub { color: var(--muted); font-size: 14px; max-width: 680px; margin-top: -2px; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.sec-head h1 { font-size: 24px; margin: 0; }
.sec-head h2 { font-size: 24px; margin: 0; }
.sec-head h2::before {
  content: '';
  display: block;
  width: 34px; height: 4px;
  border-radius: 99px;
  background: var(--grad);
  margin-bottom: 12px;
}

/* 入口大卡（首页） */
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.entry-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  align-items: center;
  color: var(--text);
  background: linear-gradient(160deg, var(--panel), color-mix(in srgb, var(--panel) 82%, var(--bg)));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: var(--shadow);
  color: var(--text);
}

.entry-card::before {
  content: '';
  position: absolute;
  top: -70px; right: -70px;
  width: 210px; height: 210px;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.11;
  filter: blur(18px);
  pointer-events: none;
}
/* 浅色主题下同一团光会被白底衬成一块紫灰污渍：压到只剩一点冷调，卡片回到干净的白 */
[data-theme='light'] .entry-card::before { opacity: 0.035; filter: blur(26px); }

.entry-card .entry-icon, .feat-card .fi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  line-height: 1;
  flex: 0 0 auto;
}
.entry-card .entry-icon { grid-column: 1; grid-row: 1; width: 52px; height: 52px; font-size: 26px; margin: 0; }
.entry-card h3 { grid-column: 2; grid-row: 1; font-size: 20px; margin: 0; }
.entry-card p { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; margin: 12px 0 16px; }
.entry-card .entry-go { grid-column: 1 / -1; color: var(--accent); font-size: 14px; font-weight: 600; }

/* 收藏星标（工具目录卡片角标） */
.fav-star {
  position: absolute;
  top: 10px; right: 10px; z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  padding: 0;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.fav-star:hover { color: #f0a63a; transform: scale(1.12); }
.fav-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fav-star[aria-pressed="true"] { color: #f0a63a; }
#tpFav { margin-bottom: 22px; }
#tpFav .tool-grid { margin-top: 0; }

/* 特性卡 */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.feat-card {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.feat-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow-sm);
}

.feat-card .fi { grid-column: 1; grid-row: 1; width: 40px; height: 40px; font-size: 20px; }
.feat-card h3 { grid-column: 2; grid-row: 1; font-size: 15px; margin: 0; }
.feat-card p { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* ================= 工具页 ================= */
.tag-form { display: grid; gap: 10px; }
/* .tool-single 的宽度只由 BATCH119 那条 body.page-tool 规则决定（30 个实物全在工具页），
   这里不再留一份永远被盖住的 max-width */

.tool-search {
  width: 100%;
  max-width: 420px;
  margin: 4px 0 10px;
  padding: 10px 16px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tool-search:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.search-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 34px 0; margin: 0; }

/* 首页工具 Tab 区：一行 4 卡、一页 3 行 */
.home-tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 4px; }
.home-tool-grid .feat-card { padding: 16px; }
.home-tool-grid .feat-card h3 { font-size: 14.5px; }
.home-tool-grid .feat-card p { font-size: 12.5px; margin-top: 8px; min-height: 2.8em; }

/* 工具合集：分类 Tab + 四列网格 */
.tool-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.tool-tab {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 9px 18px;
  border-radius: 99px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.tool-tab:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.tool-tab:focus-visible { outline: none; box-shadow: var(--ring); }
.tool-tab.active { color: #fff; background: var(--grad); border-color: transparent; }
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* BATCH149：工具合集"最近使用"区块 */
#tpRecent { margin-bottom: 22px; }
.recent-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.recent-title::before {
  content: '';
  width: 4px; height: 16px;
  border-radius: 99px;
  background: var(--grad);
}
#tpRecent .tool-grid { margin-top: 0; }
.tool-grid .entry-card { padding: 20px; column-gap: 12px; }
.tool-grid .entry-icon { width: 40px; height: 40px; font-size: 20px; }
.tool-grid .entry-card h3 { font-size: 16px; }
.tool-grid .entry-card p { font-size: 12.5px; margin: 10px 0 12px; min-height: 3.6em; }
.tool-grid .entry-go { font-size: 13px; }
/* 四列窄卡：徽章挪到右下角，与"立即使用"同行，避免压住标题 */
.tool-grid .entry-badge { top: auto; bottom: 15px; }
.entry-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  padding: 4px 10px;
  border-radius: 99px;
  pointer-events: none;
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.tool-card > h3 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 10px; }

.tool-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.tool-drop:hover, .tool-drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.tool-drop b { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 2px; }

.tool-files { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; max-height: clamp(210px, 32vh, 420px); overflow-y: auto; overflow-x: hidden; }

.tool-files li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  min-width: 0;
}

.tool-files li .tf-name { flex: 1 1 130px; min-width: 8em; overflow-wrap: anywhere; white-space: normal; }
.tool-files li .tf-name.list-ph { line-height: 1.55; }
.tool-files li .tf-label {
  flex: 0 0 96px;
  min-width: 0;
  font: inherit;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.tool-files li .tf-label:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.tool-files li .tf-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 0; line-height: 1.55; }

/* 检测类结果行：没有下载产物，指标文字必须折行读完而不是被省略号吃掉 */
.tool-files li.is-report { align-items: flex-start; }
.tool-files li.is-report .tf-name { padding-top: 1px; }
.tool-files li .tf-x { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; }
.tool-files li .tf-x:hover { color: var(--error); }

.tool-files li.err { border-color: color-mix(in srgb, var(--error) 55%, var(--border)); }
.tool-files li.done .tf-meta { color: var(--ok); }

/* BATCH143：多文件队列底部汇总行（N 个文件 · 共大小 · 总时长） */
.tool-files li.tf-sum { background: none; border: none; justify-content: flex-end; padding: 1px 4px 0; }
.tool-files li.tf-sum .tf-meta { font-size: 12px; }

.tool-opts { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }

/* BATCH140：工具页选项行紧凑化——下拉/数字框按内容取宽，短选项不再拉满半张卡 */
body.page-tool .tool-opts { gap: 12px 16px; }
body.page-tool .tool-opts .field { flex: 0 1 auto; min-width: 0; }
body.page-tool .tool-opts select { width: auto; min-width: 128px; max-width: 224px; }
body.page-tool .tool-opts input[type='number'] { width: 122px; max-width: 100%; }
body.page-tool .tool-opts input[type='text'] { width: 196px; max-width: 100%; }
body.page-tool .tool-opts input[type='range'] { width: 172px; }
body.page-tool .tool-opts .field output { margin-top: 0; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: auto; }

.tool-progress {
  height: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
  display: none;
}
.tool-progress i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.2s ease; }
.prog-count { display: none; margin-top: 5px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tool-card.running .prog-count { display: block; text-align: right; }
.tool-card.running .tool-progress { display: block; }

.tool-note { font-size: 12px; color: var(--muted); margin: 0; }

/* 与上方控件联动的实时读数（不是卡片尾部的静态 .tool-note，故独立成类） */
.tool-live { font-size: 12px; color: var(--muted); margin: 2px 0 0; }

/* ================= 帮助页 ================= */
.guide-steps { display: grid; gap: 14px; counter-reset: step; margin-top: 18px; }

.guide-step {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 18px 66px;
}

.guide-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 18px; top: 18px;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.guide-step h3 { font-size: 15.5px; margin-bottom: 4px; }
.guide-step p { color: var(--muted); font-size: 13.5px; margin: 0; }

/* 固定表格布局：窄窗口下两列按 40/60 分配，长快捷键标签折行而不是把整页顶出横向滚动 */
.kb-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 14px; font-size: 13.5px; }
.kb-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); overflow-wrap: anywhere; }
.kb-table td:first-child { width: 40%; color: var(--muted); }
.kb-table tr:hover td { background: var(--panel-2); }

/* ================= FAQ 页 ================= */
.faq-list { display: grid; gap: 10px; margin-top: 18px; }

.faq-list details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.faq-list details:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.faq-list details[open] { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: var(--shadow-sm); }

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '＋';
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }

/* ================= 404 ================= */
.page-section.notfound { max-width: 560px; margin: 84px auto 96px; text-align: center; }
.notfound h1 { font-size: 52px; line-height: 1.06; margin: 0 0 6px; letter-spacing: -0.02em; }
.notfound h2 { font-size: 20px; margin: 0 0 4px; }
.notfound p { color: var(--muted); margin: 8px 0; }
.notfound .btns { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ================= 页脚 ================= */
.site-footer {
  margin-top: 30px;
  padding: 34px 0 calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg-soft) 60%, transparent);
  color: var(--muted);
  font-size: 12.5px;
}

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 26px; }
.footer-grid h3 { color: var(--text); font-size: 13.5px; margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--accent); }
.footer-desc { max-width: 340px; }

.footer-base {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

/* ================= 通用小部件 ================= */
.chip-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-grid;
  place-items: center;
  user-select: none;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.chip-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.chip-btn:active { transform: none; }

.theme-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-grid;
  place-items: center;
  user-select: none;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.theme-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.theme-btn:active { transform: none; }

/* ================= 通用弹层（全页面共享） ================= */
/* 禁用 JavaScript 时的说明条：本站每一页的控件都由脚本驱动，不写清楚就成了"点了没反应"的静默降级。
   有脚本时 <noscript> 的内容是纯文本、根本不进 DOM（实测 .nojs 节点数 0），所以这条样式只给无脚本的用户看到。 */
.nojs { display: block; margin: 0 0 14px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--warn) 10%, var(--panel)); font-size: 13.5px; overflow-wrap: anywhere; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 18px) scale(0.96);
  z-index: 60;
  width: max-content;
  max-width: min(92vw, 560px);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 20px 13px 14px;
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 10px 34px color-mix(in srgb, var(--accent) 20%, rgba(0, 0, 0, 0.3)), 0 2px 8px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.toast::before {
  content: '\2139\FE0E';
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
/* 长停留的那两类才吃悬停（隐藏态与短提示仍完全不吃点击） */
/* 只有带关闭钮的那次停留才吃指针（钮的有无由 JS 的 dismissible 决定，与类型无关） */
.toast.show.dismissible { pointer-events: auto; }
.toast-msg { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.toast-x { flex: 0 0 auto; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--text) 14%, transparent); color: inherit; font-size: 11px; line-height: 1; cursor: pointer; }
.toast-x:hover { background: color-mix(in srgb, var(--text) 26%, transparent); }
.toast-x:focus-visible { outline: none; box-shadow: var(--ring); }
.toast-copy {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--text) 24%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.toast-copy:hover { background: color-mix(in srgb, var(--text) 18%, transparent); }
.toast-copy:focus-visible { outline: none; box-shadow: var(--ring); }
.toast-copy:disabled { opacity: 0.7; cursor: default; }
.toast.ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); box-shadow: 0 10px 34px color-mix(in srgb, var(--ok) 24%, rgba(0, 0, 0, 0.3)), 0 2px 8px rgba(0, 0, 0, 0.18); }
.toast.ok::before { content: '\2713'; color: #fff; background: var(--ok); }
.toast.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); box-shadow: 0 10px 34px color-mix(in srgb, var(--warn) 24%, rgba(0, 0, 0, 0.3)), 0 2px 8px rgba(0, 0, 0, 0.18); }
.toast.warn::before { content: '!'; color: #1c2233; background: var(--warn); }
.toast.error { border-color: color-mix(in srgb, var(--error) 55%, var(--border)); box-shadow: 0 10px 34px color-mix(in srgb, var(--error) 24%, rgba(0, 0, 0, 0.3)), 0 2px 8px rgba(0, 0, 0, 0.18); }
.toast.error::before { content: '\2715'; color: #fff; background: var(--error); }
@media (prefers-reduced-motion: reduce) { .toast { transform: translate(-50%, 0); } }

.busy {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 15px;
  color: var(--text);
}

.busy[hidden] { display: none; }

/* 解码/渲染的等待卡片：始终只说明“正在处理”，不显示百分比（浏览器解码没有进度回调），
   大文件时靠转圈 + 已用时证明没卡死；需要时可带取消钮 */
.busy-card {
  box-sizing: border-box;
  max-width: min(92vw, 380px);
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--text);
}

.busy-row { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.busy-row .spinner { flex: 0 0 auto; }

.busy-extra { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.busy-extra[hidden] { display: none; }

.busy-elapsed { font-size: 12.5px; font-weight: 500; color: var(--muted, var(--text)); opacity: 0.85; }
.busy-elapsed:empty { display: none; }

#busyCancel { min-width: 104px; min-height: 44px; }

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 18px;
  color: var(--text);
}

.drop-overlay[hidden] { display: none; }

.drop-overlay div {
  padding: 34px 46px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--glow);
}

/* 关于 / 隐私 / 条款等文本页 */
.legal-body {
  max-width: 900px;
  margin-top: 4px;
  padding: 30px 34px 34px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.legal-body h2 { margin: 26px 0 8px; font-size: 16px; }
.legal-body h2:first-of-type { margin-top: 6px; }
.legal-body p { color: var(--muted); line-height: 1.85; margin: 0 0 10px; text-wrap: pretty; overflow-wrap: anywhere; }
.legal-body ul { margin: 0 0 10px; padding-left: 20px; color: var(--muted); line-height: 1.9; overflow-wrap: anywhere; }
/*
 * 邮箱是整串不可断的词（www365Labtop@outlook.com），而文字是按钮里的裸文本节点、
 * 不是 span——所以折行规则必须落在按钮本身，否则窄屏 264px 的胶囊会把法务页顶出横向滚动。
 */
.mail-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  padding: 9px 16px;
  border-radius: 99px;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
/* 邮箱是整串不可断的词：窄屏靠 anywhere 折行，否则这颗按钮会把法务页顶出横向滚动 */
.mail-copy span { min-width: 0; overflow-wrap: anywhere; }
.mail-copy:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.mail-copy:focus-visible { outline: none; box-shadow: var(--ring); }
.mail-copy .mi { font-size: 16px; }
.mail-hint { font-size: 12.5px; }

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .home-tool-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .entry-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .tool-grid { grid-template-columns: 1fr; }
  /* 首页那排工具卡与目录页同步收成一列：两列时每格只剩 ~90px（极窄窗口），
     40px 图标加标题的 min-content 会把整页撑出横向滚动 */
  .home-tool-grid { grid-template-columns: 1fr; }
  /* 法务卡在窄屏收一档内边距：34px 的左右留白会把正文压到一百来像素宽 */
  .legal-body { padding: 22px 18px 24px; }
  /* 队列行窄屏：名称+删除一行、meta 整行、操作钮整行，多一个试听钮也不会把按钮挤成两半 */
  .tool-files li { flex-wrap: wrap; row-gap: 4px; }
  .tool-files li .tf-name { flex: 1 1 auto; }
  .tool-files li .tf-x { order: 2; margin-left: auto; align-self: center; }
  .tool-files li .tf-meta { flex: 1 1 100%; order: 3; }
  .tool-files li .btn.small { flex: 0 0 auto; order: 4; }
}

/* 超窄窗口（<400px）：快捷键表两列加起来放不下，改成"说明一行、键帽一行"的堆叠行 */
@media (max-width: 400px) {
  .kb-table, .kb-table tbody, .kb-table tr { display: block; width: 100%; }
  .kb-table tr { padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
  .kb-table td { display: block; width: auto; padding: 2px 0; border-bottom: 0; }
  .kb-table td:first-child { width: auto; }
  .kb-table tr:hover td { background: none; }
  .kb-table kbd { font-size: 11.5px; padding: 2px 6px; }
}

@media (max-width: 720px) {
  .main-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 2px; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { white-space: nowrap; }
  .header-inner { gap: 10px; }
  .site-hero { padding: 46px 0 36px; }
  .feat-grid { grid-template-columns: 1fr; }
  .brand-name small { display: none; }
  .tool-card { padding: 16px; }
}

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

/* ================= 工具页文档块 ================= */
.tool-docs { margin-top: 26px; }
.tool-docs h2 { font-size: 19px; margin: 0 0 10px; }
.tool-docs h3 { font-size: 15.5px; margin: 20px 0 8px; }
.doc-intro { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin: 0; }
.doc-steps { margin: 0; padding-left: 22px; color: var(--text); font-size: 13.5px; line-height: 1.9; }
.doc-steps li::marker { color: var(--accent); font-weight: 700; }
details.doc-faq { border: 1px solid var(--border-soft); border-radius: 10px; background: var(--panel); padding: 10px 14px; margin-top: 8px; }
details.doc-faq summary { cursor: pointer; font-size: 13.5px; font-weight: 600; list-style: none; }
details.doc-faq summary::-webkit-details-marker { display: none; }
details.doc-faq summary::before { content: "\25B8"; color: var(--accent); margin-right: 8px; display: inline-block; transition: transform 0.15s ease; }
details.doc-faq[open] summary::before { transform: rotate(90deg); }
details.doc-faq p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 8px 0 2px 20px; }

/* BATCH152：工具页文档面板底部"相关工具"胶囊 */
.rel-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.rel-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 99px;
  padding: 5px 12px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.rel-chip:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); transform: translateY(-1px); }
.rel-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* BATCH154：标签编辑页专辑封面预览 */
.tag-cover-row { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 4px; }
.tag-cover-btns { display: flex; gap: 8px; }
.tag-cover {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  margin-bottom: 4px;
  background: var(--panel-2);
}

/* ============ BATCH119: 工具页统一美化（双栏布局 + 卡片/文档加浓） ============ */
body.page-tool { background: radial-gradient(1100px 320px at 50% -140px, color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%) var(--bg); }
body.page-tool .tool-single { max-width: none; }
body.page-tool .tool-card {
  padding: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--accent) 8%), var(--panel) 46%);
  border: 1px solid color-mix(in srgb, var(--border) 70%, var(--accent) 30%);
  box-shadow: 0 18px 44px -22px rgba(10, 18, 40, 0.35), 0 2px 6px rgba(10, 18, 40, 0.06);
}
body.page-tool .tool-drop {
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-2));
  padding: 26px 18px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
body.page-tool .tool-drop:hover, body.page-tool .tool-drop.drag {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, var(--panel-2));
}
body.page-tool .tool-drop b { display: block; font-size: 15.5px; }
body.page-tool .tool-drop span { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
/* .file-name 是"用户文件名标签"这一族（工具页样本名 #sampleName、插入片段名 #clipName、试听选段名 #segPickFile、编辑页状态栏 #fileName）。
   它的保护此前只写在 base.css——而只有编辑页加载那张表，工具页拿到的是裸 span：
   255 字符不带空格的整串把标签撑到 1724px 宽、右缘 1765 远在 547px 视口之外（第365轮实测）。
   折行规则挪到每页都加载的这张表；编辑页那条 .stat .file-name 更具体，仍按省略号走，不受影响。 */
.file-name { overflow-wrap: anywhere; }
body.page-tool .tool-docs {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
body.page-tool .tool-docs h2 { font-size: 19px; margin: 0 0 10px; padding-left: 12px; border-left: 4px solid var(--accent); border-radius: 2px; line-height: 1.25; }
body.page-tool .tool-docs h3 { font-size: 15.5px; margin: 18px 0 8px; color: var(--accent); }
body.page-tool .doc-faq { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px 0; }
body.page-tool .doc-faq summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
body.page-tool .doc-faq p { color: var(--muted); font-size: 13px; margin: 8px 0 2px; line-height: 1.8; }
@media (min-width: 1101px) {
  body.page-tool main.wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0 30px; align-items: start; }
  body.page-tool main.wrap > .page-section:not(.tool-docs) { grid-column: 1; }
  body.page-tool main.wrap > .tool-docs { grid-column: 2; grid-row: 1; margin-top: 38px; position: sticky; top: calc(var(--head-h) + 14px); max-height: calc(100vh - var(--head-h) - 30px); overflow: auto; scrollbar-width: thin; }
}
@media (max-width: 1100px) {
  body.page-tool main.wrap > .page-section:first-of-type { margin-bottom: 0; }
}
/* ============ /BATCH119 ============ */
