:root {
      --ink: #24342e;
      --muted: #718078;
      --paper: #fffdf8;
      --canvas: #f2f5ed;
      --green: #34745a;
      --green-dark: #24533f;
      --green-soft: #dfece3;
      --orange: #ee8b4a;
      --orange-soft: #fff0df;
      --red: #d85c55;
      --red-soft: #fde9e6;
      --blue: #5684a6;
      --blue-soft: #e7f1f7;
      --line: #e1e6dc;
      --shadow: 0 18px 55px rgba(47, 73, 57, 0.09);
      --radius-lg: 28px;
      --radius-md: 19px;
      --radius-sm: 13px;
    }

    * { box-sizing: border-box; }

    html { scroll-behavior: smooth; }

    body {
      margin: 0;
      color: var(--ink);
      background:
        radial-gradient(circle at 8% 4%, rgba(255, 218, 174, 0.46), transparent 27rem),
        radial-gradient(circle at 94% 15%, rgba(178, 215, 189, 0.45), transparent 25rem),
        var(--canvas);
      font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
      min-height: 100vh;
    }

    button, input, select, textarea { font: inherit; }
    button { color: inherit; }

    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
      outline: 3px solid rgba(238, 139, 74, 0.35);
      outline-offset: 2px;
    }

    .app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

    .topbar {
      min-height: 86px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 26px;
    }

    .brand { display: flex; align-items: center; gap: 12px; min-width: max-content; }

    .brand-mark {
      width: 46px;
      height: 46px;
      display: grid;
      place-items: center;
      border-radius: 16px;
      color: white;
      font-size: 23px;
      background: var(--green);
      box-shadow: 0 10px 26px rgba(52, 116, 90, 0.24);
      transform: rotate(-3deg);
    }

    .brand-text strong { display: block; font-size: 18px; letter-spacing: 0.02em; }
    .brand-text small { display: block; color: var(--muted); margin-top: 2px; }

    .nav-tabs {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 5px;
      border: 1px solid rgba(222, 229, 218, 0.9);
      background: rgba(255, 255, 255, 0.68);
      border-radius: 15px;
      backdrop-filter: blur(12px);
    }

    .nav-tab {
      border: 0;
      background: transparent;
      color: #65736b;
      padding: 10px 18px;
      border-radius: 11px;
      cursor: pointer;
      font-weight: 700;
      transition: 160ms ease;
    }

    .nav-tab:hover { color: var(--green-dark); background: rgba(223, 236, 227, 0.55); }
    .nav-tab.active { color: white; background: var(--green); box-shadow: 0 8px 18px rgba(52,116,90,.18); }

    main { padding: 20px 0 50px; }
    .page { display: none; animation: pageIn 260ms ease both; }
    .page.active { display: block; }

    @keyframes pageIn {
      from { opacity: 0; transform: translateY(5px); }
      to { opacity: 1; transform: none; }
    }

    .hero {
      position: relative;
      overflow: hidden;
      min-height: 350px;
      display: grid;
      grid-template-columns: 1.35fr 0.65fr;
      align-items: center;
      gap: 44px;
      padding: 44px 48px;
      background: var(--paper);
      border: 1px solid rgba(225, 230, 220, 0.88);
      border-radius: 34px;
      box-shadow: var(--shadow);
    }

    .hero::before,
    .hero::after {
      content: "";
      position: absolute;
      border-radius: 50%;
      pointer-events: none;
    }

    .hero::before {
      width: 270px; height: 270px;
      right: -92px; top: -112px;
      background: #e2efe4;
    }

    .hero::after {
      width: 120px; height: 120px;
      left: 48%; bottom: -78px;
      border: 26px solid #fff0df;
    }

    .eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--green);
      font-size: 14px;
      font-weight: 800;
      letter-spacing: .08em;
    }

    .eyebrow::before {
      content: "";
      width: 20px;
      height: 3px;
      border-radius: 2px;
      background: var(--orange);
    }

    .hero h1 {
      margin: 14px 0 13px;
      font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
      font-size: clamp(38px, 5vw, 60px);
      line-height: 1.12;
      letter-spacing: .02em;
      font-weight: 800;
    }

    .hero-copy {
      max-width: 610px;
      color: var(--muted);
      font-size: 17px;
      line-height: 1.8;
      margin: 0 0 28px;
    }

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

    .primary-btn,
    .secondary-btn,
    .ghost-btn,
    .danger-btn {
      min-height: 46px;
      border-radius: 13px;
      border: 0;
      padding: 0 20px;
      font-weight: 800;
      cursor: pointer;
      transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
    }

    .primary-btn { background: var(--green); color: #fff; box-shadow: 0 10px 23px rgba(52,116,90,.2); }
    .primary-btn:hover { background: var(--green-dark); transform: translateY(-1px); }
    .primary-btn:active, .secondary-btn:active, .ghost-btn:active { transform: translateY(1px); }
    .primary-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

    .secondary-btn { color: #9c542b; background: var(--orange-soft); }
    .secondary-btn:hover { background: #ffe5c8; }
    .ghost-btn { color: var(--green-dark); background: #edf3ed; }
    .ghost-btn:hover { background: #dfeade; }
    .danger-btn { color: #a43f3a; background: var(--red-soft); }
    .danger-btn:hover { background: #f9d7d3; }

    .task-note { font-size: 13px; color: var(--muted); }

    .today-wheel-wrap { position: relative; z-index: 1; display: grid; place-items: center; }

    .today-wheel {
      --progress: 0deg;
      position: relative;
      width: 218px;
      aspect-ratio: 1;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: conic-gradient(var(--orange) var(--progress), #edf0e8 0);
      box-shadow: 0 18px 40px rgba(75, 91, 75, .12);
    }

    .today-wheel::before {
      content: "";
      position: absolute;
      inset: 13px;
      border-radius: inherit;
      background: var(--paper);
      box-shadow: inset 0 0 0 1px rgba(222, 228, 216, .8);
    }

    .wheel-content { position: relative; text-align: center; }
    .wheel-content strong { display: block; font-size: 62px; line-height: 1; font-weight: 900; color: var(--green-dark); }
    .wheel-content span { display: block; margin-top: 9px; color: var(--muted); font-weight: 700; }
    .wheel-badge {
      position: absolute;
      right: -8px;
      bottom: 20px;
      min-width: 78px;
      padding: 9px 11px;
      border-radius: 14px;
      background: white;
      color: var(--green-dark);
      text-align: center;
      font-size: 12px;
      font-weight: 800;
      box-shadow: 0 10px 28px rgba(42, 68, 53, .14);
      border: 1px solid var(--line);
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-top: 18px;
    }

    .stat-card,
    .panel {
      background: rgba(255, 253, 248, .93);
      border: 1px solid rgba(225, 230, 220, .9);
      border-radius: var(--radius-md);
      box-shadow: 0 10px 30px rgba(49, 72, 57, .055);
    }

    .stat-card { min-height: 123px; padding: 21px; display: flex; flex-direction: column; justify-content: space-between; }
    .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; font-weight: 700; }
    .stat-icon { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); }
    .stat-card:nth-child(2) .stat-icon { background: var(--orange-soft); }
    .stat-card:nth-child(3) .stat-icon { background: var(--blue); color: #fff; }
    .stat-card:nth-child(4) .stat-icon { background: var(--red-soft); }
    .stat-value { font-size: 31px; font-weight: 900; letter-spacing: -.02em; }
    .stat-value small { margin-left: 3px; font-size: 13px; color: var(--muted); font-weight: 700; }

    .dashboard-grid {
      display: grid;
      grid-template-columns: 1.1fr .9fr;
      gap: 18px;
      margin-top: 18px;
    }

    .panel { padding: 25px; }
    .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
    .panel-title { margin: 0; font-size: 20px; }
    .panel-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
    .tiny-pill { border-radius: 999px; padding: 7px 11px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; font-weight: 800; white-space: nowrap; }

    .memory-path {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      align-items: start;
      gap: 7px;
      position: relative;
      margin: 30px 4px 12px;
    }

    .memory-path::before {
      content: "";
      position: absolute;
      height: 3px;
      left: 7%; right: 7%; top: 14px;
      background: linear-gradient(90deg, #f3b37e, #6fa587);
      opacity: .6;
    }

    .memory-step { position: relative; z-index: 1; text-align: center; }
    .memory-dot { width: 30px; height: 30px; margin: 0 auto 9px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--green); border: 5px solid var(--paper); box-shadow: 0 0 0 2px var(--green-soft); font-size: 10px; font-weight: 900; }
    .memory-step:first-child .memory-dot { background: var(--orange); box-shadow: 0 0 0 2px var(--orange-soft); }
    .memory-step b { display: block; font-size: 13px; }
    .memory-step small { color: var(--muted); font-size: 10px; }

    .week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
    .day-cell { min-height: 90px; padding: 12px 5px; text-align: center; background: #f7f8f3; border: 1px solid #e7e9e2; border-radius: 13px; }
    .day-cell.today { background: var(--orange-soft); border-color: #f2c79f; }
    .day-cell b { display: block; font-size: 12px; color: var(--muted); }
    .day-cell strong { display: block; margin: 7px 0 5px; font-size: 21px; }
    .day-cell span { display: block; font-size: 11px; color: var(--green); font-weight: 800; }

    .page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 12px 2px 24px; }
    .page-heading h1 { font-family: "KaiTi", "STKaiti", sans-serif; font-size: clamp(31px, 4vw, 44px); margin: 0 0 7px; }
    .page-heading p { margin: 0; color: var(--muted); line-height: 1.65; }

    .settings-strip {
      display: grid;
      grid-template-columns: 1fr 1fr 1.2fr;
      gap: 15px;
      margin-bottom: 18px;
    }

    .setting-card { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; padding: 18px; }
    .setting-card label { display: block; margin-bottom: 9px; font-size: 12px; color: var(--muted); font-weight: 800; }

    .field,
    .select,
    .textarea {
      width: 100%;
      color: var(--ink);
      background: #f8f9f5;
      border: 1px solid #dfe4da;
      border-radius: 12px;
      padding: 11px 13px;
    }

    .textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
    .field:focus, .select:focus, .textarea:focus { background: white; border-color: #87ad96; }
    .backup-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .small-btn { border: 0; border-radius: 10px; padding: 10px 13px; background: #edf3ed; color: var(--green-dark); font-size: 13px; font-weight: 800; cursor: pointer; }
    .small-btn:hover { background: #dfeade; }

    .library-toolbar {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 15px;
    }

    .search-box { position: relative; flex: 1 1 250px; }
    .search-box .field { padding-left: 41px; }
    .search-box::before { content: "⌕"; position: absolute; left: 15px; top: 8px; font-size: 24px; color: var(--muted); z-index: 1; }
    .filter-select { width: auto; min-width: 128px; }

    .unit-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 13px; scrollbar-width: thin; }
    .unit-tab { flex: 0 0 auto; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 9px 15px; font-size: 13px; font-weight: 800; cursor: pointer; }
    .unit-tab.active { color: white; background: var(--green); border-color: var(--green); }

    .library-summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 3px 2px 12px; color: var(--muted); font-size: 13px; }

    .word-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .word-card { position: relative; min-height: 137px; padding: 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; transition: 150ms ease; }
    .word-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(49,72,57,.08); }
    .word-card.is-wrong { border-color: #efbeb8; background: #fffafa; }
    .word-card.is-mastered { border-color: #bcd6c4; }
    .word-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
    .word-text { font-family: "KaiTi", "STKaiti", sans-serif; font-size: 26px; font-weight: 900; }
    .word-speak { width: 33px; height: 33px; border: 0; border-radius: 11px; cursor: pointer; background: var(--green-soft); color: var(--green-dark); }
    .word-meta { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .word-bottom { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 14px; }
    .status-tag { padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; background: #edf0e8; color: var(--muted); }
    .status-tag.learning { background: var(--orange-soft); color: #a45c2d; }
    .status-tag.due { background: var(--red-soft); color: #ad4640; }
    .status-tag.mastered { background: var(--green-soft); color: var(--green-dark); }
    .word-actions { display: flex; gap: 3px; }
    .icon-action { border: 0; background: transparent; color: #8b968f; cursor: pointer; padding: 4px 5px; border-radius: 7px; font-size: 12px; }
    .icon-action:hover { background: #eef1ea; color: var(--ink); }
    .empty-state { grid-column: 1 / -1; padding: 70px 20px; text-align: center; color: var(--muted); background: rgba(255,255,255,.55); border: 1px dashed #cad3c8; border-radius: 20px; }
    .empty-state strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 7px; }

    .records-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }
    .record-list { display: grid; gap: 10px; }
    .record-row { display: grid; grid-template-columns: 1fr auto auto; gap: 15px; align-items: center; padding: 15px 16px; border-radius: 13px; background: #f7f8f3; }
    .record-date strong { display: block; font-size: 14px; }
    .record-date small { color: var(--muted); }
    .score { font-size: 19px; font-weight: 900; color: var(--green); }
    .score.low { color: var(--orange); }
    .record-count { font-size: 12px; color: var(--muted); }

    .wrong-list { display: grid; gap: 9px; }
    .wrong-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border-radius: 12px; background: #fff7f5; border: 1px solid #f4d9d5; }
    .wrong-word strong { font-family: "KaiTi", "STKaiti", sans-serif; font-size: 19px; }
    .wrong-word small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
    .wrong-times { color: var(--red); font-size: 12px; font-weight: 900; }

    .insight-box { margin-top: 17px; padding: 17px; border-radius: 15px; background: var(--green-soft); line-height: 1.65; color: var(--green-dark); font-size: 13px; }
    .insight-box strong { display: block; margin-bottom: 4px; }

    footer { padding: 0 0 35px; text-align: center; color: #88948d; font-size: 12px; line-height: 1.8; }

    dialog {
      padding: 0;
      border: 0;
      border-radius: 26px;
      color: var(--ink);
      background: var(--paper);
      box-shadow: 0 30px 100px rgba(29, 49, 37, .26);
    }

    dialog::backdrop { background: rgba(25, 40, 32, .56); backdrop-filter: blur(5px); }

    .form-dialog { width: min(610px, calc(100% - 28px)); }
    .dialog-pad { padding: 28px; }
    .dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
    .dialog-head h2 { margin: 0 0 5px; }
    .dialog-head p { margin: 0; color: var(--muted); font-size: 13px; }
    .close-btn { width: 37px; height: 37px; border: 0; border-radius: 11px; background: #edf0e9; color: var(--muted); cursor: pointer; font-size: 19px; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
    .form-group { margin-bottom: 14px; }
    .form-group.full { grid-column: 1 / -1; }
    .form-group label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
    .dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 9px; }

    .session-dialog { width: min(780px, calc(100% - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
    .session-shell { min-height: 610px; padding: 24px 32px 32px; display: flex; flex-direction: column; }
    .session-top { display: flex; align-items: center; gap: 13px; }
    .session-progress-wrap { flex: 1; }
    .session-progress-meta { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
    .progress-track { height: 8px; border-radius: 999px; background: #e9ede5; overflow: hidden; }
    .progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--orange), #f3b36e); transition: width 220ms ease; }
    .session-body { flex: 1; display: grid; place-items: center; text-align: center; padding: 25px 0; }
    .session-content { width: min(570px, 100%); }
    .task-type { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .05em; }
    .task-type.new { background: var(--orange); }
    .sound-orb { width: 126px; height: 126px; margin: 24px auto 18px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--green); font-size: 44px; cursor: pointer; box-shadow: 0 0 0 13px var(--green-soft), 0 20px 40px rgba(52,116,90,.2); transition: transform 150ms ease, box-shadow 150ms ease; }
    .sound-orb:not(.speaking):hover { transform: scale(1.035); box-shadow: 0 0 0 16px var(--green-soft), 0 22px 44px rgba(52,116,90,.22); }
    .sound-orb:not(.speaking):active { transform: scale(.98); }
    .sound-orb.speaking { animation: speakPulse 900ms ease infinite alternate; }

    @keyframes speakPulse {
      to { box-shadow: 0 0 0 20px rgba(223,236,227,.55), 0 20px 40px rgba(52,116,90,.22); transform: scale(1.02); }
    }

    .session-content h2 { margin: 13px 0 7px; font-size: 29px; }
    .session-hint { color: var(--muted); margin: 0 0 20px; }
    .listen-actions { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
    .repeat-select, .voice-select { min-height: 46px; appearance: auto; padding-right: 13px; }
    .voice-settings { margin: 16px auto 0; max-width: 100%; }
    .voice-row { display: flex; justify-content: center; align-items: center; gap: 9px; flex-wrap: wrap; }
    .voice-row label { font-size: 14px; font-weight: 700; color: var(--muted); }
    .voice-select { max-width: min(320px, 100%); min-width: 180px; text-overflow: ellipsis; }
    .voice-hint { margin: 9px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
    .voice-source-row { margin-bottom: 10px; }
    .reveal-btn { margin-top: 25px; min-width: 230px; }
    .answer-panel { margin: 24px auto 15px; padding: 25px; border-radius: 20px; background: #f4f7f1; border: 1px solid #dce5da; }
    .answer-label { color: var(--muted); font-size: 12px; font-weight: 800; }
    .answer-word { margin: 8px 0 5px; font-family: "KaiTi", "STKaiti", sans-serif; font-size: clamp(48px, 9vw, 76px); line-height: 1.15; color: var(--green-dark); font-weight: 900; }
    .answer-source { color: var(--muted); font-size: 12px; }
    .grade-prompt { margin: 13px 0 12px; font-weight: 800; }
    .grade-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
    .grade-btn { min-height: 58px; border: 0; border-radius: 15px; cursor: pointer; font-size: 17px; font-weight: 900; }
    .grade-btn.wrong { background: var(--red-soft); color: #a9443e; }
    .grade-btn.correct { background: var(--green); color: white; }

    .done-badge { width: 104px; height: 104px; margin: 4px auto 21px; display: grid; place-items: center; border-radius: 50%; background: var(--orange-soft); font-size: 51px; }
    .done-title { font-family: "KaiTi", "STKaiti", sans-serif; font-size: 42px; margin: 0 0 8px; }
    .done-score { color: var(--muted); margin-bottom: 23px; }
    .done-score strong { color: var(--green); font-size: 28px; }
    .done-wrongs { margin: 17px auto 24px; max-width: 480px; }
    .done-wrongs p { color: var(--muted); font-size: 13px; }
    .word-chip-wrap { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
    .word-chip { padding: 8px 12px; border-radius: 999px; background: var(--red-soft); color: #9f4741; font-family: "KaiTi", "STKaiti", sans-serif; font-size: 18px; font-weight: 900; }

    .toast {
      position: fixed;
      left: 50%; bottom: 28px;
      z-index: 1000;
      max-width: calc(100% - 30px);
      transform: translate(-50%, 20px);
      padding: 12px 18px;
      border-radius: 13px;
      background: #233b30;
      color: white;
      font-size: 13px;
      font-weight: 700;
      opacity: 0;
      pointer-events: none;
      transition: 200ms ease;
      box-shadow: 0 12px 30px rgba(23, 43, 32, .25);
    }
    .toast.show { opacity: 1; transform: translate(-50%, 0); }

    .hidden { display: none !important; }

    @media (max-width: 900px) {
      .hero { grid-template-columns: 1fr; padding: 38px; gap: 30px; }
      .today-wheel { width: 190px; }
      .today-wheel-wrap { justify-self: start; margin-left: 13px; }
      .stats-grid { grid-template-columns: repeat(2, 1fr); }
      .dashboard-grid, .records-grid { grid-template-columns: 1fr; }
      .settings-strip { grid-template-columns: 1fr 1fr; }
      .setting-card:last-child { grid-column: 1 / -1; }
      .word-grid { grid-template-columns: repeat(3, 1fr); }
    }

    @media (max-width: 650px) {
      .app-shell { width: min(100% - 20px, 1180px); }
      .topbar { min-height: auto; padding: 13px 0; display: block; }
      .brand { margin: 0 3px 12px; }
      .nav-tabs { width: 100%; }
      .nav-tab { flex: 1; padding: 10px 7px; font-size: 13px; }
      main { padding-top: 5px; }
      .hero { padding: 29px 24px 33px; border-radius: 25px; }
      .hero h1 { font-size: 39px; }
      .hero-copy { font-size: 15px; }
      .today-wheel-wrap { justify-self: center; margin-left: 0; }
      .stats-grid { gap: 10px; }
      .stat-card { min-height: 108px; padding: 15px; }
      .stat-value { font-size: 25px; }
      .panel { padding: 20px 16px; }
      .memory-path { grid-template-columns: repeat(4, 1fr); row-gap: 18px; }
      .memory-path::before { display: none; }
      .week-row { gap: 4px; overflow-x: auto; }
      .day-cell { min-width: 62px; }
      .page-heading { display: block; }
      .page-heading .primary-btn { margin-top: 15px; }
      .settings-strip { grid-template-columns: 1fr; }
      .setting-card:last-child { grid-column: auto; }
      .word-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
      .word-card { min-height: 131px; padding: 14px; }
      .word-text { font-size: 23px; }
      .form-grid { grid-template-columns: 1fr; }
      .form-group.full { grid-column: auto; }
      .session-shell { min-height: calc(100vh - 24px); padding: 18px 17px 24px; }
      .sound-orb { width: 105px; height: 105px; }
    }

    @media (max-width: 400px) {
      .word-grid { grid-template-columns: 1fr; }
      .hero-actions > button { width: 100%; }
      .task-note { width: 100%; text-align: center; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
    }
  
    a { color:var(--green-dark); text-decoration:none; }
    a:focus-visible { outline:3px solid var(--orange); outline-offset:3px; }
    .nav-tab { min-height:44px; }
    body { line-height:1.6; }
    .hero { min-height:290px; padding:34px 40px; gap:30px; }
    .hero h1 { font-family:inherit; font-size:clamp(30px,4vw,47px); line-height:1.3; }
    .hero-copy { font-size:16px; margin-bottom:20px; }
    .book-badge { display:inline-flex; gap:8px; align-items:center; background:var(--green-soft); color:var(--green-dark); padding:5px 12px; border-radius:99px; font-size:13px; font-weight:800; margin-bottom:10px; }
    .unit-heading { margin:24px 0 12px; font-size:19px; }
    .unit-map { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
    .unit-tile { padding:14px 12px; background:var(--paper); border:1px solid var(--line); border-radius:15px; text-align:left; cursor:pointer; }
    .unit-tile:hover { border-color:var(--green); }
    .unit-tile span { display:block; font-size:12px; color:var(--muted); }
    .unit-tile strong { display:block; font-size:16px; }
    .unit-tile.locked { background:transparent; }
    .route-progress { display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin-top:15px; }
    .route-progress span { padding:6px 10px; background:var(--canvas); border-radius:9px; font-size:14px; }
    .question-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
    .question-card { min-width:0; padding:20px; border-radius:18px; border:1px solid var(--line); background:var(--paper); display:flex; flex-direction:column; }
    .question-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; color:var(--muted); font-size:12px; }
    .question-card h2 { font-size:20px; line-height:1.45; margin:14px 0 8px; overflow-wrap:anywhere; }
    .question-card p { margin:0 0 18px; color:var(--muted); font-size:14px; }
    .card-actions { display:flex; align-items:center; gap:8px; margin-top:auto; }
    .card-actions button { min-height:42px; }
    .library-toolbar { flex-wrap:wrap; }
    .library-toolbar .search-box { flex:1 1 240px; }
    .practice-notes { margin:20px 0 0; padding:17px 20px; background:var(--orange-soft); color:#765136; border-radius:15px; font-size:14px; }
    .book-info { display:flex; justify-content:space-between; gap:16px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
    .settings-strip { grid-template-columns:repeat(3,1fr); }
    .setting-card { min-width:0; }
    .setting-card label { font-size:14px; }
    .setting-card select, .setting-card input { width:100%; }
    .checks { display:flex; gap:10px; align-items:flex-start; font-size:14px; cursor:pointer; }
    .checks input { width:18px; height:18px; flex:none; margin-top:3px; accent-color:var(--green); }
    .settings-note { grid-column:1/-1; font-size:13px; color:var(--muted); }
    .session-dialog { width:min(900px,calc(100% - 24px)); }
    .session-shell { min-height:570px; }
    .session-body { display:block; padding:18px 0 0; }
    .session-content { width:100%; }
    .session-stage { font-size:14px; color:var(--green); font-weight:700; min-height:25px; }
    .question-prompt { max-width:680px; margin:14px auto 8px; font-size:clamp(24px,3.7vw,34px); line-height:1.4; overflow-wrap:anywhere; }
    .question-translation { color:var(--muted); font-size:16px; margin:8px 0 16px; }
    .sound-orb { width:74px; height:74px; font-size:30px; margin:14px auto; }
    .voice-settings { margin:12px auto; max-width:660px; padding:12px; }
    .voice-settings .voice-row { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:9px; }
    .voice-hint { min-height:22px; font-size:13px; }
    .answer-panel { margin-top:20px; padding:20px; text-align:left; background:var(--green-soft); }
    .answer-panel h3 { margin:0 0 6px; font-size:17px; }
    .answer-note { font-size:14px; color:var(--muted); margin:0 0 15px; }
    .answer-examples { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
    .answer-example { padding:17px; border:1px solid rgba(52,116,90,.14); background:var(--paper); border-radius:14px; }
    .example-label { color:var(--green); font-size:13px; font-weight:800; display:block; }
    .answer-example .english { margin:9px 0; font-size:20px; line-height:1.5; }
    .answer-example .chinese { font-size:14px; color:var(--muted); }
    .answer-example button { margin-top:10px; min-height:40px; }
    .answer-scaffold { margin-top:14px; padding-top:13px; border-top:1px dashed #bdd2c1; font-size:14px; }
    .answer-scaffold b { display:block; font-size:17px; color:var(--green-dark); margin:5px 0; }
    .answer-source { font-size:12px; margin-top:14px; color:var(--muted); }
    .grade-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
    .grade-btn { min-height:52px; font-size:15px; padding:12px; }
    .grade-btn.prompted { background:var(--orange-soft); color:#86552e; border:1px solid #eed3b6; }
    .session-error { margin:12px 0; color:#974f36; font-size:14px; }
    .session-error button { margin-top:8px; }
    .progress-track { height:8px; }
    .source-details { margin-top:20px; font-size:13px; color:var(--muted); }
    button:disabled { cursor:not-allowed; opacity:.55; }
    .hidden,[hidden] { display:none!important; }
    .mobile-label { display:none; }
    .inline-status { font-size:14px; color:var(--green-dark); font-weight:700; }
    .speech-status { min-height:24px; }
    .toast { max-width:calc(100% - 30px); white-space:normal; }
    .record-row { grid-template-columns:minmax(0,1fr) auto; }
    .record-row strong, .wrong-row strong { overflow-wrap:anywhere; }
    .wrong-row .small-btn { flex-shrink:0; }
    .rating-label { font-size:12px; font-weight:700; color:var(--green-dark); }
    .rating-label.again { color:#9f4741; }
    .rating-label.prompted { color:#86552e; }
    .empty-state { grid-column:1/-1; padding:25px; margin:0; border:1px dashed var(--line); border-radius:14px; color:var(--muted); }
    .done-question-list { display:grid; gap:7px; text-align:left; }
    .done-question-list span { padding:9px 12px; border-radius:9px; background:var(--orange-soft); overflow-wrap:anywhere; }
    body:has(dialog[open]) { overflow:hidden; }
    .session-top { position:sticky; top:-24px; z-index:5; padding:8px 0; background:var(--paper); }
    .page-heading h1 { font-family:inherit; }
    .source-details summary { cursor:pointer; min-height:40px; }
    .checks small { display:block; font-weight:400; }
    .setting-card label.checks { display:flex; }
    .search-box::before { pointer-events:none; }
    footer a { text-decoration:underline; text-underline-offset:3px; }
    .memory-step { min-width:0; }
    @media (max-width:900px) { .question-grid { grid-template-columns:1fr 1fr; } .unit-map { grid-template-columns:repeat(3,1fr); } .settings-strip { grid-template-columns:1fr 1fr; } }
    @media (max-width:640px) {
      .hero { padding:25px 22px; gap:18px; }
      .hero h1 { font-size:30px; } .today-wheel-wrap { display:none; }
      .question-grid,.answer-examples,.settings-strip { grid-template-columns:1fr; }
      .unit-map { grid-template-columns:1fr 1fr; }
      .grade-actions { grid-template-columns:1fr; gap:8px; }
      .session-shell { padding:18px 16px; min-height:auto; }
      .session-top { top:-18px; }
      .library-summary { align-items:flex-start; flex-direction:column; gap:3px; }
      .answer-panel { padding:14px; }
      .session-content h2 { font-size:25px; }
      .brand-text small { font-size:12px; }
      .settings-strip .setting-card { grid-column:auto!important; }
      .filter-select { flex:1 1 120px; max-width:none; }
      .voice-settings { padding:0; margin:10px auto; }
      .voice-settings .voice-row { display:grid; grid-template-columns:minmax(0,1fr) 80px; max-width:310px; margin:0 auto; gap:8px; }
      .voice-row select { width:100%; min-width:0; min-height:42px; padding:8px 10px; font-size:14px; }
      .listen-actions .ghost-btn { padding:8px 12px; min-height:40px; font-size:14px; }
      .sound-orb { width:64px; height:64px; margin:12px auto; }
      .answer-panel { margin-top:16px; }
      .reveal-btn { min-width:0; }
    }
    @media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
