/* chinaPTE — mobile-first; day/night via data-theme on <html> · cache 20260915r2 */

:root,
[data-theme="night"] {
  --bg: #0c0f14;
  --bg-elevated: #151a22;
  --bg-card: #1a2130;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --text-muted: #8b95a8;
  --accent: #5b8def;
  --accent-soft: rgba(91, 141, 239, 0.18);
  --accent-glow: rgba(91, 141, 239, 0.35);
  --success: #3dd68c;
  --success-soft: rgba(61, 214, 140, 0.15);
  --chip: #243044;
  --chip-active: #2d4a7a;
  --danger-soft: rgba(239, 100, 100, 0.15);
  --nav-hover: rgba(255, 255, 255, 0.05);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --bg-glow-1: rgba(91, 141, 239, 0.12);
  --bg-glow-2: rgba(61, 214, 140, 0.05);
  --scrubber-track: #2a3344;
  --color-scheme: dark;
  --radius: 16px;
  --radius-sm: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --max: 480px;
  --max-wide: 720px;
  color-scheme: dark;
}

[data-theme="day"] {
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --text: #1a2332;
  --text-muted: #5a6578;
  --accent: #3d6fd9;
  --accent-soft: rgba(61, 111, 217, 0.12);
  --accent-glow: rgba(61, 111, 217, 0.22);
  --success: #1a9f63;
  --success-soft: rgba(26, 159, 99, 0.12);
  --chip: #e8eef8;
  --chip-active: #cfdcf5;
  --danger-soft: rgba(220, 60, 60, 0.12);
  --nav-hover: rgba(15, 23, 42, 0.05);
  --surface-soft: rgba(15, 23, 42, 0.04);
  --bg-glow-1: rgba(61, 111, 217, 0.1);
  --bg-glow-2: rgba(26, 159, 99, 0.06);
  --scrubber-track: #d5dde8;
  --color-scheme: light;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--bg-glow-1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, var(--bg-glow-2), transparent);
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  color: inherit;
  background: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.app {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 16px calc(24px + var(--safe-bottom));
}

.app-wide {
  max-width: var(--max-wide);
}

/* Stacked on phone; becomes 2-col at ≥1024 */
.practice-split {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* ===== Shared site nav ===== */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  white-space: nowrap;
  text-decoration: none;
}

.site-nav-brand:hover {
  text-decoration: none;
  color: var(--text);
}

.site-nav-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  display: block;
}

.site-nav-brand span {
  color: var(--accent);
  font-weight: 650;
  font-size: 0.85em;
}

.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
}

.site-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  min-height: 36px;
}

.site-nav-links a:hover {
  color: var(--text);
  background: var(--nav-hover);
  text-decoration: none;
}

.site-nav-links a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}


/* ===== Theme toggle (日间 / 夜间 / 自动) ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
}

.theme-toggle-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1;
  padding: 0 2px;
  white-space: nowrap;
}

.theme-toggle-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.theme-toggle-btn {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  min-height: 40px;
  min-width: 44px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.theme-toggle-btn:hover {
  color: var(--text);
  background: var(--nav-hover);
}

.theme-toggle-btn.is-active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

[data-theme="day"] .theme-toggle-btn.is-active {
  color: #fff;
}

.theme-toggle-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Fixed sticky — always visible, above Play All / bottom chrome */
.theme-toggle--sticky {
  position: fixed;
  z-index: 100;
  top: auto;
  bottom: calc(72px + var(--safe-bottom));
  right: 12px;
  left: auto;
  margin-left: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px 10px 8px;
  border-radius: 16px;
  border: 2px solid var(--accent);
  background: var(--bg-card);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-theme="day"] .theme-toggle--sticky {
  border-color: var(--accent);
  box-shadow:
    0 8px 28px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(61, 111, 217, 0.2);
}

.theme-toggle--sticky .theme-toggle-label {
  text-align: center;
  font-size: 0.75rem;
  color: var(--accent);
}

.theme-toggle--sticky .theme-toggle-btns {
  width: 100%;
  justify-content: space-between;
}

.theme-toggle--sticky .theme-toggle-btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 0.82rem;
}

/* Compact nav mirror (desktop); hide on crowded mobile nav */
.theme-toggle--nav {
  flex-basis: 100%;
  justify-content: flex-end;
  margin-top: 4px;
  padding: 3px 6px;
  gap: 4px;
  border-radius: 999px;
}

.theme-toggle--nav .theme-toggle-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.theme-toggle--nav .theme-toggle-btn {
  min-height: 32px;
  min-width: 0;
  padding: 6px 10px;
  font-size: 0.72rem;
}

@media (max-width: 519px) {
  .theme-toggle--nav {
    display: none;
  }
}

@media (min-width: 520px) {
  .theme-toggle--nav {
    flex-basis: auto;
    margin-top: 0;
  }
}

/* Header (WFD) */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 16px;
  gap: 12px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stats-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.stats-pill strong {
  color: var(--success);
  font-weight: 700;
}

.streak-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.streak-pill {
  background: var(--success-soft);
  border: 1px solid rgba(61, 214, 140, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 600;
}

/* Hero Play All */
.hero {
  margin-bottom: 20px;
}

.btn-play-all {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #4a7de0 0%, #3d6bc7 100%);
  border-radius: var(--radius);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 32px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 64px;
  color: #fff;
}

.btn-play-all:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-play-all.is-playing {
  background: linear-gradient(135deg, #3a5fad 0%, #2d4a8a 100%);
}

.btn-play-all .icon {
  font-size: 1.4rem;
  line-height: 1;
}

.btn-play-all .label-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.btn-play-all .label-en {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Progress */
.progress-wrap {
  margin-bottom: 16px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 2px;
  width: 0%;
  transition: width 0.35s ease;
}

.progress-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0 0 8px;
  background: transparent;
  cursor: pointer;
}

.progress-range:focus {
  outline: none;
}

.progress-range:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.progress-range::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.progress-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--success));
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: grab;
}

.progress-range:active::-webkit-slider-thumb {
  cursor: grabbing;
}

.progress-range::-moz-range-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.progress-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--success));
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: grab;
}

.progress-range:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.jump-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.jump-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.jump-input {
  width: 72px;
  min-height: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  -moz-appearance: textfield;
}

.jump-input::-webkit-outer-spin-button,
.jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.jump-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.jump-btn:active {
  background: var(--accent-soft);
  color: var(--accent);
}

.jump-error {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--danger, #e85d5d);
  white-space: nowrap;
}

.jump-error[hidden] {
  display: none !important;
}

/* Now playing card */
.now-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 220px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 10px;
  border-radius: 999px;
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease infinite;
}

.status-badge.is-idle .dot {
  animation: none;
  background: var(--text-muted);
}

.status-badge.is-idle {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.sentence-en {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--text);
}

.sentence-zh {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.sentence-zh.hidden {
  display: none;
}

.vocab-section {
  margin-top: auto;
}

.vocab-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.vocab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.85rem;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  text-align: left;
  max-width: 100%;
}

.chip:active {
  transform: scale(0.97);
}

.chip.is-active {
  background: var(--chip-active);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.chip-word {
  font-weight: 700;
  color: var(--text);
}

.chip-gloss {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chip-spelling {
  font-size: 0.7rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--accent);
  letter-spacing: 0.04em;
  display: none;
}

.chip.is-active .chip-spelling {
  display: block;
}

.chip-tip {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: none;
  margin-top: 2px;
}

.chip.is-active .chip-tip {
  display: block;
}

/* Transport controls */
.controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.ctrl-btn .ico {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text);
}

.ctrl-btn:active:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.ctrl-btn.is-primary {
  background: var(--accent-soft);
  border-color: rgba(91, 141, 239, 0.4);
}

.ctrl-btn.is-primary .ico {
  color: var(--accent);
}

/* Play mode: 听题目 | 随身听 */
.play-mode-seg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.play-mode-seg .play-mode-btn {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.play-mode-seg .play-mode-btn + .play-mode-btn {
  margin-left: -1px;
}
.play-mode-seg .play-mode-btn:first-of-type {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.play-mode-seg .play-mode-btn:nth-of-type(2) {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.play-mode-seg .play-mode-btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(91, 141, 239, 0.45);
  z-index: 1;
}
.play-mode-hint {
  flex: 1 1 100%;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Options row */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.speed-group {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.speed-btn {
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-height: 44px;
  min-width: 48px;
  border-right: 1px solid var(--border);
}

.speed-btn:last-child {
  border-right: none;
}

.speed-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.loop-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px 4px 12px;
  min-height: 44px;
}

.loop-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.loop-step {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.loop-step:active {
  background: var(--accent-soft);
  color: var(--accent);
}

.loop-input {
  width: 48px;
  min-height: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  -moz-appearance: textfield;
}

.loop-input::-webkit-outer-spin-button,
.loop-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.loop-indicator {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.loop-indicator[hidden] {
  display: none !important;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  min-height: 44px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  flex: 1;
  min-width: 140px;
}

.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--scrubber-track);
  border-radius: 11px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
}

.toggle.is-on .toggle-track {
  background: var(--accent);
}

.toggle.is-on .toggle-track::after {
  transform: translateX(18px);
  background: #fff;
}

.toggle.is-on {
  color: var(--text);
}

/* Filter / search */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-bar input {
  flex: 1;
  min-height: 44px;
}

.btn-ghost {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-height: 44px;
  white-space: nowrap;
}

.btn-ghost:active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Privacy note */
.privacy {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  padding: 8px 4px;
  opacity: 0.85;
}

.privacy span {
  color: var(--success);
}

.unsupported {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 100, 100, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #f0a0a0;
  margin-bottom: 12px;
  display: none;
}

.unsupported.is-visible {
  display: block;
}

/* Soft lead blurb (sticky / footer) */
.lead-blurb {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-blurb p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.lead-blurb strong {
  color: var(--text);
}

.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 141, 239, 0.35);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  min-height: 48px;
  text-decoration: none;
  text-align: center;
}

.btn-soft:hover {
  text-decoration: none;
  background: rgba(91, 141, 239, 0.28);
}

.btn-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #4a7de0 0%, #3d6bc7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 16px 20px;
  border-radius: var(--radius);
  min-height: 56px;
  text-decoration: none;
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-primary-link:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.btn-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 18px;
  border-radius: var(--radius);
  min-height: 52px;
  text-decoration: none;
  margin-top: 10px;
}

.btn-secondary-link:hover {
  text-decoration: none;
  border-color: var(--accent);
}

/* ===== Marketing home ===== */
.home-hero {
  text-align: left;
  padding: 8px 0 24px;
}

.home-hero h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.home-hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.home-hero .tagline {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.trust-grid {
  display: grid;
  gap: 10px;
  margin: 20px 0 24px;
}

.trust-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.trust-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.trust-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 8px 0 12px;
}

.method-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.method-steps li {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.method-steps .num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bridge-card {
  background: linear-gradient(135deg, rgba(91, 141, 239, 0.12), rgba(61, 214, 140, 0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 8px 0 24px;
}

.bridge-card h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.bridge-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.9;
  line-height: 1.5;
  margin-top: 8px;
}

/* Lead form */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.lead-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lead-form .btn-submit {
  background: linear-gradient(135deg, #4a7de0 0%, #3d6bc7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px;
  border-radius: var(--radius-sm);
  min-height: 52px;
  margin-top: 4px;
  box-shadow: 0 6px 20px var(--accent-glow);
}

.lead-form .btn-submit:active {
  transform: scale(0.98);
}

.wechat-box {
  background: var(--bg-elevated);
  border: 1px dashed rgba(91, 141, 239, 0.4);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  margin: 12px 0;
}

.wechat-box .wx-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.wechat-box .wx-id {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.form-success {
  display: none;
  background: var(--success-soft);
  border: 1px solid rgba(61, 214, 140, 0.35);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}

.form-success.is-visible {
  display: block;
}

.form-success h3 {
  color: var(--success);
  font-size: 1rem;
  margin-bottom: 8px;
}

.form-success p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.form-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

.copy-toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.copy-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Bank list */
.bank-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.bank-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.bank-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s;
}

.bank-item:active,
.bank-item:hover {
  border-color: var(--accent);
}

.bank-item .bi-id {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.bank-item .bi-en {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 6px;
}

.bank-item .bi-zh {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bank-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 480px) {
  .app {
    padding-top: 24px;
  }

  .sentence-en {
    font-size: 1.3rem;
  }

  .home-hero h1 {
    font-size: 1.9rem;
  }
}

@media (min-width: 481px) {
  .trust-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ——— Practice hub & multi-type additions ——— */
.tip-banner {
  margin: 10px 0 14px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 141, 239, 0.28);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.answer-reveal,
.answer-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--success-soft);
  border: 1px solid rgba(61, 214, 140, 0.3);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-weight: 600;
}

.answer-reveal.is-shown { display: block; }

.practice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 28px;
}

@media (min-width: 768px) {
  .practice-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.practice-card {
  display: block;
  padding: 16px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.practice-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

.practice-card.is-hot {
  border-color: rgba(91, 141, 239, 0.45);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.practice-card h3 {
  font-size: 1.15rem;
  margin: 4px 0 6px;
}

.practice-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.pc-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.pc-flow {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--accent);
}

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.type-tab {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.type-tab.is-active {
  background: var(--accent-soft);
  border-color: rgba(91, 141, 239, 0.4);
  color: var(--accent);
  font-weight: 600;
}

.type-select {
  width: auto;
  min-width: 120px;
  flex-shrink: 0;
}

.site-nav-links {
  flex-wrap: wrap;
}

.text-practice-card .sentence-en {
  white-space: pre-wrap;
}

.home-hero .btn-secondary-link {
  display: inline-block;
  margin: 6px 8px 0 0;
}


/* Keep-alive / wake-lock toggles */
.keep-awake-options {
  margin-top: -6px;
  margin-bottom: 14px;
}
.keep-awake-options .toggle {
  flex: 1 1 160px;
  font-size: 0.78rem;
}
.tip-banner.is-warn {
  background: rgba(255, 176, 32, 0.12);
  border-color: rgba(255, 176, 32, 0.35);
}


/* DI Describe Image — chart / picture */
.di-image-wrap {
  width: 100%;
  margin: 0 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 280px;
}
.di-image-wrap img {
  display: block;
  width: 100%;
  max-height: 280px;
  height: auto;
  object-fit: contain;
  background: #f8fafc;
}
[data-theme="night"] .di-image-wrap img {
  background: #0f172a;
}
[data-theme="night"] .di-image-wrap {
  background: rgba(255, 255, 255, 0.03);
}


/* Speak-score (RA / RS 跟读评分) */
.speak-score-wrap {
  margin-bottom: 16px;
}

.speak-score {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.speak-score-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.speak-score-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: -4px;
}

.speak-score-unsupported {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 100, 100, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #f0a0a0;
}

[data-theme="day"] .speak-score-unsupported {
  color: #b33a3a;
}

.speak-score-playfirst {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
  min-height: 32px;
}

.speak-score-playfirst input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.speak-score-playfirst.is-disabled {
  opacity: 0.55;
}

.speak-score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.speak-score-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.speak-score-btn:active {
  transform: scale(0.98);
}

.speak-score-btn-primary {
  background: var(--accent-soft);
  border-color: rgba(91, 141, 239, 0.35);
  color: var(--accent);
}

.speak-score-btn-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 100, 100, 0.35);
  color: #f0a0a0;
}

[data-theme="day"] .speak-score-btn-danger {
  color: #b33a3a;
}

.speak-score-status {
  font-size: 0.85rem;
  color: var(--accent);
  line-height: 1.5;
  word-break: break-word;
}

.speak-score-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.speak-score-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.speak-score-num {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.speak-score-num.is-good {
  color: var(--success);
}

.speak-score-num.is-mid {
  color: var(--accent);
}

.speak-score-num.is-low {
  color: #f0a0a0;
}

[data-theme="day"] .speak-score-num.is-low {
  color: #b33a3a;
}

.speak-score-best {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.speak-score-sublabel {
  align-self: stretch;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 6px;
}

.speak-score-transcript {
  align-self: stretch;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.speak-score-comment {
  align-self: stretch;
  text-align: left;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ——— Industry English ——— */
.ind-back {
  margin: 8px 0 4px;
  font-size: 0.85rem;
}
.ind-back a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.ind-back a:hover { text-decoration: underline; }

/* Industry category: vocab / phrases tabs */
.ind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.ind-tab {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  min-height: 40px;
}
.ind-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ind-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.ind-panel {
  margin-top: 4px;
}
.ind-panel[hidden] {
  display: none !important;
}
.ind-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 24px;
}
.ind-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.ind-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.ind-en {
  color: var(--text);
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.4;
}
.ind-zh {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.ind-spell {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.ind-speak {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}
.ind-speak:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ——— Industry IPA / phrase keys ——— */
.ind-ipa {
  font-size: 0.82rem;
  color: var(--accent);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.ind-keys {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--surface-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.ind-keys-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.ind-keys ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.ind-key {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 6px 10px;
  align-items: baseline;
  font-size: 0.8rem;
  line-height: 1.35;
}
.ind-key-en {
  font-weight: 650;
  color: var(--text);
}
.ind-key-ipa {
  color: var(--accent);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}
.ind-key-zh {
  color: var(--text-muted);
}
.ind-item-phrase .ind-main {
  gap: 6px;
}
@media (max-width: 520px) {
  .ind-key {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  .ind-key:last-child { border-bottom: 0; padding-bottom: 0; }
}

/* ——— Vocab bank: phonetic + pos + gloss ——— */
.vr-pos {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}
.vocab-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.vocab-meta-line .vm-ph {
  color: var(--accent);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}
.vocab-meta-line .vm-pos {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.75rem;
}
.vocab-meta-line .vm-gloss {
  color: var(--text-muted);
}
.vr-word-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  grid-column: 1;
}


/* Home CTA grid + vocab count badge (mobile-first base) */
.home-cta-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
}
.home-cta-grid .btn-secondary-link {
  width: 100%;
  margin-top: 10px;
}
.vocab-count-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.copyright-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 42em;
}
.copyright-note strong {
  color: var(--text);
  font-weight: 650;
}

/* ===== Responsive layout system ===== */
/*
  Breakpoints (mobile-first):
  - base / ≤480px     phone
  - ≥481px            large phone / tablet portrait
  - ≥768px            tablet landscape
  - ≥1024px           desktop
  - ≥1280px           large desktop
  Content --max / --max-wide + grids/nav/player scale at each step.
*/

/* —— ≥481: large phone / tablet portrait —— */
@media (min-width: 481px) {
  :root,
  [data-theme="night"],
  [data-theme="day"] {
    --max: 540px;
    --max-wide: 640px;
  }

  .app {
    padding: 16px 20px calc(28px + var(--safe-bottom));
  }

  .home-hero h1 {
    font-size: 1.85rem;
  }

  .home-cta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
  }

  .home-cta-grid .btn-secondary-link {
    width: 100%;
    margin-top: 0;
    min-height: 48px;
  }

  .vocab-count-badge {
    font-size: 0.78rem;
    padding: 2px 10px;
    margin-left: 8px;
  }

  .controls {
    gap: 10px;
  }

  .ctrl-btn {
    min-height: 58px;
  }
}

/* —— ≥768: tablet landscape —— */
@media (min-width: 768px) {
  :root,
  [data-theme="night"],
  [data-theme="day"] {
    --max: 720px;
    --max-wide: 920px;
  }

  .app {
    padding: 20px 24px calc(32px + var(--safe-bottom));
  }

  .site-nav {
    gap: 12px;
    padding: 6px 0 14px;
  }

  .site-nav-brand {
    font-size: 0.95rem;
  }

  .site-nav-links {
    gap: 4px;
  }

  .site-nav-links a {
    padding: 8px 11px;
    font-size: 0.78rem;
    min-height: 38px;
  }

  .home-hero {
    padding: 10px 0 24px;
  }

  .home-hero h1 {
    font-size: 2rem;
  }

  .home-hero .tagline {
    font-size: 1.02rem;
    max-width: 40em;
  }

  .home-hero .btn-primary-link {
    width: auto;
    display: inline-flex;
    min-width: 260px;
    max-width: 400px;
    margin-bottom: 8px;
  }

  .home-cta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .home-cta-grid .btn-secondary-link {
    display: flex;
    width: 100%;
    margin: 0;
  }

  .trust-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 26px;
  }

  .practice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .method-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .seo-quick-links.method-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Industry lists: 2 columns */
  .ind-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  /* Vocab word list: 2 columns */
  #wordList,
  .vocab-word-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    max-height: min(48vh, 420px);
  }

  #wordList .vocab-row,
  .vocab-word-list .vocab-row {
    margin-bottom: 0;
  }

  .sentence-en {
    font-size: 1.32rem;
  }

  .bridge-card .btn-secondary-link {
    width: auto;
    display: inline-flex;
    margin-top: 10px;
  }

  .now-card {
    padding: 18px 18px;
  }
}

/* —— ≥1024: desktop —— */
@media (min-width: 1024px) {
  :root,
  [data-theme="night"],
  [data-theme="day"] {
    --max: 1280px;
    --max-wide: 1280px;
  }

  /* Fill the viewport with comfortable side margins (unmistakable desktop shell) */
  .app,
  .app-wide {
    width: min(1280px, 96vw);
    max-width: 100%;
    padding: 24px clamp(24px, 2.2vw, 48px) calc(40px + var(--safe-bottom));
  }

  .now-card {
    padding: 24px 28px;
  }

  .sentence-en {
    font-size: 1.52rem;
  }

  .sentence-zh {
    font-size: 1.06rem;
  }

  .vocab-player-pane {
    max-width: none;
  }

  /* Desktop practice split: player | list / dictation / score */
  .practice-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.95fr);
    column-gap: 24px;
    row-gap: 16px;
    align-items: start;
    margin-top: 4px;
  }

  .practice-split > .practice-split-player {
    min-width: 0;
  }

  .practice-split > .practice-split-list,
  .practice-split > #wordList {
    min-width: 0;
    position: sticky;
    top: 16px;
    align-self: start;
  }

  .practice-split > .practice-split-list:has(#wordList),
  .practice-split > #wordList {
    max-height: min(74vh, 720px);
  }

  .practice-split #wordList,
  .practice-split .vocab-word-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-template-columns: none;
    max-height: min(74vh, 720px);
    overflow: auto;
  }

  .practice-split #wordList .vocab-row,
  .practice-split .vocab-word-list .vocab-row {
    margin-bottom: 0;
  }

  /* Nav: readable horizontal desktop row */
  .site-nav {
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    padding: 8px 0 16px;
    margin-bottom: 20px;
  }

  .site-nav-brand {
    font-size: 1.35rem;
  }
  .site-nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }


  .site-nav-links {
    flex-wrap: nowrap;
    gap: 2px;
    justify-content: flex-end;
  }

  .site-nav-links a {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 38px;
  }

  .home-hero h1 {
    font-size: 2.25rem;
    max-width: 18em;
  }

  .home-hero .tagline {
    font-size: 1.08rem;
    margin-bottom: 22px;
    max-width: 46em;
  }

  .home-hero .home-cta-grid,
  .home-cta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
    margin-top: 12px;
  }

  .home-hero .home-cta-grid .btn-secondary-link,
  .home-cta-grid .btn-secondary-link {
    display: flex;
    width: 100%;
    margin: 0;
    min-height: 48px;
  }

  .trust-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .practice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .consult-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    gap: 24px;
    align-items: start;
    margin-top: 8px;
  }

  .ind-list {
    gap: 10px 14px;
  }

  #wordList,
  .vocab-word-list {
    max-height: min(52vh, 520px);
  }

  .controls {
    gap: 12px;
    max-width: none;
  }

  .ctrl-btn {
    min-height: 60px;
    font-size: 0.7rem;
  }

  .ctrl-btn .ico {
    font-size: 1.35rem;
  }

  .wfd-dictation,
  .speak-score,
  .ra-sentence-panel {
    padding: 20px 18px;
  }
}

/* —— ≥1280: large desktop —— */
@media (min-width: 1280px) {
  :root,
  [data-theme="night"],
  [data-theme="day"] {
    --max: 1280px;
    --max-wide: 1280px;
  }

  .app,
  .app-wide {
    width: min(1280px, 96vw);
    max-width: 100%;
    padding: 28px clamp(28px, 2.5vw, 56px) calc(44px + var(--safe-bottom));
  }

  .now-card {
    padding: 26px 32px;
  }

  .sentence-en {
    font-size: 1.62rem;
  }

  .practice-split {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
    column-gap: 28px;
  }

  .practice-split > .practice-split-list:has(#wordList),
  .practice-split > #wordList {
    max-height: min(78vh, 760px);
  }

  .home-hero h1 {
    font-size: 2.45rem;
  }

  .home-hero .home-cta-grid,
  .home-cta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
  }

  .home-hero .btn-primary-link {
    min-width: 300px;
    max-width: 440px;
    font-size: 1.08rem;
  }

  .practice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .trust-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .site-nav-links a {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .trust-card {
    padding: 18px 20px;
  }

  .ind-list {
    gap: 12px 16px;
  }

  #wordList,
  .vocab-word-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(56vh, 560px);
  }

  .controls {
    max-width: none;
  }
}

/* Phone safety: keep single-column CTAs & touch targets on very narrow screens */
@media (max-width: 480px) {
  .home-cta-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .home-cta-grid .btn-secondary-link {
    width: 100%;
    margin-top: 10px;
    min-height: 52px;
  }

  .site-nav-links a {
    min-height: 36px;
    padding: 8px 10px;
  }

  .ctrl-btn {
    min-height: 56px;
  }

  /* Avoid accidental 2-col squeeze on tiny phones for industry */
  .ind-list {
    display: flex;
    flex-direction: column;
  }
}

/* ========== WFD 听写练习 ========== */
.wfd-dictation-wrap {
  margin: 0 0 16px;
}

.wfd-dictation {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wfd-dictation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wfd-dictation-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.wfd-dictation-hide-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.wfd-dictation-hide-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.wfd-dictation-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.wfd-dictation-input {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 12px 12px;
  font-size: 1rem;
  line-height: 1.5;
  font-family: var(--font);
  box-sizing: border-box;
}

.wfd-dictation-input:focus {
  outline: 2px solid var(--accent-glow);
  border-color: var(--accent);
}

.wfd-dictation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wfd-dictation-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.wfd-dictation-btn:active {
  transform: scale(0.98);
}

.wfd-dictation-btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.wfd-dictation-result {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wfd-dictation-score {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.wfd-dictation-sublabel {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wfd-dictation-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  line-height: 1.7;
  font-size: 1.02rem;
}

.wfd-word {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

.wfd-word.is-correct {
  background: var(--success-soft);
  color: var(--success);
}

.wfd-word.is-wrong,
.wfd-word.is-extra {
  background: var(--danger-soft);
  color: #e85d5d;
  text-decoration: underline;
  text-decoration-style: wavy;
}

.wfd-word.is-missing {
  background: rgba(139, 149, 168, 0.18);
  color: var(--text-muted);
  text-decoration: line-through;
}

[data-theme="day"] .wfd-word.is-wrong,
[data-theme="day"] .wfd-word.is-extra {
  color: #c62828;
}

.wfd-dictation-target {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
}

.wfd-dictation-zh {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.now-card.is-dictation-hide .sentence-en.is-spoiler-hidden,
.sentence-en.is-spoiler-hidden {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 500;
}

.now-card.is-dictation-hide .vocab-section[hidden] {
  display: none !important;
}

/* ========== RA longer passages + 一句话模式 ========== */
.now-card-ra .sentence-en {
  font-size: 1.05rem;
  line-height: 1.65;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.ra-sentence-wrap {
  margin: 0 0 12px;
}

.ra-sentence-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ra-sentence-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ra-sentence-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ra-mode-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

.ra-mode-btn.is-active {
  background: var(--accent-soft);
  border-color: rgba(91, 141, 239, 0.45);
  color: var(--accent);
}

.ra-sentence-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ra-sentence-nav-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

.ra-sentence-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ra-sentence-progress {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.ra-sentence-preview {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.ra-sentence-agg {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.sentence-en.ra-has-sentence-hl .ra-sent {
  border-radius: 4px;
  padding: 1px 2px;
  transition: background 0.15s ease;
}

.sentence-en.ra-has-sentence-hl .ra-sent.is-current {
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
  font-weight: 700;
}

@media (min-width: 768px) {
  .wfd-dictation,
  .ra-sentence-panel {
    padding: 18px 16px;
  }

  .now-card-ra .sentence-en {
    max-height: min(50vh, 420px);
    font-size: 1.1rem;
  }
}
