  :root {
    --primary: #1a4d8f;
    --primary-light: #2e6db4;
    --accent: #b03a2e;
    --success: #2e7d4f;
    --warning: #e67e22;
    --bg: #f7f9fc;
    --card-bg: #ffffff;
    --border: #d8dde6;
    --text: #2c3e50;
    --text-mute: #6b7785;
    --reveal-bg: #fff8e1;
    --reveal-border: #f0c060;
    --think-bg: #e8f4fd;
    --think-border: #5dade2;
    --note-bg: #fafbfc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
  }
  /* ========== Top bar ========== */
  .topbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 20px;
  }
  .topbar h1 { margin: 0; font-size: 18px; font-weight: 600; }
  .topbar .crumbs { font-size: 12px; opacity: 0.8; }
  .topbar .crumbs a {
    color: white;
    text-decoration: none;
    opacity: 0.95;
    padding: 1px 3px;
    border-radius: 3px;
  }
  @media (hover: hover) and (pointer: fine) {
    .topbar .crumbs a:hover { background: rgba(255,255,255,0.15); }
  }
  .topbar .crumbs a:active { background: rgba(255,255,255,0.25); }
  .topbar .crumbs .sep { opacity: 0.5; margin: 0 2px; }
  .topbar .back-btn {
    background: rgba(255,255,255,0.12);
    color: white;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-family: inherit;
  }
  @media (hover: hover) and (pointer: fine) {
    .topbar .back-btn:hover { background: rgba(255,255,255,0.22); }
  }
  .topbar .back-btn:active { background: rgba(255,255,255,0.32); }
  .topbar .progress-wrap {
    flex: 1; max-width: 400px;
    display: flex; align-items: center; gap: 10px;
  }
  .topbar .progress-bar {
    flex: 1; height: 8px; background: rgba(255,255,255,0.25);
    border-radius: 4px; overflow: hidden;
  }
  .topbar .progress-fill {
    height: 100%; background: #6dd49a;
    width: 0%; transition: width 0.5s;
  }
  .topbar .progress-text { font-size: 12px; min-width: 32px; }
  .mode-toggle {
    display: flex; background: rgba(255,255,255,0.15);
    border-radius: 6px; overflow: hidden;
  }
  .mode-toggle button {
    background: none; border: none; color: white;
    padding: 6px 12px; cursor: pointer; font-size: 13px;
    font-family: inherit;
  }
  .mode-toggle button.active { background: rgba(255,255,255,0.3); font-weight: 600; }
  .reset-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    font-family: inherit;
    transition: all 0.2s;
  }
  @media (hover: hover) and (pointer: fine) {
    .reset-btn:hover { background: rgba(255,255,255,0.2); }
  }
  .reset-btn:active { background: rgba(255,255,255,0.3); }
  .reset-btn.arming {
    background: #d44a3a;
    border-color: #d44a3a;
    animation: pulse 1.5s infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
  }

  /* Reset modal */
  .modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 200;
    align-items: center; justify-content: center;
  }
  .modal-overlay.show { display: flex; }
  .modal {
    background: white;
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  }
  .modal h3 {
    margin: 0 0 12px 0;
    color: var(--accent);
    font-size: 18px;
  }
  .modal p { margin: 8px 0; font-size: 14px; line-height: 1.7; }
  .modal ul { font-size: 13px; color: var(--text-mute); margin: 8px 0 16px; padding-left: 20px; }
  .modal .confirm-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    margin: 10px 0 16px;
  }
  .modal .confirm-input:focus {
    border-color: var(--accent);
    outline: none;
  }
  .modal-actions {
    display: flex; justify-content: flex-end; gap: 10px;
  }
  .modal-actions button {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
  }
  .modal-cancel {
    background: #eef2f7;
    color: var(--text);
  }
  .modal-confirm {
    background: var(--accent);
    color: white;
  }
  .modal-confirm:disabled {
    background: #bbb;
    cursor: not-allowed;
  }

  /* ========== Layout ========== */
  .container {
    max-width: 1400px; margin: 0 auto;
    padding: 20px;
  }
  .section {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
  }
  .section-header {
    padding: 16px 24px;
    background: linear-gradient(to right, #eaf2fb, transparent);
    border-bottom: 1px solid var(--border);
  }
  .section-header h2 {
    margin: 0; font-size: 18px; color: var(--primary);
    display: flex; align-items: center; gap: 10px;
  }
  .section-body { padding: 20px 24px; }

  /* ========== Pre-learning cards ========== */
  .pre-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
  .pre-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    background: var(--card-bg);
  }
  .pre-card h3 {
    margin: 0 0 10px 0; font-size: 15px;
    color: var(--primary-light);
    display: flex; align-items: center; gap: 8px;
  }
  .pre-card ol, .pre-card ul { padding-left: 22px; margin: 8px 0; }
  .pre-card li { font-size: 14px; margin: 4px 0; }
  .pre-card .meta { color: var(--text-mute); font-size: 12px; }

  /* ========== Sub-section tabs ========== */
  .subnav {
    display: flex; gap: 4px;
    background: #eef2f7;
    padding: 6px;
    border-radius: 8px;
    flex-wrap: wrap;
  }
  .subnav button {
    flex: 1; min-width: 130px;
    background: transparent;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-mute);
    transition: all 0.2s;
    font-family: inherit;
  }
  @media (hover: hover) and (pointer: fine) {
    .subnav button:hover { background: rgba(255,255,255,0.7); }
  }
  .subnav button:active { background: rgba(255,255,255,0.9); transform: scale(0.98); }
  .subnav button.active {
    background: white;
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
  }
  .subnav button .tab-status {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; background: #d0d7de; margin-left: 6px;
    vertical-align: middle;
  }
  .subnav button.completed .tab-status { background: var(--success); }

  /* ========== Tri-view ========== */
  .triview {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 20px;
    align-items: stretch;
  }
  @media (max-width: 1100px) {
    .triview { grid-template-columns: 1fr; }
  }
  .panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
  }
  .panel-header {
    padding: 10px 14px;
    background: var(--note-bg);
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px;
    color: var(--text-mute);
  }
  .panel-body { padding: 16px; }
  .panel-img { padding: 0; }
  .panel-img img {
    width: 100%; display: block;
    transition: transform 0.3s;
    transform-origin: top center;
  }

  /* ===== Tri-view: left + right share same height, each has own scroll =====
     Target: iPad Air 4 landscape (1180×820), so two columns can be aligned. */
  .triview .panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
    min-height: 480px;
  }
  .triview .panel-header { flex-shrink: 0; }
  .triview .panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    max-height: none;     /* override any inline max-height inside subpanes */
  }
  /* Keep the subtab bar (笔记 / 翻译 切换) visible while scrolling */
  .triview .panel.notes .subtab-bar {
    position: sticky;
    top: -16px;       /* offset = panel-body padding-top, so it sticks flush at top */
    z-index: 2;
  }
  @media (max-width: 1100px) {
    .triview .panel {
      max-height: 70vh;
      min-height: 400px;
    }
  }
  .zoom-controls button {
    background: none; border: 1px solid var(--border);
    padding: 2px 8px; border-radius: 3px;
    cursor: pointer; font-size: 12px; margin-left: 4px;
  }

  /* ========== Notes / think-reveal blocks ========== */
  .notes h3 { color: var(--primary); margin: 18px 0 10px; font-size: 16px; }
  .notes h4 { color: var(--text); margin: 14px 0 8px; font-size: 14px; }
  .notes table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
  .notes th, .notes td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
  .notes th { background: #eaf2fb; }
  .notes tr:nth-child(even) td { background: #fbfcfd; }
  .notes strong { color: var(--accent); }
  .notes blockquote {
    border-left: 3px solid var(--border);
    margin: 10px 0; padding: 6px 14px;
    background: var(--note-bg); color: var(--text-mute);
    font-size: 13.5px;
  }

  .think-box {
    background: var(--think-bg);
    border-left: 4px solid var(--think-border);
    padding: 12px 16px;
    margin: 14px 0;
    border-radius: 4px;
  }
  .think-box .think-q { font-weight: 600; color: #1f5582; }
  .think-box .think-q::before { content: "💭 先想想 "; margin-right: 4px; }
  .think-box .reveal-btn {
    margin-top: 8px;
    background: var(--think-border); color: white;
    border: none; padding: 4px 12px; border-radius: 4px;
    cursor: pointer; font-size: 13px;
  }
  .think-box .answer { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--think-border); }
  .think-box.revealed .answer { display: block; }
  .think-box.revealed .reveal-btn { display: none; }

  /* ========== Subtab in notes panel ========== */
  .subtab-bar {
    display: flex;
    gap: 4px;
    margin: -4px -4px 14px;
    padding: 4px;
    border-bottom: 2px solid var(--border);
    background: white;
  }
  .subtab-btn {
    background: none;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-mute);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    border-radius: 4px 4px 0 0;
    transition: all 0.15s;
  }
  @media (hover: hover) and (pointer: fine) {
    .subtab-btn:hover { background: var(--note-bg); }
  }
  .subtab-btn:active { background: var(--note-bg); }
  .subtab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
  }
  .subtab-pane { display: none; }
  .subtab-pane.active { display: block; }

  /* Translation rows */
  .trans-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .trans-section-title:first-child { margin-top: 0; }
  .trans-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    align-items: start;
    font-size: 13.5px;
    line-height: 1.6;
  }
  .trans-row:last-child { border-bottom: none; }
  .trans-row .trans-en {
    color: var(--text);
  }
  .trans-row .trans-en strong { color: var(--accent); }
  .trans-row .trans-zh {
    color: var(--text);
    background: var(--note-bg);
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-light);
  }
  .trans-row .trans-zh strong { color: var(--accent); }
  .trans-row.is-question {
    background: #fffbea;
    padding: 8px 10px;
    border: 1px solid #f0d97b;
    border-radius: 4px;
    margin: 6px 0;
  }
  .trans-row.is-question .trans-en::before {
    content: "❓ ";
  }
  .trans-row.section-heading {
    background: #eaf2fb;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    margin: 10px 0 4px;
    font-weight: 600;
  }
  .trans-placeholder {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-mute);
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: var(--note-bg);
  }
  .trans-placeholder .placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
  }

  @media (max-width: 700px) {
    .trans-row { grid-template-columns: 1fr; }
    .trans-row .trans-zh { margin-top: 4px; }
  }

  /* ========== Mini check ========== */
  .mini-check { background: #f0f9f4; border: 1px solid #b6e2c8; padding: 14px 16px; border-radius: 6px; margin-top: 18px; }
  .mini-check h4 { margin: 0 0 8px; color: var(--success); }
  .check-item { margin: 8px 0; }
  .check-q { font-weight: 500; }
  .check-actions { margin-top: 6px; display: flex; gap: 8px; }
  .check-actions button {
    border: 1px solid var(--border); background: white;
    padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12.5px;
    font-family: inherit;
  }
  .check-actions .got { color: var(--success); border-color: var(--success); }
  .check-actions .wrong { color: var(--accent); border-color: var(--accent); }
  .check-actions button.selected { background: currentColor; color: white !important; }
  .check-actions .got.selected { background: var(--success); }
  .check-actions .wrong.selected { background: var(--accent); }

  .complete-section {
    margin-top: 20px;
    text-align: right;
  }
  .complete-section button {
    background: var(--success); color: white;
    border: none; padding: 10px 20px; border-radius: 6px;
    cursor: pointer; font-size: 14px; font-family: inherit;
  }
  .complete-section button:disabled { background: #b0bec5; cursor: not-allowed; }

  /* ========== Skills drills ========== */
  .drills-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
  .drills-tabs button {
    background: none; border: none;
    padding: 10px 16px; cursor: pointer;
    font-size: 14px; color: var(--text-mute);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
  }
  .drills-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
  .drill-pane { display: none; }
  .drill-pane.active { display: block; }

  /* Flashcards */
  .flashcards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
  .flashcard {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    min-height: 90px;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    transition: all 0.3s;
    position: relative;
  }
  @media (hover: hover) and (pointer: fine) {
    .flashcard:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
  }
  .flashcard:active { transform: scale(0.96); box-shadow: 0 1px 4px rgba(0,0,0,0.1); border-color: var(--primary); }
  .flashcard .front { display: block; }
  .flashcard .back { display: none; font-size: 13px; color: var(--text-mute); }
  .flashcard.flipped .front { display: none; }
  .flashcard.flipped .back { display: block; }
  .flashcard.flipped { background: #fff8e1; border-color: var(--reveal-border); }
  .flashcard .en-word { font-weight: 600; color: var(--primary); font-size: 15px; }
  .flashcard .hint { position: absolute; top: 4px; right: 8px; font-size: 10px; color: var(--text-mute); }

  /* Label diagram */
  .diagram-drill { display: flex; gap: 20px; flex-wrap: wrap; }
  .diagram-area {
    flex: 1; min-width: 280px;
    position: relative;
    background: var(--note-bg);
    padding: 16px;
    border-radius: 8px;
  }
  .diagram-area .cell-diagram { width: 100%; max-width: 320px; display: block; margin: 0 auto; }
  .label-targets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
  .label-target {
    border: 2px dashed var(--border);
    padding: 8px;
    border-radius: 4px;
    min-height: 36px;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
  }
  .label-target.filled { background: #d4f1e0; border-color: var(--success); border-style: solid; }
  .label-target.wrong { background: #fde0dc; border-color: var(--accent); border-style: solid; }
  .label-bank { flex: 1; min-width: 200px; }
  .label-tile {
    display: inline-block;
    background: white;
    border: 2px solid var(--border);
    padding: 6px 12px;
    margin: 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
  }
  .label-tile.selected {
    background: var(--reveal-bg);
    border-color: var(--reveal-border);
    box-shadow: 0 0 0 3px rgba(240, 192, 96, 0.3);
    transform: scale(1.05);
  }
  .label-tile.used {
    opacity: 0.35;
    pointer-events: none;
  }
  .label-tile:active {
    transform: scale(0.95);
  }
  .label-tile.selected:active {
    transform: scale(1);
  }
  .label-target { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .label-target.target-hint {
    fill: #fff8e1 !important;
    stroke: var(--reveal-border) !important;
    stroke-dasharray: none !important;
  }

  /* ========== Practice question levels ========== */
  .level-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
  .level-tabs button {
    flex: 1; padding: 12px;
    border-radius: 8px; border: 2px solid;
    background: white;
    cursor: pointer; font-family: inherit;
    font-size: 14px;
  }
  .level-tabs button.L1 { border-color: #6dd49a; color: var(--success); }
  .level-tabs button.L2 { border-color: var(--warning); color: var(--warning); }
  .level-tabs button.L3 { border-color: var(--accent); color: var(--accent); }
  .level-tabs button.active.L1 { background: #6dd49a; color: white; }
  .level-tabs button.active.L2 { background: var(--warning); color: white; }
  .level-tabs button.active.L3 { background: var(--accent); color: white; }

  .level-pane { display: none; }
  .level-pane.active { display: block; }
  .question-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    background: var(--card-bg);
  }
  .question-card .q-num {
    display: inline-block;
    background: var(--primary);
    color: white;
    width: 24px; height: 24px;
    border-radius: 50%;
    text-align: center; line-height: 24px;
    font-size: 12px;
    margin-right: 8px;
  }
  .question-card .q-text { font-weight: 500; }
  .question-card .think-prompt {
    margin-top: 10px;
    color: var(--text-mute);
    font-size: 13px;
    font-style: italic;
  }
  .question-card .answer-area {
    background: var(--reveal-bg);
    border-left: 3px solid var(--reveal-border);
    padding: 10px 14px;
    margin-top: 10px;
    border-radius: 4px;
    display: none;
  }
  .question-card.revealed .answer-area { display: block; }
  .question-card .actions {
    margin-top: 12px;
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  .question-card .actions button {
    border: 1px solid var(--border);
    background: white;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer; font-size: 12.5px;
    font-family: inherit;
  }
  .question-card .show-answer { color: var(--primary); border-color: var(--primary); }
  .question-card .mark-got { color: var(--success); border-color: var(--success); }
  .question-card .mark-wrong { color: var(--accent); border-color: var(--accent); }
  .question-card .mark-got.selected { background: var(--success); color: white; }
  .question-card .mark-wrong.selected { background: var(--accent); color: white; }
  .question-card.marked-got { background: #f0fbf4; border-left: 4px solid var(--success); }
  .question-card.marked-wrong { background: #fff5f4; border-left: 4px solid var(--accent); }
  .question-card .q-status {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
  }
  .question-card.marked-got .q-status { background: var(--success); color: white; }
  .question-card.marked-wrong .q-status { background: var(--accent); color: white; }

  /* ========== Mistake notebook ========== */
  .mistake-list { min-height: 60px; }
  .mistake-item {
    background: #fff5f5;
    border: 1px solid #f5c4bc;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center;
  }
  .mistake-empty {
    text-align: center; color: var(--text-mute);
    padding: 30px;
    font-style: italic;
  }
  .mistake-clear {
    background: none; border: 1px solid var(--accent); color: var(--accent);
    padding: 4px 10px; border-radius: 4px; cursor: pointer;
    font-size: 12px; font-family: inherit;
  }

  /* ========== Self-check list ========== */
  .checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .checklist label {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    font-size: 13.5px;
    transition: background 0.2s;
  }
  @media (hover: hover) and (pointer: fine) {
    .checklist label:hover { background: var(--note-bg); }
  }
  .checklist label:active { background: #e8eef5; }
  .checklist input { accent-color: var(--success); }
  .checklist label.checked { background: #f0f9f4; border-color: #b6e2c8; }

  /* ========== Misc ========== */
  .toggle-zh {
    background: none; border: 1px solid var(--border);
    padding: 4px 10px; border-radius: 4px;
    cursor: pointer; font-size: 12px;
    color: var(--text-mute);
    font-family: inherit;
  }
  .toggle-zh.active { background: var(--primary); color: white; border-color: var(--primary); }

  .tag {
    display: inline-block;
    background: #e8eef5; color: var(--primary);
    font-size: 11px; padding: 2px 8px; border-radius: 10px;
    margin-right: 6px;
  }
  .tag.warn { background: #fef0e0; color: var(--warning); }
  .tag.danger { background: #fde0dc; color: var(--accent); }

  footer {
    text-align: center; padding: 30px;
    color: var(--text-mute); font-size: 12px;
  }

  /* ========== Workbook subtab ========== */
  .wb-intro {
    background: #fff8e1;
    border-left: 3px solid #f9a825;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6d4c00;
    border-radius: 4px;
  }
  .wb-page-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin: 22px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary);
  }
  .wb-page-title:first-child { margin-top: 0; }

  .wb-question {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
  }
  .wb-q-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
  }
  .wb-q-num {
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
  }
  .wb-q-type {
    display: inline-block;
    background: #e3f2fd;
    color: #0277bd;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
  }
  .wb-q-source {
    color: var(--text-mute);
    font-size: 11px;
    margin-left: auto;
  }
  .wb-q-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 12px;
  }
  .wb-q-body ul, .wb-q-body ol { padding-left: 22px; margin: 6px 0; }
  .wb-q-body .wb-options { list-style: upper-alpha; padding-left: 24px; }
  .wb-q-body .wb-options li { padding: 2px 0; }
  .wb-q-body .wb-blank {
    display: inline-block;
    border-bottom: 1.5px solid #999;
    min-width: 80px;
    margin: 0 2px;
  }
  /* Inline single-line input (e.g. Q1 list 3) */
  .wb-q-body .wb-input-inline {
    display: inline-block;
    width: calc(100% - 30px);
    border: none;
    border-bottom: 1.5px solid #aaa;
    background: transparent;
    padding: 4px 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    margin-bottom: 6px;
  }
  .wb-q-body .wb-input-inline:focus {
    outline: none;
    border-bottom-color: var(--primary);
    background: #f5f9ff;
  }

  /* Multi-line textarea (Describe / Explain / Suggest) */
  .wb-q-body .wb-input {
    display: block;
    width: 100%;
    min-height: 84px;
    margin: 10px 0;
    padding: 8px 12px;
    border: 1px solid #d4d8df;
    border-radius: 4px;
    background: repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 27px,
      #e8ecf1 27px,
      #e8ecf1 28px
    );
    font-size: 14px;
    line-height: 28px;
    font-family: inherit;
    color: var(--text);
    resize: vertical;
    box-sizing: border-box;
  }
  .wb-q-body .wb-input.large { min-height: 140px; }
  .wb-q-body .wb-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 77, 143, 0.1);
  }

  /* Interactive matching rows with dropdowns */
  .wb-q-body .wb-match-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
  }
  .wb-q-body .wb-match-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr;
    gap: 8px;
    align-items: center;
  }
  .wb-q-body .wb-match-row .wb-match-letter {
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 20px;
    background: var(--note-bg);
    border-radius: 4px;
    padding: 6px;
  }
  .wb-q-body .wb-match-select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
  }
  .wb-q-body .wb-match-select:focus {
    outline: none;
    border-color: var(--primary);
  }

  /* Interactive choice options */
  .wb-q-body .wb-options {
    list-style: none;
    padding-left: 0;
    margin: 8px 0;
  }
  .wb-q-body .wb-options li,
  .wb-q-body .wb-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 10px;
    margin: 4px 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
  }
  .wb-q-body .wb-option input[type="radio"],
  .wb-q-body .wb-option input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
  }
  .wb-q-body .wb-option-letter {
    font-weight: 600;
    color: var(--primary);
    min-width: 18px;
  }
  @media (hover: hover) and (pointer: fine) {
    .wb-q-body .wb-option:hover { background: var(--note-bg); }
  }
  .wb-q-body .wb-option:has(input:checked) {
    background: #e3f2fd;
    border-color: var(--primary);
  }
  .wb-q-body .wb-tick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  /* Match-the-columns table */
  .wb-q-body .wb-match {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 4px;
    margin: 8px 0;
    font-size: 13px;
  }
  .wb-q-body .wb-match .wb-match-head {
    font-weight: 600;
    color: var(--text-mute);
    padding: 4px 8px;
    border-bottom: 1.5px solid var(--border);
    background: var(--note-bg);
  }
  .wb-q-body .wb-match .wb-match-cell {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    text-align: center;
  }
  .wb-q-body .wb-match .wb-match-letter {
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    font-size: 18px;
  }

  .wb-reveal-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
  }
  @media (hover: hover) and (pointer: fine) {
    .wb-reveal-btn:hover { filter: brightness(1.1); }
  }
  .wb-answer {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f0f9f4;
    border-left: 3px solid var(--success);
    border-radius: 4px;
    font-size: 13.5px;
    line-height: 1.65;
  }
  .wb-answer[hidden] { display: none; }
  .wb-answer .wb-ans-label {
    display: block;
    font-weight: 600;
    color: var(--success);
    margin-top: 8px;
    margin-bottom: 4px;
  }
  .wb-answer .wb-ans-label:first-child { margin-top: 0; }
  .wb-answer .wb-trick { color: #d84315; }

  .wb-mark-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
  }
  .wb-mark-actions button {
    flex: 1;
    background: white;
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
  }
  .wb-mark-actions button.got.marked { background: #d4f1de; border-color: var(--success); color: var(--success); }
  .wb-mark-actions button.wrong.marked { background: #fde0dc; border-color: var(--accent); color: var(--accent); }

/* ============ 词汇详解 vocab pane ============ */
.vocab-section-title {
  color: var(--primary);
  margin: 18px 0 8px;
  font-size: 14px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 5px;
  font-weight: 600;
}
.vocab-section-title:first-child { margin-top: 4px; }
.vocab-card {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.6;
}
.vocab-card .vocab-head { margin-bottom: 5px; line-height: 1.4; }
.vocab-card .vocab-word {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.3px;
}
.vocab-card .vocab-ipa {
  color: #888;
  font-size: 12px;
  font-weight: 400;
  margin-left: 6px;
}
.vocab-card .vocab-pos {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 9px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 500;
}
.vocab-card .vocab-cn {
  font-weight: 600;
  color: var(--text);
  margin-left: 8px;
  font-size: 14px;
}
.vocab-card .vocab-row {
  margin: 2px 0;
  padding-left: 16px;
  position: relative;
  font-size: 12.5px;
}
.vocab-card .vocab-row::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--warning);
  font-weight: bold;
}
.vocab-card .vocab-row b {
  color: #555;
  font-weight: 600;
  margin-right: 4px;
  font-size: 11.5px;
}
.vocab-card em {
  background: #fff8e1;
  padding: 0 4px;
  font-style: normal;
  border-radius: 3px;
  font-size: 12.5px;
  color: #6b4810;
}
.vocab-card .vocab-warn {
  background: #fbeae8;
  border-left: 3px solid var(--accent);
  padding: 3px 9px;
  margin-top: 5px;
  font-size: 12px;
  color: #802020;
  border-radius: 0 4px 4px 0;
}
.vocab-card .vocab-warn::before { content: "⚠️ "; font-style: normal; }

/* 喇叭播放按钮（由 app.js 注入） */
.vocab-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .vocab-play:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.08);
  }
}
.vocab-play:active { transform: scale(0.95); }
.vocab-play.playing {
  background: var(--success);
  color: white;
  border-color: var(--success);
  animation: vocabPulse 0.8s ease-in-out infinite;
}
@keyframes vocabPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,125,79,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(46,125,79,0); }
}
