@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --navy: #071c2d;
  --navy-2: #0b2b42;
  --ink: #10293a;
  --paper: #f4f7f5;
  --white: #ffffff;
  --mist: #dce6e5;
  --muted: #70828d;
  --signal: #ff6846;
  --signal-deep: #e9492c;
  --aqua: #56d6c4;
  --line: rgba(16, 41, 58, .13);
  --shadow: 0 24px 70px rgba(7, 28, 45, .16);
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: Manrope, "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 88% 8%, rgba(86, 214, 196, .18), transparent 25rem),
    linear-gradient(180deg, var(--navy) 0 29rem, var(--paper) 29rem 100%);
}

button, select { font: inherit; }
button, select, input { outline: none; }
button:focus-visible, select:focus-visible, input:focus-visible + span { box-shadow: 0 0 0 3px rgba(86, 214, 196, .5); }

.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 44px; }

.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; color: white; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 13px; }
.brand > span:last-child { display: grid; }
.brand b { font-size: 23px; letter-spacing: .18em; line-height: 1; }
.brand small { font-family: "DM Mono", monospace; font-size: 8px; letter-spacing: .13em; opacity: .55; margin-top: 5px; }
.brand-mark { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; gap: 2px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.brand-mark i { width: 2px; height: 7px; border-radius: 2px; background: var(--aqua); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 14px; }
.brand-mark i:nth-child(3) { height: 20px; background: var(--signal); }

.connection { display: flex; align-items: center; gap: 8px; font: 500 11px "DM Mono", monospace; letter-spacing: .08em; color: rgba(255,255,255,.67); }
.connection span { width: 7px; height: 7px; border-radius: 50%; background: #8293a0; box-shadow: 0 0 0 4px rgba(130,147,160,.12); }
.connection.live span { background: var(--aqua); box-shadow: 0 0 0 4px rgba(86,214,196,.13), 0 0 15px var(--aqua); }

.hero { min-height: 250px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center; color: white; padding: 18px 38px 34px; }
.eyebrow { margin: 0 0 12px; color: var(--aqua); font: 500 10px "DM Mono", monospace; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 64px); font-weight: 500; line-height: 1.08; letter-spacing: -.055em; }
h1 em { color: var(--signal); font-style: normal; }
.hero-note { max-width: 440px; margin: 0; font-size: 14px; line-height: 1.8; color: rgba(255,255,255,.62); border-left: 1px solid rgba(86,214,196,.5); padding-left: 24px; }

.console { background: var(--white); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.65); }
.controls { min-height: 104px; display: flex; align-items: center; gap: 28px; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.field { display: grid; gap: 7px; min-width: 210px; }
.field > span { font: 500 9px "DM Mono", monospace; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.field select { appearance: none; width: 100%; height: 42px; padding: 0 38px 0 13px; color: var(--ink); background: #f5f8f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2310293a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 13px center; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; }
.sound-toggle { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.sound-toggle input { position: absolute; opacity: 0; }
.sound-toggle span { position: relative; width: 34px; height: 20px; background: #cbd6d7; border-radius: 20px; transition: .2s; }
.sound-toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.sound-toggle input:checked + span { background: var(--aqua); }
.sound-toggle input:checked + span::after { transform: translateX(14px); }
.start { margin-left: auto; min-width: 170px; height: 52px; border: 0; border-radius: 9px; color: white; background: var(--signal); display: flex; align-items: center; justify-content: center; gap: 11px; cursor: pointer; box-shadow: 0 8px 22px rgba(255,104,70,.26); transition: transform .18s, background .18s; }
.start:hover { transform: translateY(-1px); background: var(--signal-deep); }
.start:active { transform: translateY(0); }
.start b { font-size: 14px; font-weight: 700; }
.start-icon { width: 11px; height: 11px; background: white; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,255,255,.2); }
.start.running { background: var(--navy-2); box-shadow: none; }
.start.running .start-icon { border-radius: 2px; box-shadow: none; }
.start:disabled { opacity: .6; cursor: wait; transform: none; }

.status-strip { min-height: 50px; padding: 0 28px; display: grid; grid-template-columns: 128px 1fr auto; align-items: center; gap: 18px; color: var(--muted); background: #f7faf9; border-bottom: 1px solid var(--line); font-size: 11px; }
.meter { height: 24px; display: flex; align-items: center; gap: 4px; }
.meter i { width: 2px; height: 4px; background: #9cb1b5; border-radius: 3px; transition: height .12s; }
.running + .status-strip .meter i, .status-strip.live .meter i { animation: voice .72s ease-in-out infinite alternate; background: var(--signal); }
.meter i:nth-child(2n) { animation-delay: -.2s !important; }
.meter i:nth-child(3n) { animation-delay: -.4s !important; }
.meter i:nth-child(5n) { animation-delay: -.55s !important; }
@keyframes voice { from { height: 4px; } to { height: 22px; } }
.status-strip time { font: 500 11px "DM Mono", monospace; color: var(--ink); }

.subtitles { display: grid; grid-template-columns: 1fr 1fr; min-height: 390px; }
.subtitle-card { min-width: 0; padding: 30px 32px 38px; }
.subtitle-card + .subtitle-card { border-left: 1px solid var(--line); }
.translation-card { background: #fbfdfc; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.card-head span { font-size: 12px; font-weight: 700; }
.card-head small { color: var(--muted); font: 400 9px "DM Mono", monospace; letter-spacing: .08em; }
.subtitle-card p { height: 274px; overflow-y: auto; margin: 22px 0 0; padding-right: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: clamp(17px, 1.55vw, 22px); line-height: 1.75; letter-spacing: -.015em; scrollbar-width: thin; scrollbar-color: var(--mist) transparent; }
.subtitle-card p.empty { color: #aab9bc; font-size: 15px; }
.translation-card p:not(.empty) { color: var(--navy-2); font-weight: 550; }

.actions { min-height: 70px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px; }
.actions > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.actions > span i { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); }
.actions > div { display: flex; gap: 8px; }
.quiet { height: 34px; padding: 0 13px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; font-weight: 600; cursor: pointer; }
.quiet:hover { background: var(--paper); }

.tips { margin: 16px 4px 0; padding: 14px 18px; display: flex; gap: 12px; align-items: baseline; color: #536874; font-size: 11px; line-height: 1.65; }
.tips b { flex: none; color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 12px 17px; color: white; background: var(--navy); border-radius: 8px; box-shadow: 0 10px 30px rgba(7,28,45,.22); opacity: 0; pointer-events: none; transition: .22s; font-size: 12px; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #9f3122; }

@media (max-width: 760px) {
  body { background: linear-gradient(180deg, var(--navy) 0 30rem, var(--paper) 30rem); }
  .shell { width: min(100% - 24px, 1160px); }
  .hero { grid-template-columns: 1fr; gap: 20px; padding: 28px 10px 38px; }
  .hero-note { padding-left: 16px; }
  .controls { flex-wrap: wrap; gap: 16px; padding: 20px; }
  .field { min-width: calc(100% - 120px); }
  .start { width: 100%; margin-left: 0; }
  .status-strip { grid-template-columns: 76px 1fr auto; padding: 0 18px; gap: 10px; }
  .meter i:nth-child(n+8) { display: none; }
  .subtitles { grid-template-columns: 1fr; }
  .subtitle-card + .subtitle-card { border-left: 0; border-top: 1px solid var(--line); }
  .subtitle-card { padding: 24px 22px 28px; }
  .subtitle-card p { height: 210px; }
  .actions { align-items: flex-start; flex-direction: column; padding: 16px 20px; }
  .actions > div { width: 100%; }
  .quiet { flex: 1; padding: 0 6px; }
  .tips { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

