/* wav2mp3 — one column: hero, the converter panel (the page's job), then how-to, features, FAQ.
   Waveform thumbnails double as progress meters. System fonts only: the site makes no third-party requests. */
:root {
  --bg: #F2F5F4;
  --surface: #FFFFFF;
  --sunken: #E8EDEB;
  --line: #D3DCD8;
  --line-strong: #B7C4BF;
  --fg: #13201B;
  --muted: #586863;
  --accent: #0A6A73;
  --accent-hover: #075860;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEEEE;
  --wave: #B3C3BE;
  --meter: #C47A1E;
  --ok: #26774A;
  --err: #B23B3B;
  --shadow: 0 1px 2px rgb(19 32 27 / .06), 0 12px 32px -16px rgb(19 32 27 / .22);

  --f-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "PingFang SC", "Microsoft YaHei", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1311; --surface: #151D1A; --sunken: #101815; --line: #25312C; --line-strong: #34433D;
    --fg: #E2EAE6; --muted: #8E9F98; --accent: #4FB8C1; --accent-hover: #6FCBD3; --accent-ink: #061A1C;
    --accent-soft: #12302F; --wave: #33433D; --meter: #E6A855; --ok: #5FC48C; --err: #EA8585;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -20px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1311; --surface: #151D1A; --sunken: #101815; --line: #25312C; --line-strong: #34433D;
  --fg: #E2EAE6; --muted: #8E9F98; --accent: #4FB8C1; --accent-hover: #6FCBD3; --accent-ink: #061A1C;
  --accent-soft: #12302F; --wave: #33433D; --meter: #E6A855; --ok: #5FC48C; --err: #EA8585;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -20px rgb(0 0 0 / .6);
  color-scheme: dark;
}
/* CJK pages put their own script's fonts first so shared Han characters use the right shapes. */
:lang(ja) { --f-sans: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif; }
:lang(zh-CN) { --f-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif; }
:lang(zh-TW) { --f-sans: system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Source Han Sans TC", sans-serif; }
:lang(ko) { --f-sans: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.7 var(--f-sans); -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
:lang(ja), :lang(zh-CN), :lang(zh-TW), :lang(ko) { line-break: strict; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: 960px; margin-inline: auto; padding-inline: 20px; }
@media (max-width: 480px) { .wrap { padding-inline: 16px; } }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo-bg { fill: var(--accent); }
.logo-fg { fill: var(--accent-ink); }
.drop-icon rect { fill: currentColor; }

/* ---------- top bar */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { color: var(--fg); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--accent); font-weight: 700; }

.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; border: 1px solid transparent;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { color: var(--fg); border-color: var(--line); background: var(--surface); }
.lang summary svg { width: 16px; height: 16px; }
.lang summary .caret { width: 10px; height: 10px; transition: transform .15s; }
.lang[open] summary .caret { transform: rotate(180deg); }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; margin: 0; padding: 6px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.lang li a { display: block; padding: 7px 12px; border-radius: 7px; color: var(--fg); text-decoration: none; font-size: 15px; }
.lang li a:hover { background: var(--sunken); }
.lang li a[aria-current] { color: var(--accent); font-weight: 700; }

.suggest { background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 14px; }
.suggest .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; }
.suggest a { font-weight: 700; white-space: nowrap; }

/* ---------- hero */
.hero { padding-block: 44px 26px; display: grid; gap: 14px; }
.hero h1 { margin: 0; font-size: clamp(30px, 5.2vw, 46px); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
:lang(ja) .hero h1, :lang(zh-CN) .hero h1, :lang(zh-TW) .hero h1, :lang(ko) .hero h1 { letter-spacing: 0; font-weight: 700; }
.lede { max-width: 60ch; color: var(--muted); font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; font-weight: 600; }
.chips li { display: inline-flex; align-items: center; gap: 6px; }
.chips svg { width: 16px; height: 16px; color: var(--ok); flex: none; }

/* ---------- converter panel */
.tool { padding-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 18px; }
@media (max-width: 480px) { .panel { padding: 14px; } }

.settings { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; }
.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
:lang(ja) .seg legend, :lang(zh-CN) .seg legend, :lang(zh-TW) .seg legend, :lang(ko) .seg legend { letter-spacing: .04em; }
.seg-opts { display: inline-flex; padding: 3px; gap: 3px; background: var(--sunken); border-radius: 10px; }
.seg-opts label { position: relative; }
.seg-opts input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg-opts span { display: block; padding: 6px 14px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .12s, color .12s; }
.seg-opts span small { font-weight: 500; font-size: 11px; margin-left: 3px; opacity: .75; }
.seg-opts label:hover span { color: var(--fg); }
.seg-opts input:checked + span { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 0 0 1px var(--line); }
:root[data-theme="dark"] .seg-opts input:checked + span { background: var(--line-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-opts input:checked + span { background: var(--line-strong); } }
.seg-opts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { flex-basis: 100%; min-height: 1.6em; font-size: 13.5px; color: var(--muted); }
@media (max-width: 560px) {
  .settings .seg { flex: 1 1 100%; }
  .seg-opts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .seg-opts span { text-align: center; padding-inline: 6px; }
}

.drop {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 10px; text-align: center;
  min-height: 230px; padding: 28px 16px; border: 1.5px dashed var(--line-strong); border-radius: 12px;
  background: var(--sunken); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-icon { width: 64px; height: 40px; color: var(--accent); }
.drop-main { font-size: 18px; font-weight: 700; }
.drop-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px;
}
.drop:hover .drop-btn { background: var(--accent-hover); }
.drop-note { font-size: 13px; color: var(--muted); }
.drop-compact { display: none; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); font-size: 15px; }
.drop-compact svg { width: 16px; height: 16px; }
.drop.compact { min-height: 0; padding: 14px 16px; }
.drop.compact > :not(input):not(.drop-compact) { display: none; }
.drop.compact .drop-compact { display: inline-flex; }

.files-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.files-head h2 { margin: 0; font-size: 16px; display: flex; align-items: baseline; gap: 10px; }
.files-head h2 .num { font-size: 13px; font-weight: 400; color: var(--muted); }
.bulk { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600;
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--sunken); color: var(--fg); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover:not(:disabled) { color: var(--fg); background: var(--sunken); border-color: transparent; }
.btn.sm { font-size: 13px; padding: 5px 12px; border-radius: 8px; }
.x { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.x:hover:not(:disabled) { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); }
.x:disabled { opacity: .3; cursor: not-allowed; }

.list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.item {
  display: grid; grid-template-columns: 148px minmax(0, 1fr) auto auto; grid-template-areas: "wave info pill acts";
  gap: 8px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; padding-bottom: 2px; }
.wave { grid-area: wave; display: block; width: 100%; height: 44px; }
.info { grid-area: info; min-width: 0; display: grid; gap: 1px; }
.name { font-weight: 700; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.meta, .size { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.item[data-status="error"] .size { font-family: var(--f-sans); color: var(--err); }
.pill {
  grid-area: pill; justify-self: end; min-width: 5.5em; padding: 2px 10px; border-radius: 999px; text-align: center;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--muted); background: var(--sunken);
}
.item[data-status="working"] .pill { color: var(--meter); background: color-mix(in srgb, var(--meter) 14%, transparent); }
.item[data-status="done"] .pill { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.item[data-status="error"] .pill { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); }
.acts { grid-area: acts; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
@media (max-width: 640px) {
  .item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "wave wave" "info info" "pill acts"; }
  .pill { justify-self: start; }
}

.support { margin-top: 14px; font-size: 13px; color: var(--muted); max-width: 80ch; }

/* ---------- content sections */
.section { padding-block: 52px 8px; }
.section h2 { margin: 0 0 22px; font-size: clamp(22px, 3.2vw, 28px); line-height: 1.3; letter-spacing: -.01em; }
.section h3 { margin: 0; font-size: 16.5px; line-height: 1.45; }
.section p { color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.steps li { display: grid; gap: 8px; align-content: start; padding-top: 16px; border-top: 2px solid var(--line); }
.step-n { font-family: var(--f-mono); font-size: 13px; font-weight: 600; color: var(--accent); }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feat { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.feat svg { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feat p { font-size: 15px; }
@media (max-width: 720px) { .feats { grid-template-columns: 1fr; } }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 2px; font-weight: 700; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq details p { padding: 0 2px 18px; max-width: 70ch; }

/* ---------- footer */
.foot { margin-top: 64px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot-in { display: grid; gap: 14px; padding-block: 28px 36px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--fg); }
.foot-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.foot-langs a[aria-current] { color: var(--fg); font-weight: 700; text-decoration: none; }

/* ---------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  max-width: min(560px, calc(100% - 32px)); padding: 10px 16px; border-radius: 10px;
  background: var(--fg); color: var(--bg); font-size: 14px; box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- licenses page */
.doc { padding-block: 40px 0; max-width: 760px; }
.doc h1 { font-size: clamp(26px, 4vw, 34px); margin: 0 0 16px; }
.doc h2 { font-size: 20px; margin: 32px 0 10px; }
.doc p, .doc li { color: var(--muted); }
.doc p + p { margin-top: 10px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 8px; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--fg); width: 30%; }
.doc .scroll { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
