:root {
  --bg: #090b0f;
  --panel: #11151c;
  --panel-soft: #161b24;
  --line: #262d39;
  --text: #f5f7fb;
  --muted: #919aab;
  --accent: #68f5b7;
  --accent-strong: #24d997;
  --danger: #ff8b8b;
  --shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 8%, rgba(104, 245, 183, .08), transparent 28rem),
    linear-gradient(180deg, #0b0e13 0%, var(--bg) 65%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.wordmark {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 720;
  letter-spacing: .02em;
  font-size: 1.12rem;
}

.mini-wave, .brand-mark { display: flex; align-items: center; justify-content: center; gap: 3px; }
.mini-wave { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.mini-wave i, .brand-mark span { display: block; width: 2px; background: var(--accent); border-radius: 99px; }
.mini-wave i:nth-child(1), .mini-wave i:nth-child(4) { height: 7px; }
.mini-wave i:nth-child(2) { height: 14px; }
.mini-wave i:nth-child(3) { height: 10px; }

.account { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: .9rem; }
.text-button { color: var(--muted); background: transparent; border: 0; padding: 7px 4px; }
.text-button:hover { color: var(--text); }

.workspace { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding: 78px 0 40px; flex: 1; }
.intro { margin-bottom: 32px; }
.eyebrow { color: var(--accent); font-size: .75rem; letter-spacing: .18em; font-weight: 750; margin: 0 0 12px; }
.intro h1 { font-size: clamp(2.25rem, 7vw, 4.6rem); line-height: 1.02; letter-spacing: -.055em; margin: 0 0 20px; font-weight: 720; }
.intro > p:last-child { color: var(--muted); margin: 0; max-width: 38rem; font-size: 1.02rem; }

.upload-panel, .result-panel, .error-panel {
  background: linear-gradient(145deg, rgba(24,29,38,.96), rgba(15,19,26,.96));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.drop-zone {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #3b4556;
  border-radius: 15px;
  padding: 32px 20px;
  background: rgba(255,255,255,.016);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging { border-color: var(--accent); background: rgba(104,245,183,.04); outline: none; }
.drop-zone.is-dragging { transform: scale(.994); }
.upload-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: #07130e; background: var(--accent); font-size: 1.75rem; margin-bottom: 20px; }
.drop-zone h2 { font-size: 1.25rem; margin: 0 0 5px; }
.drop-zone p { margin: 0; color: var(--muted); }
.drop-zone .format-note { margin-top: 22px; font-size: .75rem; letter-spacing: .055em; color: #697385; }

.selected-file { display: flex; align-items: center; gap: 14px; padding: 17px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 14px; }
.file-glyph { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: rgba(104,245,183,.1); color: var(--accent); font-size: .85rem; }
.file-meta { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.file-meta span { color: var(--muted); font-size: .8rem; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; width: 36px; height: 36px; }

.primary-button, .secondary-button {
  border: 0;
  border-radius: 11px;
  padding: 13px 20px;
  font-weight: 700;
  transition: transform .16s ease, opacity .16s ease, background .16s ease;
}
.primary-button { color: #06150f; background: var(--accent); }
.primary-button:hover:not(:disabled) { background: #83fac7; transform: translateY(-1px); }
.primary-button:disabled { opacity: .35; cursor: not-allowed; }
.primary-button.wide { width: 100%; margin-top: 16px; }
.secondary-button { color: var(--text); border: 1px solid #3a4453; background: #202632; }
.secondary-button:hover { background: #29313e; }

.progress-panel, .result-panel, .error-panel { margin-top: 22px; }
.status-row, .result-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.status-row h2, .result-heading h2 { margin: 0; font-size: 1.3rem; }
.status-pill { font-size: .8rem; padding: 7px 11px; color: var(--accent); background: rgba(104,245,183,.09); border-radius: 999px; }
.progress-track { overflow: hidden; height: 6px; background: #252d38; border-radius: 99px; margin: 24px 0 15px; }
.progress-track span { display: block; height: 100%; width: 35%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: scan 1.5s ease-in-out infinite; }
@keyframes scan { from { transform: translateX(-110%); } to { transform: translateX(320%); } }
.muted { color: var(--muted); margin: 0; font-size: .9rem; }
.result-actions { display: flex; align-items: center; gap: 12px; }
#transcript { width: 100%; min-height: 360px; margin-top: 22px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; background: #0c1016; color: var(--text); padding: 19px; line-height: 1.8; outline: none; }
#transcript:focus { border-color: #465264; }
.copy-feedback { min-height: 24px; color: var(--accent); font-size: .85rem; margin: 8px 2px 0; }
.error-panel { border-color: rgba(255,139,139,.35); }
.error-panel strong { color: var(--danger); }
.error-panel p { color: var(--muted); }

footer { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 32px; color: #657083; font-size: .8rem; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(430px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: rgba(17,21,28,.94); box-shadow: var(--shadow); }
.brand-mark { width: 58px; height: 58px; background: rgba(104,245,183,.1); border-radius: 16px; margin-bottom: 28px; }
.brand-mark span { width: 4px; }
.brand-mark span:nth-child(1), .brand-mark span:nth-child(4) { height: 13px; }
.brand-mark span:nth-child(2) { height: 31px; }
.brand-mark span:nth-child(3) { height: 23px; }
.login-card h1 { font-size: 2.6rem; margin: 0; letter-spacing: -.04em; }
.lede { color: var(--muted); margin: 10px 0 30px; }
.login-form { display: grid; gap: 10px; }
.login-form label { font-size: .85rem; color: #c5ccd7; margin-top: 5px; }
.login-form input { color: var(--text); background: #0c1016; border: 1px solid #303947; border-radius: 10px; padding: 13px 14px; outline: none; }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(104,245,183,.08); }
.login-form .primary-button { margin-top: 12px; }
.form-error { color: var(--danger); font-size: .86rem; margin: 4px 0 0; }

[hidden] { display: none !important; }

@media (max-width: 620px) {
  .topbar { width: min(100% - 28px, 1080px); height: 66px; }
  .workspace { width: min(100% - 28px, 820px); padding-top: 48px; }
  .intro h1 { font-size: 2.65rem; }
  .upload-panel, .result-panel, .error-panel { border-radius: 17px; padding: 14px; }
  .drop-zone { min-height: 240px; }
  .status-row, .result-heading { align-items: flex-start; flex-direction: column; }
  .result-actions { width: 100%; justify-content: space-between; }
  #transcript { min-height: 310px; }
  .login-card { padding: 30px 24px; }
}

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

