:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #0f0f0f;
  --muted: #606060;
  --soft: #f2f2f2;
  --soft-2: #e5e5e5;
  --line: #dedede;
  --accent: #d71920;
  --accent-dark: #b51218;
  --blue: #065fd4;
  --green: #138a4b;
  --topbar-bg: rgba(255,255,255,0.96);
  --field-bg: #ffffff;
  --field-border: #c6c6c6;
  --icon: #222222;
  --hover: #eef5ff;
  --chip-active-bg: #0f0f0f;
  --chip-active-text: #ffffff;
  --hero-button-bg: #ffffff;
  --hero-button-text: #111111;
  --note-bg: #fff7e6;
  --note-text: #6b4b00;
  --placeholder-a: #efefef;
  --placeholder-b: #dcdcdc;
  --skeleton: #e5e5e5;
  --duration-bg: rgba(0,0,0,0.86);
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --sidebar: 84px;
  --topbar: 64px;
  font-family: Arial, Helvetica, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0f0f0f;
    --panel: #181818;
    --text: #f1f1f1;
    --muted: #aaa;
    --soft: #272727;
    --soft-2: #303030;
    --line: #303030;
    --accent: #e03036;
    --accent-dark: #f0444a;
    --blue: #7db1ff;
    --green: #7ad99d;
    --topbar-bg: rgba(15,15,15,0.96);
    --field-bg: #121212;
    --field-border: #3f3f3f;
    --icon: #f1f1f1;
    --hover: #263142;
    --chip-active-bg: #f1f1f1;
    --chip-active-text: #0f0f0f;
    --hero-button-bg: #f1f1f1;
    --hero-button-text: #0f0f0f;
    --note-bg: #312915;
    --note-text: #f1ce7a;
    --placeholder-a: #242424;
    --placeholder-b: #333;
    --skeleton: #2d2d2d;
    --duration-bg: rgba(0,0,0,0.78);
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0f;
  --panel: #181818;
  --text: #f1f1f1;
  --muted: #aaa;
  --soft: #272727;
  --soft-2: #303030;
  --line: #303030;
  --accent: #e03036;
  --accent-dark: #f0444a;
  --blue: #7db1ff;
  --green: #7ad99d;
  --topbar-bg: rgba(15,15,15,0.96);
  --field-bg: #121212;
  --field-border: #3f3f3f;
  --icon: #f1f1f1;
  --hover: #263142;
  --chip-active-bg: #f1f1f1;
  --chip-active-text: #0f0f0f;
  --hero-button-bg: #f1f1f1;
  --hero-button-text: #0f0f0f;
  --note-bg: #312915;
  --note-text: #f1ce7a;
  --placeholder-a: #242424;
  --placeholder-b: #333;
  --skeleton: #2d2d2d;
  --duration-bg: rgba(0,0,0,0.78);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-width: 320px;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar);
  display: grid;
  grid-template-columns: 220px minmax(180px, 640px) minmax(96px, 1fr);
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.header-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}
.brand-name {
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}
.search-shell {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--field-border);
  border-radius: 21px;
  padding: 0 16px;
  background: var(--field-bg);
  min-width: 0;
}
.search-shell:focus-within {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.search-icon {
  width: 16px;
  height: 16px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  background: var(--muted);
  right: -5px;
  bottom: -3px;
  transform: rotate(45deg);
  border-radius: 2px;
}
.search-shell input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  font-size: 15px;
  background: transparent;
  color: var(--text);
}
.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--soft); }
.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.moon-icon { fill: currentColor; stroke: none; }
.sun-icon { display: none; }
.theme-toggle.is-dark .moon-icon { display: none; }
.theme-toggle.is-dark .sun-icon { display: block; }
.install-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}
.install-link:hover { background: var(--hover); }

.sidebar {
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  padding-top: 12px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  z-index: 10;
}
.nav-item {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
}
.nav-item:hover,
.nav-item.active { background: var(--soft); }
.nav-icon {
  width: 22px;
  height: 22px;
  position: relative;
}
.nav-icon.home::before {
  content: "";
  position: absolute;
  inset: 7px 3px 2px;
  border: 2px solid var(--icon);
  border-top: 0;
  border-radius: 2px;
}
.nav-icon.home::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--icon);
  border-top: 2px solid var(--icon);
  transform: rotate(45deg);
  left: 4px;
  top: 1px;
}
.nav-icon.feedback::before {
  content: "";
  position: absolute;
  inset: 3px 2px 6px;
  border: 2px solid var(--icon);
  border-radius: 5px;
}
.nav-icon.feedback::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--icon);
  border-bottom: 2px solid var(--icon);
  transform: skew(-18deg);
}

.page {
  padding: calc(var(--topbar) + 16px) 28px 48px calc(var(--sidebar) + 28px);
}
.chips {
  position: sticky;
  top: var(--topbar);
  z-index: 12;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 0 16px;
  background: var(--bg);
}
.chip {
  height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
}

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  margin: 0 0 28px;
}
.hero-card {
  min-height: 280px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: block;
  background: #111;
  box-shadow: var(--shadow);
}
.preview-hero { border: 0; text-align: left; }
.hero-card img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.78), rgba(0,0,0,0.16) 58%, rgba(0,0,0,0.02));
}
.hero-copy {
  position: absolute;
  inset: auto auto 26px 28px;
  max-width: 560px;
  z-index: 1;
  color: #fff;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  background: rgba(255,255,255,0.18);
  font-size: 13px;
  font-weight: 700;
}
.hero-copy h1 {
  margin: 14px 0 10px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  border: 0;
  background: var(--hero-button-bg);
  color: var(--hero-button-text);
  font-weight: 800;
  cursor: pointer;
}
.hero-cta:hover { transform: translateY(-1px); }
.hero-note {
  margin: 12px 0 0;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 1px 12px rgba(0,0,0,0.72);
}

.install-panel {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.panel-badge {
  order: 2;
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}
.install-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}
.install-summary {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.install-actions {
  display: grid;
  gap: 10px;
  margin: 22px 0 16px;
}
.install-steps {
  margin: 18px 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.7;
}
.install-steps span {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--soft);
  border-radius: 5px;
  padding: 2px 5px;
}
.install-note {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--note-bg);
  color: var(--note-text);
  font-size: 13px;
  line-height: 1.45;
}
.primary-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0 18px;
}
.primary-btn:hover { background: var(--accent-dark); }
.primary-btn.pending {
  background: #8a8a8a;
  cursor: default;
}
.primary-btn.pending:hover { background: #8a8a8a; }
.lesson-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 22px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0 18px;
}
.section-head h2 {
  margin: 0 0 4px;
  font-size: 24px;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.count-label {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 24px;
}
.video-card {
  display: block;
  min-width: 0;
}
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--soft-2);
}
.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #fff;
  background: var(--duration-bg);
  font-size: 12px;
  font-weight: 700;
}
.card-body {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding-top: 12px;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.video-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}
.video-meta,
.video-tags {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.video-tags {
  margin-top: 5px;
  color: var(--muted);
}
.video-card:hover .video-title { color: var(--blue); }

.placeholder-card {
  min-height: 260px;
  opacity: 0.78;
}
.placeholder-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--placeholder-a), var(--placeholder-b)),
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(255,255,255,0.24) 8px 16px);
}
.placeholder-lines {
  padding-top: 12px;
}
.line {
  height: 12px;
  border-radius: 6px;
  background: var(--soft-2);
  margin-bottom: 10px;
}
.line.short { width: 62%; }
.line.mid { width: 84%; }
.soon-label {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  background: var(--panel);
}

.feedback-panel {
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--panel);
}
.feedback-panel h2 {
  margin: 8px 0 8px;
  font-size: 22px;
  line-height: 1.2;
}
.feedback-panel p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}
.secondary-btn {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0 16px;
  color: var(--blue);
  font-weight: 800;
}
.secondary-btn:hover { background: var(--hover); }

.site-footer {
  margin-top: 28px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a {
  color: var(--blue);
  font-weight: 700;
}
.site-footer a:hover { text-decoration: underline; }

body.preview-open { overflow: hidden; }

.plugin-prompt {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.plugin-prompt.open { display: flex; }
.plugin-prompt-card {
  position: relative;
  width: min(440px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 60px rgba(0,0,0,0.22);
}
.plugin-prompt-card .panel-badge {
  margin-bottom: 12px;
  order: 0;
}
.plugin-prompt-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
}
.plugin-prompt-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.plugin-prompt-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.plugin-prompt-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.plugin-prompt-actions .secondary-btn {
  width: 100%;
  background: transparent;
  cursor: pointer;
}

#site-preview-overlay {
  --preview-red: #ff0033;
  --preview-font: Arial, Helvetica, sans-serif;
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  overflow: hidden;
  background: #000;
  color: rgba(255,255,255,0.88);
  font-family: var(--preview-font);
}
#site-preview-overlay.active { display: block; }
#site-preview-overlay * { box-sizing: border-box; }
#site-preview-overlay button { font-family: var(--preview-font); cursor: pointer; }
.preview-player-root {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
#previewVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.preview-player-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.30) 10%, transparent 26%),
    linear-gradient(transparent 42%, rgba(0,0,0,0.44) 72%, rgba(0,0,0,0.90) 100%);
}
.preview-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  min-height: 62px;
  padding: 14px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(rgba(0,0,0,0.72), rgba(0,0,0,0.36) 62%, transparent);
}
.preview-top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-home-btn,
.preview-back-btn {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.preview-home-btn {
  background: rgba(255,255,255,0.92);
  color: rgba(8,8,8,0.95);
}
.preview-back-btn {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
}
.preview-home-btn:hover { background: #fff; }
.preview-back-btn:hover { background: rgba(255,255,255,0.24); }
.preview-top-title {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: min(52vw, 760px);
  max-width: calc(100vw - 360px);
  overflow: hidden;
  color: rgba(255,255,255,0.96);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
  white-space: nowrap;
}
.preview-subtitle {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 10;
  width: min(78vw, 980px);
  max-width: calc(100vw - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
}
.preview-sub-en,
.preview-sub-zh {
  display: inline;
  max-width: 100%;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  text-shadow: 0 1px 2px rgba(0,0,0,0.95);
}
.preview-sub-en {
  padding: 3px 10px 5px;
  background: rgba(0,0,0,0.74);
  color: rgba(255,255,255,0.98);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  line-height: 1.45;
}
.preview-sub-zh {
  margin-top: 7px;
  padding: 2px 8px 4px;
  background: rgba(0,0,0,0.46);
  color: rgba(255,255,255,0.72);
  font-size: 16px;
  line-height: 1.55;
}
.preview-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 50;
  padding: 10px 28px;
  border-radius: 10px;
  background: rgba(0,0,0,0.72);
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity .15s;
}
.preview-toast.show { opacity: 1; }
.preview-coach {
  position: absolute;
  top: 76px;
  left: 50%;
  z-index: 45;
  display: none;
  width: min(520px, calc(100vw - 48px));
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(8,8,12,0.72);
  color: rgba(255,255,255,0.84);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.preview-coach.show { display: block; }
.preview-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 0 28px 18px;
  background: linear-gradient(transparent, rgba(0,0,0,0.50) 30%, rgba(0,0,0,0.90));
}
.preview-progress-track {
  position: relative;
  height: 4px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.26);
  cursor: pointer;
}
.preview-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--preview-red);
}
.preview-progress-marker {
  position: absolute;
  top: 0;
  width: 1px;
  height: 4px;
  background: rgba(0,0,0,0.48);
}
.preview-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255,255,255,0.74);
  font-size: 13px;
}
.preview-ctrl-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.preview-ctrl-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  padding: 4px;
  background: transparent;
  color: rgba(255,255,255,0.92);
}
.preview-ctrl-btn:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
}
.preview-mode-pill {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.82);
  font-size: 13px;
}
.preview-mode-pill.on {
  background: rgba(255,255,255,0.24);
  color: #fff;
}
.preview-sub-counter,
.preview-speed-label {
  color: rgba(255,255,255,0.70);
  font-variant-numeric: tabular-nums;
}
.preview-speed-label {
  min-width: 38px;
  text-align: center;
}
.preview-dictation-panel {
  position: absolute;
  left: 50%;
  bottom: 76px;
  z-index: 43;
  width: min(540px, calc(100vw - 64px));
  max-height: min(280px, calc(100vh - 150px));
  display: none;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  overflow-y: auto;
  border-radius: 14px;
  background: rgba(0,0,0,0.58);
  box-shadow: 0 8px 22px rgba(0,0,0,0.30);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.preview-dictation-panel.open { display: flex; }
.preview-dictation-panel.has-result {
  max-height: none;
  overflow: visible;
}
.preview-dictation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.preview-dictation-title {
  color: rgba(255,255,255,0.94);
  font-size: 14px;
  font-weight: 700;
}
.preview-dictation-sub {
  margin-top: 2px;
  color: rgba(255,255,255,0.52);
  font-size: 12px;
}
.preview-dictation-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.78);
  font-size: 18px;
  line-height: 1;
}
.preview-dictation-panel textarea {
  width: 100%;
  min-height: 30px;
  max-height: 44px;
  resize: none;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  outline: none;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.94);
  font-size: 15px;
  line-height: 1.3;
}
.preview-dictation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.preview-btn-cancel,
.preview-btn-add {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}
.preview-btn-cancel {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.78);
}
.preview-btn-add {
  background: rgba(255,255,255,0.92);
  color: rgba(8,8,8,0.94);
}
.preview-dictation-result {
  display: none;
  padding: 10px 12px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
}
.preview-dictation-result:not(:empty) { display: block; }
.preview-dict-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
}
.preview-dict-score strong { font-size: 22px; }
.preview-dict-score span {
  color: rgba(255,255,255,0.42);
  font-size: 11px;
}
.preview-dict-score.good strong { color: rgba(130,210,130,0.9); }
.preview-dict-score.ok strong { color: rgba(255,200,100,0.86); }
.preview-dict-score.low strong { color: rgba(255,130,120,0.9); }
.preview-dict-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.preview-dict-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.62);
  font-size: 12px;
  font-weight: 700;
}
.preview-dict-legend-mark {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(255,255,255,0.95);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.preview-dict-legend-item.wrong .preview-dict-legend-mark {
  background: rgba(180,95,88,0.86);
}
.preview-dict-legend-item.missing .preview-dict-legend-mark {
  background: rgba(92,145,90,0.86);
}
.preview-dict-legend-item.extra .preview-dict-legend-mark {
  background: rgba(177,132,72,0.86);
}
.preview-dict-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.preview-dict-word {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12.5px;
}
.preview-dict-word.perfect {
  border-color: rgba(120,210,140,0.28);
  background: rgba(120,210,140,0.14);
  color: rgba(225,255,225,0.92);
}
.preview-dict-word.wrong {
  border-color: rgba(255,110,100,0.48);
  background: rgba(255,110,100,0.20);
  color: rgba(255,225,220,0.95);
}
.preview-dict-word.wrong .old {
  color: rgba(255,180,170,0.85);
  text-decoration: line-through;
}
.preview-dict-word.missing {
  border-color: rgba(120,210,140,0.42);
  background: rgba(120,210,140,0.16);
  color: rgba(225,255,225,0.95);
}
.preview-dict-word.extra {
  border-color: rgba(255,180,90,0.45);
  background: rgba(255,180,90,0.16);
  color: rgba(255,235,200,0.95);
  text-decoration: line-through;
}
.preview-dict-mark {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: rgba(255,255,255,0.16);
  font-size: 11px;
  font-weight: 800;
}
.preview-dict-compare {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}
.preview-dict-label {
  color: rgba(255,255,255,0.28);
  font-size: 10px;
}
.preview-dict-line {
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  line-height: 1.42;
}
.preview-dict-line.zh {
  color: rgba(255,255,255,0.48);
  font-size: 12px;
}
.preview-sub-panel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 30;
  width: 380px;
  max-width: 100vw;
  height: 100%;
  display: none;
  flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.06);
  background: rgba(8,8,12,0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.preview-sub-panel.open { display: flex; }
.preview-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.preview-panel-header h3 {
  margin: 0;
  color: rgba(255,255,255,0.42);
  font-size: 13px;
}
.preview-panel-close {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-size: 20px;
}
.preview-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}
.preview-panel-item {
  width: 100%;
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
  padding: 12px 14px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(255,255,255,0.52);
  text-align: left;
}
.preview-panel-item:hover,
.preview-panel-item.active {
  background: rgba(255,255,255,0.05);
}
.preview-panel-item.active { border-left-color: rgba(160,195,255,0.55); }
.preview-time {
  color: rgba(255,255,255,0.22);
  font-size: 10px;
}
.preview-panel-en {
  color: rgba(255,255,255,0.72);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  line-height: 1.45;
}
.preview-panel-zh {
  color: rgba(255,255,255,0.30);
  font-size: 12px;
  line-height: 1.45;
}
.preview-shortcuts {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.88);
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.preview-shortcuts.hide { display: none; }
.preview-shortcut-title {
  margin-bottom: 28px;
  color: rgba(255,255,255,0.18);
  font-size: 10px;
  letter-spacing: 5px;
  text-align: center;
}
.preview-shortcut-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px 44px;
}
.preview-key {
  padding: 4px 12px;
  border-radius: 5px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.42);
  font-size: 11px;
  text-align: right;
}
.preview-desc {
  color: rgba(255,255,255,0.34);
  font-size: 12px;
  text-align: left;
}
.preview-shortcut-hint {
  margin-top: 36px;
  color: rgba(255,255,255,0.18);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 980px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    padding: 0 16px;
  }
  .brand-name { display: none; }
  .page { padding-left: 16px; padding-right: 16px; }
  .hero-row { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-top-title { display: none; }
  .preview-ctrl-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .preview-controls { padding: 0 16px 14px; }
}

@media (max-width: 640px) {
  :root { --topbar: 58px; }
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .install-link { display: none; }
  .hero-card,
  .hero-card img,
  .install-panel { min-height: 240px; }
  .hero-copy {
    left: 20px;
    right: 20px;
    bottom: 22px;
  }
  .hero-copy h1 { font-size: 28px; }
  .hero-copy p { font-size: 15px; }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .count-label { white-space: normal; }
  .video-grid {
    grid-template-columns: 1fr;
  }
  .feedback-panel {
    align-items: flex-start;
    flex-direction: column;
  }
  .preview-subtitle {
    bottom: 166px;
    width: calc(100vw - 28px);
  }
  .preview-sub-en { font-size: 23px; }
  .preview-sub-zh { font-size: 14px; }
  .preview-coach {
    top: 68px;
    border-radius: 10px;
  }
  .preview-ctrl-group {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  .preview-ctrl-btn {
    min-width: 36px;
    height: 36px;
  }
  .preview-mode-pill {
    padding: 7px 10px;
    font-size: 12px;
  }
  .preview-dictation-panel {
    bottom: 134px;
    width: calc(100vw - 28px);
  }
  .preview-sub-panel { width: 100%; }
  .preview-shortcut-grid {
    gap: 8px 18px;
    padding: 0 18px;
  }
}
