:root {
  --ink: #17332d;
  --muted: #687c76;
  --paper: #fffdf7;
  --canvas: #edf4e9;
  --line: #cbd9ce;
  --brand: #0b6b57;
  --brand-dark: #074c3f;
  --accent: #f4a340;
  --error: #b9362b;
  --success: #247249;
  --shadow: 0 18px 50px rgba(28, 61, 50, 0.1);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(244, 163, 64, 0.24), transparent 28rem),
    linear-gradient(135deg, var(--canvas), #f8f4e8 72%);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input { font: inherit; }
button, input[type="range"] { touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(11, 107, 87, 0.3);
  outline-offset: 3px;
}

.shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 36px; }
.utility-nav { display: flex; justify-content: flex-end; margin-bottom: 26px; }
.download-tool-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 8px 10px 8px 8px;
  border: 1px solid rgba(11, 107, 87, 0.18);
  border-radius: 17px;
  color: var(--brand-dark);
  background: linear-gradient(135deg, rgba(255, 253, 247, 0.96), rgba(237, 244, 233, 0.96));
  box-shadow: 0 10px 28px rgba(28, 61, 50, 0.09);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.download-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--brand);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.download-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.download-copy { display: grid; gap: 2px; min-width: 0; }
.download-sites { color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.2; letter-spacing: 0.08em; }
.download-copy strong { font-size: 14px; line-height: 1.25; }
.external-mark {
  display: grid;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: rgba(11, 107, 87, 0.09);
  font-size: 16px;
  font-weight: 800;
  transition: color 160ms ease, background 160ms ease;
}
.download-tool-link:hover { border-color: rgba(11, 107, 87, 0.42); transform: translateY(-2px); box-shadow: 0 14px 34px rgba(28, 61, 50, 0.15); }
.download-tool-link:hover .external-mark { color: white; background: var(--brand); }
.hero { position: relative; margin-bottom: 28px; }
.hero::after {
  content: "";
  position: absolute;
  width: 96px;
  height: 8px;
  right: 8px;
  top: 18px;
  border-radius: 50%;
  background: var(--accent);
  transform: rotate(-8deg);
}
.eyebrow, .section-tag {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
h1 { margin: 0; max-width: 660px; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 8vw, 68px); line-height: 1.04; letter-spacing: -0.04em; }
h1 span { color: var(--brand); }
.intro { max-width: 590px; margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.card { padding: 24px; border: 1px solid rgba(203, 217, 206, 0.9); border-radius: 20px; background: rgba(255, 253, 247, 0.94); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.query-card { margin-bottom: 18px; }
label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 700; }
.input-row { display: flex; gap: 10px; }
input[type="text"] { min-width: 0; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; }
input[type="text"]::placeholder { color: #8b9a95; }
.button { min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; cursor: pointer; font-weight: 700; white-space: nowrap; }
.button:hover { border-color: var(--brand); color: var(--brand); }
.button.primary { height: 48px; border-color: var(--brand); color: white; background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button:disabled { cursor: wait; opacity: 0.58; }
.button.mini { min-height: 36px; padding: 0 13px; font-size: 13px; }
.status { min-height: 20px; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status.loading { color: var(--brand); }
.status.ok { color: var(--success); }
.status.err { color: var(--error); }
.official-link { display: inline-block; margin-top: 4px; color: var(--brand); font-size: 13px; font-weight: 700; }
.player-card { animation: rise 360ms ease-out both; }
.title-row { padding-bottom: 4px; }
.title-row h2 { margin: 0 0 18px; font-family: Georgia, "Songti SC", serif; font-size: clamp(21px, 4vw, 28px); line-height: 1.4; overflow-wrap: anywhere; }
.clip-list, .rate-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.clip-list { margin-bottom: 14px; }
.clip-button, .rate-button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: white; cursor: pointer; }
.clip-button.active, .rate-button.active { border-color: var(--brand); color: white; background: var(--brand); }
audio { display: block; width: 100%; margin: 8px 0 20px; }
.speed-panel { padding-top: 18px; border-top: 1px dashed var(--line); }
.speed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.speed-head label { margin: 0; }
#rateVal { margin-left: 8px; color: var(--brand); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rate-buttons { margin: 15px 0; }
.rate-button { flex: 1 0 58px; padding: 0 8px; }
input[type="range"] { width: 100%; height: 32px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.hints { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.share-box { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
footer { padding: 24px 10px 0; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.65; }
footer p { margin: 2px 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .shell { width: min(100% - 24px, 760px); padding: max(12px, env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom)); }
  .utility-nav { margin-bottom: 20px; }
  .download-tool-link { min-height: 52px; padding: 7px 9px 7px 7px; border-radius: 15px; }
  .download-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .download-icon svg { width: 21px; height: 21px; }
  .download-copy strong { font-size: 13px; }
  .external-mark { width: 26px; height: 26px; font-size: 15px; }
  .hero { margin-bottom: 22px; padding: 0 4px; }
  .hero::after { width: 58px; right: 2px; top: 8px; }
  h1 { font-size: clamp(38px, 12vw, 52px); }
  .intro { margin-top: 15px; font-size: 14px; }
  .card { padding: 18px; border-radius: 17px; }
  .query-row, .share-row { flex-direction: column; }
  .query-row .button, .share-row .button { width: 100%; }
  input[type="text"], .button.primary { height: 50px; }
  .title-row h2 { margin-bottom: 14px; }
  .clip-list { flex-wrap: nowrap; margin-right: -18px; padding-right: 18px; overflow-x: auto; scrollbar-width: none; }
  .clip-list::-webkit-scrollbar { display: none; }
  .clip-button { flex: 0 0 auto; }
  .rate-buttons { display: grid; grid-template-columns: repeat(3, 1fr); }
  .rate-button { min-height: 44px; }
  .hints { display: none; }
}

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