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

:root {
  --primary: #112E81;
  --secondary: #4647AE;
  --tertiary: #4382DF;
  --accent: #AACCD6;
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --line: #DCE3F0;
  --ink: #16204A;
  --ink-muted: #5C6B8A;
  --success: #1E8E5A;
  --danger: #C4432E;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(17, 46, 129, 0.05), 0 6px 20px rgba(17, 46, 129, 0.06);
  --font-display: "Space Grotesk", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.match-item:focus-visible {
  outline: 2px solid var(--tertiary);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.sidebar {
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(180deg, var(--primary), #0A1E5C);
  color: #FFFFFF;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-text span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 0.3px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
  border-left: 2px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item i {
  font-size: 15px;
  width: 16px;
  text-align: center;
  color: var(--accent);
  opacity: 0.85;
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.nav-label::before {
  content: "<";
  color: rgba(255, 255, 255, 0.35);
}

.nav-label::after {
  content: ">";
  color: rgba(255, 255, 255, 0.35);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #FFFFFF;
}

.nav-item.active {
  background: rgba(67, 130, 223, 0.24);
  color: #FFFFFF;
  border-left-color: var(--tertiary);
}

.nav-item.active .nav-label::before,
.nav-item.active .nav-label::after {
  color: var(--accent);
}

.sidebar-player {
  margin-top: auto;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-player-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #FFFFFF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-player-level {
  font-size: 10.5px;
  color: var(--accent);
}

.sidebar-sync {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7FE0A8;
  margin-top: 3px;
}

.sidebar-sync.offline {
  color: #F0B4A8;
}

.sidebar-player button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
}

.sidebar-player button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main {
  padding: 34px 42px 64px;
  max-width: 1200px;
  background-image: radial-gradient(circle, rgba(17, 46, 129, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

.view {
  display: none;
  flex-direction: column;
  gap: 26px;
}

.view.active {
  display: flex;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.view-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

.view-header p {
  color: var(--ink-muted);
  font-size: 14px;
  margin-top: 5px;
  max-width: 540px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.3px;
  color: var(--tertiary);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.eyebrow::before {
  content: "// ";
  color: var(--accent);
}

.ladder {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ladder-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
}

.ladder-tag.done {
  border-color: var(--tertiary);
  background: #EAF1FC;
  color: var(--primary);
}

.ladder-arrow {
  color: var(--line);
  font-size: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.panel,
.tile-card {
  position: relative;
}

.panel::before,
.tile-card::before {
  content: "<";
  position: absolute;
  top: 6px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  opacity: 0.9;
}

.panel::after,
.tile-card::after {
  content: "/>";
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  opacity: 0.9;
}

.tile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(17, 46, 129, 0.1);
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.tile-desc {
  font-size: 13px;
  color: var(--ink-muted);
  flex-grow: 1;
}

.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.3px;
  padding: 4px 9px;
  border-radius: 5px;
}

.badge.easy {
  background: #E4F5EC;
  color: var(--success);
}

.badge.intermediate {
  background: #E6EEFC;
  color: var(--tertiary);
}

.badge.advanced {
  background: #EAE8FA;
  color: var(--secondary);
}

.badge.professional {
  background: #101E44;
  color: var(--accent);
}

.badge.state {
  background: var(--accent);
  color: var(--primary);
}

.btn {
  border: none;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--secondary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #3B3D96;
}

.btn-outline {
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.btn-outline:hover {
  background: rgba(70, 71, 174, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
}

.btn-ghost:hover {
  color: var(--ink);
}

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

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-family: var(--font-mono);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.select-input {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-mono);
}

.select-input:focus {
  outline: 2px solid var(--tertiary);
  outline-offset: 1px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

.progress-track {
  height: 6px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 22px;
}

.progress-fill {
  height: 100%;
  background: var(--tertiary);
  transition: width 0.25s ease;
}

.timer-track {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 18px;
}

.timer-fill {
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
}

.question-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 18px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--bg);
  text-align: left;
}

.option:hover {
  border-color: var(--tertiary);
}

.option-key {
  font-family: var(--font-mono);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.option.correct {
  border-color: var(--success);
  background: #EAF7F0;
}

.option.correct .option-key {
  background: var(--success);
  color: #FFFFFF;
  border-color: var(--success);
}

.option.wrong {
  border-color: var(--danger);
  background: #FBEBE8;
}

.option.wrong .option-key {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}

.option:disabled {
  cursor: default;
}

.explanation {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--bg);
  border-left: 3px solid var(--tertiary);
  padding: 10px 14px;
  border-radius: 6px;
  display: none;
}

.explanation.show {
  display: block;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.result-score {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}

.result-sub {
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  margin-top: 4px;
}

.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 14px;
  font-size: 13px;
  background: var(--bg);
  font-family: var(--font-mono);
}

.match-col.desc .match-item {
  font-family: var(--font-ui);
}

.match-item.selected {
  border-color: var(--secondary);
  background: #EEEDFB;
}

.match-item.matched {
  border-color: var(--success);
  background: #EAF7F0;
  color: var(--success);
}

.match-item.shake {
  animation: shake 0.3s ease;
  border-color: var(--danger);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.fillblank-code {
  font-family: var(--font-mono);
  background: #0C1A3D;
  color: #DCE6FF;
  padding: 16px 18px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.fillblank-row {
  display: flex;
  gap: 10px;
}

.fillblank-row input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.fillblank-row input:focus {
  outline: 2px solid var(--tertiary);
  outline-offset: 1px;
}

.project-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.editor-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-block {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.editor-label {
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.3px;
  color: var(--ink-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.editor-block textarea {
  border: none;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px;
  min-height: 140px;
  background: #0C1A3D;
  color: #DCE6FF;
  line-height: 1.55;
}

.editor-block textarea:focus {
  outline: none;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.editor-toolbar-actions {
  display: flex;
  gap: 6px;
}

.editor-toolbar-actions .btn {
  padding: 7px 12px;
  font-size: 12px;
}

.preview-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-frame-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #FFFFFF;
  flex-grow: 1;
}

.preview-frame-wrap iframe {
  width: 100%;
  height: 320px;
  border: none;
  display: block;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink-muted);
}

.check-item.pass {
  border-color: var(--success);
  background: #EAF7F0;
  color: var(--success);
}

.check-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
}

.progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.progress-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: lowercase;
  letter-spacing: 0.3px;
  color: var(--ink-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.progress-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.progress-table tr.current-player {
  background: #EAF1FC;
}

.mini-bar {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  background: var(--tertiary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
}

.empty-state i {
  font-size: 26px;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(17, 46, 129, 0.25);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 50;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.module-head-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.module-head-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.module-toggle {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.module-card.open .module-toggle {
  transform: rotate(45deg);
  color: var(--secondary);
  border-color: var(--secondary);
}

.module-detail {
  display: none;
  padding: 0 20px 22px;
  border-top: 1px solid var(--line);
}

.module-card.open .module-detail {
  display: block;
  padding-top: 18px;
}

.module-keypoints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.module-keypoints li {
  list-style: none;
  font-size: 13px;
  color: var(--ink);
  padding-left: 18px;
  position: relative;
}

.module-keypoints li::before {
  content: "\2022";
  color: var(--tertiary);
  position: absolute;
  left: 2px;
}

.module-code {
  font-family: var(--font-mono);
  background: #0C1A3D;
  color: #DCE6FF;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.leaderboard-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-muted);
}

.leaderboard-rank.top {
  color: var(--secondary);
}

.player-gate {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 60, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.player-gate.hidden {
  display: none;
}

.player-gate-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(10, 20, 60, 0.35);
}

.player-gate-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 6px;
}

.player-gate-card p {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 20px;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  max-height: 220px;
  overflow-y: auto;
}

.player-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg);
}

.player-list-item:hover {
  border-color: var(--tertiary);
}

.player-gate-form {
  display: flex;
  gap: 8px;
}

.player-gate-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.player-gate-form input:focus {
  outline: 2px solid var(--tertiary);
  outline-offset: 1px;
}

.book-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.book-cover {
  position: relative;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.book-cover:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(17, 46, 129, 0.12);
}

.book-spine {
  width: 10px;
  flex-shrink: 0;
  background: var(--primary);
}

.book-cover.badge-intermediate .book-spine {
  background: var(--tertiary);
}

.book-cover.badge-advanced .book-spine {
  background: var(--secondary);
}

.book-cover.badge-professional .book-spine {
  background: #101E44;
}

.book-cover-body {
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: lowercase;
}

.book-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
}

.book-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.toc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--bg);
}

.toc-row:hover {
  border-color: var(--tertiary);
}

.toc-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toc-number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: var(--primary);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toc-progress {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.reader-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reader-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 48px;
}

.reader-sheet-head {
  margin-bottom: 24px;
}

.reader-sheet-head h1 {
  font-size: 26px;
  color: var(--primary);
  margin-top: 6px;
}

.reader-dots {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.reader-dot {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.reader-dot.read {
  background: var(--tertiary);
}

.reader-dot.current {
  background: var(--primary);
}

.reader-heading {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 16px;
}

.reader-paragraph {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 16px;
  max-width: 640px;
}

.reader-paragraph.drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  color: var(--primary);
  float: left;
  line-height: 1;
  padding-right: 8px;
  padding-top: 4px;
}

.reader-nav {
  display: flex;
  justify-content: space-between;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    overflow-x: auto;
  }

  .nav-list {
    flex-direction: row;
  }

  .sidebar-player {
    display: none;
  }

  .main {
    padding: 24px 20px 60px;
  }

  .match-board,
  .project-workspace {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .reader-sheet {
    padding: 24px 20px;
  }
}