/* 单词打卡 · 共享样式 */
:root {
  --brand-1: #6366f1;
  --brand-2: #8b5cf6;
  --brand-3: #a855f7;
  --bg-1: #eef2ff;
  --bg-2: #f5f3ff;
  --ink: #1e293b;
  --ink-soft: #64748b;
  --card: #ffffff;
  --green: #10b981;
  --green-soft: #d1fae5;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --amber: #f59e0b;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(99, 102, 241, .14);
  --shadow-sm: 0 4px 14px rgba(30, 41, 59, .08);
}

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

html {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}
html::-webkit-scrollbar { width: 6px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: #b8bcc8; border-radius: 99px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 55%, #fce7f3 100%);
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}

body::before, body::after {
  content: "";
  position: fixed;
  width: 420px; height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .45;
  z-index: 0;
  pointer-events: none;
}
body::before { background: #c7d2fe; top: -120px; right: -80px; }
body::after  { background: #fbcfe8; bottom: -140px; left: -100px; }

.wrap { position: relative; z-index: 1; max-width: 1480px; margin: 0 auto; padding: 22px 20px 40px; }
.scroll-groove { display: none; }
.page-scroll { min-width: 0; }

/* ── 顶栏 ── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.topbar-left { display: flex; align-items: center; gap: 18px; }
.user-chip { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 16px rgba(99,102,241,.4);
}
.brand .name { font-weight: 800; font-size: 17px; letter-spacing: .5px; }

.ui-theme-tabs {
  display: flex; gap: 3px; flex: none;
  padding: 3px; border-radius: 999px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-sm);
}
.ui-theme-tab {
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 800;
  color: var(--ink-soft); padding: 6px 11px; border-radius: 999px;
  line-height: 1;
}
.ui-theme-tab.on { background: var(--ink); color: #fff; }
.ui-theme-tab:active { transform: scale(.97); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.8); backdrop-filter: blur(8px);
  padding: 6px 13px; border-radius: 999px; box-shadow: var(--shadow-sm);
  font-size: 13px;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.link-btn { border: none; background: transparent; color: var(--brand-1); font-size: 13px; cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ── 卡片容器 ── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }

/* ── 按钮 ── */
.btn {
  border: none; cursor: pointer; font-weight: 700; font-size: 14px;
  border-radius: 11px; padding: 11px 18px;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  font-family: inherit;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(135deg, var(--brand-1), var(--brand-3)); color: #fff; box-shadow: 0 8px 20px rgba(99,102,241,.4); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(99,102,241,.55); }
.btn-ghost { background: #f1f5f9; color: var(--ink); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(16,185,129,.35); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(239,68,68,.3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── 登录页 ── */
.login-stage { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--card); border-radius: 24px; box-shadow: 0 24px 60px rgba(99,102,241,.22);
  padding: 40px 34px;
}
.login-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--ink-soft); font-size: 14px; margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 13px 16px; border: 2px solid #e2e8f0; border-radius: 12px;
  font-size: 15px; outline: none; transition: border .2s; font-family: inherit;
}
.field input:focus { border-color: var(--brand-1); }
.login-card .btn { width: 100%; margin-top: 8px; }
.login-err { color: var(--red); font-size: 13px; text-align: center; min-height: 20px; margin-top: 10px; }
.hint-box { margin-top: 18px; background: #f8fafc; border-radius: 12px; padding: 12px 14px; font-size: 12px; color: var(--ink-soft); line-height: 1.7; }

/* ── 进度条 ── */
.progress-head { margin-bottom: 18px; }
.progress-head .labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.progress-head .labels b { color: var(--ink); }
.progress-track { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), #34d399); transition: width .5s cubic-bezier(.22,1,.36,1); }

/* ═══ 主布局：左 3/4 + 右 1/4 ═══ */
.layout { display: flex; gap: 18px; align-items: flex-start; }
.main { flex: 3; min-width: 0; }
.sidebar { flex: 1; min-width: 0; position: sticky; top: 20px; }

/* ── 组容器横排：每行 5 组 ── */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* 大容器（每组） */
.group {
  background: var(--card); border: 1px solid #e8ebf3; border-radius: 14px;
  padding: 14px 12px 16px; box-shadow: var(--shadow-sm);
}
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding: 0 2px;
}
.group-no { font-size: 13px; font-weight: 800; }
.group-no .g-dot {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3)); color: #fff;
  font-size: 12px; margin-right: 6px;
}
.group-progress { font-size: 11px; color: var(--ink-soft); }

/* 单词竖排（小容器列表） */
.word-list { display: flex; flex-direction: column; gap: 10px; position: relative; }

/* 小容器：点击翻转，正面单词 / 背面释义+判定 */
.word-cell {
  position: relative;
  perspective: 900px;
  background: transparent;
  border: none;
  padding: 0;
  display: block;
}
.word-cell:not(.state-done) { cursor: pointer; }
.wc-flipper {
  display: grid;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .48s cubic-bezier(.4,.12,.2,1);
}
.word-cell.is-flipped .wc-flipper { transform: rotateY(180deg); }
.wc-face {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #eef1f6;
  border-radius: 13px;
  background: #fbfcfe;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  min-height: 56px;
  box-sizing: border-box;
  width: 100%;
}
.wc-front { transform: rotateY(0deg); }
.wc-back { transform: rotateY(180deg); pointer-events: none; }
.word-cell.is-flipped .wc-front { pointer-events: none; }
.word-cell.is-flipped .wc-back { pointer-events: auto; }
.wc-word { flex: none; font-size: 15px; font-weight: 700; line-height: 1.25; word-break: break-word; color: var(--ink); text-align: left; }
.wc-meaning {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 600; line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-badge { font-size: 10px; color: var(--ink-soft); margin-bottom: 2px; }
.wc-actions { display: flex; gap: 6px; align-items: center; flex: none; margin-left: auto; }
.wc-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 17px; display: grid; place-items: center; transition: transform .12s;
  line-height: 1; padding: 0; flex: none;
}
.wc-btn:active { transform: scale(.85); }
.wc-btn.know { background: var(--green-soft); color: var(--green); }
.wc-btn.know:hover { box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.wc-btn.dunno { background: var(--red-soft); color: var(--red); }
.wc-btn.dunno:hover { box-shadow: 0 0 0 3px rgba(239,68,68,.18); }

/* peek 按钮 */
.wc-peek-btn {
  border: none; cursor: pointer; font-size: 13px; font-weight: 700;
  padding: 8px 12px; border-radius: 10px; white-space: nowrap; min-height: 36px;
  background: #eef2ff; color: var(--brand-1);
  transition: all .15s; font-family: inherit;
}
.wc-peek-btn:hover { background: #e0e7ff; }
.wc-peek-btn:active { transform: scale(.95); }
.wc-peek-btn.peek-pop { animation: cellPop .45s cubic-bezier(.34,1.56,.64,1); }
.word-cell.xql-idle .wc-front { cursor: pointer; }

/* 小容器状态 */
.word-cell.state-known .wc-face { background: var(--green-soft); border-color: #a7f3d0; }
.word-cell.state-known .wc-word, .word-cell.state-known .wc-meaning { color: var(--green); }
.word-cell.state-wrong .wc-face { background: var(--red-soft); border-color: #fecaca; }
.word-cell.state-wrong .wc-word, .word-cell.state-wrong .wc-meaning { color: var(--red); }
.word-cell .cell-tag {
  position: absolute; top: -6px; right: -4px; z-index: 2; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; display: none;
}
.word-cell.state-known .cell-tag.k { display: block; background: var(--green); color: #fff; }
.word-cell.state-wrong .cell-tag.w { display: block; background: var(--red); color: #fff; }
@keyframes wcShake {
  0%, 100% { transform: translateX(0); }
  16% { transform: translateX(-7px) rotate(-1.4deg); }
  32% { transform: translateX(7px) rotate(1.4deg); }
  48% { transform: translateX(-5px) rotate(-1deg); }
  64% { transform: translateX(5px) rotate(1deg); }
  80% { transform: translateX(-2px); }
}
.word-cell.shake, .review-modal.shake, .combo-card.shake { animation: wcShake .48s ease; }
@media (prefers-reduced-motion: reduce) {
  .wc-flipper { transition: none; }
  .word-cell.shake, .review-modal.shake, .combo-card.shake { animation: none; }
  .wc-back { display: none; transform: none; }
  .word-cell.is-flipped .wc-flipper { transform: none; }
  .word-cell.is-flipped .wc-front { display: none; }
  .word-cell.is-flipped .wc-back { display: flex; }
}

/* ── 遗忘池 ── */
.pool-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; display: flex; flex-direction: column; min-height: 0; }
@media (min-width: 1100px) {
  .pool-card { max-height: calc(100dvh - 160px); }
}
.pool-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
}
.pool-title { font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.pool-hint { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; line-height: 1.5; }
.pool-slots { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.pool-slot {
  min-height: 44px; height: auto;
  border: 1px solid #e8ebf3; border-radius: 12px;
  background: #f8f9fc;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 10px 14px;
  font-size: 14px; color: #94a3b8; transition: all .2s;
  box-sizing: border-box;
}
.pool-slot-idx {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  color: #c4cad6;
}
.pool-slot.filled {
  border-color: #f1d4d4; background: #fff7f7; color: #b42318;
  font-weight: 700; justify-content: flex-start;
}
.pool-slot-word {
  font-size: 14px; font-weight: 700; line-height: 1.45;
  word-break: break-word; overflow-wrap: anywhere;
  text-align: left; width: 100%;
}
.pool-count { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.pool-count b { color: var(--amber); }
.pool-card .btn { width: 100%; }
.pool-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  margin-right: -2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c5c8d4 transparent;
}
.pool-body::-webkit-scrollbar { width: 5px; }
.pool-body::-webkit-scrollbar-track { background: transparent; }
.pool-body::-webkit-scrollbar-thumb {
  background: #c5c8d4; border-radius: 99px;
}

/* 错词飞入弹跳 */
@keyframes slotPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
.pool-slot.pop { animation: slotPop .4s cubic-bezier(.22,1,.36,1); }

/* 收拢 */
@keyframes slotCollapse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(.2) translateY(-10px); opacity: 0; } }
.pool-slot.collapsing { animation: slotCollapse .42s ease forwards; }

/* 组卡片：只保留组名 + 点我试试 */
.pool-groups { display: flex; flex-direction: column; gap: 8px; }
.pool-groups:empty { display: none; }
.pool-slots { margin-top: 8px; }
.pool-slots:empty { display: none; margin: 0; }
.group-card {
  background: #f7f4ff;
  border: 1px solid #e7e0f8;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.group-card-head { font-size: 14px; font-weight: 800; color: var(--brand-1); margin: 0; }
.group-card-words { display: none; }
.try-btn {
  border: none; cursor: pointer; font-size: 12px; font-weight: 800;
  padding: 7px 12px; border-radius: 999px; flex: none; white-space: nowrap;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3)); color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.28); font-family: inherit;
}
.try-btn:hover { box-shadow: 0 6px 16px rgba(99,102,241,.4); }
.try-btn:active { transform: scale(.97); }

/* 动效 */
@keyframes groupBounce { 0% { transform: translateY(18px) scale(.5); opacity: 0; } 60% { transform: translateY(-6px) scale(1.06); opacity: 1; } 100% { transform: translateY(0) scale(1); } }
.group-card.appear { animation: groupBounce .55s cubic-bezier(.22,1,.36,1); }

/* ── 教师仪表盘 ── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
.stat-card .num { font-size: 30px; font-weight: 800; }
.stat-card .lbl { font-size: 13px; color: var(--ink-soft); }
.stat-card.accent { background: linear-gradient(135deg, var(--brand-1), var(--brand-3)); color: #fff; }
.stat-card.accent .lbl { color: rgba(255,255,255,.85); }
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.section-title { font-size: 16px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.upload-box textarea {
  width: 100%; min-height: 160px; border: 2px dashed #cbd5e1; border-radius: 14px;
  padding: 14px; font-size: 14px; font-family: inherit; resize: vertical; outline: none; line-height: 1.7;
}
.upload-box textarea:focus { border-color: var(--brand-1); }
.upload-box .row { display: flex; gap: 10px; margin-top: 12px; }
.upload-box input[type=text] { flex: 1; padding: 12px 14px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 14px; outline: none; font-family: inherit; }
.upload-box input[type=text]:focus { border-color: var(--brand-1); }
.upload-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.upload-msg.ok { color: var(--green); }
.upload-msg.err { color: var(--red); }
.stu-card { background: var(--card); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.stu-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stu-card .head .nm { font-weight: 800; font-size: 16px; }
.stu-card .head .un { font-size: 12px; color: var(--ink-soft); }
.stu-card .head .acc { margin-left: auto; font-size: 13px; font-weight: 700; }
.stu-card .mini-track { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.stu-card .mini-fill { height: 100%; background: linear-gradient(90deg, var(--brand-1), var(--brand-3)); border-radius: 999px; transition: width .4s; }
.stu-card .nums { display: flex; gap: 16px; font-size: 13px; color: var(--ink-soft); }
.stu-card .nums b { color: var(--ink); }
.stu-card .wrong-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.wtag { font-size: 12px; background: var(--red-soft); color: var(--red); padding: 3px 9px; border-radius: 8px; font-weight: 600; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.list-row .t { font-weight: 600; }
.list-row .meta { margin-left: auto; color: var(--ink-soft); font-size: 12px; }
.empty { text-align: center; color: var(--ink-soft); padding: 30px 0; font-size: 14px; }
.spin { width: 34px; height: 34px; border: 3px solid #e2e8f0; border-top-color: var(--brand-1); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 14px; opacity: 0; transition: all .35s cubic-bezier(.22,1,.36,1); z-index: 999; box-shadow: 0 10px 30px rgba(0,0,0,.25); pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── 编故事弹窗 ── */
.story-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.story-overlay[hidden] { display: none; }

.story-modal {
  width: 66%; max-width: 880px; height: 82%;
  background: #fff; border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
  display: flex; flex-direction: column; overflow: hidden;
}
.story-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 24px 12px; border-bottom: none;
}
.memory-head-text { min-width: 0; }
.memory-sub { font-size: 12px; color: var(--ink-soft); font-weight: 700; margin-top: 3px; }
.memory-tabs {
  display: flex; gap: 10px; flex: none;
  padding: 0 20px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid #f1f5f9;
}
.memory-tabs::-webkit-scrollbar { display: none; }
.memory-tab {
  flex: none; min-width: 112px;
  border: 1.5px solid #e8ebf3; border-radius: 14px;
  background: #f7f8fc; color: var(--ink);
  padding: 12px 16px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 800;
  text-align: center; line-height: 1.2;
}
.memory-tab.on {
  background: #fff; color: var(--brand-1); border-color: #c4b5fd;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .16);
}
.memory-empty {
  text-align: center; color: var(--ink-soft);
  padding: 56px 18px; font-size: 15px; line-height: 1.7;
}
.story-title { font-size: 20px; font-weight: 800; }
.story-words { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.story-words .sw { font-size: 12px; background: #ede9fe; color: var(--brand-1); padding: 3px 9px; border-radius: 8px; font-weight: 700; }
.story-close { margin-left: auto; border: none; background: #f1f5f9; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--ink-soft); }
.story-close:hover { background: #e2e8f0; }
.story-body { flex: 1; overflow-y: auto; padding: 22px 28px; }
.story-prompt { font-size: 15px; line-height: 1.75; color: var(--ink); background: #f8fafc; border-radius: 14px; padding: 16px 18px; margin-bottom: 20px; }
.story-mic {
  display: block; margin: 0 auto; border: none; cursor: pointer;
  width: 120px; height: 120px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: #fff; font-size: 15px; font-weight: 700; font-family: inherit;
  box-shadow: 0 10px 30px rgba(99,102,241,.4); transition: transform .15s;
}
.story-mic.recording { animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99,102,241,.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(99,102,241,0); }
}
.story-rec-text { margin-top: 20px; font-size: 15px; line-height: 1.75; color: var(--ink); background: #f1f5f9; border-radius: 12px; padding: 14px 16px; min-height: 56px; white-space: pre-wrap; }
.story-section-label { font-size: 14px; font-weight: 800; color: var(--brand-1); margin: 20px 0 10px; }
.story-lines .line {
  padding: 10px 14px; margin-bottom: 8px; border-radius: 10px;
  background: #f8fafc; font-size: 15px; line-height: 1.75; transition: all .3s;
}
.story-lines .line.active { background: #ede9fe; border-left: 3px solid var(--brand-1); }
.story-lines .line.done { background: #f1f5f9; color: var(--ink-soft); }

/* ── 5连击 ── */
.combo-progress {
  text-align: center; font-size: 13px; font-weight: 700;
  color: var(--ink-soft); margin-bottom: 14px;
}
.combo-loading, .combo-done { text-align: center; padding: 40px 12px; color: var(--ink-soft); }
.combo-done h3 { color: var(--ink); font-size: 20px; margin: 8px 0 10px; }
.combo-done-icon { font-size: 32px; }
.combo-card {
  position: relative; width: 100%; max-width: 460px;
  min-height: 300px; margin: 0 auto;
  perspective: 1200px;
  background: transparent; border: none; box-shadow: none; padding: 0;
  cursor: pointer;
}
.combo-flipper {
  display: grid;
  min-height: 300px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,.12,.2,1);
}
.combo-card.is-flipped .combo-flipper { transform: rotateY(180deg); }
.combo-side {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 36px 24px 28px;
  background: #fff; border: 1px solid #eceff4; border-radius: 22px;
  box-shadow: 0 10px 30px rgba(30, 41, 59, .08);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  min-height: 300px;
  box-sizing: border-box;
  width: 100%;
}
.combo-front { transform: rotateY(0deg); }
.combo-back { transform: rotateY(180deg); pointer-events: none; }
.combo-card.is-flipped .combo-front { pointer-events: none; }
.combo-card.is-flipped .combo-back { pointer-events: auto; }
.combo-speak {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: #f3f4f7; font-size: 16px; cursor: pointer;
}
.combo-ring { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.combo-ring svg { position: absolute; inset: 0; }
.combo-ring-bg { fill: none; stroke: #e8edf2; stroke-width: 7; }
.combo-ring-fg {
  fill: none; stroke: #c4a36a; stroke-width: 7;
  stroke-linecap: round; transition: stroke-dashoffset .1s linear;
}
.combo-ring.done .combo-ring-fg { stroke: #10b981; }
.combo-count { font-size: 30px; font-weight: 700; color: #64748b; }
.combo-word { font-size: 28px; font-weight: 800; color: #334155; text-align: center; line-height: 1.3; }
.combo-zh { font-size: 20px; font-weight: 700; color: #64748b; text-align: center; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) {
  .combo-flipper { transition: none; }
  .combo-back { display: none; transform: none; }
  .combo-card.is-flipped .combo-flipper { transform: none; }
  .combo-card.is-flipped .combo-front { display: none; }
  .combo-card.is-flipped .combo-back { display: flex; }
}
.combo-hint { text-align: center; margin-top: 16px; font-size: 13px; color: #94a3b8; line-height: 1.6; }
.combo-rate, .combo-actions {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 18px;
}
.combo-btn {
  border: 1.5px solid transparent; border-radius: 999px;
  padding: 11px 22px; font-size: 15px; font-weight: 800;
  cursor: pointer; font-family: inherit;
}
.combo-btn.remember { background: #d1fae5; color: #059669; }
.combo-btn.forgot { background: #fee2e2; color: #dc2626; }
.combo-btn.primary {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: #fff;
}
.combo-btn.ghost { background: #f1f5f9; color: var(--ink-soft); }
.combo-dict-prompt, .combo-speak-prompt {
  text-align: center; font-size: 22px; font-weight: 800;
  color: var(--ink); line-height: 1.5; margin: 18px 8px 22px;
}
.combo-speak-prompt mark.hlw {
  background: #fde047; color: #1f2937; border-radius: 4px;
  padding: 0 3px; font-weight: 800;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, .45);
}
.combo-stage-label {
  text-align: center; font-size: 13px; font-weight: 800; color: var(--brand-1);
}
.combo-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; }
.combo-slot {
  border: 0; border-bottom: 2px solid #334155;
  background: transparent; outline: none; text-align: center;
  font-size: 20px; font-weight: 700; padding: 4px 2px 6px; min-width: 3ch;
}
.combo-slot:focus { border-bottom-color: var(--brand-1); }
.combo-slot.wrong { border-bottom-color: #dc2626; color: #dc2626; }
.combo-slot.ok { border-bottom-color: #059669; color: #059669; }
.combo-reveal { text-align: center; margin-top: 14px; font-weight: 700; color: var(--brand-1); }
.combo-rec {
  display: block; width: 100%; box-sizing: border-box; resize: none;
  margin: 0; font: inherit; font-size: 16px; font-weight: 600;
  background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: 14px 16px; min-height: 88px; color: var(--ink); line-height: 1.6;
  outline: none;
}
.combo-rec::placeholder { color: #94a3b8; font-weight: 500; }
.combo-rec:focus { border-color: var(--brand-1); background: #fff; }
.combo-mic {
  border: none; cursor: pointer; border-radius: 999px;
  padding: 12px 22px; font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: #fff; font-family: inherit;
}
.combo-mic.recording { animation: micPulse 1.2s ease-in-out infinite; }
.combo-mic:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.15); }

.mic-loud-tip {
  margin: 4px 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #fb923c;
  color: #9a3412;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  line-height: 1.55;
  box-shadow: 0 8px 20px rgba(234, 88, 12, .16);
}
.fw-canvas {
  position: fixed; inset: 0; z-index: 4000;
  pointer-events: none; width: 100%; height: 100%;
  display: none;
}
.combo-yes {
  position: fixed; left: 50%; top: 38%;
  transform: translate(-50%, -50%) scale(.6);
  z-index: 4001; pointer-events: none;
  font-size: clamp(26px, 8vw, 42px); font-weight: 900; color: #059669;
  text-shadow: 0 4px 0 #bbf7d0, 0 10px 24px rgba(5,150,105,.28);
  white-space: nowrap;
  animation: comboYesPop .9s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes comboYesPop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.4) rotate(-8deg); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(2deg); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(.9); }
}

.combo-next-bridge {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.combo-next-label {
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 900;
  color: var(--brand-1);
  letter-spacing: .18em;
  animation: comboNextIn .75s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes comboNextIn {
  0% { opacity: 0; transform: scale(.8) translateY(12px); }
  42% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .combo-next-label { animation: none; }
}


/* ── 分组解锁：迷雾 + 开锁动画 ── */
.group.locked .group-head { opacity: .55; }

.fog {
  position: absolute; inset: 0; z-index: 10;
  border-radius: 11px; overflow: hidden;
}
.fog-panel {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background: linear-gradient(160deg, rgba(226,232,240,.94) 0%, rgba(241,245,249,.97) 55%, rgba(255,255,255,.99) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .9s cubic-bezier(.22,.9,.34,1);
}
.fog-left { left: 0; border-right: 1px dashed rgba(148,163,184,.55); }
.fog-right { right: 0; border-left: 1px dashed rgba(148,163,184,.55); }
.fog-center {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .35s ease;
}
.lock-icon { font-size: 34px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(99,102,241,.35)); }
.lock-text { font-size: 12px; font-weight: 700; color: #94a3b8; letter-spacing: .5px; }

.fog.stripping .fog-left { transform: translateX(-104%); }
.fog.stripping .fog-right { transform: translateX(104%); }
.fog.stripping .fog-center { opacity: 0; }

.word-cell.pop-in { animation: cellPop .5s cubic-bezier(.34,1.56,.64,1) backwards; }
@keyframes cellPop {
  from { opacity: 0; transform: translateY(12px) scale(.8); }
  to { opacity: 1; transform: none; }
}


/* ── 松动库 ── */
.loose-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: #fff; font-size: 14px; font-weight: 700;
  padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
  transition: transform .15s;
}
.loose-btn b { font-size: 15px; }
.loose-btn:hover { transform: translateY(-1px); }
.loose-btn:active { transform: translateY(0) scale(.97); }

.add-word-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid rgba(59, 47, 26, .14);
  background: #fffaf3;
  color: #3b2f1a;
  font-family: inherit; font-size: 14px; font-weight: 800;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(92, 64, 28, .12), inset 0 1px 0 #fff;
  transition: transform .15s, box-shadow .15s;
}
.add-word-plus {
  width: 26px; height: 26px; border-radius: 50%;
  background: #3b2f1a; color: #fffaf3;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700; line-height: 1;
}
.add-word-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(92, 64, 28, .18), inset 0 1px 0 #fff; }
.add-word-btn:active { transform: translateY(0) scale(.97); }

.add-words-overlay {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(28, 22, 14, .48);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.add-words-overlay[hidden] { display: none; }
.add-words-sheet {
  position: relative;
  width: min(540px, 100%);
  max-height: min(88dvh, 720px);
  overflow: auto;
  background:
    linear-gradient(90deg, transparent 36px, #e8b4b4 36px, #e8b4b4 38px, transparent 38px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(90, 70, 40, .06) 31px 32px),
    #f7f1e3;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(40, 28, 12, .28);
  padding: 28px 28px 22px 48px;
}
.add-words-close {
  position: absolute; top: 14px; right: 14px;
  border: none; background: rgba(59, 47, 26, .08);
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 16px; color: #6b5a45;
}
.add-words-close:hover { background: rgba(59, 47, 26, .14); }
.add-words-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
  color: #b08968; margin-bottom: 6px;
}
.add-words-title {
  font-size: 26px; font-weight: 800; color: #2c2116;
  letter-spacing: .02em; line-height: 1.25; margin-bottom: 8px;
}
.add-words-lead {
  font-size: 14px; color: #7a6752; line-height: 1.6; margin-bottom: 16px;
}
.add-words-input {
  width: 100%; min-height: 180px; resize: vertical;
  border: none; outline: none; background: transparent;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "PingFang SC", serif;
  font-size: 18px; line-height: 32px; color: #2c2116;
  padding: 0 4px 8px 0;
}
.add-words-input::placeholder { color: #c4b49a; }
.add-words-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 14px;
}
.add-words-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(59, 47, 26, .1);
  border-radius: 999px; padding: 4px 10px;
  font-size: 12px; color: #3b2f1a;
}
.add-words-chip b { font-weight: 800; }
.add-words-chip i { font-style: normal; color: #8a735a; }
.add-words-chip.more { color: #8a735a; font-weight: 700; }
.add-words-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px;
}
.add-words-mic {
  border: none; cursor: pointer; font-family: inherit;
  background: #3b2f1a; color: #fffaf3;
  font-size: 14px; font-weight: 800;
  padding: 11px 16px; border-radius: 999px;
}
.add-words-mic.recording { animation: micPulse 1.2s ease-in-out infinite; }
.add-words-lang {
  border: 1.5px solid rgba(59, 47, 26, .16);
  background: rgba(255,255,255,.55); color: #3b2f1a;
  width: 40px; height: 40px; border-radius: 50%;
  font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}
.add-words-go {
  margin-left: auto; border: none; cursor: pointer; font-family: inherit;
  background: #c45c26; color: #fffaf3;
  font-size: 15px; font-weight: 800;
  padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 8px 18px rgba(196, 92, 38, .28);
}
.add-words-go:disabled { opacity: .6; cursor: not-allowed; }
.add-words-hint {
  margin-top: 12px; font-size: 12px; color: #9a8670; line-height: 1.55;
}
.empty-add {
  display: block; margin: 14px auto 0; border: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 800;
  background: #3b2f1a; color: #fffaf3;
  padding: 10px 18px; border-radius: 999px;
}

.loose-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,23,42,.55);
  display: flex; align-items: stretch; justify-content: center;
  padding: 0;
}
.loose-modal {
  width: 100%; max-width: 520px; height: 100%;
  background: #f4f6fb;
  border-radius: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.loose-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex: none;
  padding: calc(16px + env(safe-area-inset-top)) 18px 12px;
  background: #f4f6fb;
}
.loose-head-main { min-width: 0; flex: 1; }
.loose-title {
  font-size: 22px; font-weight: 800; letter-spacing: .02em;
  white-space: nowrap; line-height: 1.2;
}
.loose-sub {
  margin-top: 6px;
  font-size: 13px; color: var(--ink-soft); line-height: 1.5;
}
.loose-extra {
  flex: none;
  margin: 0 18px 12px;
  font-size: 13px; font-weight: 700; color: #9a3412;
  background: #ffedd5; border: 1px solid #fdba74;
  padding: 10px 14px; border-radius: 12px; line-height: 1.4;
}
.loose-extra[hidden] { display: none; }
.loose-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.loose-log-btn {
  border: 1px solid #c7d2fe; background: #fff; color: var(--brand-1);
  font-family: inherit; font-size: 13px; font-weight: 800;
  padding: 8px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.loose-log-btn:active { background: #eef2ff; }
.loose-reset-btn {
  border-color: #e2e8f0; color: #64748b;
}
.loose-reset-btn:active { background: #f8fafc; }
.loose-close {
  flex: none; border: none; background: #fff; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.loose-close:hover { background: #eef2ff; }
.loose-grid {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 18px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; align-content: start;
}
.loose-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; border: 1px solid #e8ebf3; border-radius: 16px;
  background: #fff; padding: 14px 14px 14px 12px;
  cursor: pointer; text-align: left; font-family: inherit;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.loose-card:hover, .loose-card:active {
  border-color: #c7d2fe;
  box-shadow: 0 8px 20px rgba(99,102,241,.12);
}
.loose-card:active { transform: scale(.99); }
.loose-no {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: #eef2ff; color: var(--brand-1);
  font-size: 16px; font-weight: 800;
}
.loose-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.loose-riddle {
  font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--ink);
}
.loose-meta { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.loose-go {
  flex: none;
  font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  padding: 8px 14px; border-radius: 999px;
}
.loose-empty {
  text-align: center; padding: 72px 16px;
  font-size: 15px; color: var(--ink-soft); line-height: 1.7;
}
.loose-grid[hidden], .loose-records[hidden] { display: none !important; }
.loose-records {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 14px calc(20px + env(safe-area-inset-bottom));
}
.loose-table-wrap { overflow-x: auto; }
.loose-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; background: #fff; border-radius: 14px;
}
.loose-table th {
  text-align: left; font-size: 11px; font-weight: 800;
  color: var(--ink-soft); letter-spacing: .04em;
  padding: 10px 8px; border-bottom: 1px solid #e8ebf3;
  white-space: nowrap; background: #f8fafc;
}
.loose-table td {
  padding: 11px 8px; border-bottom: 1px solid #f1f5f9;
  color: var(--ink); white-space: nowrap;
}
.loose-table tr:last-child td { border-bottom: 0; }
.loose-td-word { font-weight: 800; }
.loose-table td:nth-child(3),
.loose-table td:nth-child(4),
.loose-table td:nth-child(5),
.loose-table th:nth-child(3),
.loose-table th:nth-child(4),
.loose-table th:nth-child(5) { text-align: right; }
.loose-table tbody tr { cursor: pointer; }
.loose-table tbody tr:active { background: #eef2ff; }
.loose-table tbody tr.on { background: #eef2ff; }
.record-action {
  flex: none;
  margin: 0 14px calc(12px + env(safe-area-inset-bottom));
  padding: 14px;
  background: #fff;
  border: 1px solid #e8ebf3;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, .08);
}
.record-action[hidden] { display: none !important; }
.record-action-word {
  font-size: 18px; font-weight: 800; color: var(--ink);
  margin-bottom: 12px; word-break: break-word;
}
.record-action-btns { display: flex; gap: 10px; }
.record-go, .record-cancel {
  flex: 1; border: none; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 800; padding: 12px 10px; border-radius: 12px;
}
.record-go {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: #fff;
}
.record-cancel { background: #f1f5f9; color: var(--ink-soft); }
@media (min-width: 768px) {
  .loose-overlay { padding: 28px; align-items: center; }
  .loose-modal {
    height: min(720px, 88vh);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  }
  .loose-head { padding-top: 22px; }
}

/* ── 转圈复习 ── */
.review-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(15,23,42,.7); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.review-modal {
  width: 440px; max-width: 92vw; background: #fff; border-radius: 24px;
  box-shadow: 0 40px 120px rgba(0,0,0,.45); padding: 24px 28px 30px;
}
.review-head { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin-bottom: 20px; }
.review-count { color: var(--brand-1); }
.review-close {
  margin-left: auto; border: none; background: #f1f5f9; width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--ink-soft);
}
.review-close:hover { background: #e2e8f0; }
.review-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.ring-wrap { position: relative; width: 180px; height: 180px; }
.ring-wrap svg { position: absolute; inset: 0; }
#ringFg { transition: none; }
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.ring-word { font-size: 26px; font-weight: 800; color: var(--ink); word-break: break-word; text-align: center; padding: 0 26px; }
.ring-timer { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.review-meaning {
  font-size: 15px; line-height: 1.6; color: var(--ink); background: #f8fafc;
  border-radius: 12px; padding: 12px 16px; text-align: center; width: 100%;
}
.review-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.rv-btn {
  border: none; cursor: pointer; font-weight: 700; font-size: 15px;
  padding: 11px 24px; border-radius: 12px; transition: transform .12s;
}
.rv-btn:active { transform: scale(.96); }
.rv-btn.peek { background: #ede9fe; color: var(--brand-1); }
.rv-judge { display: flex; gap: 14px; }
.rv-btn.know { background: var(--green); color: #fff; }
.rv-btn.dunno { background: var(--red); color: #fff; }

/* 隐藏属性生效（覆盖 display:flex） */
.loose-overlay[hidden], .review-overlay[hidden] { display: none; }


/* ── 复习规则提示横幅（醒目闪光） ── */
.review-notice {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff7d6, #ffe9a8, #fff7d6);
  background-size: 200% 100%;
  color: #8a5a00;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .5px;
  text-align: center;
  border: 2px solid #ffc94d;
  box-shadow: 0 0 12px rgba(255, 180, 40, .55), inset 0 0 6px rgba(255, 200, 80, .35);
  animation: noticeGlow 1.4s ease-in-out infinite, noticeBg 2.4s linear infinite;
}
@keyframes noticeGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 180, 40, .35), inset 0 0 4px rgba(255, 200, 80, .25); }
  50%      { box-shadow: 0 0 22px rgba(255, 170, 20, .9), inset 0 0 10px rgba(255, 210, 90, .55); }
}
@keyframes noticeBg {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ── 编故事：词义标签 + 目标词高亮 + 下一句按钮 ── */
.story-words .sw { display: inline-flex; align-items: baseline; gap: 4px; }
.story-words .sw .sw-zh { font-style: normal; font-weight: 600; color: var(--ink-soft); font-size: 11px; }
.story-lines .line mark.hlw {
  background: #fde047; color: #1f2937; border-radius: 4px;
  padding: 0 3px; font-weight: 800;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, .45);
}
.next-line-wrap { text-align: center; margin-top: 18px; }
.next-line-btn {
  background: linear-gradient(135deg, var(--brand-1), #a855f7);
  color: #fff; border: none; border-radius: 999px;
  padding: 12px 34px; font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 18px rgba(99,102,241,.35);
  transition: transform .15s, box-shadow .15s;
}
.next-line-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(99,102,241,.45); }
.next-line-btn:active { transform: translateY(0) scale(.97); }

/* ── 顶栏更多菜单（手机） ── */
.user-chip { position: relative; }
.more-btn {
  display: none; border: none; background: #eef2ff; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%; font-size: 16px; font-weight: 800;
  color: var(--ink); line-height: 1; font-family: inherit;
}
.more-btn:active { background: #eef2ff; }
.more-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  background: #fff; border-radius: 12px; min-width: 108px;
  box-shadow: 0 10px 28px rgba(30, 41, 59, .16); overflow: hidden;
}
.more-menu[hidden] { display: none; }
.more-menu button {
  display: block; width: 100%; border: none; background: #fff;
  padding: 12px 16px; text-align: left; font-size: 14px; font-weight: 700;
  color: var(--ink); cursor: pointer; font-family: inherit;
}
.more-menu button:active { background: #f1f5f9; }
.group-switch { display: none; }

/* ═══ 平板：当前组 + 错词池并排 ═══ */
@media (max-width: 1099px) {
  .group-switch {
    display: flex; gap: 8px; overflow-x: auto; padding: 0 2px 10px;
    width: 100%; max-width: 100%; min-width: 0;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .group-switch::-webkit-scrollbar { display: none; }
  .g-tab {
    flex: none; border: none; cursor: pointer; font-family: inherit;
    background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 700;
    padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow-sm);
  }
  .g-tab.on { background: var(--ink); color: #fff; }
  .g-tab.locked { opacity: .45; cursor: not-allowed; }
  .groups { display: block; width: 100%; }
  .group { display: none; }
  .group.is-active { display: block; width: 100%; }
  .wc-word { font-size: 17px; }
  .wc-peek-btn { font-size: 14px; padding: 8px 12px; min-height: 40px; }
  .wc-btn { width: 44px; height: 44px; font-size: 18px; }
  .word-list { gap: 12px; }
  .word-cell .wc-face { padding: 14px 16px; min-height: 60px; }

  html, body {
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
  }
  body { min-height: 100dvh; }
  .wrap {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  .topbar {
    flex: none;
    margin-bottom: 0;
    position: relative;
    z-index: 30;
  }
  .scroll-groove {
    display: block;
    flex: none;
    height: 10px;
    margin: 8px 10px 0 0;
    position: relative;
  }
  .scroll-groove::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 3px;
    height: 4px;
    border-radius: 99px;
    background: linear-gradient(180deg, #b7bdca 0%, #e8ebf2 52%, #ffffff 100%);
    box-shadow:
      inset 0 1px 2px rgba(30, 41, 59, .22),
      0 1px 0 rgba(255, 255, 255, .9);
  }
  .page-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #8b90a0 #e4e7ee;
    padding-top: 10px;
  }
  .page-scroll::-webkit-scrollbar { width: 7px; }
  .page-scroll::-webkit-scrollbar-track {
    background: #e4e7ee;
    border-radius: 99px;
    margin: 6px 0;
  }
  .page-scroll::-webkit-scrollbar-thumb {
    background: #8b90a0;
    border-radius: 99px;
  }
}

/* ═══ 手机：顶栏固定，橙色沟壑以下滚动 ═══ */
@media (max-width: 767px) {
  .desk-only { display: none; }
  .more-btn { display: grid; place-items: center; }
  .topbar {
    margin-bottom: 0; gap: 8px; flex: none;
    display: flex; align-items: center; flex-wrap: wrap;
    padding-right: 12px;
  }
  .topbar-left { gap: 8px; min-width: 0; overflow: hidden; flex: 1; }
  .brand .name { display: none; }
  .ui-theme-tabs { padding: 2px; }
  .ui-theme-tab { font-size: 11px; padding: 5px 9px; }
  .loose-btn { padding: 7px 10px; font-size: 12px; }
  .add-word-btn { padding: 5px 10px 5px 5px; font-size: 12px; }
  .add-word-plus { width: 22px; height: 22px; font-size: 14px; }
  .user-chip {
    position: static; z-index: 5;
    display: flex; align-items: center;
    padding: 3px; gap: 2px; flex: none; margin-left: auto;
    background: #fff; min-width: 36px; min-height: 36px;
  }
  .more-btn {
    display: grid !important; place-items: center;
    width: 32px; height: 32px; background: #eef2ff;
  }
  .user-chip #userName { display: none; }
  .wrap {
    max-width: none;
    width: 100%;
    padding: 10px 0 0 12px;
    box-sizing: border-box;
    position: relative;
  }
  .progress-head { margin-bottom: 8px; flex: none; width: 100%; }
  .progress-head .labels span:last-child { white-space: nowrap; }
  .page-scroll {
    padding: 10px 12px calc(16px + env(safe-area-inset-bottom)) 0;
    width: 100%;
    box-sizing: border-box;
  }
  .layout {
    flex: none; min-height: 0; gap: 8px;
    display: flex; flex-direction: column;
    width: 100%; min-width: 0; max-width: 100%;
    align-self: stretch;
  }
  .main { flex: none; min-height: 0; min-width: 0; width: 100%; max-width: 100%; display: flex; flex-direction: column; align-self: stretch; }
  .group-switch { flex: none; min-width: 0; width: 100%; max-width: 100%; }
  .groups {
    display: block;
    flex: none; min-height: 0; width: 100%; max-width: 100%;
    overflow: visible; align-self: stretch;
  }
  .group.is-active {
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 10px 12px;
  }
  .word-list, .word-cell { width: 100%; }
  .word-list { gap: 12px; }
  .word-cell .wc-face { padding: 14px 16px; min-height: 58px; }
  .sidebar {
    flex: none; min-height: 0; position: static; width: 100%; max-width: 100%;
    display: flex; flex-direction: column;
  }
  .pool-card {
    flex: none; min-height: 0;
    padding: 12px 12px 10px;
    overflow: visible;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex; flex-direction: column;
  }
  .pool-hint { display: none; }
  .pool-title { font-size: 14px; }
  .pool-head { margin-bottom: 10px; flex: none; }
  .pool-body { flex: none; min-height: 0; overflow: visible; }
  .pool-slots {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 0; width: 100%;
    flex: none;
  }
  .pool-slot {
    flex: none;
    width: auto; min-width: 0; min-height: 40px; height: auto;
    overflow: visible; font-size: 14px; padding: 8px 12px;
    box-sizing: border-box;
  }
  .pool-slot-word { font-size: 14px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }

  .story-overlay, .review-overlay, .add-words-overlay { padding: 0; }
  .story-modal {
    width: 100%; max-width: none; height: 100%;
    border-radius: 0;
  }
  .add-words-sheet {
    width: 100%; max-width: none; height: 100%; max-height: none;
    border-radius: 0; padding: calc(22px + env(safe-area-inset-top)) 22px calc(18px + env(safe-area-inset-bottom)) 42px;
  }
  .story-body { padding: 16px; }
  .story-head { padding: 14px 16px 10px; }
  .memory-tabs { padding: 0 16px 12px; }
  .story-mic { width: 96px; height: 96px; }
  .combo-word { font-size: 24px; }
  .combo-zh { font-size: 18px; }
  .combo-dict-prompt, .combo-speak-prompt { font-size: 18px; }
  .review-modal { width: 100%; max-width: none; border-radius: 16px 16px 0 0; }
}

/* 平板：当前组左、遗忘池右；顶栏固定，沟壑以下滚动 */
@media (min-width: 768px) and (max-width: 1099px) {
  .wrap {
    padding: 16px 0 0 16px;
  }
  .topbar { padding-right: 16px; }
  .scroll-groove { margin-right: 12px; }
  .page-scroll {
    padding: 12px 4px 20px 0;
  }
  .topbar, .progress-head { flex: none; }
  .layout {
    flex: none; min-height: 0;
    display: flex; flex-direction: row; gap: 14px;
    align-items: flex-start;
  }
  .main { flex: 1.3; min-width: 0; display: flex; flex-direction: column; }
  .groups { flex: none; min-height: 0; overflow: visible; }
  .sidebar {
    flex: 0 0 280px; width: 280px; position: static;
    overflow: visible; align-self: flex-start;
  }
  .pool-card { height: auto; overflow: visible; display: flex; flex-direction: column; }
  .pool-body { overflow: visible; flex: none; }
}
