:root {
  color-scheme: light;
  --navy: #1e3a8a;
  --navy-dark: #0b1b45;
  --gold: #b45309;
  --paper: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --danger: #b42318;
  --success: #166534;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: radial-gradient(circle at 50% 0, #eef2fb 0, var(--paper) 38%, var(--paper) 100%); min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.shell { width: min(720px, 100%); margin: 0 auto; padding: 32px 20px 72px; }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--navy); color: #fff; font-family: serif; font-size: 27px; }
.eyebrow { margin: 0 0 3px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; color: var(--navy-dark); font-size: clamp(25px, 5vw, 34px); }
h2 { margin: 0 0 10px; color: var(--navy-dark); font-size: 20px; }
p { line-height: 1.65; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 12px 34px rgba(15, 23, 42, .06); margin-bottom: 16px; }
.login-card { margin-top: 54px; }
label, .label { display: block; margin-bottom: 7px; color: #334155; font-size: 14px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: 12px 13px; color: var(--text); background: #fff; }
input:focus, textarea:focus { outline: 3px solid rgba(30, 58, 138, .14); border-color: var(--navy); }
.field-row, .button-row { display: flex; gap: 10px; align-items: stretch; }
.field-row input { min-width: 0; }
button { border: 0; border-radius: 10px; padding: 11px 17px; font-weight: 700; }
.primary { color: #fff; background: var(--navy); }
.primary:hover:not(:disabled) { background: #16306e; }
.secondary { color: var(--navy); background: #eef2fb; }
.text-button { padding: 4px 7px; color: var(--navy); background: transparent; }
.banner { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; line-height: 1.5; }
.banner.notice { color: #7c2d12; background: #fff7ed; border: 1px solid #fed7aa; }
.banner.warning { color: #713f12; background: #fefce8; border: 1px solid #fde68a; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: #f1f5f9; margin-bottom: 18px; }
.tab { color: var(--muted); background: transparent; }
.tab.active { color: var(--navy); background: #fff; box-shadow: 0 1px 5px rgba(15,23,42,.09); }
.controls textarea { margin-bottom: 18px; resize: vertical; }
.record-center { text-align: center; padding: 22px 0 8px; }
.record-button { width: 86px; height: 86px; padding: 0; border: 8px solid #dce4f4; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--navy); }
.record-button.recording { animation: pulse 1.5s infinite; }
.record-dot { display: block; width: 32px; height: 32px; margin: auto; border-radius: 50%; background: #c2410c; }
.timer { margin: 2px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.drop-zone { display: grid; gap: 6px; place-items: center; min-height: 140px; padding: 20px; border: 1px dashed #94a3b8; border-radius: 14px; text-align: center; background: #f8fafc; cursor: pointer; }
.drop-zone span { color: var(--muted); font-size: 13px; font-weight: 400; }
.selected-file { word-break: break-all; color: var(--muted); font-size: 14px; }
.status-heading, .result-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.progress { height: 8px; overflow: hidden; border-radius: 99px; background: #e2e8f0; }
.progress span { display: block; width: 15%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy), #0ea5e9); transition: width .3s ease; }
.result-block { margin-top: 18px; }
.translation-block { padding: 16px; border-left: 4px solid var(--gold); background: #fffaf0; border-radius: 0 10px 10px 0; }
.translation-block p { margin: 0; font-size: 19px; }
.uncertain-block { padding: 14px; border-radius: 10px; background: #fff7ed; }
.uncertain-block ul { margin: 8px 0 0; padding-left: 20px; }
.edited-note, .notice-text { color: var(--muted); font-size: 13px; }
.error { min-height: 1.4em; color: var(--danger); font-size: 14px; }
.global-error { text-align: center; }
.success { min-height: 1.4em; color: var(--success); font-size: 14px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(30,58,138,.10); } }

@media (max-width: 480px) {
  .shell { padding: 20px 14px 54px; }
  .card { padding: 17px; border-radius: 14px; }
  .field-row { flex-direction: column; }
  .button-row { flex-wrap: wrap; }
  .button-row button { flex: 1 1 140px; }
}

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