:root {
  color-scheme: light;
  --bg: #f6f1ea;
  --bg-2: #efe7db;
  --ink: #1d1b16;
  --muted: #6c645a;
  --accent: #f36f3a;
  --accent-2: #3a8d94;
  --accent-3: #f3b63a;
  --blue: #1b6cff;
  --blue-2: #e7f0ff;
  --panel: #ffffff;
  --shadow: 0 25px 60px rgba(34, 25, 16, 0.15);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-title: "Space Grotesk", "ZCOOL KuaiLe", sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

*[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: radial-gradient(circle at 10% 10%, #fbe5d8 0%, transparent 35%),
    radial-gradient(circle at 80% 20%, #dff1f2 0%, transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  transition: background 0.25s ease, color 0.25s ease;
}

body.sheet-open {
  overflow: hidden;
}

.bg-glow {
  position: fixed;
  inset: -30vh -10vw auto;
  height: 60vh;
  background: linear-gradient(120deg, rgba(243, 111, 58, 0.18), rgba(58, 141, 148, 0.2));
  filter: blur(80px);
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 6vw 10px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: 16px;
  letter-spacing: 1px;
}

.logo-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
}

.logo-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.header-links {
  display: flex;
  gap: 18px;
  font-size: 0.95rem;
  color: var(--muted);
}

.app-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid rgba(29, 27, 22, 0.12);
  background: rgba(255, 255, 255, 0.5);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-body);
}

.tab-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(29, 27, 22, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.user-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(34, 25, 16, 0.1);
}

.user-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(58, 141, 148, 0.12);
}

.ghost-btn,
.primary-btn,
.outline-btn {
  border: none;
  padding: 12px 20px;
  font-family: var(--font-body);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 25px rgba(29, 27, 22, 0.25);
}

.primary-btn:hover {
  transform: translateY(-2px);
}

.outline-btn {
  border: 1px solid rgba(29, 27, 22, 0.2);
  background: transparent;
  color: var(--ink);
}

.outline-btn.active {
  background: rgba(29, 27, 22, 0.08);
}

.ghost-btn {
  background: rgba(29, 27, 22, 0.08);
  color: var(--ink);
}

main {
  padding: 0 6vw 80px;
}

.authed main {
  padding-top: 12px;
}

.authed .bg-glow {
  opacity: 0.35;
}

.public-only {
  display: block;
}

.authed-only {
  display: block;
}

.auth-pending .public-only {
  display: none !important;
}

.auth-pending .site-header .authed-only {
  display: flex !important;
}

.auth-pending .app-shell.authed-only {
  display: block !important;
}

.authed .public-only {
  display: none !important;
}

.authed .authed-only {
  display: block !important;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: 40px;
  padding: 40px 0 30px;
}

.hero-text h1 {
  font-family: var(--font-title);
  font-size: clamp(2.6rem, 4vw, 4rem);
  margin: 0 0 16px;
}

.hero-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 28px;
}

.hero-tags span {
  background: rgba(243, 111, 58, 0.12);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-panel {
  background: var(--panel);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.panel-title {
  font-weight: 700;
  font-size: 1.15rem;
}

.panel-desc {
  color: var(--muted);
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 26px 0 40px;
}

.stat-card {
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 14px 30px rgba(38, 29, 18, 0.12);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--muted);
  margin: 0 0 18px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

select {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(29, 27, 22, 0.15);
  background: #fff;
  font-family: var(--font-body);
}

.vlog-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.vlog-card {
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 16px 30px rgba(38, 29, 18, 0.1);
  display: grid;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.vlog-cover {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.vlog-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.vlog-creator {
  display: grid;
  gap: 4px;
}

@media (max-width: 1600px) {
  .vlog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .vlog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .vlog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .vlog-grid {
    grid-template-columns: 1fr;
  }
}

.player {
  margin-top: 50px;
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(240px, 1fr);
  gap: 20px;
}

.player-card,
.vocab-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.player-title {
  font-weight: 700;
  font-size: 1.15rem;
}

.player-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(58, 141, 148, 0.2);
  color: var(--accent-2);
  font-weight: 600;
  font-size: 0.8rem;
}

audio {
  width: 100%;
  margin: 14px 0 6px;
}

.player-video {
  width: 100%;
  margin: 14px 0 8px;
  border-radius: var(--radius-md);
  background: #000;
}

.player-desc {
  margin: 6px 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.speed {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle-controls {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid rgba(29, 27, 22, 0.15);
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.chip-sm {
  padding: 5px 10px;
  font-size: 0.85rem;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.study-bar {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.study-status {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.study-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-right: 2px;
}

.download-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subtitle-list {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 6px;
}

.subtitle-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(29, 27, 22, 0.05);
  cursor: pointer;
  transition: background 0.2s ease;
}

.subtitle-item.active {
  background: rgba(243, 111, 58, 0.18);
}

.subtitle-line {
  font-weight: 600;
}

.subtitle-zh,
.subtitle-ipa {
  color: var(--muted);
  font-size: 0.9rem;
}

.hl {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-color: #74c69d;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hl[data-category="单词"],
.hl[data-category="短语"],
.hl[data-category="地道表达"],
.hl[data-category="短语动词"],
.hl[data-category="搭配"],
.hl[data-category="口语句式"],
.hl[data-category="话语标记"] {
  text-decoration-color: #74c69d;
}

.dictation .subtitle-line,
.dictation .subtitle-zh,
.dictation .subtitle-ipa {
  color: transparent;
  text-shadow: 0 0 8px rgba(29, 27, 22, 0.2);
}

.dictation-panel {
  margin-top: 16px;
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(29, 27, 22, 0.04);
  border: 1px solid rgba(29, 27, 22, 0.08);
  display: grid;
  gap: 10px;
}

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

.dictation-panel textarea {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid rgba(29, 27, 22, 0.12);
  font-family: var(--font-body);
  resize: vertical;
}

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

.dictation-result {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.dictation-result .ok {
  color: #1f5c61;
  font-weight: 600;
}

.dictation-result .bad {
  color: #a43b14;
  font-weight: 600;
}

.vocab-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.vocab-list {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow: auto;
  padding-right: 6px;
}

.vocab-item {
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(58, 141, 148, 0.12);
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.vocab-item.active {
  outline: 2px solid rgba(243, 111, 58, 0.5);
}

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

.vocab-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.vocab-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.vocab-item[data-category="单词"] .vocab-tag { background: rgba(243, 111, 58, 0.2); color: #a43b14; }
.vocab-item[data-category="短语"] .vocab-tag { background: rgba(58, 141, 148, 0.2); color: #1f5c61; }
.vocab-item[data-category="短语动词"] .vocab-tag { background: rgba(243, 182, 58, 0.2); color: #946500; }
.vocab-item[data-category="搭配"] .vocab-tag { background: rgba(120, 96, 208, 0.2); color: #4c3a8a; }
.vocab-item[data-category="口语句式"] .vocab-tag { background: rgba(52, 130, 84, 0.2); color: #1f5a3d; }
.vocab-item[data-category="话语标记"] .vocab-tag { background: rgba(224, 92, 123, 0.2); color: #8a2f4a; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature-item {
  background: var(--panel);
  padding: 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 14px 30px rgba(38, 29, 18, 0.1);
}

.coach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.coach-card {
  background: var(--panel);
  padding: 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 14px 30px rgba(38, 29, 18, 0.1);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 6vw 40px;
  color: var(--muted);
}

.app-shell {
  padding: 10px 0 30px;
}

.study-view {
  padding: 10px 0 40px;
}

.study-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  justify-content: flex-start;
}

.study-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.study-top-title {
  display: grid;
  gap: 2px;
}

.study-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.study-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.night-mode {
  color-scheme: dark;
  --bg: #231a17;
  --bg-2: #14100f;
  --ink: #f2ece5;
  --muted: #c7b7aa;
  --accent: #ff9a62;
  --accent-2: #77cbc3;
  --accent-3: #f2c56c;
  --blue: #8fb2ff;
  --blue-2: rgba(143, 178, 255, 0.18);
  --panel: rgba(29, 23, 21, 0.94);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.night-mode body {
  background:
    radial-gradient(circle at 18% 12%, rgba(166, 96, 62, 0.24) 0%, transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(73, 104, 108, 0.18) 0%, transparent 30%),
    linear-gradient(180deg, #302421 0%, #1b1513 42%, #120f0e 100%);
}

.night-mode .authed main {
  background: transparent;
}

.night-mode .site-header {
  background:
    radial-gradient(circle at 18% 18%, rgba(166, 96, 62, 0.22) 0%, transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(73, 104, 108, 0.18) 0%, transparent 28%),
    linear-gradient(90deg, rgba(86, 66, 58, 0.9) 0%, rgba(70, 56, 50, 0.88) 42%, rgba(67, 64, 60, 0.9) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(242, 236, 229, 0.1);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.night-mode .bg-glow {
  background: linear-gradient(120deg, rgba(199, 117, 72, 0.2), rgba(97, 133, 136, 0.18));
}

.night-mode .logo-title,
.night-mode .section-title,
.night-mode .panel-title,
.night-mode .player-title,
.night-mode .study-title,
.night-mode .app-card-title {
  color: #fffdf9;
}

.night-mode .logo-sub,
.night-mode .header-links,
.night-mode .player-meta,
.night-mode .panel-desc,
.night-mode .study-meta,
.night-mode .section-desc,
.night-mode .hint,
.night-mode .study-label {
  color: #e0d3c7;
}

.night-mode .logo-mark,
.night-mode .primary-btn {
  background: #f2f6ff;
  color: #101722;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.night-mode .tab-btn,
.night-mode .ghost-btn,
.night-mode .outline-btn,
.night-mode .user-pill,
.night-mode select,
.night-mode .chip,
.night-mode .mode-chip,
.night-mode .mode-dropdown-btn,
.night-mode .study-player-btn,
.night-mode .study-mobile-btn,
.night-mode .icon-btn,
.night-mode .cards-hide-zh,
.night-mode .dictation-sheet-btn.ghost {
  color: var(--ink);
  border-color: rgba(255, 248, 242, 0.24);
  background: rgba(255, 248, 242, 0.14);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.night-mode .header-links a,
.night-mode .user-pill,
.night-mode .tab-btn,
.night-mode .ghost-btn,
.night-mode .outline-btn {
  color: #fffdfa;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
  font-weight: 700;
}

.night-mode .tab-btn,
.night-mode .ghost-btn,
.night-mode .outline-btn,
.night-mode .user-pill {
  background: rgba(255, 248, 242, 0.16);
}

.night-mode .tab-btn.active,
.night-mode .chip.active,
.night-mode .mode-chip.active,
.night-mode .outline-btn.active,
.night-mode .study-player-btn.active,
.night-mode .study-mobile-btn.active {
  background: linear-gradient(180deg, rgba(132, 165, 241, 0.42), rgba(109, 145, 226, 0.34));
  color: #ffffff;
  border-color: rgba(160, 189, 255, 0.56);
  box-shadow: 0 14px 28px rgba(57, 94, 177, 0.24);
}

.night-mode .hero-panel,
.night-mode .stat-card,
.night-mode .vlog-card,
.night-mode .player-card,
.night-mode .vocab-card,
.night-mode .app-card,
.night-mode .study-card,
.night-mode .modal-card,
.night-mode .dictation-sheet-card,
.night-mode .vocab-sheet-card,
.night-mode .study-mobile-bar,
.night-mode .cards-sidebar,
.night-mode .cards-main,
.night-mode .record-list-card,
.night-mode .calendar-card,
.night-mode .message-card {
  background: rgba(36, 28, 25, 0.92);
  border-color: rgba(242, 236, 229, 0.08);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.32);
}

.night-mode .study-sub-head,
.night-mode .study-player-toolbar {
  background: rgba(22, 17, 15, 0.96);
  border-color: rgba(242, 236, 229, 0.08);
}

.night-mode .study-desc,
.night-mode .study-desc .panel-desc,
.night-mode .player-desc {
  background: #120f0e;
  color: #eadfd4;
}

.night-mode .study-desc {
  border-color: rgba(242, 236, 229, 0.06);
}

.night-mode .cards-page {
  background: rgba(27, 21, 19, 0.96);
  border-color: rgba(242, 236, 229, 0.08);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
}

.night-mode .cards-sidebar {
  background: rgba(24, 19, 17, 0.98);
  border-right-color: rgba(242, 236, 229, 0.08);
}

.night-mode .cards-sidebar-head,
.night-mode .cards-search-wrap,
.night-mode .cards-category-tabs,
.night-mode .cards-toolbar {
  border-color: rgba(242, 236, 229, 0.08);
}

.night-mode .cards-sidebar-title,
.night-mode .cards-video-name,
.night-mode .cards-vocab-term,
.night-mode .cards-vocab-zh {
  color: #f3ece5;
}

.night-mode .cards-main {
  background: linear-gradient(180deg, rgba(31, 24, 22, 0.96), rgba(22, 17, 15, 0.98));
}

.night-mode .cards-search-wrap input {
  background: rgba(255, 248, 242, 0.08);
  border-color: rgba(242, 236, 229, 0.14);
  color: #f3ece5;
}

.night-mode .cards-search-wrap input::placeholder {
  color: rgba(243, 236, 229, 0.42);
}

.night-mode .cards-category-tabs {
  background: rgba(22, 17, 15, 0.94);
}

.night-mode .cards-top-tab {
  color: #d3c2b3;
  border-color: rgba(242, 236, 229, 0.12);
  background: rgba(255, 248, 242, 0.05);
}

.night-mode .cards-top-tab.active {
  background: rgba(143, 178, 255, 0.28);
  color: #fff;
  border-color: rgba(143, 178, 255, 0.38);
  box-shadow: 0 12px 28px rgba(44, 91, 176, 0.22);
}

.night-mode .cards-filter-chip,
.night-mode .cards-hide-zh {
  background: rgba(255, 248, 242, 0.06);
  color: #d5c6b9;
  border-color: rgba(242, 236, 229, 0.12);
}

.night-mode .cards-filter-chip.active,
.night-mode .cards-hide-zh.active {
  background: rgba(143, 178, 255, 0.28);
  color: #fff;
  border-color: rgba(143, 178, 255, 0.4);
}

.night-mode .cards-toolbar {
  background: rgba(24, 19, 17, 0.96);
}

.night-mode .cards-video-item {
  background: rgba(255, 248, 242, 0.04);
  border-color: rgba(242, 236, 229, 0.08);
}

.night-mode .cards-video-item.active {
  background: rgba(143, 178, 255, 0.14);
  border-color: rgba(143, 178, 255, 0.24);
  box-shadow: 0 10px 26px rgba(44, 91, 176, 0.16);
}

.night-mode .cards-video-open {
  background: rgba(255, 248, 242, 0.08);
  color: #e4d8cf;
}

.night-mode .cards-video-open:hover {
  background: rgba(255, 248, 242, 0.14);
  color: #fff;
}

.night-mode .cards-vocab-card {
  background: linear-gradient(180deg, rgba(44, 35, 31, 0.98), rgba(30, 24, 22, 0.98));
  border-color: rgba(242, 236, 229, 0.08);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.night-mode .cards-vocab-card.is-known {
  background: linear-gradient(180deg, rgba(25, 58, 44, 0.96), rgba(21, 46, 36, 0.96));
  border-color: rgba(62, 192, 127, 0.26);
  box-shadow: inset 4px 0 0 #2aca84, 0 16px 32px rgba(0, 0, 0, 0.26);
}

.night-mode .cards-vocab-card.is-unknown {
  background: linear-gradient(180deg, rgba(78, 35, 38, 0.96), rgba(56, 25, 28, 0.96));
  border-color: rgba(255, 98, 102, 0.24);
  box-shadow: inset 4px 0 0 #ff6b6d, 0 16px 32px rgba(0, 0, 0, 0.26);
}

.night-mode .cards-vocab-pron,
.night-mode .cards-vocab-en,
.night-mode .cards-example-zh,
.night-mode .cards-empty,
.night-mode .cards-empty-side {
  color: #c9b9ab;
}

.night-mode .cards-vocab-en,
.night-mode .cards-eye-btn {
  border-top-color: rgba(242, 236, 229, 0.08);
}

.night-mode .cards-audio-btn,
.night-mode .cards-eye-btn {
  color: #d8ccc2;
}

.night-mode .cards-audio-btn {
  background: rgba(255, 248, 242, 0.08);
}

.night-mode .cards-example-box {
  background: linear-gradient(180deg, rgba(245, 236, 223, 0.08), rgba(224, 210, 190, 0.06));
  border-left-color: #6f9cff;
}

.night-mode .cards-example-en {
  color: #f2e8de;
}

.night-mode .cards-mark-btn {
  background: rgba(255, 248, 242, 0.06);
}

.night-mode .dash-card {
  background: rgba(26, 20, 18, 0.96);
  border-color: rgba(242, 236, 229, 0.12);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.night-mode .dash-body {
  background: linear-gradient(180deg, rgba(39, 30, 27, 0.98), rgba(24, 19, 17, 0.98));
}

.night-mode .dash-title {
  color: #f4ede7;
}

.night-mode .dash-meta {
  color: #ccbcae;
}

.night-mode .tag {
  background: rgba(255, 248, 242, 0.06);
  border-color: rgba(242, 236, 229, 0.14);
  color: #e6d8cb;
}

.night-mode .tag-creator {
  background: rgba(143, 178, 255, 0.1);
  border-color: rgba(143, 178, 255, 0.28);
  color: #bdd3ff;
}

.night-mode .tag-topic {
  background: rgba(67, 170, 121, 0.1);
  border-color: rgba(88, 205, 146, 0.24);
  color: #9de2ba;
}

.night-mode .tag.todo {
  background: rgba(255, 154, 98, 0.12);
  border-color: rgba(255, 154, 98, 0.2);
  color: #ffc39f;
}

.night-mode .calendar,
.night-mode .cal-title {
  color: #f4ede7;
}

.night-mode .cal-nav {
  border-color: rgba(242, 236, 229, 0.12);
  background: rgba(255, 248, 242, 0.12);
  color: #fff7ef;
}

.night-mode .cal-dow {
  color: #d9cabd;
}

.night-mode .cal-day {
  border-color: rgba(242, 236, 229, 0.12);
  background: rgba(255, 248, 242, 0.14);
  color: #fff7ef;
}

.night-mode .cal-day.muted {
  background: rgba(255, 248, 242, 0.06);
  color: rgba(255, 247, 239, 0.22);
  opacity: 1;
}

.night-mode .cal-day.today {
  background: rgba(31, 109, 237, 0.18);
  color: #91b5ff;
}

.night-mode .cal-day.checkin {
  background: rgba(67, 170, 121, 0.18);
  border-color: rgba(88, 205, 146, 0.24);
  color: #b5efcd;
}

.night-mode .cal-day.today.checkin {
  background: rgba(31, 109, 237, 0.24);
  color: #c6daff;
}

.night-mode .records-page-title {
  color: #fff7ef;
}

.night-mode .records-page-desc {
  color: #cdbeb1;
}

.night-mode .records-page-tabs {
  background: rgba(28, 22, 20, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.night-mode .records-page-tab {
  color: #d3c2b3;
}

.night-mode .record-card {
  background: rgba(31, 24, 22, 0.96);
  border-color: rgba(242, 236, 229, 0.1);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.night-mode .record-body {
  background: linear-gradient(180deg, rgba(39, 30, 27, 0.98), rgba(24, 19, 17, 0.98));
}

.night-mode .record-title {
  color: #f4ede7;
}

.night-mode .record-creator,
.night-mode .record-progress {
  color: #ccbcae;
}

.night-mode .records-empty {
  background: rgba(31, 24, 22, 0.9);
  border-color: rgba(242, 236, 229, 0.14);
  color: #ccbcae;
}

.night-mode .study-keywords-meta,
.night-mode .study-keyword-empty {
  color: #ccbcae;
}

.night-mode .study-keywords-tabs {
  background: linear-gradient(180deg, rgba(44, 35, 31, 0.98), rgba(31, 24, 22, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 248, 242, 0.08), 0 10px 22px rgba(0, 0, 0, 0.18);
}

.night-mode .study-keywords-tab {
  color: #cfbeaf;
}

.night-mode .study-keywords-tab.active {
  background: rgba(255, 248, 242, 0.08);
  color: #a8c2ff;
  border-color: rgba(143, 178, 255, 0.2);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.night-mode .study-keywords-tab:not(:disabled):not(.active):hover {
  background: rgba(255, 248, 242, 0.05);
  color: #f0e6dc;
}

.night-mode .study-keyword-card {
  border-color: rgba(242, 236, 229, 0.08);
  background: linear-gradient(180deg, rgba(43, 34, 31, 0.98), rgba(30, 24, 22, 0.98));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.night-mode .study-keyword-term,
.night-mode .study-keyword-meaning {
  color: #f3ece5;
}

.night-mode .study-keyword-tag {
  background: rgba(67, 170, 121, 0.12);
  color: #9de2ba;
}

.night-mode .study-keyword-ipa,
.night-mode .study-keyword-notes {
  color: #cbbcad;
}

.night-mode .study-keyword-audio {
  border-color: rgba(242, 236, 229, 0.1);
  background: rgba(143, 178, 255, 0.14);
  color: #bdd3ff;
}

.night-mode .study-keyword-fav {
  color: #b8a99b;
}

.night-mode .study-keyword-fav.active {
  color: #ff7d86;
}

.night-mode .study-keyword-example {
  color: #e5d9ce;
  background: linear-gradient(180deg, rgba(245, 236, 223, 0.08), rgba(224, 210, 190, 0.06));
  border-left-color: rgba(143, 178, 255, 0.85);
}

.night-mode .mode-dropdown-btn {
  border-color: rgba(242, 236, 229, 0.16);
  background: linear-gradient(180deg, rgba(52, 42, 38, 0.96), rgba(37, 30, 27, 0.94));
  color: #f6eee7;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.night-mode .mode-dropdown-caret {
  border-right-color: rgba(223, 211, 199, 0.92);
  border-bottom-color: rgba(223, 211, 199, 0.92);
}

.night-mode .mode-dropdown-btn:hover,
.night-mode .mode-dropdown-btn:focus {
  border-color: rgba(143, 178, 255, 0.34);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.night-mode .mode-dropdown-menu {
  border-color: rgba(242, 236, 229, 0.12);
  background: rgba(30, 24, 22, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.night-mode .mode-dropdown-item {
  color: #f2e7dc;
}

.night-mode .mode-dropdown-item:hover,
.night-mode .mode-dropdown-item:focus {
  background: rgba(255, 248, 242, 0.08);
  color: #ffffff;
}

.night-mode .mode-dropdown-item.active {
  background: linear-gradient(180deg, rgba(90, 132, 243, 0.94), rgba(58, 104, 226, 0.92));
  color: #fff;
  box-shadow: 0 10px 24px rgba(32, 66, 151, 0.24);
}

.night-mode input,
.night-mode textarea,
.night-mode select {
  background: rgba(255, 248, 242, 0.05);
  color: var(--ink);
  border: 1px solid rgba(242, 236, 229, 0.12);
}

.night-mode input::placeholder,
.night-mode textarea::placeholder {
  color: rgba(242, 236, 229, 0.42);
}

.night-mode .badge {
  background: rgba(103, 193, 199, 0.22);
  color: #c5f4f6;
}

.night-mode .user-dot {
  background: #67c1c7;
  box-shadow: 0 0 0 6px rgba(103, 193, 199, 0.14);
}

.night-mode .player-video,
.night-mode .study-video {
  background: #000;
}

.night-mode .user-pill:hover,
.night-mode .ghost-btn:hover,
.night-mode .outline-btn:hover,
.night-mode .tab-btn:hover {
  background: rgba(255, 248, 242, 0.14);
}

.study-grid {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.study-left,
.study-right {
  display: grid;
  gap: 16px;
}

.study-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  box-shadow: 0 18px 45px rgba(34, 25, 16, 0.1);
  overflow: hidden;
}

.study-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.study-player-toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(29, 27, 22, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.study-player-btn {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(34, 47, 78, 0.08);
  color: #21304c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.study-player-btn:hover:not(:disabled) {
  background: rgba(34, 47, 78, 0.14);
  transform: translateY(-1px);
}

.study-player-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.study-player-btn-primary {
  background: #1f5eff;
  color: #fff;
}

.study-player-btn.active,
.study-player-btn.active:hover,
.study-player-btn.active:focus,
.study-player-btn.active:focus-visible {
  background: rgba(166, 188, 235, 0.92);
  color: #173a8a;
  box-shadow: inset 0 0 0 1px rgba(47, 95, 197, 0.16);
  transform: none;
}

.study-player-btn:focus {
  outline: none;
}

.study-player-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(47, 95, 197, 0.18);
}

.study-desc {
  padding: 14px 16px;
}

.study-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(29, 27, 22, 0.08);
  flex-wrap: nowrap;
}

.study-sub-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  justify-content: stretch;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.icon-btn {
  border: 1px solid rgba(29, 27, 22, 0.12);
  background: rgba(255, 255, 255, 0.7);
  width: 44px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 800;
}

.icon-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}

.mode-chip {
  border: 1px solid rgba(29, 27, 22, 0.1);
  background: rgba(255, 255, 255, 0.88);
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.88rem;
  color: #24324a;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mode-chip:hover {
  border-color: rgba(27, 108, 255, 0.2);
  box-shadow: 0 8px 18px rgba(27, 108, 255, 0.08);
}

.mode-chip.active {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(27, 108, 255, 0.2);
}

.mode-dropdown {
  position: relative;
  display: block;
  width: 100%;
}

.mode-dropdown-btn {
  border: 1px solid rgba(170, 196, 242, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  color: #24324a;
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  box-shadow: 0 6px 18px rgba(124, 152, 211, 0.08);
  position: relative;
}

.mode-dropdown-label {
  display: block;
  min-width: 0;
  padding-left: 18px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-dropdown-caret {
  justify-self: center;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(76, 91, 121, 0.9);
  border-bottom: 2px solid rgba(76, 91, 121, 0.9);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.mode-dropdown.open .mode-dropdown-caret {
  transform: rotate(225deg) translate(-1px, -1px);
}

.mode-dropdown-btn:hover,
.mode-dropdown-btn:focus {
  border-color: rgba(93, 142, 234, 0.5);
  box-shadow: 0 10px 24px rgba(93, 142, 234, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.mode-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(170, 196, 242, 0.82);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(76, 108, 170, 0.18);
  backdrop-filter: blur(14px);
}

.mode-dropdown-item {
  border: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px 10px 18px;
  border-radius: 14px;
  cursor: pointer;
  color: #24324a;
  font: inherit;
  font-weight: 800;
  font-size: 0.96rem;
  text-align: center;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.mode-dropdown-item:hover,
.mode-dropdown-item:focus {
  background: rgba(232, 239, 255, 0.92);
  color: #1c4fc7;
  outline: none;
}

.mode-dropdown-item.active {
  background: linear-gradient(180deg, rgba(55, 110, 255, 0.96), rgba(37, 94, 245, 0.94));
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 94, 245, 0.22);
}

@media (max-width: 900px) {
  .study-sub-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .study-sub-tools {
    width: 100%;
  }
}

.study-sub-list {
  max-height: 70vh;
  overflow: auto;
  padding: 12px 12px 14px;
  display: grid;
  gap: 10px;
}

.study-sub-layout {
  display: block;
}

.study-keywords-view {
  max-height: 70vh;
  overflow: auto;
  padding: 12px 12px 14px;
  display: grid;
  gap: 10px;
}

.study-view.split-keywords .study-grid {
  grid-template-columns: minmax(620px, 2.18fr) minmax(700px, 1.22fr);
  gap: 6px;
}

.study-view.split-keywords .study-left {
  gap: 14px;
}

.study-view.split-keywords .study-video-card,
.study-view.split-keywords .study-desc {
  max-width: 980px;
}

.study-view.split-keywords .study-sub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.9fr);
  gap: 12px;
  align-items: start;
  padding: 0 8px 8px;
}

.study-view.split-keywords .study-sub-list,
.study-view.split-keywords .study-keywords-view {
  max-height: 68vh;
  padding: 0;
}

.study-view.split-keywords .study-sub-list {
  gap: 8px;
}

.study-view.split-keywords .study-keywords-view {
  border-left: 1px solid rgba(29, 27, 22, 0.08);
  padding-left: 12px;
  gap: 8px;
}

.study-view.split-keywords .study-keywords-meta {
  font-size: 0.8rem;
}

.study-view.split-keywords .study-keywords-list,
.study-view.split-keywords .study-keyword-cards {
  gap: 8px;
}

.study-view.split-keywords .study-keywords-tabs {
  gap: 0;
  padding: 2px;
  border-radius: 16px;
}

.study-view.split-keywords .study-keywords-tab {
  min-height: 44px;
  padding: 6px 1px;
  border-radius: 12px;
  font-size: clamp(0.72rem, 0.9vw, 0.82rem);
  line-height: 1.1;
  white-space: nowrap;
}

.study-view.split-keywords .study-keyword-card {
  border-radius: 16px;
  padding: 12px;
  gap: 8px;
}

.study-view.split-keywords .study-keyword-term {
  font-size: 1.04rem;
}

.study-view.split-keywords .study-keyword-card-meta {
  gap: 8px;
  margin-top: 4px;
}

.study-view.split-keywords .study-keyword-tag {
  padding: 3px 7px;
  font-size: 0.66rem;
}

.study-view.split-keywords .study-keyword-ipa {
  font-size: 0.82rem;
}

.study-view.split-keywords .study-keyword-audio {
  width: 34px;
  height: 34px;
  font-size: 0.82rem;
}

.study-view.split-keywords .study-keyword-meaning {
  font-size: 0.9rem;
}

.study-view.split-keywords .study-keyword-notes {
  font-size: 0.82rem;
}

.study-view.split-keywords .study-keyword-example {
  font-size: 0.86rem;
  padding: 10px 12px;
  border-radius: 12px;
}

.study-view.split-keywords .study-sub-item {
  padding: 10px 10px;
}

.study-view.split-keywords .study-time {
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.study-view.split-keywords .study-line {
  font-size: 1rem;
}

.study-view.split-keywords .study-zh {
  font-size: 0.9rem;
}

.study-keywords-meta {
  color: var(--muted);
  font-size: 0.86rem;
  padding: 0 2px;
}

.study-keywords-list,
.study-keyword-cards {
  display: grid;
  gap: 10px;
}

.study-keywords-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 4px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(239, 244, 251, 0.98), rgba(233, 240, 249, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 8px 18px rgba(34, 25, 16, 0.04);
}

.study-keywords-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  min-height: 54px;
  padding: 8px 2px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(0.72rem, 0.92vw, 0.84rem);
  line-height: 1.12;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.study-keywords-tab.active {
  background: #fff;
  color: var(--blue);
  border-color: rgba(27, 108, 255, 0.12);
  box-shadow: 0 8px 18px rgba(34, 25, 16, 0.08);
  transform: translateY(-1px);
}

.study-keywords-tab:not(:disabled):not(.active):hover {
  background: rgba(255, 255, 255, 0.48);
  color: #5d6f8f;
}

.study-keywords-tab:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.study-keyword-card {
  border: 1px solid rgba(29, 27, 22, 0.08);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: 0 16px 34px rgba(34, 25, 16, 0.08);
  cursor: pointer;
}

.study-keyword-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.study-keyword-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.study-keyword-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.study-keyword-term {
  font-weight: 900;
  line-height: 1.35;
  font-size: 1.34rem;
}

.study-keyword-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(116, 198, 157, 0.18);
  color: #236648;
}

.study-keyword-ipa {
  color: #627391;
  font-size: 0.94rem;
  font-style: italic;
}

.study-keyword-audio {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  background: rgba(27, 108, 255, 0.08);
  color: #245fda;
  cursor: pointer;
  font-size: 1rem;
}

.study-keyword-fav {
  width: auto;
  height: auto;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 4px;
}

.study-keyword-fav.active {
  color: #dc2626;
  background: transparent;
}

.study-keyword-meaning {
  color: var(--ink);
  line-height: 1.6;
  font-size: 1rem;
  font-weight: 650;
}

.study-keyword-notes {
  color: #60708b;
  line-height: 1.6;
  font-size: 0.94rem;
}

.study-keyword-example {
  color: #5f6f8b;
  line-height: 1.6;
  font-size: 0.98rem;
  background: linear-gradient(180deg, rgba(27, 108, 255, 0.06), rgba(58, 141, 148, 0.05));
  border-left: 4px solid rgba(27, 108, 255, 0.75);
  border-radius: 14px;
  padding: 12px 14px;
}

.study-keyword-empty {
  color: var(--muted);
  line-height: 1.6;
  padding: 10px 4px;
}

.study-sub-list.dictation .study-line {
  color: var(--ink);
  text-shadow: none;
}

.study-sub-list.dictation .study-zh,
.study-sub-list.dictation .study-ipa {
  color: var(--muted);
  text-shadow: none;
}

.study-sub-list.dictation .study-line .hl {
  text-shadow: none;
}

.study-sub-list.dictation .study-line .hl[data-category="单词"] {
  border-bottom-color: rgba(37, 99, 235, 0.65);
}

.study-sub-list.dictation .study-line .hl[data-category="短语"] {
  border-bottom-color: rgba(15, 118, 110, 0.65);
}

.study-sub-list.dictation .study-line .hl[data-category="地道表达"] {
  border-bottom-color: rgba(15, 118, 110, 0.65);
}

.study-sub-list.dictation .study-line .hl.dictation-blank {
  display: inline-block;
  width: calc(var(--blank-ch, 6) * 0.72em);
  max-width: 100%;
  color: transparent;
  user-select: none;
  letter-spacing: 0;
}

.study-sub-list.dictation .study-line .hl.dictation-filled {
  text-shadow: none;
}

.study-sub-list.dictation .study-line .hl.dictation-pending {
  color: #1f2b40;
}

.study-sub-list.dictation .study-line .hl.dictation-correct[data-category="单词"] {
  color: #2563eb;
}

.study-sub-list.dictation .study-line .hl.dictation-correct[data-category="短语"] {
  color: #0f766e;
}

.study-sub-list.dictation .study-line .hl.dictation-correct[data-category="地道表达"] {
  color: #0f766e;
}

.study-sub-list.dictation .study-line .hl.dictation-wrong {
  position: relative;
  color: #b91c1c;
  border-bottom-color: rgba(185, 28, 28, 0.6);
}

.study-sub-list.dictation .study-line .hl.dictation-wrong::after {
  content: "";
  position: absolute;
  top: -0.2em;
  right: -0.45em;
  width: 0.48em;
  height: 0.48em;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.94);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
}

.study-sub-list.dictation .study-line .hl.dictation-revealed[data-category="单词"] {
  color: #2563eb;
  border-bottom-color: rgba(37, 99, 235, 0.72);
}

.study-sub-list.dictation .study-line .hl.dictation-revealed[data-category="短语"] {
  color: #0f766e;
  border-bottom-color: rgba(15, 118, 110, 0.72);
}

.study-sub-list.dictation .study-line .hl.dictation-revealed[data-category="地道表达"] {
  color: #0f766e;
  border-bottom-color: rgba(15, 118, 110, 0.72);
}

.study-sub-list.dictation .study-line .hl.dictation-editing {
  position: relative;
  display: inline-block;
  width: calc(var(--blank-ch, 6) * 0.72em);
  max-width: 100%;
  padding-bottom: 0;
}

.study-sub-list.dictation .study-line .hl.dictation-editing::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.42em;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.85) 0 8px,
    transparent 8px 12px
  );
  pointer-events: none;
}

.dictation-inline-input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #1f2b40;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  padding: 0 0 1px;
  outline: none;
  border-radius: 0;
}

.dictation-inline-input:focus {
  outline: none;
}

.study-sub-item {
  background: rgba(27, 108, 255, 0.06);
  border: 1px solid rgba(27, 108, 255, 0.12);
  border-radius: 14px;
  padding: 12px 12px;
  cursor: pointer;
}

.shadow-controls {
  margin-top: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 28px;
}

.shadow-controls-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 2px;
  align-items: start;
}

.study-time-spacer {
  display: block;
  width: 38px;
}

.shadow-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(29, 27, 22, 0.1);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(34, 25, 16, 0.05);
}

.shadow-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.shadow-pause {
  width: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 999px;
  background: rgba(27, 108, 255, 0.12);
  border-color: rgba(27, 108, 255, 0.2);
  color: #1144a6;
}

.shadow-rec {
  width: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff4a4a, #e12626);
  border-color: rgba(216, 58, 58, 0.26);
  color: #fff;
}

.shadow-rec.is-recording {
  background: linear-gradient(180deg, #ef4444, #c81e1e);
  transform: scale(1.06);
}

.shadow-rec-ico {
  position: relative;
  width: 12px;
  height: 12px;
  display: inline-block;
}

.shadow-rec-ico::before,
.shadow-rec-ico::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.shadow-rec-ico::before {
  top: 0;
  width: 7px;
  height: 8px;
  border: 1.8px solid currentColor;
  border-bottom-width: 2.2px;
  border-radius: 4px 4px 5px 5px;
}

.shadow-rec-ico::after {
  bottom: 0;
  width: 8px;
  height: 4px;
  border-left: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  border-radius: 0 0 5px 5px;
}

.shadow-rec.is-recording .shadow-rec-ico {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

.shadow-rec.is-recording .shadow-rec-ico::before,
.shadow-rec.is-recording .shadow-rec-ico::after {
  display: none;
}

.shadow-play-rec {
  width: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(29, 27, 22, 0.08);
  color: rgba(29, 27, 22, 0.55);
}

.shadow-play-rec.has-rec {
  color: rgba(6, 95, 70, 1);
}

.shadow-play-rec.is-playing {
  color: #9a3412;
}

.study-sub-item.active {
  background: rgba(27, 108, 255, 0.12);
  border-color: rgba(27, 108, 255, 0.22);
}

.study-main-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 2px;
}

.study-side-col {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 6px;
}

.study-main-copy {
  min-width: 0;
}

.study-seg-fav {
  width: 24px;
  height: 24px;
  align-self: start;
  justify-self: start;
  margin-top: 0;
  border: 0;
  background: transparent;
  color: rgba(73, 88, 117, 0.58);
  font-size: 1.02rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.study-seg-fav.active {
  color: #dc2626;
}

.study-seg-fav:hover {
  color: #dc2626;
}

.study-time {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
  white-space: nowrap;
}

.study-line {
  font-weight: 650;
  font-size: 1.12rem;
  line-height: 1.4;
}

.study-zh {
  color: var(--muted);
  font-size: 0.96rem;
  margin-top: 4px;
  line-height: 1.42;
}

.study-ipa {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
}

.study-view .hl {
  background: transparent;
  border: 0;
  border-bottom: 3px solid #74c69d;
  padding: 0;
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
}

.study-view .hl[data-category="单词"] {
  color: #2563eb;
  border-bottom-color: rgba(37, 99, 235, 0.65);
}

.study-view .hl[data-category="短语"] {
  color: #0f766e;
  border-bottom-color: rgba(15, 118, 110, 0.65);
}

.study-view .hl[data-category="地道表达"] {
  color: #0f766e;
  border-bottom-color: rgba(15, 118, 110, 0.65);
}

.vocab-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.dictation-sheet {
  position: fixed;
  inset: 0;
  z-index: 85;
  pointer-events: none;
}

.dictation-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.dictation-sheet-card {
  position: fixed;
  width: min(280px, calc(100vw - 24px));
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(34, 25, 16, 0.14);
  border: 1px solid rgba(29, 27, 22, 0.08);
  padding: 14px;
  pointer-events: auto;
}

.dictation-sheet-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: #6f7b92;
  margin-bottom: 10px;
}

.dictation-sheet-input {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(27, 108, 255, 0.18);
  background: rgba(245, 248, 255, 0.9);
  padding: 0 12px;
  font: inherit;
  font-size: 1rem;
  color: #24324a;
  outline: none;
}

.dictation-sheet-input:focus {
  border-color: rgba(27, 108, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(27, 108, 255, 0.08);
}

.dictation-sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.dictation-sheet-btn {
  min-width: 68px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(29, 27, 22, 0.1);
  background: #fff;
  color: #33425f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

.study-mobile-bar {
  display: none;
}

.study-mobile-btn {
  border: 0;
  background: transparent;
  color: #31405d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  min-width: 0;
}

.study-mobile-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.study-mobile-btn.active {
  color: var(--blue);
}

.study-mobile-btn-primary {
  background: var(--blue);
  color: #fff;
}

.vocab-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(29, 27, 22, 0.08);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.vocab-sheet-card {
  position: fixed;
  width: fit-content;
  min-width: min(176px, calc(100vw - 24px));
  max-width: min(272px, calc(100vw - 24px));
  max-height: min(62vh, 360px);
  overflow: auto;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(34, 25, 16, 0.16);
  padding: 18px 18px 18px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  pointer-events: auto;
}

.vocab-sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-right: 38px;
}

.vocab-sheet-head-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: block;
}

.vocab-sheet-term {
  font-size: clamp(1rem, 1.8vw, 1.36rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.vocab-sheet-term-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.vocab-sheet-card.no-ipa .vocab-sheet-head {
  align-items: flex-start;
}

.vocab-sheet-card.no-ipa .vocab-sheet-term-row {
  gap: 8px;
}

.vocab-sheet-cat {
  display: none;
}

.vocab-sheet-body {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-width: 100%;
}

.vocab-sheet-pron {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 2px;
  max-width: 100%;
}

.vocab-sheet-ipa {
  color: #74809a;
  font-size: clamp(0.82rem, 1.45vw, 0.94rem);
  line-height: 1.4;
  font-style: italic;
}

.vocab-sheet-audio {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #7d899e;
  cursor: pointer;
  box-shadow: none;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.vocab-sheet-audio:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vocab-sheet-audio:hover:not(:disabled) {
  color: #5f6f8b;
  background: transparent;
}

.vocab-sheet-audio-ico {
  width: 13px;
  height: 13px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 10v4h4l5 4V6L7 10H3zm12.5 2a4.5 4.5 0 0 0-2.5-4.03v8.06A4.5 4.5 0 0 0 15.5 12zm0-9.5v2.06A8 8 0 0 1 15.5 19.44v2.06A10 10 0 0 0 15.5 2.5z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 10v4h4l5 4V6L7 10H3zm12.5 2a4.5 4.5 0 0 0-2.5-4.03v8.06A4.5 4.5 0 0 0 15.5 12zm0-9.5v2.06A8 8 0 0 1 15.5 19.44v2.06A10 10 0 0 0 15.5 2.5z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.vocab-sheet-label {
  color: #7a6f63;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 4px;
}

.vocab-sheet-def,
.vocab-sheet-notes,
.vocab-sheet-example {
  line-height: 1.5;
  font-size: clamp(0.88rem, 1.2vw, 0.95rem);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vocab-sheet-example {
  color: #2f6458;
  white-space: pre-line;
  background: linear-gradient(180deg, rgba(226, 244, 234, 0.92), rgba(219, 239, 228, 0.88));
  border-left: 4px solid #49b95b;
  border-radius: 14px;
  padding: 12px 14px;
}

#vocab-sheet-close.icon-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  flex: 0 0 auto;
  margin-left: 0;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  color: #a8b0bf;
}

#vocab-sheet-close.icon-btn:hover {
  color: #8e97a8;
  background: rgba(29, 27, 22, 0.03);
}

.vocab-sheet-def {
  color: #1f2b40;
  font-weight: 800;
}

.vocab-sheet-label {
  display: none;
}

.vocab-sheet-notes {
  background: linear-gradient(180deg, rgba(71, 189, 110, 0.12), rgba(71, 189, 110, 0.08));
  border-left: 4px solid #49b95b;
  border-radius: 12px;
  padding: 8px 10px;
  color: #106b51;
}

@media (max-width: 1024px) {
  .study-player-toolbar {
    display: none;
  }

  .vocab-sheet-card {
    width: min(420px, calc(100vw - 18px));
    min-width: min(320px, calc(100vw - 18px));
    max-width: calc(100vw - 18px);
    max-height: min(78vh, calc(100vh - 24px));
    border-radius: 20px;
    padding: 16px 16px 16px;
  }

  #vocab-sheet-close.icon-btn {
    min-width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 1.35rem;
  }

  .vocab-sheet-audio {
    width: 22px;
    height: 22px;
  }
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.app-aside {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.app-main {
  display: grid;
  gap: 16px;
}

.app-card {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(34, 25, 16, 0.1);
  padding: 16px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  overflow: hidden;
}

.app-card-title {
  font-weight: 700;
  margin-bottom: 10px;
}

@media (min-width: 901px) {
  .authed .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 20px 6vw 14px;
    background: linear-gradient(180deg, rgba(246, 241, 234, 0.96), rgba(246, 241, 234, 0.88));
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(29, 27, 22, 0.06);
  }

  .night-mode .authed .site-header {
    background:
      radial-gradient(circle at 18% 18%, rgba(166, 96, 62, 0.22) 0%, transparent 24%),
      radial-gradient(circle at 84% 18%, rgba(73, 104, 108, 0.18) 0%, transparent 28%),
      linear-gradient(90deg, rgba(86, 66, 58, 0.9) 0%, rgba(70, 56, 50, 0.88) 42%, rgba(67, 64, 60, 0.9) 100%);
    border-bottom: 1px solid rgba(242, 236, 229, 0.1);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  }

  .authed main {
    padding: 8px 6vw 28px;
  }

  .authed .app-aside {
    position: sticky;
    top: 102px;
    align-self: start;
  }

  .authed .app-main {
    min-width: 0;
  }

  .authed .app-toolbar {
    position: static;
  }
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric {
  border-radius: 16px;
  padding: 12px;
  background: rgba(27, 108, 255, 0.08);
  border: 1px solid rgba(27, 108, 255, 0.15);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.metric:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(34, 25, 16, 0.08);
}

.metric.active {
  background: rgba(27, 108, 255, 0.14);
  border-color: rgba(27, 108, 255, 0.35);
  box-shadow: 0 14px 30px rgba(27, 108, 255, 0.12);
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
}

.metric-ok {
  color: #1f5c61;
}

.metric-warn {
  color: #a43b14;
}

.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.metric-hint {
  display: none;
}

.calendar {
  display: grid;
  gap: 8px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cal-nav {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1;
}

.cal-title {
  font-weight: 700;
  text-align: center;
  flex: 1 1 auto;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-dow {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 4px 0;
}

.cal-day {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
}

.cal-day.muted {
  opacity: 0.28;
}

.cal-day.today {
  outline: 2px solid rgba(27, 108, 255, 0.72);
  background: rgba(27, 108, 255, 0.12);
  color: #1144a6;
  font-weight: 800;
}

.cal-day.checkin {
  background: rgba(116, 198, 157, 0.22);
  border-color: rgba(56, 140, 102, 0.26);
  color: #246848;
  font-weight: 700;
}

.cal-day.today.checkin {
  background: rgba(27, 108, 255, 0.2);
  border-color: rgba(27, 108, 255, 0.26);
  color: #1144a6;
}

.msg-list {
  display: grid;
  gap: 10px;
}

.msg {
  border-radius: 16px;
  padding: 12px;
  background: rgba(27, 108, 255, 0.08);
  border: 1px solid rgba(27, 108, 255, 0.12);
  line-height: 1.5;
}

.msg-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.msg-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.app-toolbar {
  display: grid;
  gap: 12px;
}

.toolbar-title {
  font-weight: 800;
}

.toolbar-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid rgba(29, 27, 22, 0.12);
  background: rgba(255, 255, 255, 0.65);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
}

.pill.active {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}

.toolbar-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.toolbar-filters label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.toolbar-filters select {
  width: 100%;
}

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

.dash-card {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(34, 25, 16, 0.1);
  border: 1px solid rgba(29, 27, 22, 0.08);
  overflow: hidden;
  display: grid;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(34, 25, 16, 0.14);
}

.dash-card:focus-visible {
  outline: 3px solid rgba(27, 108, 255, 0.26);
  outline-offset: 4px;
}

.dash-cover-wrap {
  position: relative;
}

.dash-float-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dash-card:hover .dash-float-actions,
.dash-card:focus-within .dash-float-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dash-cover {
  width: 100%;
  height: 156px;
  object-fit: cover;
}

.dash-fav,
.dash-complete-float {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  color: #db2448;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(34, 25, 16, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dash-fav:hover,
.dash-complete-float:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 16px 32px rgba(34, 25, 16, 0.2);
}

.dash-fav-ico {
  width: 18px;
  height: 18px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12.1 21.35l-1.1-1.01C5.14 14.99 2 12.11 2 8.5C2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3C19.58 3 22 5.42 22 8.5c0 3.61-3.14 6.49-8.99 11.85l-1.11 1zm4.4-16.35c-1.54 0-3.04.99-3.57 2.36h-1.87C10.54 5.99 9.04 5 7.5 5C5.53 5 4 6.53 4 8.5c0 2.7 2.55 5.05 8 10.07c5.45-5.02 8-7.37 8-10.07C20 6.53 18.47 5 16.5 5z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12.1 21.35l-1.1-1.01C5.14 14.99 2 12.11 2 8.5C2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3C19.58 3 22 5.42 22 8.5c0 3.61-3.14 6.49-8.99 11.85l-1.11 1zm4.4-16.35c-1.54 0-3.04.99-3.57 2.36h-1.87C10.54 5.99 9.04 5 7.5 5C5.53 5 4 6.53 4 8.5c0 2.7 2.55 5.05 8 10.07c5.45-5.02 8-7.37 8-10.07C20 6.53 18.47 5 16.5 5z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.dash-fav.active {
  color: #ff4d73;
  background: #fff;
}

.dash-fav.active .dash-fav-ico {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5C2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3C19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5C2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3C19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.dash-complete-float {
  color: #25a764;
}

.dash-complete-ico {
  width: 16px;
  height: 16px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.17l-3.88-3.88L3.7 13.71L9 19l12-12l-1.41-1.41z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.17l-3.88-3.88L3.7 13.71L9 19l12-12l-1.41-1.41z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.dash-complete-float.active {
  background: #25a764;
  color: #fff;
}

.dash-body {
  padding: 12px;
  display: grid;
  gap: 7px;
}

.dash-title {
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.35;
}

.dash-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.dash-tags {
  display: flex;
  gap: 10px 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: min(100%, 210px);
  min-width: 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(241, 247, 255, 0.92);
  border: 1px solid rgba(128, 170, 255, 0.42);
  color: #2e63c8;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1320px) {
  .dash-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

button.tag {
  font: inherit;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tag-filter:hover {
  background: rgba(228, 238, 255, 0.98);
  border-color: rgba(96, 145, 246, 0.48);
  color: #2456b9;
  transform: translateY(-1px);
}

.tag-creator {
  flex-basis: 100%;
  width: auto;
  max-width: fit-content;
  align-self: flex-start;
  background: rgba(241, 247, 255, 0.96);
  border-color: rgba(139, 178, 255, 0.46);
  color: #2d66cc;
}

.tag-topic {
  background: rgba(240, 252, 245, 0.96);
  border-color: rgba(126, 220, 170, 0.45);
  color: #2a9b62;
}

.tag-topic:hover {
  background: rgba(230, 248, 237, 0.98);
  border-color: rgba(94, 196, 142, 0.52);
  color: #1f8753;
}

.tag.todo {
  background: rgba(243, 111, 58, 0.12);
  border-color: rgba(243, 111, 58, 0.2);
  color: #a43b14;
}

.dash-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.dash-complete-btn {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.dash-complete-btn:hover {
  transform: translateY(-1px);
}

.dash-complete-btn.active {
  background: rgba(27, 108, 255, 0.12);
  border-color: rgba(27, 108, 255, 0.34);
  color: #1659d4;
  box-shadow: 0 10px 20px rgba(27, 108, 255, 0.14);
}

.records {
  display: grid;
  gap: 10px;
}

.record {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  background: rgba(255, 255, 255, 0.75);
}

.record strong {
  display: block;
}

.record .sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.cards {
  display: grid;
  gap: 10px;
}

.cards-page {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  min-height: 760px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 45px rgba(34, 25, 16, 0.1);
}

.cards-sidebar {
  background: rgba(249, 251, 255, 0.9);
  border-right: 1px solid rgba(29, 27, 22, 0.08);
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.cards-sidebar-head {
  padding: 20px;
  border-bottom: 1px solid rgba(29, 27, 22, 0.08);
}

.cards-sidebar-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #1f2b40;
}

.cards-search-wrap {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(29, 27, 22, 0.08);
}

.cards-search-wrap input {
  width: 100%;
  border: 1px solid rgba(29, 27, 22, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.96rem;
  background: #fff;
}

.cards-video-list {
  padding: 12px 14px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.cards-video-item {
  width: 100%;
  border: 1px solid rgba(29, 27, 22, 0.1);
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.cards-video-item.active {
  background: #eef5ff;
  border-color: rgba(27, 108, 255, 0.24);
  box-shadow: 0 10px 26px rgba(27, 108, 255, 0.12);
}

.cards-video-name {
  font-size: 0.98rem;
  line-height: 1.45;
  color: #2a3347;
  flex: 1 1 auto;
}

.cards-video-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.cards-video-open {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: rgba(31, 41, 55, 0.08);
  color: rgba(31, 41, 55, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.cards-video-open:hover {
  background: rgba(31, 41, 55, 0.14);
  color: rgba(31, 41, 55, 0.88);
  transform: translateY(-1px);
}

.cards-video-open svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cards-video-open svg path:nth-of-type(1) {
  fill: currentColor;
  stroke: none;
}

.cards-main {
  background: rgba(245, 248, 253, 0.92);
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.cards-category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(29, 27, 22, 0.08);
}

.cards-top-tab {
  border: 1px solid rgba(29, 27, 22, 0.12);
  background: transparent;
  color: #4a5568;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
}

.cards-top-tab.active {
  background: #1f82ff;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(31, 130, 255, 0.24);
}

.cards-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(29, 27, 22, 0.08);
}

.cards-mastery-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cards-filter-chip,
.cards-hide-zh {
  border: 1px solid rgba(29, 27, 22, 0.14);
  background: #fff;
  color: #5a6272;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
}

.cards-filter-chip.active,
.cards-hide-zh.active {
  background: #1f82ff;
  border-color: transparent;
  color: #fff;
}

.cards-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
}

.cards-vocab-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(29, 27, 22, 0.08);
  box-shadow: 0 10px 24px rgba(34, 25, 16, 0.08);
  padding: 20px;
  display: grid;
  gap: 14px;
  position: relative;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.cards-vocab-card.is-known {
  background: linear-gradient(180deg, rgba(225, 249, 236, 0.94), rgba(212, 244, 227, 0.92));
  border-color: rgba(28, 190, 117, 0.2);
  box-shadow: inset 4px 0 0 #18b875, 0 10px 24px rgba(34, 25, 16, 0.08);
}

.cards-vocab-card.is-unknown {
  background: linear-gradient(180deg, rgba(255, 238, 239, 0.95), rgba(255, 228, 230, 0.93));
  border-color: rgba(255, 77, 79, 0.2);
  box-shadow: inset 4px 0 0 #ff4d4f, 0 10px 24px rgba(34, 25, 16, 0.08);
}

.cards-vocab-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cards-vocab-term {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.04rem;
  font-weight: 900;
  color: #263248;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cards-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.cards-vocab-card:hover .cards-card-actions,
.cards-vocab-card:focus-within .cards-card-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cards-mark-btn {
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 9px;
  padding: 6px 11px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.cards-mark-btn.known {
  color: #18b875;
}

.cards-mark-btn.unknown {
  color: #ff4d4f;
}

.cards-mark-btn.known.active {
  background: #18b875;
  border-color: #18b875;
  color: #fff;
}

.cards-mark-btn.unknown.active {
  background: #ff4d4f;
  border-color: #ff4d4f;
  color: #fff;
}

.cards-vocab-pron {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #7182a1;
}

.cards-vocab-ipa {
  font-style: italic;
  font-size: 0.96rem;
}

.cards-audio-btn,
.cards-eye-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #4e5d78;
  font-family: var(--font-body);
}

.cards-audio-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(29, 27, 22, 0.06);
}

.cards-vocab-zh {
  font-size: 0.98rem;
  color: #263248;
}

.cards-vocab-en {
  padding-top: 12px;
  border-top: 1px solid rgba(29, 27, 22, 0.08);
  color: #7584a0;
  font-size: 0.95rem;
}

.cards-example-box {
  background: linear-gradient(180deg, rgba(236, 242, 250, 0.96), rgba(233, 239, 247, 0.92));
  border-left: 4px solid #2e77ff;
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.cards-example-en {
  color: #2f3a4f;
  font-style: italic;
  line-height: 1.6;
}

.cards-example-zh {
  color: #7182a1;
  line-height: 1.6;
}

.cards-eye-btn {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(29, 27, 22, 0.08);
  font-size: 0.95rem;
}

.cards-empty,
.cards-empty-side {
  color: var(--muted);
  text-align: center;
  padding: 28px 16px;
}

.app-grid.records-mode {
  grid-template-columns: 1fr;
}

.records-page {
  display: grid;
  gap: 20px;
  padding-top: 10px;
}

.records-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.records-page-copy {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.records-page-title {
  font-size: clamp(1.22rem, 2vw, 1.7rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.records-page-desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.records-page-tabs {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(244, 247, 253, 0.96);
  box-shadow: 0 10px 24px rgba(34, 25, 16, 0.08);
}

.records-page-tab {
  border: 0;
  background: transparent;
  color: #6b7078;
  padding: 12px 22px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.records-page-tab.active {
  background: linear-gradient(180deg, #2f8fff, #176ded);
  color: #fff;
  box-shadow: 0 8px 20px rgba(23, 109, 237, 0.24);
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.record-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(29, 27, 22, 0.08);
  box-shadow: 0 16px 42px rgba(34, 25, 16, 0.12);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.record-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgba(34, 25, 16, 0.16);
}

.record-cover-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(224, 230, 239, 0.6);
}

.record-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.record-duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(21, 24, 33, 0.72);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.record-body {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.record-title {
  font-size: 0.92rem;
  line-height: 1.42;
  font-weight: 800;
  min-height: 0;
}

.record-creator,
.record-progress {
  color: var(--muted);
  font-size: 0.88rem;
}

.record-creator {
  margin-top: -4px;
}

.record-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.record-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 9px;
  background: #49b95b;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.record-badge.fav-sentence {
  background: #dc2626;
}

.record-card.sentence .record-title {
  line-height: 1.45;
}

.record-card.sentence .record-creator {
  min-height: 1.4em;
}

.records-empty {
  padding: 40px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  border: 1px dashed rgba(29, 27, 22, 0.12);
}

@media (max-width: 1600px) {
  .records-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .records-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards-page {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 27, 22, 0.55);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  z-index: 1;
}

.debug {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: min(520px, calc(100vw - 28px));
  max-height: 46vh;
  overflow: auto;
  background: rgba(29, 27, 22, 0.92);
  color: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  z-index: 60;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  white-space: pre-wrap;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-step {
  border-radius: 999px;
  border: 1px solid rgba(29, 27, 22, 0.12);
  padding: 8px 12px;
  color: var(--muted);
  text-align: center;
  background: rgba(29, 27, 22, 0.03);
}

.auth-step.active {
  border-color: rgba(58, 141, 148, 0.24);
  background: rgba(58, 141, 148, 0.12);
  color: var(--accent-2);
  font-weight: 700;
}

.auth-register-code {
  display: grid;
  gap: 10px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.auth-form input {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(29, 27, 22, 0.15);
  font-family: var(--font-body);
}

.auth-footer {
  display: grid;
  gap: 10px;
}

.auth-error {
  color: #a43b14;
  min-height: 1.2em;
}

.auth-success {
  color: #1f5c61;
  min-height: 1.2em;
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-links {
    flex-wrap: wrap;
  }

  .player-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-filters {
    grid-template-columns: 1fr 1fr;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .records-page-head {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .records-page-tabs {
    align-self: stretch;
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .records-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .cards-page {
    grid-template-columns: 1fr;
  }

  .cards-main {
    grid-template-rows: auto auto auto 1fr;
  }

  .cards-category-tabs {
    grid-template-columns: 1fr;
  }

  .cards-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .study-grid {
    grid-template-columns: 1fr;
  }

  .study-view.split-keywords .study-grid {
    grid-template-columns: 1fr;
  }

  .study-view.split-keywords .study-video-card,
  .study-view.split-keywords .study-desc {
    max-width: none;
  }

  .study-view.split-keywords .study-sub-layout {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .study-view.split-keywords .study-keywords-view {
    border-left: 0;
    border-top: 1px solid rgba(29, 27, 22, 0.08);
    padding-left: 0;
    padding-top: 12px;
  }
}

@media (max-width: 1024px) {
  body {
    padding-bottom: 78px;
  }

  .study-view {
    min-height: 100dvh;
    overflow: hidden;
  }

  .study-grid {
    display: block;
  }

  .study-top,
  .study-desc {
    display: none;
  }

  :root {
    --study-mobile-video-h: calc(100vw * 9 / 16);
    --study-mobile-bar-space: calc(96px + env(safe-area-inset-bottom));
  }

  .study-left {
    display: contents;
  }

  .study-video-card {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 20;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 14px 30px rgba(34, 25, 16, 0.18);
  }

.study-desc {
  margin-top: 16px;
}

.app-mode .study-top,
.app-mode .study-desc {
  display: none;
}

  .study-right {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--study-mobile-video-h) + 10px);
    bottom: 0;
    margin-top: 0;
    z-index: 30;
  }

  .study-sub-card {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    max-height: none;
  }

  .study-sub-head {
    position: sticky;
    top: 0;
    z-index: 35;
    margin: 0;
    padding: 8px 12px 8px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(29, 27, 22, 0.06);
    box-shadow: 0 6px 16px rgba(34, 25, 16, 0.08);
  }

  .study-sub-layout {
    overflow: auto;
    max-height: none;
    min-height: 0;
    padding-bottom: var(--study-mobile-bar-space);
  }

  .study-view.mobile-inline-input-active .study-right {
    bottom: 0;
  }

  .study-sub-list {
    max-height: none;
  }

  .study-keywords-view {
    max-height: none;
  }

  .study-view.split-keywords .study-sub-layout {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .study-view.split-keywords .study-keywords-view {
    border-top: 1px solid rgba(29, 27, 22, 0.08);
    border-left: 0;
    padding-top: 12px;
    padding-left: 0;
  }

  .study-view.mobile-vocab-only .study-sub-layout {
    display: block;
    padding: 0 0 var(--study-mobile-bar-space);
  }

  .study-view.mobile-vocab-only .study-keywords-view {
    max-height: calc(100svh - var(--study-mobile-video-h) - 120px);
    border-top: 0;
    border-left: 0;
    padding: 0;
  }

  .study-mobile-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
    background: rgba(243, 247, 255, 0.97);
    border: 1px solid rgba(66, 88, 132, 0.14);
    box-shadow: 0 20px 40px rgba(34, 25, 16, 0.14);
    backdrop-filter: blur(14px);
  }

  .study-mobile-bar.hidden-for-input {
    display: none;
  }

  .study-mobile-btn {
    min-height: 44px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.1;
    text-align: center;
    padding: 8px 4px;
    background: rgba(227, 235, 249, 0.9);
    color: #233252;
    box-shadow: inset 0 0 0 1px rgba(74, 95, 137, 0.08);
  }

  #mobile-fav-seg {
    font-size: 1.26rem;
    font-weight: 1000;
    line-height: 1;
    letter-spacing: -0.02em;
  }

  #mobile-fav-seg.active {
    background: rgba(160, 184, 232, 0.98);
    color: #173a8a;
    box-shadow: inset 0 0 0 1px rgba(47, 95, 197, 0.16);
  }

  .study-mobile-btn-primary {
    min-height: 52px;
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(27, 108, 255, 0.28);
  }

  .study-keywords-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 6px;
  }

  .study-keywords-tab {
    min-height: 44px;
    padding: 6px 4px;
    font-size: 0.72rem;
    line-height: 1.08;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  .study-view {
    overflow: hidden;
  }

  .study-grid,
  .study-view.split-keywords .study-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: 10px;
    height: calc(100dvh - var(--study-mobile-bar-space) - 10px);
    padding: 8px 10px calc(var(--study-mobile-bar-space) + 4px);
    box-sizing: border-box;
  }

  .study-left {
    display: grid;
    gap: 10px;
    min-width: 0;
    align-content: start;
  }

  .study-video-card {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    border-radius: 18px;
  }

  .study-video {
    max-height: min(58vh, 420px);
    object-fit: cover;
  }

  .study-desc {
    display: block;
    margin-top: 0;
  }

  .app-mode .study-desc {
    display: block;
  }

  .study-right {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    min-width: 0;
    height: 100%;
  }

  .study-sub-card {
    min-height: 0;
  }

  .study-sub-layout,
  .study-view.split-keywords .study-sub-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.74fr);
    gap: 10px;
    overflow: hidden;
    padding: 0 8px 0;
  }

  .study-sub-list,
  .study-keywords-view,
  .study-view.split-keywords .study-keywords-view {
    min-width: 0;
    max-height: none;
    overflow: auto;
    padding: 0;
    border-top: 0;
    border-left: 0;
  }
}
