:root{
  --blue:#1b6fb8; --orange:#e87722; --red:#ff4b4b; --purple:#8e44ad;
  --green:#58cc02; --green-edge:#58a700; --gold:#ffc800; --ink:#3b4750;
  --muted:#8a95a0; --bg:#f7f9fa; --line:#e5e9ee;
  --navy:#1e2d3d; --soft:#f2f5f8; --c:#1b6fb8;
  --target-size:24px;
}
@media (pointer: coarse){
  :root{ --target-size:44px; }
}
@property --fade-start{
  syntax:"<length>";
  inherits:false;
  initial-value:0px;
}
@property --fade-end{
  syntax:"<length>";
  inherits:false;
  initial-value:0px;
}
*{ box-sizing:border-box; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:"Noto Sans","Noto Sans CJK SC",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased;
  overflow-wrap:break-word;
}
.app{ max-width:460px; margin:0 auto; min-height:100vh; background:#fff; position:relative; }
.screen{ display:none; padding:12px 14px 24px; }
.screen.active{ display:block; }

.topbar{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 8px; margin-bottom:10px; }
.brand{ flex:1 1 110px; min-inline-size:0; font-weight:900; font-size:16.5px; line-height:1.25; letter-spacing:.2px; color:var(--navy); }
.brand small{
  display:block; font-size:11px; color:var(--muted); font-weight:700; letter-spacing:.4px;
  margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.icon-btn{
  position:relative; border:2px solid var(--line); border-bottom-width:4px; background:#fff;
  min-inline-size:44px; min-block-size:max(44px, var(--target-size)); padding:4px 7px;
  border-radius:11px; display:inline-flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  cursor:pointer; color:#52616e; flex:0 0 auto;
}
.icon-btn:active{ transform:translateY(2px); border-bottom-width:2px; }
.icon-btn:focus-visible{ outline:2px solid var(--c); outline-offset:2px; }
.icon-btn svg{ flex:none; width:16px; height:16px; pointer-events:none; }
.icon-btn .ib-label{ font-size:10.5px; font-weight:800; line-height:1.1; white-space:nowrap; color:var(--ink); }
.icon-btn.is-muted{ background:#f5f7fa; color:#72808c; }
.icon-btn.is-muted .ib-label{ color:#72808c; }
.top-actions{ display:flex; align-items:center; gap:6px; flex:0 0 auto; }

.hero{
  border-radius:18px; color:#fff; padding:12px 14px 11px; margin-bottom:10px;
  background:linear-gradient(140deg,var(--c),color-mix(in srgb,var(--c) 78%,#1f3c88));
  border:2px solid color-mix(in srgb,var(--c) 70%,#000); border-bottom-width:5px;
}
.hero-main{ display:flex; align-items:center; gap:11px; }
.hero .mascot{ flex:0 0 auto; line-height:0; }
.hero-info{ flex:1; min-width:0; }
.hero-badges{ display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-bottom:4px; }
.lv-chip{
  display:inline-flex; align-items:center; background:rgba(255,255,255,.22); border:1.5px solid rgba(255,255,255,.35);
  border-radius:999px; padding:1px 9px; font-size:11px; font-weight:900; line-height:1.4;
}
.today-pill{
  display:inline-flex; align-items:center; background:rgba(255,255,255,.14); border:1.5px solid rgba(255,255,255,.26);
  border-radius:999px; padding:1px 8px; font-size:11px; font-weight:800; line-height:1.4; color:rgba(255,255,255,.95);
}
.today-pill.done{ background:#e5fbd0; border-color:#bce996; color:#2b6600; }
.hero h2{ margin:0 0 2px; font-size:16px; line-height:1.3; font-weight:900; text-wrap:balance; }
.hero p{ margin:0; font-size:11.5px; opacity:.94; line-height:1.35; }
.hero-xp{ margin-top:9px; padding-top:8px; border-top:1px solid rgba(255,255,255,.2); }
.hero-xp .xp-lab{
  display:flex; justify-content:space-between; font-size:11px; color:rgba(255,255,255,.92); font-weight:800;
  margin-bottom:4px; font-variant-numeric:tabular-nums;
}
.hero-xp .xp-bar{ height:8px; background:rgba(0,0,0,.18); border:1px solid rgba(255,255,255,.22); border-radius:999px; overflow:hidden; }
.hero-xp .xp-bar i{ display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,#fff4b8,var(--gold)); transition:width .45s; }

.stats-strip{
  display:grid; grid-template-columns:repeat(3,1fr);
  border:2px solid var(--line); border-bottom-width:4px; border-radius:15px;
  background:#fff; margin-bottom:10px; overflow:hidden;
}
.stat-cell{ padding:7px 4px; text-align:center; position:relative; min-width:0; }
.stat-cell + .stat-cell::before{
  content:""; position:absolute; left:0; top:20%; bottom:20%; width:1.5px; background:var(--line);
}
.stat-cell .n{ font-size:18px; line-height:1.2; font-weight:900; color:var(--navy); font-variant-numeric:tabular-nums; }
.stat-cell .l{ font-size:10.5px; color:var(--muted); margin-top:2px; font-weight:700; }

.resume-card{
  border:2px solid color-mix(in srgb,var(--c) 45%,#fff); border-bottom-width:4px;
  border-radius:15px; padding:10px 12px; margin-bottom:10px;
  background:color-mix(in srgb,var(--c) 7%,#fff);
}
.resume-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:8px; margin-bottom:8px; }
.resume-copy{ min-width:0; }
.resume-title{ font-size:14px; font-weight:900; color:var(--navy); line-height:1.3; }
.resume-desc{ font-size:12px; color:var(--ink); font-weight:700; margin-top:2px; }
.resume-tag{
  flex:0 0 auto; font-size:11px; font-weight:900; padding:2px 8px; border-radius:999px;
  background:var(--c); color:#fff; white-space:nowrap;
}
.resume-actions{ display:flex; gap:8px; }
.resume-btn-main{
  flex:2; border:2px solid color-mix(in srgb,var(--c) 65%,#000); border-bottom-width:4px;
  border-radius:12px; padding:8px 10px; min-height:40px; font-size:13.5px; font-weight:900;
  background:var(--c); color:#fff; cursor:pointer;
}
.resume-btn-main:active{ transform:translateY(2px); border-bottom-width:2px; }
.resume-btn-sub{
  flex:1; border:2px solid var(--line); border-bottom-width:4px;
  border-radius:12px; padding:8px 8px; min-height:40px; font-size:12.5px; font-weight:800;
  background:#fff; color:var(--muted); cursor:pointer;
}
.resume-btn-sub:active{ transform:translateY(2px); border-bottom-width:2px; }

.quick-start-card{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  border:2px solid color-mix(in srgb,var(--c) 38%,#fff); border-bottom-width:4px;
  border-radius:15px; padding:10px 12px; margin-bottom:10px;
  background:color-mix(in srgb,var(--c) 7%,#fff);
}
.qs-info{ flex:1; min-width:0; }
.qs-title{ font-size:14px; font-weight:900; color:var(--navy); line-height:1.3; }
.qs-sub{ font-size:11.5px; color:var(--ink); opacity:.82; font-weight:700; margin-top:2px; }
.qs-btn{
  flex:0 0 auto; border:2px solid color-mix(in srgb,var(--c) 65%,#000); border-bottom-width:4px;
  border-radius:12px; padding:8px 14px; min-height:42px; font-size:13.5px; font-weight:900;
  background:var(--c); color:#fff; cursor:pointer; white-space:nowrap;
}
.qs-btn:active{ transform:translateY(2px); border-bottom-width:2px; }

.wrong-book-card{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  border:2px solid #ffd8b5; border-bottom-width:4px; border-radius:15px;
  padding:10px 12px; margin-bottom:10px; background:#fff9f2;
}
.wrong-book-card.wb-wait{
  border-color:#d8e7f3; background:#f8fbff;
}
.wrong-book-card.wb-cleared{
  border-color:#c8ecc2; background:#f3fcf0;
}
.wb-info{ flex:1; min-width:0; cursor:pointer; }
.wb-title-row{ display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.wb-title{ font-size:14px; font-weight:900; color:var(--navy); line-height:1.3; }
.wb-due-pill{
  display:inline-flex; align-items:center; background:#ffe5cc; color:#c84b00;
  border:1px solid #ffc799; border-radius:999px; padding:1px 8px;
  font-size:11px; font-weight:900; line-height:1.4; white-space:nowrap;
}
.wrong-book-card.wb-wait .wb-due-pill{
  background:#e8f3ff; color:#1b6fb8; border-color:#c6e0fa;
}
.wrong-book-card.wb-cleared .wb-due-pill{
  background:#dcf8cc; color:#2b7a00; border-color:#b2e894;
}
.wb-sub{
  font-size:11.5px; color:var(--ink); opacity:.85; font-weight:700; margin-top:2px; line-height:1.35;
}
.wb-actions{ display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.wb-btn-list{
  border:2px solid var(--line); border-bottom-width:3px; border-radius:11px;
  background:#fff; color:var(--navy); padding:7px 10px; min-height:38px;
  font-size:12.5px; font-weight:800; cursor:pointer; white-space:nowrap;
}
.wb-btn-list:active{ transform:translateY(1px); border-bottom-width:2px; }
.wb-btn-go{
  border:2px solid #c85500; border-bottom-width:4px; border-radius:12px;
  background:#ff841f; color:#fff; padding:8px 13px; min-height:40px;
  font-size:13px; font-weight:900; cursor:pointer; white-space:nowrap;
}
.wb-btn-go:active{ transform:translateY(2px); border-bottom-width:2px; }
@media (pointer: coarse){
  .wb-btn-list, .wb-btn-go{ min-height:44px; }
}
@media (max-width:360px){
  .wrong-book-card{ flex-wrap:wrap; }
  .wb-actions{ width:100%; justify-content:flex-end; }
}

.review-pill-row{
  display:flex; justify-content:center; margin:0 0 8px;
}
.review-pill{
  display:inline-flex; align-items:center; gap:5px; max-width:100%; flex-wrap:wrap;
  justify-content:center; padding:4px 11px; border-radius:999px;
  background:#fff3e6; border:1.5px solid #ffd0a1; color:#c84b00;
  font-size:12px; font-weight:900; line-height:1.3;
}
.review-pill .rp-sub{ font-size:11px; color:#8f4c16; font-weight:800; }

.panel{
  border:2px solid var(--line); border-bottom-width:4px; border-radius:16px;
  padding:12px; margin-bottom:10px; background:#fff;
}
.map-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.map-title-group{ display:flex; align-items:center; gap:7px; min-width:0; }
.map-title-group h3{ margin:0; font-size:14px; font-weight:900; color:var(--navy); text-wrap:balance; }
.map-progress-pill{
  font-size:11px; font-weight:800; color:var(--c);
  background:color-mix(in srgb,var(--c) 10%,#fff); border:1px solid color-mix(in srgb,var(--c) 25%,#fff);
  border-radius:999px; padding:1px 8px; white-space:nowrap; font-variant-numeric:tabular-nums;
}
.map-controls{ display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.map-locate-btn{
  border:1.5px solid var(--c); background:#fff; color:var(--c); border-radius:999px;
  padding:4px 10px; min-height:30px; font-size:11.5px; font-weight:800; cursor:pointer; white-space:nowrap;
}
.map-locate-btn:active{ background:color-mix(in srgb,var(--c) 8%,#fff); }
.map-step-btn{
  position:relative; border:1.5px solid var(--line); border-bottom-width:3px; background:#fff; color:var(--navy);
  width:30px; height:30px; border-radius:9px; font-size:16px; line-height:1; font-weight:900;
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; padding:0;
}
.map-step-btn:disabled{ opacity:.38; cursor:default; }
.map-step-btn:not(:disabled):active{ transform:translateY(1px); border-bottom-width:2px; }
@media (pointer: coarse){
  .map-step-btn{ width:36px; height:36px; }
  .map-locate-btn{ min-height:36px; }
}

.chapter-tabs{
  display:flex; gap:6px; overflow-x:auto; scroll-snap-type:inline proximity; scroll-padding-inline:24px;
  scrollbar-width:none; padding:2px 2px 7px; margin-bottom:8px; --fade-size:24px;
}
.chapter-tabs::-webkit-scrollbar{ display:none; }
@supports (animation-timeline: scroll(self inline)){
  .chapter-tabs{
    mask:
      linear-gradient(black,black) no-clip subtract,
      linear-gradient(to right,black,transparent) 0 0 / var(--fade-start) 100% no-repeat no-clip,
      linear-gradient(to right,transparent,black) 100% 0 / var(--fade-end) 100% no-repeat no-clip;
    animation:reveal-fade-start linear both, hide-fade-end linear both;
    animation-timeline:scroll(self inline);
    animation-range:0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
  }
}
@keyframes reveal-fade-start{ to{ --fade-start:var(--fade-size); } }
@keyframes hide-fade-end{ from{ --fade-end:var(--fade-size); } }

.ch-tab{
  flex:none; scroll-snap-align:start; position:relative;
  display:inline-flex; align-items:center; gap:5px;
  border:1.5px solid var(--line); background:var(--soft); color:var(--ink);
  border-radius:10px; padding:6px 10px; min-height:34px;
  font-size:12px; font-weight:800; cursor:pointer; white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.ch-tab[aria-selected="true"]{
  background:color-mix(in srgb,var(--c) 11%,#fff);
  border-color:color-mix(in srgb,var(--c) 45%,#fff);
  color:var(--c);
}
.ch-tab[aria-selected="true"]::after{
  content:""; position:absolute; inset:auto 8px 0;
  border-block-end:3px solid var(--c); border-radius:2px 2px 0 0;
}
.ch-tab-dot{ width:7px; height:7px; border-radius:50%; flex:0 0 auto; }
.ch-tab-dot.done{ background:var(--green); }
.ch-tab-dot.cur{ background:var(--c); }
@media (pointer: coarse){
  .ch-tab{ min-height:38px; }
}

.lesson-grid{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; margin-bottom:9px; }
.lesson-tile{
  min-height:48px; border-radius:12px; border:2px solid var(--line); border-bottom-width:4px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
  cursor:pointer; position:relative; padding:4px 2px; background:#fff; color:var(--ink);
  transition:transform .06s, border-bottom-width .06s;
}
.lesson-tile:active{ transform:translateY(2px); border-bottom-width:2px; }
.lesson-tile .lt-num{ font-size:14px; font-weight:900; line-height:1.1; font-variant-numeric:tabular-nums; }
.lesson-tile .lt-mark{ line-height:0; display:flex; align-items:center; justify-content:center; }
.lesson-tile .lt-sub{ font-size:9.5px; font-weight:800; line-height:1; color:var(--muted); }
.lesson-tile.done{ background:var(--green); border-color:var(--green-edge); color:#fff; }
.lesson-tile.current{
  background:var(--c); border-color:color-mix(in srgb,var(--c) 65%,#000); color:#fff;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--c) 22%,transparent);
}
@media (prefers-reduced-motion: no-preference){
  .lesson-tile.current{ animation:tilePulse 1.8s ease-in-out infinite; }
}
@keyframes tilePulse{
  0%,100%{ box-shadow:0 0 0 0 color-mix(in srgb,var(--c) 35%,transparent); }
  50%{ box-shadow:0 0 0 5px color-mix(in srgb,var(--c) 0%,transparent); }
}
.lesson-tile.open{ background:#fff; border-color:var(--line); color:var(--navy); }
.lesson-tile.has-draft::after{
  content:""; position:absolute; top:-4px; right:-4px; width:12px; height:12px; border-radius:50%;
  background:#ff9f1c; border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.25);
}

.map-legend{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:10px;
  font-size:11px; font-weight:700; color:var(--muted); padding-top:2px;
}
.map-legend span{ display:inline-flex; align-items:center; gap:4px; }
.lg-dot{ display:inline-block; width:9px; height:9px; border-radius:3px; }
.lg-dot.done{ background:var(--green); }
.lg-dot.current{ background:var(--c); }
.lg-dot.open{ background:#fff; border:1.5px solid #cbd3dc; }
.lg-dot.draft{ background:#ff9f1c; border-radius:50%; }

.map-rule-details{ margin-top:8px; padding-top:8px; border-top:1px solid var(--soft); }
.map-rule-details summary,
.badges-summary{
  list-style:none; display:flex; align-items:center; gap:6px; cursor:pointer;
  font-size:12px; font-weight:800; color:var(--muted); min-height:28px; user-select:none;
}
.map-rule-details summary::-webkit-details-marker,
.badges-summary::-webkit-details-marker{ display:none; }
.map-rule-details summary::before,
.badges-summary::before{
  content:""; inline-size:12px; block-size:12px; flex-shrink:0; background-color:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate:-90deg;
}
details[open] > summary::before{ rotate:0deg; }
@media (prefers-reduced-motion: no-preference){
  .map-rule-details summary::before,
  .badges-summary::before{ transition:rotate .2s; }
}
.map-rule-body{
  font-size:11.5px; color:var(--muted); background:var(--soft); border-radius:10px;
  padding:8px 10px; margin-top:6px; line-height:1.5; text-wrap:pretty;
}

.badges-panel{ padding:10px 12px; }
.badges-summary{ font-size:14px; font-weight:900; color:var(--navy); min-height:30px; }
.badge-count-pill{
  margin-left:auto; font-size:11px; font-weight:800; color:var(--muted);
  background:var(--soft); border-radius:999px; padding:2px 8px; font-variant-numeric:tabular-nums;
}
.badges-content{ margin-top:10px; }
.badge-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.badge{ text-align:center; }
.badge .b-ico{
  width:38px; height:38px; border-radius:50%; margin:0 auto 4px; display:flex;
  align-items:center; justify-content:center; background:#f0f2f4; border:2px solid #e4e7ea;
}
.badge.on .b-ico{ background:color-mix(in srgb,var(--gold) 22%,#fff); border-color:var(--gold); }
.badge .b-name{ font-size:10px; color:var(--muted); font-weight:700; }
.badge.on .b-name{ color:var(--ink); font-weight:900; }

details::details-content{
  interpolate-size:allow-keywords;
  overflow:clip;
  contain:layout;
}
details:not([open])::details-content{ block-size:0; }
@media (prefers-reduced-motion: no-preference){
  details::details-content{
    transition:block-size .25s ease-in-out, content-visibility .25s allow-discrete, display .25s allow-discrete;
  }
}

.board-head h3, .auth-panel h3, .modal-box h3, .done-box h2{ text-wrap:balance; }
.auth-panel p, .m-desc, .shot-tip{ text-wrap:pretty; }
@media (max-width: 360px){
  .screen{ padding:10px 10px 20px; }
  .lesson-grid{ gap:5px; }
  .lesson-tile{ min-height:44px; }
  .qs-btn{ padding:8px 10px; font-size:13px; }
  .spell-vk{ padding:7px 4px 8px; gap:5px; }
  .vk-row{ gap:3px; }
  .vk-key{ height:42px; font-size:15.5px; border-radius:8px; }
  .vk-key-space, .vk-key-clear{ font-size:12px; }
  .vk-key-submit{ font-size:13px; }
}

.btn{
  display:block; width:100%; border:2px solid color-mix(in srgb,var(--c) 65%,#000);
  border-bottom-width:7px; border-radius:17px; padding:15px; font-size:16px; font-weight:900;
  letter-spacing:1px; cursor:pointer; min-height:54px; background:var(--c); color:#fff;
  transition:transform .06s,border-bottom-width .06s; margin-top:12px;
}
.btn:active{ transform:translateY(4px); border-bottom-width:3px; }
.btn:disabled{ opacity:.65; cursor:default; }
.btn-ghost{
  background:#fff; color:var(--c); border-color:var(--line); border-bottom-width:5px; margin-top:10px;
}

.quest-top{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.progress{ flex:1; height:16px; background:#eef1f4; border:2px solid #e4e7ea; border-radius:10px; overflow:hidden; margin-bottom:12px; }
.quest-top .progress{ margin-bottom:0; }
.progress i{ display:block; height:100%; background:var(--green); border-radius:6px; transition:width .3s; }
.hearts{ display:flex; gap:4px; align-items:center; flex:0 0 auto; }
.heart{ width:26px; height:26px; transition:transform .2s,opacity .2s; }
.heart.lost{ opacity:.2; transform:scale(.85); }
.step-tag{ font-size:12px; color:var(--muted); font-weight:900; margin-bottom:8px; letter-spacing:1px; display:flex; align-items:center; justify-content:space-between; }
.quit-link{ background:none; border:none; color:var(--muted); font-size:12px; font-weight:800; cursor:pointer; padding:2px 6px; }

.flash{
  border:2px solid color-mix(in srgb,var(--c) 30%,#fff); border-bottom-width:6px; border-radius:22px;
  padding:22px 18px 20px; text-align:center; background:#fff; min-height:250px;
  display:flex; flex-direction:column; justify-content:center; position:relative;
}
.flash .pos{ font-size:12px; color:var(--muted); font-weight:800; }
.flash .word{ font-size:34px; font-weight:900; margin:5px 0 3px; letter-spacing:.5px; color:var(--navy); }
.flash .cn{ font-size:18px; font-weight:800; margin-bottom:9px; color:var(--ink); }
#f-blocks{ margin-top:4px; }
.en-block{ border-radius:13px; padding:9px 12px; margin-bottom:8px; text-align:left; }
.en-block:last-child{ margin-bottom:2px; }
.en-block .lab{
  font-size:10.5px; font-weight:900; letter-spacing:1px; margin-bottom:4px;
  display:flex; gap:5px; align-items:center;
}
.en-block .txt{ font-size:13px; font-weight:700; line-height:1.55; }
.en-def{ background:#eef6ff; border:2px solid #d6e6f7; }
.en-def .lab{ color:#1b6fb8; }
.en-phrase{ background:#f0fbf2; border:2px solid #d3eed9; }
.en-phrase .lab{ color:#2e9e63; }
.en-root{ background:#fff6e6; border:2px solid #ffe2b3; }
.en-root .lab{ color:#e8940f; }
.en-ex{ background:#faf3fb; border:2px solid #ecddf2; }
.en-ex .lab{ color:#8e44ad; }
.en-ex .txt{ font-style:italic; color:#4a3a52; }
.audio-btn{
  border:2px solid color-mix(in srgb,var(--c) 25%,#fff); border-bottom-width:5px;
  background:#fff; color:var(--c); width:56px; height:56px; border-radius:50%;
  margin:0 auto 6px; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.audio-btn:active{ transform:translateY(2px); border-bottom-width:3px; }

.q-word{ text-align:center; font-size:28px; font-weight:900; margin:8px 0 16px; color:var(--navy); }
.opt{
  width:100%; text-align:left; border:2px solid var(--line); border-bottom-width:5px; background:#fff;
  border-radius:16px; padding:14px 15px; margin-bottom:11px; font-size:15px; font-weight:800; color:var(--ink);
  cursor:pointer; min-height:52px; position:relative; transition:transform .06s;
}
.opt:active{ transform:translateY(2px); }
.opt.correct{ border-color:var(--green-edge); background:#e5fbd0; color:var(--green-edge); }
.opt.wrong{ border-color:#ea2b2b; background:#ffe5e5; color:#ea2b2b; }
.opt:disabled{ cursor:default; }

.spell-cn{
  text-align:center; font-size:20px; font-weight:900; margin:4px 0 10px; color:var(--navy);
  line-height:1.35; text-wrap:balance;
}
.spell-tools{
  display:flex; align-items:center; justify-content:center; gap:8px; margin-bottom:10px; flex-wrap:wrap;
}
.spell-listen-btn{
  display:inline-flex; align-items:center; gap:5px; padding:6px 13px; min-height:36px;
  border:2px solid color-mix(in srgb,var(--c) 35%,#fff); border-bottom-width:4px;
  border-radius:999px; background:#fff; color:var(--c); font-size:13px; font-weight:900;
  cursor:pointer; transition:transform .06s, background-color .12s;
}
.spell-listen-btn:active{ transform:translateY(2px); border-bottom-width:2px; }
.spell-kb-toggle{
  display:inline-flex; align-items:center; padding:6px 11px; min-height:36px;
  border:1.5px solid var(--line); border-bottom-width:3px; border-radius:999px;
  background:var(--soft); color:var(--muted); font-size:12px; font-weight:800; cursor:pointer;
}
.spell-kb-toggle:active{ transform:translateY(1px); border-bottom-width:2px; }
@media (pointer: coarse){
  .spell-listen-btn, .spell-kb-toggle{ min-height:40px; }
}

.spell-display{
  min-height:58px; border:2px solid color-mix(in srgb,var(--c) 45%,#fff); border-bottom-width:5px;
  border-radius:16px; padding:12px 12px; margin-bottom:8px; background:#fff; color:var(--navy);
  font-size:22px; font-weight:900; letter-spacing:1px; display:flex; align-items:center; justify-content:center;
  text-align:center; user-select:none; -webkit-user-select:none; position:relative; overflow:hidden;
}
.spell-display.len-md{ font-size:18px; letter-spacing:.4px; }
.spell-display.len-lg{ font-size:15.5px; letter-spacing:0; }
.spell-track{
  display:inline-flex; align-items:center; max-width:100%; min-height:26px;
  overflow-x:auto; scrollbar-width:none; white-space:nowrap;
}
.spell-track::-webkit-scrollbar{ display:none; }
.spell-text{ white-space:pre; line-height:26px; }
.spell-placeholder{ white-space:nowrap; font-size:13.5px; font-weight:700; color:var(--muted); letter-spacing:0; line-height:26px; }
.spell-caret{
  display:inline-block; width:2.5px; height:22px; background:var(--c); border-radius:2px;
  margin-left:2px; vertical-align:middle; flex:0 0 auto;
}
@media (prefers-reduced-motion: no-preference){
  .spell-caret{ animation:caretBlink 1.05s steps(1) infinite; }
}
@keyframes caretBlink{ 0%,49%{ opacity:1; } 50%,100%{ opacity:0; } }
.spell-display.good{ border-color:var(--green-edge); background:#e5fbd0; color:var(--green-edge); }
.spell-display.bad{ border-color:#ea2b2b; background:#ffe5e5; color:#ea2b2b; }
.spell-display.locked .spell-caret{ display:none; }

.spell-input{
  width:100%; border:2px solid var(--line); border-bottom-width:5px; border-radius:16px;
  padding:13px 14px; font-size:19px; font-weight:800; text-align:center; margin-bottom:10px; color:var(--navy);
}
.spell-input:focus{ outline:none; border-color:var(--c); }
.spell-input:focus-visible{ outline:2px solid var(--c); outline-offset:2px; }
.feedback{ text-align:center; font-size:14px; font-weight:900; min-height:22px; margin-bottom:8px; }
.feedback.good{ color:var(--green-edge); }
.feedback.bad{ color:#ea2b2b; }

.spell-vk{
  background:#eef2f6; border:1.5px solid var(--line); border-radius:16px; padding:8px 5px 9px;
  display:flex; flex-direction:column; gap:6px; user-select:none; -webkit-user-select:none;
  -webkit-touch-callout:none; touch-action:manipulation;
}
.spell-vk.locked{ opacity:.62; pointer-events:none; }
.vk-row{ display:flex; gap:4px; justify-content:center; }
.vk-row-2{ padding:0 4.5%; }
.vk-key{
  flex:1 1 0; min-width:0; height:44px; border-radius:9px;
  border:1px solid #d5dce4; border-bottom:3px solid #c0cbd6; background:#fff; color:var(--navy);
  font-size:17px; font-weight:800; font-family:inherit; display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer; padding:0; touch-action:manipulation; -webkit-tap-highlight-color:transparent;
  transition:transform .05s, background-color .08s, border-bottom-width .05s;
}
@media (hover: hover){
  .vk-key:hover{ background:#f6f8fa; }
}
.vk-key:active, .vk-key.pressed{
  transform:translateY(2px); border-bottom-width:1px;
  background:color-mix(in srgb,var(--c) 14%,#fff);
  border-color:color-mix(in srgb,var(--c) 45%,#fff); color:var(--c);
}
.vk-key:focus-visible{ outline:2px solid var(--navy); outline-offset:2px; z-index:1; }
.vk-key-del{ flex:1.55 1 0; background:#f8fafc; color:var(--ink); font-size:15px; }
.vk-key-sym{ flex:1 1 0; background:#f8fafc; font-size:16px; }
.vk-key-space{ flex:3.4 1 0; font-size:13px; color:var(--muted); }
.vk-key-clear{ flex:1.5 1 0; background:#f8fafc; color:var(--muted); font-size:12.5px; }
.vk-key-submit{
  flex:2.3 1 0; background:var(--c); border-color:color-mix(in srgb,var(--c) 65%,#000);
  border-bottom-width:3px; color:#fff; font-size:14px; font-weight:900;
}
@media (hover: hover){
  .vk-key-submit:hover{ background:color-mix(in srgb,var(--c) 90%,#000); color:#fff; }
}
.vk-key-submit:active, .vk-key-submit.pressed{
  background:color-mix(in srgb,var(--c) 82%,#000); border-color:color-mix(in srgb,var(--c) 65%,#000); color:#fff;
}
.vk-key-submit:disabled{ opacity:.6; cursor:default; }
:where(.app button, .app summary, .app textarea):focus-visible{
  outline:2px solid var(--navy); outline-offset:2px;
}

.float-plus{
  position:absolute; font-weight:900; font-size:17px; pointer-events:none;
  animation:floatUp .8s ease-out forwards; z-index:5;
}
@keyframes floatUp{ from{opacity:1; transform:translateY(0);} to{opacity:0; transform:translateY(-42px);} }
@keyframes pop{ 0%{transform:scale(.5); opacity:0;} 60%{transform:scale(1.1);} 100%{transform:scale(1); opacity:1;} }
.pop{ animation:pop .4s ease-out; }
@keyframes bounce{ 0%,100%{transform:translateY(0);} 50%{transform:translateY(-9px);} }
.bounce{ animation:bounce 1.1s ease-in-out infinite; }
@keyframes shake{ 0%,100%{transform:translateX(0);} 25%{transform:translateX(-7px);} 75%{transform:translateX(7px);} }
.shake{ animation:shake .35s; }

.done-box{ text-align:center; padding:6px 0; }
.done-box .mascot{ display:inline-block; }
.done-box h2{ margin:8px 0 8px; font-size:22px; font-weight:900; color:var(--navy); }
.sync-pill{
  display:inline-block; padding:4px 12px; border-radius:16px; font-size:12px; font-weight:800; margin-bottom:12px;
  background:var(--soft); color:var(--muted);
}
.sync-pill.ok{ background:#e5fbd0; color:var(--green-edge); }
.sync-pill.err{ background:#ffe5e5; color:#ea2b2b; }
.retry-box{
  background:#fff5f5; border:2px solid #ffc9c9; border-radius:14px; padding:12px; margin-bottom:14px; text-align:center;
}
.retry-box p{ margin:0 0 8px; font-size:12.5px; color:#c92a2a; font-weight:700; }
.retry-btn{
  border:none; background:#ea2b2b; color:#fff; border-radius:10px; padding:9px 18px; font-size:13px; font-weight:800; cursor:pointer;
}

.done-rows{ text-align:left; margin-bottom:15px; }
.done-row{ display:flex; justify-content:space-between; padding:11px 4px; border-bottom:2px solid var(--line); font-size:14px; font-weight:700; }
.done-row b{ color:var(--green-edge); font-weight:900; }
.new-badges{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-bottom:14px; }
.new-badge{
  background:color-mix(in srgb,var(--gold) 20%,#fff); border:2px solid var(--gold);
  border-radius:20px; padding:5px 12px; font-size:12px; font-weight:900; animation:pop .4s;
}
.shot-tip{
  background:#fff7e8; border:2px solid #ffd98a; border-left-width:6px; border-radius:12px;
  padding:11px 13px; font-size:12.5px; text-align:left; margin-bottom:15px; font-weight:700;
}
.shot-tip b{ color:#e8940f; }

#flash-overlay{ position:fixed; inset:0; opacity:0; pointer-events:none; z-index:60; }
#flash-overlay.good{ background:#d7ffb8; animation:flash .55s; }
#flash-overlay.bad{ background:#ffdfe0; animation:flash .55s; }
@keyframes flash{ 0%{opacity:0;} 25%{opacity:.6;} 100%{opacity:0;} }
.verdict{
  position:fixed; left:50%; top:42%; transform:translate(-50%,-50%) scale(.4); z-index:61;
  width:120px; height:120px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none;
}
.verdict.show{ animation:verdictPop .55s; }
.verdict.good{ background:#fff; border:6px solid var(--green); }
.verdict.bad{ background:#fff; border:6px solid #ea2b2b; }
@keyframes verdictPop{ 0%{opacity:0; transform:translate(-50%,-50%) scale(.4);} 50%{opacity:1; transform:translate(-50%,-50%) scale(1.1);} 100%{opacity:1; transform:translate(-50%,-50%) scale(1);} }

#confetti{ position:fixed; inset:0; pointer-events:none; z-index:50; overflow:hidden; }
.conf-piece{ position:absolute; top:-12px; width:9px; height:14px; border-radius:2px; animation:fall linear forwards; }
@keyframes fall{ to{ transform:translateY(105vh) rotate(720deg); } }

.board{ border:2px solid var(--line); border-bottom-width:5px; border-radius:16px; padding:14px; margin-bottom:14px; background:#fff; }
.board-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.board-head h3{ margin:0; font-size:15px; font-weight:900; color:var(--navy); }
.board-sync{ border:1.5px solid var(--c); color:var(--c); background:#fff; border-radius:8px; padding:5px 11px; font-size:12px; font-weight:800; cursor:pointer; }
.lb-tabs{
  display:flex; gap:6px; overflow-x:auto; scroll-snap-type:inline proximity; scroll-padding-inline:20px;
  scrollbar-width:none; padding:2px 2px 8px; margin-bottom:8px; border-bottom:1px solid var(--soft); --fade-size:20px;
}
.lb-tabs::-webkit-scrollbar{ display:none; }
@supports (animation-timeline: scroll(self inline)){
  .lb-tabs{
    mask:
      linear-gradient(black,black) no-clip subtract,
      linear-gradient(to right,black,transparent) 0 0 / var(--fade-start) 100% no-repeat no-clip,
      linear-gradient(to right,transparent,black) 100% 0 / var(--fade-end) 100% no-repeat no-clip;
    animation:reveal-fade-start linear both, hide-fade-end linear both;
    animation-timeline:scroll(self inline);
    animation-range:0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
  }
}
.lb-tab{
  flex:0 0 auto; scroll-snap-align:start; border:1.5px solid var(--line); background:var(--soft); color:var(--muted);
  border-radius:20px; padding:4px 11px; min-height:30px; font-size:12px; font-weight:800; cursor:pointer; white-space:nowrap;
}
.lb-tab.active{ background:var(--c); border-color:var(--c); color:#fff; }
.log-lib{ font-size:11px; color:var(--muted); font-weight:700; margin-left:6px; }
.lb-row{ display:flex; align-items:center; gap:10px; padding:9px 4px; border-bottom:1px solid var(--soft); }
.lb-row:last-child{ border-bottom:none; }
.lb-row.me{ background:#f4f9ff; border-radius:10px; padding:9px 8px; }
.lb-rank{ width:26px; height:26px; border-radius:50%; flex:0 0 auto; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:900; font-size:13px; background:#9fb0c0; }
.lb-rank.r1{ background:#ffb020; } .lb-rank.r2{ background:#8d9fae; } .lb-rank.r3{ background:#d9915f; }
.lb-dot{ width:10px; height:10px; border-radius:50%; flex:0 0 auto; }
.lb-name{ flex:1; font-weight:800; font-size:13.5px; color:var(--navy); display:flex; align-items:center; gap:6px; }
.lb-today{ font-size:10px; padding:1px 6px; border-radius:8px; background:#e5fbd0; color:#3d7a00; font-weight:800; }
.lb-stats{ display:flex; gap:10px; font-size:11px; color:var(--muted); }
.lb-stats b{ color:var(--navy); font-size:13px; margin-right:2px; }

.auth-panel{ border:2px solid var(--line); border-bottom-width:5px; border-radius:18px; padding:16px; background:#fff; margin-bottom:14px; }
.auth-panel h3{ margin:0 0 6px; font-size:15px; font-weight:900; color:var(--navy); }
.auth-panel p{ margin:0 0 12px; font-size:12.5px; color:var(--muted); line-height:1.6; }
.auth-err{ background:#fff3f3; border:1px solid #ffd1d1; color:#c92a2a; border-radius:10px; padding:9px 12px; font-size:12.5px; font-weight:700; margin-bottom:12px; }
.auth-input{
  width:100%; border:2px solid var(--line); border-radius:12px; padding:11px 12px; font-size:13px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; color:var(--navy); margin-bottom:10px;
}
.auth-input:focus{ outline:none; border-color:var(--c); }

.backup-row{ display:flex; gap:8px; margin:2px 0 4px; }
.backup-row button{ flex:1; border-radius:11px; padding:8px 6px; min-height:38px; font-size:12px; font-weight:800; cursor:pointer; }
@media (pointer: coarse){
  .backup-row button{ min-height:42px; }
}
.bk-export{ border:1.5px solid var(--c); background:#fff; color:var(--c); }
.bk-import{ border:1.5px solid var(--line); background:var(--soft); color:var(--navy); }

.modal-mask{
  position:fixed; inset:0; background:rgba(15,23,32,.5); display:none; align-items:center; justify-content:center;
  z-index:90; padding:18px; overflow:hidden; overscroll-behavior:contain;
}
.modal-mask.show{ display:flex; }
.modal-box{
  display:flex; flex-direction:column; width:100%; max-width:430px; background:#fff; border-radius:18px;
  padding:0; max-height:86vh; max-height:86dvh; overflow:hidden; overscroll-behavior:contain;
}
.modal-head{
  flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:15px 18px 12px; margin-bottom:0; border-bottom:1px solid var(--line); background:#fff;
}
.modal-box h3{ font-size:17px; color:var(--navy); margin:0; font-weight:900; min-width:0; word-break:break-word; }
.modal-close{ flex:0 0 auto; border:none; background:var(--soft); color:var(--navy); width:30px; height:30px; border-radius:50%; font-size:16px; font-weight:900; cursor:pointer; }
.modal-body{
  flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain;
  scrollbar-gutter:stable; -webkit-overflow-scrolling:touch; padding:14px 18px 18px;
}
.modal-box .m-desc{ font-size:12px; color:var(--muted); margin-bottom:12px; line-height:1.6; }
.modal-box textarea{ width:100%; min-height:96px; border:1.5px solid var(--line); border-radius:10px; padding:10px; font-size:12px; resize:vertical; font-family:ui-monospace,Menlo,monospace; word-break:break-all; color:var(--navy); }
.modal-actions{
  flex:0 0 auto; display:flex; gap:10px; padding:12px 18px 16px; margin-top:0;
  border-top:1px solid var(--line); background:#fff;
}
.modal-actions button{ flex:1; border:none; border-radius:10px; padding:11px 0; font-size:14px; font-weight:800; cursor:pointer; }
.m-cancel{ background:var(--soft); color:var(--navy); }
.m-ok{ background:var(--c,var(--blue)); color:#fff; }

.modal-box > .tab-bar{
  flex:0 0 auto; padding:10px 18px; margin-bottom:0; border-bottom:1px solid var(--line); background:#fff;
}
.tab-bar{ display:flex; gap:8px; margin-bottom:12px; }
.tab-btn{
  flex:1; border:1.5px solid var(--line); background:var(--soft); color:var(--muted);
  border-radius:10px; padding:8px; font-size:13px; font-weight:800; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:5px;
}
.tab-btn.active{ background:var(--c); border-color:var(--c); color:#fff; }
.tab-badge{
  display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px;
  padding:0 5px; border-radius:999px; font-size:11px; font-weight:900;
  background:#ff6b1a; color:#fff; line-height:1;
}
.tab-btn.active .tab-badge{ background:#fff; color:var(--c); }

.log-item{ border:1.5px solid var(--line); border-radius:12px; padding:10px 12px; margin-bottom:9px; background:#fff; }
.log-top{ display:flex; justify-content:space-between; align-items:center; font-size:12px; margin-bottom:5px; gap:6px; flex-wrap:wrap; }
.log-badge{ display:inline-block; padding:2px 8px; border-radius:8px; font-size:11px; font-weight:800; }
.log-badge.daily{ background:#e8f4ff; color:#1b6fb8; }
.log-badge.review{ background:#f0fbf2; color:#2e9e63; }
.log-badge.wrong_review{ background:#fff2e5; color:#d95b00; }
.log-mix-tag{
  display:inline-block; margin-left:5px; padding:2px 7px; border-radius:7px;
  background:#fff4e8; color:#c85500; font-size:10.5px; font-weight:800;
}
.log-bonus-tag{
  display:inline-block; margin-left:4px; padding:1px 6px; border-radius:6px;
  background:#fff7d6; color:#b86b00; border:1px solid #ffe08a; font-size:11px; font-weight:900;
}
.log-scores{ font-size:13px; font-weight:800; color:var(--navy); display:flex; gap:12px; flex-wrap:wrap; }
.log-wrong{ margin-top:6px; display:flex; flex-wrap:wrap; gap:5px; }
.wrong-chip{
  appearance:none; font-family:inherit; line-height:1.4; display:inline-flex; align-items:center;
  background:#fff0f0; color:#c92a2a; border:1px solid #ffd1d1; border-radius:6px;
  padding:2px 8px; font-size:11.5px; font-weight:800; cursor:pointer;
  transition:background .12s,border-color .12s;
}
.wrong-chip:hover{ background:#ffe3e3; border-color:#ffa8a8; }
.wrong-chip.is-active{ background:#ffe0e0; border-color:#f03e3e; box-shadow:0 0 0 2px rgba(240,62,62,.14); }
.wrong-chip:focus-visible{ outline:2px solid var(--c); outline-offset:2px; }

.wb-summary-bar{
  display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap;
  background:#fff9f2; border:1.5px solid #ffdcb8; border-radius:12px; padding:9px 11px; margin-bottom:10px;
}
.wb-sum-nums{ font-size:12.5px; font-weight:800; color:var(--navy); line-height:1.45; }
.wb-sum-nums b{ color:#d95b00; font-weight:900; }
.wb-sum-nums .wb-ok-n{ color:#2e9e63; }
.wb-modal-go{
  border:none; border-radius:10px; background:#ff841f; color:#fff;
  padding:7px 12px; min-height:36px; font-size:12.5px; font-weight:900; cursor:pointer; white-space:nowrap;
}
.wb-subtabs{
  display:flex; gap:6px; border-bottom:2px solid var(--line); margin-bottom:10px;
  overflow-x:auto; scroll-snap-type:x proximity; scrollbar-width:none;
}
.wb-subtabs::-webkit-scrollbar{ display:none; }
.wb-subtab{
  position:relative; flex:1 0 auto; border:none; background:none; color:var(--muted);
  padding:8px 10px; min-height:38px; font-size:12.5px; font-weight:800; cursor:pointer;
  white-space:nowrap; scroll-snap-align:start;
}
.wb-subtab[aria-selected="true"]{ color:var(--c); font-weight:900; }
.wb-subtab[aria-selected="true"]::after{
  content:""; position:absolute; left:14%; right:14%; bottom:-2px; height:3px;
  background:var(--c); border-radius:3px 3px 0 0;
}
.wb-card-item{
  display:flex; align-items:flex-start; gap:10px; border:1.5px solid var(--line);
  border-radius:12px; padding:10px 11px; margin-bottom:8px; background:#fff;
}
.wb-card-item.is-due{ border-color:#ffd7b3; background:#fffaf4; }
.wb-card-item.is-mastered{ border-color:#d7f2cb; background:#f9fef7; }
.wb-card-main{ flex:1; min-width:0; }
.wb-word-line{ display:flex; align-items:baseline; flex-wrap:wrap; gap:6px; }
.wb-word-txt{ font-size:15px; font-weight:900; color:var(--navy); }
.wb-pos-txt{ font-size:11px; color:var(--muted); font-weight:700; }
.wb-cn-txt{ font-size:12.5px; color:var(--ink); font-weight:700; margin-top:2px; }
.wb-meta-row{ display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; align-items:center; }
.wb-stage-tag{
  display:inline-flex; align-items:center; padding:1px 7px; border-radius:6px;
  font-size:11px; font-weight:800; background:#eef5ff; color:#1b6fb8;
}
.wb-stage-tag.mastered{ background:#e6f9de; color:#2b7a00; }
.wb-due-tag{
  display:inline-flex; align-items:center; padding:1px 7px; border-radius:6px;
  font-size:11px; font-weight:800; background:#ffe9d4; color:#c84b00;
}
.wb-due-tag.wait{ background:#f2f5f8; color:var(--muted); }
.wb-wrong-input{
  margin-top:5px; font-size:11.5px; color:#c92a2a; font-weight:700;
  background:#fff2f2; border-radius:6px; padding:2px 7px; display:inline-block; max-width:100%;
  word-break:break-word;
}

.wr-summary{
  width:100%; border:1.5px solid #ffd8b5; border-radius:14px; background:#fff9f2;
  padding:10px 12px; margin-bottom:12px; text-align:left; font-size:12.5px;
}
.wr-bonus-banner{
  background:linear-gradient(90deg,#fff3c4,#ffe48c); color:#8c4b00; font-weight:900;
  border:1px solid #ffd25c; border-radius:10px; padding:6px 10px; margin-bottom:8px;
  font-size:12.5px; text-align:center;
}
.wr-sum-title{ font-weight:900; color:var(--navy); margin-bottom:5px; }
.wr-chip-list{ display:flex; flex-wrap:wrap; gap:5px; margin-top:4px; }
.wr-chip{
  display:inline-flex; align-items:center; padding:2px 8px; border-radius:7px;
  font-size:11px; font-weight:800;
}
.wr-chip.ok{ background:#e7f9df; color:#2b7a00; }
.wr-chip.adv{ background:#e8f3ff; color:#1b6fb8; }
.wr-chip.fail{ background:#fff0f0; color:#c92a2a; }
.wr-chip-btn{
  appearance:none; font-family:inherit; line-height:1.4; border:1px solid #ffd1d1; cursor:pointer;
  transition:background .12s,border-color .12s;
}
.wr-chip-btn:hover{ background:#ffe3e3; border-color:#ffa8a8; }
.wr-chip-btn.is-active{ background:#ffe0e0; border-color:#f03e3e; box-shadow:0 0 0 2px rgba(240,62,62,.14); }
.wr-chip-btn:focus-visible{ outline:2px solid var(--c); outline-offset:2px; }

.wrong-popover{
  position:fixed; z-index:98; margin:0; inset:auto; display:none;
  min-width:210px; max-width:min(300px, calc(100vw - 24px));
  background:#fff; border:1.5px solid #f5c2c7; border-radius:12px;
  padding:10px 12px; box-shadow:0 12px 28px rgba(15,23,42,.18);
  color:var(--ink); font-size:12.5px; line-height:1.45; overflow:visible;
}
.wrong-popover.is-open{ display:block; }
.wrong-popover:popover-open{ display:block; }
.wrong-popover::before,
.wrong-popover::after{
  content:""; position:absolute; left:var(--wp-arrow-x, 28px); transform:translateX(-50%);
  width:0; height:0; pointer-events:none;
}
.wrong-popover::before{
  top:-14px; border:7px solid transparent; border-bottom-color:#f5c2c7;
}
.wrong-popover::after{
  top:-12px; border:6px solid transparent; border-bottom-color:#fff;
}
.wrong-popover.is-above::before{
  top:auto; bottom:-14px; border-bottom-color:transparent; border-top-color:#f5c2c7;
}
.wrong-popover.is-above::after{
  top:auto; bottom:-12px; border-bottom-color:transparent; border-top-color:#fff;
}
.wp-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:3px; }
.wp-title{ display:flex; align-items:baseline; gap:5px; flex-wrap:wrap; min-width:0; }
.wp-word{ font-size:15px; font-weight:900; color:#15803d; word-break:break-word; }
.wp-pos{ font-size:11px; color:var(--muted); font-weight:700; }
.wp-speak{
  flex:0 0 auto; border:1.5px solid var(--line); background:#fff; color:var(--c);
  width:28px; height:28px; border-radius:50%; display:inline-flex; align-items:center;
  justify-content:center; cursor:pointer; padding:0;
}
.wp-speak:active{ background:#eff6ff; }
.wp-cn{ font-size:12px; color:var(--navy); font-weight:700; margin-bottom:6px; }
.wp-diff{
  background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px;
  padding:6px 8px; display:flex; flex-direction:column; gap:4px;
}
.wp-row{ display:flex; align-items:baseline; gap:6px; font-size:12px; line-height:1.4; }
.wp-lab{ color:var(--muted); font-weight:700; flex-shrink:0; font-size:11.5px; }
.wp-good{
  color:#15803d; font-weight:900; word-break:break-word;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}
.wp-bad{
  color:#dc2626; font-weight:900; word-break:break-word;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}
.wp-good-txt{ color:#15803d; font-weight:800; word-break:break-word; }
.wp-bad-txt{ color:#dc2626; font-weight:800; word-break:break-word; }
.wp-legacy{ font-size:11.5px; color:var(--muted); background:#f8fafc; border-radius:7px; padding:5px 8px; }

.ww-item{ display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid var(--soft); padding:10px 2px; }
.ww-item:last-child{ border-bottom:none; }
.ww-word{ font-size:15px; font-weight:900; color:var(--navy); }
.ww-cn{ font-size:12px; color:var(--muted); font-weight:700; }
.ww-meta{ text-align:right; font-size:11.5px; color:var(--muted); flex-shrink:0; }
.ww-meta b{ color:#ea2b2b; }
.ww-speak{ border:1.5px solid var(--line); background:#fff; color:var(--c); width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }
.empty-tip{ text-align:center; padding:24px 10px; color:var(--muted); font-size:13px; font-weight:700; }

.toast{ position:fixed; left:50%; bottom:26px; transform:translateX(-50%); background:var(--navy); color:#fff; padding:11px 20px; border-radius:10px; font-size:13px; font-weight:700; z-index:95; opacity:0; transition:opacity .3s; pointer-events:none; max-width:88vw; text-align:center; }
.toast.show{ opacity:1; }

/* ===== 中考四关模式样式 ===== */
.en-block .lab-row{
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px;
}
.en-block .lab-row .lab{ margin-bottom:0; }
.en-speak-btn{
  border:1px solid #dcc3e8; background:#fff; color:#8e44ad;
  border-radius:999px; padding:2px 8px; min-height:24px;
  font-size:11px; font-weight:800; display:inline-flex; align-items:center; gap:4px;
  cursor:pointer; flex-shrink:0;
}
.en-speak-btn:active{ background:#f5e9fb; }

.zk-hub-card{
  border:2px solid color-mix(in srgb,var(--c) 38%,#fff); border-bottom-width:5px;
  border-radius:16px; padding:12px; margin-bottom:10px;
  background:linear-gradient(180deg, color-mix(in srgb,var(--c) 7%,#fff), #fff 60%);
}
.zk-hub-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:8px; margin-bottom:8px;
}
.zk-hub-copy{ min-width:0; flex:1; }
.zk-hub-title{ font-size:14.5px; font-weight:900; color:var(--navy); line-height:1.3; }
.zk-hub-sub{ font-size:11.5px; font-weight:700; color:var(--muted); margin-top:2px; line-height:1.35; }
.zk-hub-right{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex:0 0 auto; }
.zk-hub-pill{
  font-size:11px; font-weight:900; color:var(--c); white-space:nowrap;
  background:color-mix(in srgb,var(--c) 12%,#fff);
  border:1.5px solid color-mix(in srgb,var(--c) 30%,#fff);
  border-radius:999px; padding:2px 9px; font-variant-numeric:tabular-nums;
}
.zk-hub-reset{
  border:none; background:none; color:var(--muted); font-size:11px; font-weight:800;
  cursor:pointer; padding:2px 4px; text-decoration:underline;
}
.zk-hub-prog{
  height:9px; background:#e9eef4; border-radius:999px; overflow:hidden; margin-bottom:10px;
}
.zk-hub-prog i{
  display:block; height:100%; background:var(--green); border-radius:999px; transition:width .25s;
}
.zk-mod-grid{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:10px;
}
.zk-mod-card{
  appearance:none; font-family:inherit; text-align:left; min-width:0;
  border:2px solid var(--line); border-bottom-width:4px; border-radius:13px;
  background:#fff; padding:9px 10px; cursor:pointer;
  transition:background-color .12s, border-color .12s, transform .06s, box-shadow .12s;
}
.zk-mod-card:active{ transform:translateY(2px); }
.zk-mod-card.is-next{
  border-color:color-mix(in srgb,var(--c) 60%,#fff);
  background:color-mix(in srgb,var(--c) 5%,#fff);
  box-shadow:0 2px 8px color-mix(in srgb,var(--c) 14%,transparent);
}
.zk-mod-card.is-done{
  border-color:#93d87a; background:#f2fce9;
}
.zk-mod-card.is-partial{
  border-color:#ffb86c; background:#fff9f0;
}
.zk-mod-top{ display:flex; align-items:center; justify-content:space-between; gap:4px; margin-bottom:4px; }
.zk-mod-num{ font-size:10.5px; font-weight:900; color:var(--muted); }
.zk-mod-state{
  font-size:10px; font-weight:900; border-radius:999px; padding:1px 6px;
  background:var(--soft); color:var(--muted); white-space:nowrap;
}
.zk-mod-card.is-done .zk-mod-state{ background:#dff7cf; color:#2b7a00; }
.zk-mod-card.is-partial .zk-mod-state{ background:#ffe8cc; color:#c85500; }
.zk-mod-card.is-next .zk-mod-state{ background:color-mix(in srgb,var(--c) 14%,#fff); color:var(--c); }
.zk-mod-name{ font-size:13.5px; font-weight:900; color:var(--navy); line-height:1.25; }
.zk-mod-meta{ font-size:11px; font-weight:700; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.zk-hub-main-btn{
  display:block; width:100%; border:2px solid color-mix(in srgb,var(--c) 65%,#000); border-bottom-width:5px;
  border-radius:13px; padding:10px 14px; min-height:44px; font-size:14.5px; font-weight:900;
  background:var(--c); color:#fff; cursor:pointer; transition:transform .06s;
}
.zk-hub-main-btn:active{ transform:translateY(2px); }

/* 第二关 语篇语法填空 */
.zk-sentence-card{
  border:2px solid color-mix(in srgb,var(--c) 28%,#fff); border-bottom-width:5px;
  border-radius:18px; padding:16px 15px; background:#fff; margin-bottom:14px;
}
.zk-sc-top{
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px;
}
.zk-sc-label{ font-size:11px; font-weight:900; color:var(--c); letter-spacing:.5px; }
.zk-sc-pos{
  font-size:11px; font-weight:800; color:var(--muted); background:var(--soft);
  border-radius:999px; padding:2px 8px;
}
.zk-sc-sentence{
  font-size:18px; font-weight:800; color:var(--navy); line-height:1.6; word-break:break-word;
}
.zk-blank-mark{
  display:inline-block; min-width:68px; padding:0 6px; margin:0 2px; text-align:center;
  border-bottom:2.5px solid var(--c); color:var(--c); font-weight:900;
  background:color-mix(in srgb,var(--c) 8%,#fff); border-radius:6px 6px 0 0;
}
.zk-blank-mark.good{ border-bottom-color:var(--green-edge); color:var(--green-edge); background:#e5fbd0; }
.zk-blank-mark.bad{ border-bottom-color:#ea2b2b; color:#ea2b2b; background:#ffe5e5; }
.zk-explain-box{
  border:2px solid var(--line); border-radius:14px; padding:11px 13px; margin-top:8px;
  background:#f8fbff; font-size:13px; line-height:1.55; color:var(--navy);
}
.zk-explain-box.good{ background:#f1fce9; border-color:#a5e07d; }
.zk-explain-box.bad{ background:#fff3f3; border-color:#ffc4c4; }
.zk-explain-title{ font-weight:900; margin-bottom:4px; }
.zk-explain-sub{ font-size:12.5px; font-weight:700; color:var(--ink); }

/* 第三关 选词填空（8选6全屏页） */
.zk-bank-sticky{
  position:sticky; top:6px; z-index:8;
  background:#f8fbff; border:2px solid color-mix(in srgb,var(--c) 32%,#fff);
  border-bottom-width:4px; border-radius:15px; padding:10px 11px; margin-bottom:12px;
  box-shadow:0 4px 12px rgba(20,38,60,.08);
}
.zk-bank-head{
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px;
}
.zk-bank-title{ font-size:11.5px; font-weight:900; color:var(--navy); }
.zk-bank-clear-btn{
  border:1.5px solid var(--line); background:#fff; color:var(--muted);
  border-radius:8px; padding:3px 9px; font-size:11px; font-weight:800; cursor:pointer;
}
.zk-bank-chips{
  display:flex; flex-wrap:wrap; gap:6px;
}
.zk-bank-chip{
  appearance:none; font-family:inherit;
  border:2px solid color-mix(in srgb,var(--c) 38%,#fff); border-bottom-width:3px;
  background:#fff; color:var(--navy); border-radius:10px;
  padding:5px 10px; min-height:34px; font-size:13.5px; font-weight:900; cursor:pointer;
  transition:background-color .12s, border-color .12s, opacity .12s;
}
.zk-bank-chip.used{
  opacity:.42; background:#eef1f4; border-color:#d4dce4; color:var(--muted);
  text-decoration:line-through;
}
.zk-bank-chip:disabled{ cursor:default; }
.zk-cloze-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:10px; }
.zk-cloze-item{
  border:2px solid var(--line); border-radius:14px; padding:11px 12px; background:#fff;
  transition:border-color .12s, background-color .12s;
}
.zk-cloze-item.is-active{
  border-color:color-mix(in srgb,var(--c) 60%,#fff);
  background:color-mix(in srgb,var(--c) 3%,#fff);
}
.zk-cloze-item.ok{ border-color:#88d66c; background:#f4fced; }
.zk-cloze-item.bad{ border-color:#ff9b9b; background:#fff5f5; }
.zk-cloze-meta{
  display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:5px;
}
.zk-cloze-num{ font-size:11.5px; font-weight:900; color:var(--c); }
.zk-cloze-pos{ font-size:11px; font-weight:800; color:var(--muted); }
.zk-cloze-text{ font-size:14.5px; font-weight:700; color:var(--navy); line-height:1.65; word-break:break-word; }
.zk-slot{
  appearance:none; font-family:inherit; vertical-align:baseline;
  display:inline-flex; align-items:center; justify-content:center;
  min-width:72px; min-height:28px; padding:1px 9px; margin:0 3px;
  border:2px dashed #b9c6d4; border-radius:8px; background:#f8fafc;
  color:var(--muted); font-size:13.5px; font-weight:900; cursor:pointer;
  transition:border-color .12s, background-color .12s, color .12s;
}
.zk-slot.active-slot{
  border-style:solid; border-color:var(--c); background:color-mix(in srgb,var(--c) 10%,#fff); color:var(--c);
}
.zk-slot.filled{
  border-style:solid; border-color:color-mix(in srgb,var(--c) 50%,#fff);
  background:#eef6ff; color:var(--c);
}
.zk-slot.ok{ border-style:solid; border-color:var(--green-edge); background:#e5fbd0; color:var(--green-edge); }
.zk-slot.bad{ border-style:solid; border-color:#ea2b2b; background:#ffe5e5; color:#ea2b2b; text-decoration:line-through; }
.zk-cloze-explain{
  margin-top:6px; padding-top:6px; border-top:1px solid rgba(0,0,0,.07);
  font-size:12px; font-weight:700; color:var(--ink); line-height:1.45;
}
.zk-cloze-ans{ color:#15803d; font-weight:900; margin-right:6px; }

/* 第四关 听写句子 */
.zk-dict-card{
  border:2px solid var(--line); border-radius:16px; padding:12px; margin-bottom:10px; background:#fff;
  text-align:center;
}
.zk-dict-meta{ font-size:13px; font-weight:800; color:var(--navy); margin-bottom:9px; }
.zk-dict-play-row{
  display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; margin-bottom:8px;
}
.zk-dict-play-btn.is-speaking{
  background:color-mix(in srgb,var(--c) 12%,#fff);
  border-color:var(--c);
  color:var(--c);
}
@media (prefers-reduced-motion: no-preference){
  .zk-dict-play-btn.is-speaking svg{
    animation:zkSpeakPulse .9s ease-in-out infinite;
  }
}
@keyframes zkSpeakPulse{ 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(1.16); opacity:.72; } }
.zk-speed-group{
  display:inline-flex; align-items:center; gap:4px; background:var(--soft);
  border:1.5px solid var(--line); border-radius:999px; padding:3px;
}
.zk-speed-btn{
  border:1.5px solid transparent; background:transparent; color:var(--muted);
  border-radius:999px; padding:4px 9px; font-size:12px; font-weight:900; cursor:pointer;
}
.zk-speed-btn.active{
  background:#fff; border-color:color-mix(in srgb,var(--c) 45%,#fff); color:var(--c);
}
.zk-dict-subtools{
  display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap;
}
.zk-dict-hint-box{
  margin-top:8px; padding:8px 10px; border-radius:10px; background:#fff7e8;
  border:1.5px solid #ffd899; font-size:12.5px; font-weight:800; color:#8a5100; line-height:1.45;
}
.zk-dict-display{
  min-height:68px; justify-content:flex-start; text-align:left; padding:11px 13px;
  font-size:17px; letter-spacing:.2px;
}
.zk-dict-display .spell-track{
  white-space:pre-wrap; word-break:break-word; overflow-x:visible; line-height:1.5; display:block; width:100%;
}
.zk-dict-display .spell-text{ white-space:pre-wrap; line-height:1.5; }
.zk-dict-textarea{
  font-size:16px; text-align:left; line-height:1.45; resize:vertical; min-height:74px;
}
.zk-diff-wrap{
  border:2px solid var(--line); border-radius:14px; padding:11px 12px; margin-bottom:10px; background:#f8fafc;
}
.zk-diff-wrap.good{ background:#f2fce9; border-color:#93d87a; }
.zk-diff-wrap.bad{ background:#fff5f5; border-color:#ffb3b3; }
.zk-diff-tokens{ display:flex; flex-wrap:wrap; gap:5px; margin-bottom:7px; }
.zk-tok{
  display:inline-block; padding:2px 7px; border-radius:7px; font-size:13.5px; font-weight:900;
}
.zk-tok-match{ background:#dcfce7; color:#15803d; }
.zk-tok-miss{ background:#fee2e2; color:#b91c1c; border:1px dashed #ef4444; }
.zk-tok-extra{ background:#ffedd5; color:#c2410c; text-decoration:line-through; }
.zk-diff-ref{ font-size:12.5px; font-weight:800; color:var(--navy); line-height:1.45; }
.zk-diff-cn{ font-size:12px; font-weight:700; color:var(--muted); margin-top:3px; }

.zk-done-breakdown{
  display:flex; flex-wrap:wrap; justify-content:center; gap:6px; margin-bottom:12px;
}
.zk-done-chip{
  border:1.5px solid var(--line); background:var(--soft); color:var(--navy);
  border-radius:999px; padding:4px 10px; font-size:11.5px; font-weight:800;
}
.zk-done-chip.ok{ background:#eafbd8; border-color:#9dd875; color:#2b7a00; }

.log-zk-stages{
  display:flex; flex-wrap:wrap; gap:5px; margin-top:5px;
}
.log-zk-chip{
  font-size:11px; font-weight:800; background:var(--soft); color:var(--navy);
  border-radius:6px; padding:2px 7px;
}

@media (max-width: 360px){
  .zk-mod-grid{ gap:6px; }
  .zk-mod-card{ padding:8px; }
  .zk-sc-sentence{ font-size:16px; }
  .zk-bank-chip{ padding:4px 8px; font-size:12.5px; }
  .zk-dict-play-row{ gap:6px; }
  .zk-speed-btn{ padding:3px 7px; font-size:11px; }
}

/* ===== 提交防误触与拼写错题对照 ===== */
.spell-action-btn{
  margin:4px 0 10px;
  min-block-size:46px;
  padding:11px 16px;
  font-size:15px;
  border-bottom-width:5px;
}
.spell-action-btn.btn-warn-confirm{
  background:#f59f00;
  border-color:#c27800;
  color:#fff;
}
.btn-ack{
  margin-top:8px;
  min-block-size:48px;
}
.spell-diff-box{
  border:2px solid #ffc4c4;
  border-radius:14px;
  background:#fff6f6;
  padding:11px 12px;
  margin-bottom:8px;
  text-align:left;
}
.sd-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:8px;
}
.sd-title{
  font-size:13px;
  font-weight:900;
  color:#c92a2a;
}
.sd-speak{
  display:inline-flex;
  align-items:center;
  gap:4px;
  border:1.5px solid #ffd1d1;
  background:#fff;
  color:var(--c);
  border-radius:999px;
  padding:4px 10px;
  min-block-size:34px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.sd-speak:active{ background:#eff6ff; }
@media (pointer: coarse){
  .sd-speak{ min-block-size:44px; padding:6px 12px; }
}
.sd-row{
  display:flex;
  align-items:baseline;
  gap:8px;
  padding:4px 0;
  font-size:14px;
  line-height:1.5;
}
.sd-lab{
  flex:0 0 60px;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}
.sd-chars{
  flex:1;
  min-width:0;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:16px;
  font-weight:900;
  letter-spacing:.8px;
  overflow-wrap:break-word;
  word-break:break-word;
}
.sc-ok{
  color:#15803d;
}
.sc-bad{
  background:#ffe0e0;
  color:#c92a2a;
  border-radius:4px;
  padding:0 2px;
  text-decoration:line-through;
}
.sc-miss{
  background:#dcfce7;
  color:#15803d;
  border-bottom:2px solid #15803d;
  border-radius:4px;
  padding:0 2px;
}
.sd-ref{
  margin-top:6px;
  padding-top:6px;
  border-top:1px dashed #ffd1d1;
  font-size:12.5px;
  font-weight:700;
  color:var(--navy);
  overflow-wrap:break-word;
}
