/* ============================================================
 * 速学霸 · 样式（平板优先 · 毛玻璃 + 蓝色学习主题）
 * ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --blue: #2E9BFF;
  --blue-d: #0F6FD8;
  --blue-l: #59C8FF;
  --mint: #2BE0A8;
  --mint-d: #0FA97E;
  --violet: #7B6BFF;
  --amber: #FFB020;
  --coral: #FF6B7E;
  --ink: #0F2540;
  --ink-2: #587394;
  --ink-3: #93A9C4;
  --panel: rgba(255, 255, 255, .72);
  --panel-strong: rgba(255, 255, 255, .92);
  --shadow: 0 18px 44px -24px rgba(30, 80, 150, .45);
  --radius: 18px;
  /* 奖章档位主题（青铜→白银→金牌→铂金→传说） */
  --medal-a: #FFE38A; --medal-b: #F5B301; --medal-glow: rgba(255, 190, 40, .55);
}

html, body { height: 100%; }
body {
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  background: radial-gradient(1400px 900px at 50% -10%, #E4F1FF 0%, #CFE3F7 45%, #BED7EF 100%);
  position: relative;
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(46,120,200,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46,120,200,.06) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 75%);
}
button { font-family: inherit; cursor: pointer; }
b { color: inherit; }

/* ============ 整体框架 ============ */
.app { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }

.topbar {
  /* backdrop-filter 会创建独立绘制层级，必须显式给 topbar 一个 z-index，
     否则内部 av-menu(z:60) 被封顶，菜单会被内容区的毛玻璃面板(backdrop-filter)盖住 */
  position: relative; z-index: 80;
  flex: none; height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; background: rgba(255,255,255,.55); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.7);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-icon {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--blue-l), var(--blue)); color: #fff;
  box-shadow: 0 8px 18px -8px rgba(46,155,255,.9), inset 0 1px 0 rgba(255,255,255,.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16px; font-weight: 900; letter-spacing: .5px; }
.brand-sub { font-size: 10px; font-weight: 700; color: var(--ink-3); letter-spacing: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.streak-chip {
  display: flex; align-items: center; font-size: 12.5px; font-weight: 800; color: #E8890C;
  background: linear-gradient(180deg, #FFF9EC, #FFF1D6); border: 1px solid #FFE3B3;
  padding: 6px 13px; border-radius: 11px; box-shadow: inset 0 1px 0 #fff;
}
.streak-chip .flame { font-size: 14px; margin-right: 5px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(46,120,200,.22);
  background: linear-gradient(180deg, #fff, #EAF6FF); color: #0E8FD6; display: grid; place-items: center;
  box-shadow: 0 5px 14px -8px rgba(46,155,255,.8), inset 0 1px 0 #fff; transition: .2s;
}
.icon-btn:hover { transform: scale(1.06); }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, var(--mint), #22C494);
  box-shadow: 0 8px 18px -8px rgba(43,224,168,.9), inset 0 1px 0 rgba(255,255,255,.4);
}

.main { flex: 1; min-height: 0; display: flex; }

/* ---- 侧栏 ---- */
.sidebar {
  flex: none; width: 92px; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 10px; overflow-y: auto;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 13px 4px; border-radius: 16px; border: none; background: transparent;
  color: var(--ink-2); font-size: 12px; font-weight: 700; transition: .2s;
}
.nav-item svg { opacity: .75; }
.nav-item:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.nav-item.active {
  background: var(--panel-strong); color: var(--blue-d);
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
}
.nav-item.active svg { opacity: 1; }

/* ---- 内容区 ---- */
.content { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 26px 40px; }
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: rgba(46,120,200,.18); border-radius: 99px; }

.page { display: none; animation: pageIn .35s ease; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ 通用组件 ============ */
.panel {
  background: var(--panel); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.85); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 #fff; padding: 18px 20px;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title { font-size: 16px; font-weight: 800; }
.panel-sub { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 3px; }
.memory-badge {
  flex: none; display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700;
  color: var(--ink-2); padding: 6px 12px; border-radius: 10px; white-space: nowrap;
  background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 4px 12px -8px rgba(30,80,150,.4), inset 0 1px 0 #fff;
}
.memory-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-title { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.page-title span { color: var(--blue); }
.page-sub { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-top: 4px; }
.head-chip {
  font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 6px 12px; border-radius: 10px;
  background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.95); white-space: nowrap;
  box-shadow: 0 4px 12px -8px rgba(30,80,150,.4), inset 0 1px 0 #fff;
}
.head-chip b { color: #0E8FD6; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.exit-chip { cursor: pointer; transition: .2s; }
.exit-chip:hover { background: #FFE4E9; color: #E5484D; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px; border-radius: 11px; border: 1px solid rgba(46,120,200,.2);
  background: rgba(255,255,255,.7); font-size: 13px; font-weight: 700; color: var(--ink-2); transition: .2s;
}
.chip.on { background: linear-gradient(140deg, var(--blue-l), var(--blue)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(46,155,255,.9); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  padding: 10px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 800; border: none;
  transition: .2s; display: inline-block; cursor: pointer;
}
.btn-secondary { background: #fff; color: var(--blue-d); border: 1px solid rgba(46,120,200,.25); box-shadow: 0 5px 12px -8px rgba(46,155,255,.6); }
.btn-secondary:hover { transform: translateY(-1px); }
.btn-danger { background: #FFE9EC; color: #E5484D; border: 1px solid #FFD2D8; }
.btn-danger:hover { background: #FFDDE2; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px); z-index: 300;
  padding: 11px 22px; border-radius: 14px; background: rgba(15,37,64,.92); color: #fff;
  font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: .3s;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); backdrop-filter: blur(6px); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 首页 ============ */
/* 首行：英雄区（左·缩短靠左）+ 今日数据（右·上移补位），两行等宽对齐 */
.hero-row {
  display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px;
  align-items: stretch; margin-bottom: 20px;
}
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
  padding: 16px 30px;
  background: linear-gradient(135deg, rgba(255,255,255,.88) 0%, rgba(240,249,255,.82) 55%, rgba(232,244,255,.86) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.9); border-radius: 22px;
  box-shadow: 0 22px 50px -28px rgba(30,80,150,.55), inset 0 1px 0 #fff;
}
.hero-divider { width: 1px; align-self: stretch; background: linear-gradient(180deg, transparent, rgba(46,120,200,.22), transparent); }

/* 左：打卡奖章 */
.medal-zone { display: flex; align-items: center; gap: 16px; flex: none; }
.medal-wrap { position: relative; width: 92px; text-align: center; }
.medal-aura {
  position: absolute; inset: -12%; border-radius: 50%;
  background: radial-gradient(circle, var(--medal-glow) 0%, transparent 68%);
  animation: aura 2.6s ease-in-out infinite;
}
@keyframes aura { 0%,100%{opacity:.55; transform:scale(.94)} 50%{opacity:1; transform:scale(1.05)} }
.medal-svg { position: relative; display: block; width: 100%; transition: transform .45s cubic-bezier(.36,.06,.2,1); }
.medal-wrap .num { position: relative; margin-top: -26px; font-size: 19px; font-weight: 900; line-height: 1; text-shadow: 0 2px 6px rgba(255,255,255,.9); }
.medal-wrap .cap { position: relative; font-size: 9.5px; font-weight: 800; letter-spacing: 1.5px; color: var(--ink-3); margin-top: 2px; }
.m-body-a { stop-color: var(--medal-a); } .m-body-b { stop-color: var(--medal-b); }
.medal-info { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.medal-info .tier {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 900;
  padding: 4px 12px; border-radius: 99px; color: #fff; white-space: nowrap;
  background: linear-gradient(140deg, var(--medal-a), var(--medal-b));
  box-shadow: 0 8px 20px -8px var(--medal-glow), inset 0 1px 0 rgba(255,255,255,.55);
}
.medal-info .next { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.medal-info .next b { color: #E8890C; }

/* 右：开始学习主按钮（呼吸光圈） */
.cta-zone { flex: none; display: flex; align-items: center; gap: 20px; }
.cta-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 44px; border: none; border-radius: 20px;
  font-size: 22px; font-weight: 900; letter-spacing: 3px; color: #fff; white-space: nowrap;
  background: linear-gradient(140deg, var(--blue-l) 0%, var(--blue) 55%, var(--blue-d) 100%);
  box-shadow: 0 16px 38px -12px rgba(46,155,255,.95), inset 0 1px 0 rgba(255,255,255,.45);
  animation: ctaPulse 2.2s ease-in-out infinite; transition: transform .15s;
}
.cta-btn:active { transform: scale(.96); }
@keyframes ctaPulse {
  0%,100% { box-shadow: 0 16px 38px -12px rgba(46,155,255,.95), 0 0 0 0 rgba(46,155,255,.42), inset 0 1px 0 rgba(255,255,255,.45); }
  50%     { box-shadow: 0 16px 44px -10px rgba(46,155,255,1),   0 0 0 16px rgba(46,155,255,0), inset 0 1px 0 rgba(255,255,255,.45); }
}
.cta-btn svg { width: 24px; height: 24px; }
.cta-info { display: flex; flex-direction: column; gap: 7px; min-width: 170px; }
.cta-sub { font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.cta-sub b { color: var(--blue-d); }
.cta-bar { height: 9px; border-radius: 99px; background: rgba(15,60,110,.1); overflow: hidden; box-shadow: inset 0 1px 3px rgba(15,60,110,.12); }
.cta-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--blue-l), var(--blue)); transition: width .45s ease; }

/* 中部两栏：等高对齐；今日数据填满首行右侧 */
.today-panel { display: flex; flex-direction: column; }
.today-panel .data-body { flex: 1; }
.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: stretch; margin-bottom: 20px; }
.cols > .panel { display: flex; flex-direction: column; }
.memory-panel .chart { flex: 1; }
.mode-panel .mode-grid { flex: 1; grid-auto-rows: 1fr; }

/* 记忆周期图 */
.chart { height: 150px; display: flex; align-items: flex-end; gap: 8px; padding: 4px 2px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.chart-num { font-size: 11px; font-weight: 800; color: var(--blue-d); font-family: ui-monospace, "SF Mono", Menlo, monospace; min-height: 13px; }
.chart-bar {
  width: 70%; max-width: 34px; border-radius: 8px 8px 4px 4px; min-height: 5px;
  background: linear-gradient(180deg, var(--blue-l), var(--blue));
  box-shadow: 0 4px 10px -4px rgba(46,155,255,.7), inset 0 1px 0 rgba(255,255,255,.5);
}
.chart-bar.zero { background: rgba(46,120,200,.12); box-shadow: none; }
.chart-col.today .chart-bar { background: linear-gradient(180deg, #5CE3C0, var(--mint)); box-shadow: 0 4px 12px -4px rgba(43,224,168,.8); }
.chart-col.today .chart-day { color: var(--mint-d); font-weight: 900; }
.chart-day { font-size: 11px; font-weight: 700; color: var(--ink-3); }

/* 任务卡（首页底行：复习 + 快速测试） */
.task-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 0; }
.task-card {
  position: relative; border-radius: var(--radius); padding: 16px 18px; text-align: left; border: none;
  background: var(--panel); backdrop-filter: blur(16px);
  box-shadow: var(--shadow), inset 0 1px 0 #fff; transition: .22s;
  display: flex; flex-direction: column; gap: 10px; overflow: hidden; cursor: pointer;
}
.task-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: 4px 4px 0 0;
}
.task-card:hover { transform: translateY(-2px); }
.task-new::before { background: linear-gradient(90deg, var(--blue-l), var(--blue)); }
.task-review::before { background: linear-gradient(90deg, #5CE3C0, var(--mint)); }
.task-test::before { background: linear-gradient(90deg, var(--violet), #A08BFF); }
.task-head { display: flex; align-items: center; gap: 9px; }
.task-icon {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none;
}
.task-new .task-icon { background: linear-gradient(140deg, var(--blue-l), var(--blue)); box-shadow: 0 6px 12px -6px rgba(46,155,255,.9); }
.task-review .task-icon { background: linear-gradient(140deg, #5CE3C0, var(--mint)); box-shadow: 0 6px 12px -6px rgba(43,224,168,.9); }
.task-test .task-icon { background: linear-gradient(140deg, var(--violet), #A08BFF); box-shadow: 0 6px 12px -6px rgba(123,107,255,.9); }
.task-title { font-size: 14.5px; font-weight: 800; }
.task-num { font-size: 24px; font-weight: 900; color: var(--blue-d); }
.task-num small { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.task-bar { height: 7px; border-radius: 99px; background: rgba(15,60,110,.09); overflow: hidden; }
.task-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #59C8FF, #2E9BFF); transition: width .45s ease; }
.task-review .task-bar-fill { background: linear-gradient(90deg, #5CE3C0, var(--mint)); }
.task-test .task-bar-fill { background: linear-gradient(90deg, var(--violet), #A08BFF); }
.task-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-time { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.task-btn {
  flex: none; padding: 8px 16px; border-radius: 11px; border: none; font-size: 12.5px; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, var(--blue-l), var(--blue));
  box-shadow: 0 8px 18px -8px rgba(46,155,255,.95); transition: .2s;
}
.task-review .task-btn { background: linear-gradient(140deg, #5CE3C0, var(--mint)); box-shadow: 0 8px 18px -8px rgba(43,224,168,.95); }
.task-test .task-btn { background: linear-gradient(140deg, var(--violet), #A08BFF); box-shadow: 0 8px 18px -8px rgba(123,107,255,.95); }
.task-btn:hover { transform: translateY(-1px) scale(1.03); }

/* 模式宫格 */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.mode-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 14px 15px; border-radius: 15px; border: 1px solid rgba(255,255,255,.9); transition: .2s;
  background: rgba(255,255,255,.6); box-shadow: 0 8px 20px -14px rgba(30,80,150,.4), inset 0 1px 0 #fff;
}
.mode-item:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(30,80,150,.55), inset 0 1px 0 #fff; }
.mode-icon { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.mode-name { font-size: 14px; font-weight: 800; }
.mode-desc { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.m1 .mode-icon { background: linear-gradient(140deg, var(--blue-l), var(--blue)); box-shadow: 0 6px 14px -6px rgba(46,155,255,.9); }
.m1 .mode-name { color: var(--blue-d); }
.m2 .mode-icon { background: linear-gradient(140deg, #FFD08A, var(--amber)); box-shadow: 0 6px 14px -6px rgba(255,176,32,.9); }
.m2 .mode-name { color: #C77F0A; }
.m3 .mode-icon { background: linear-gradient(140deg, #B3A6FF, var(--violet)); box-shadow: 0 6px 14px -6px rgba(123,107,255,.9); }
.m3 .mode-name { color: #6553E8; }
.m4 .mode-icon { background: linear-gradient(140deg, #5CE3C0, var(--mint)); box-shadow: 0 6px 14px -6px rgba(43,224,168,.9); }
.m4 .mode-name { color: var(--mint-d); }

/* 数据面板（今日数据，位于首行右侧） */
.data-body { display: flex; align-items: center; gap: 20px; }
.ring-wrap { position: relative; width: 118px; height: 118px; flex: none; }
.ring-wrap svg { width: 100%; height: 100%; }
.ring-fg { transition: stroke-dashoffset .8s ease; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring-val { font-size: 21px; font-weight: 900; color: var(--blue-d); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.ring-label { font-size: 10.5px; font-weight: 700; color: var(--ink-3); }
.data-stats { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.stat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.stat-val { font-size: 15px; font-weight: 800; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.stat-val.green { color: var(--mint-d); }

/* ============ 学习页 ============ */
.idle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.idle-card { min-height: 200px; }

.learn-session { display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 220px); }
.prog { flex: none; height: 8px; border-radius: 99px; background: rgba(15,60,110,.09); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #59C8FF, #2E9BFF); transition: width .45s ease; }
.session-body { flex: 1; min-height: 0; position: relative; perspective: 1600px; }

/* ---- 闪卡：点击 3D 翻面 / 答题左右滑切（高度自适应内容，不截断） ---- */
.flashcard {
  max-width: 780px; margin: 0 auto; position: relative; transform-style: preserve-3d;
  transition: transform .48s cubic-bezier(.36,.06,.2,1), opacity .48s ease;
}
.flashcard.out { transform: translateX(-118%) rotate(-3deg) scale(.96); opacity: 0; }
.flashcard.pre { transition: none; transform: translateX(118%) rotate(3deg) scale(.96); opacity: 0; }
/* 双面叠放在同一网格单元：卡片高度 = max(正面, 背面)，背面内容完整撑开、不再被固定高度截断 */
.flash-inner {
  position: relative; display: grid; transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.4,.1,.2,1);
}
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  grid-area: 1 / 1; min-width: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border-radius: 24px; padding: 26px 34px; display: flex; flex-direction: column;
  background: linear-gradient(158deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.85) 40%, rgba(240,249,255,.94) 100%);
  border: 1px solid rgba(255,255,255,.95); overflow: visible;
  box-shadow: 0 22px 50px -30px rgba(30,80,150,.55), inset 0 1px 0 #fff;
}
.flashcard.study-card { cursor: pointer; }
.flashcard.study-card .flash-front { min-height: min(44vh, 380px); align-items: center; justify-content: center; gap: 18px; }
/* 背面上限 = 视口 − 固定 UI（顶栏+页头+进度条+反馈按钮+边距），保证平板横屏也能一屏放下完整卡 + 按钮 */
.flash-back {
  transform: rotateY(180deg);
  max-height: calc(100vh - 340px);
  max-height: calc(100dvh - 340px); /* dvh：处理移动端地址栏收放的动态视口 */
  overflow-y: auto;
}

.f-grade {
  padding: 6px 14px; border-radius: 99px; font-size: 12px; font-weight: 800; color: #0E8FD6;
  background: rgba(46,155,255,.12); border: 1px solid rgba(46,155,255,.28); letter-spacing: 1px;
}
.f-word { font-size: 54px; font-weight: 900; letter-spacing: -1px; line-height: 1; text-align: center; }
.f-ph-row { display: flex; align-items: center; gap: 12px; justify-content: center; }
.f-ph { font-size: 16px; color: var(--ink-2); font-weight: 600; }
.spk {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(46,155,255,.3);
  background: linear-gradient(180deg, #fff, #EAF6FF); color: #0E8FD6; display: grid; place-items: center;
  box-shadow: 0 5px 14px -8px rgba(46,155,255,.8), inset 0 1px 0 #fff; transition: .2s; flex: none;
}
.spk:hover { transform: scale(1.06); }
.spk svg { width: 18px; height: 18px; }
.f-hint { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 2px; animation: hintFloat 2.4s ease-in-out infinite; }
@keyframes hintFloat { 0%,100% { transform: translateY(0); opacity: .75; } 50% { transform: translateY(4px); opacity: 1; } }

.b-top { display: flex; align-items: center; gap: 14px; flex: none; }
.b-word { font-size: 28px; font-weight: 900; letter-spacing: -.5px; }
.b-cn-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex: none; }
.b-pos {
  font-size: 13px; font-weight: 800; color: #fff; padding: 3px 10px; border-radius: 8px;
  background: linear-gradient(140deg, #59C8FF, #2E9BFF);
}
.b-cn { font-size: 17px; font-weight: 800; }
.b-sec-title {
  flex: none; font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: 2px;
  margin: 14px 0 8px; display: flex; align-items: center; gap: 8px;
}
.b-sec-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(46,120,200,.18), transparent); }
.b-direct {
  flex: none; margin: 14px 0 8px; padding: 12px 16px; border-radius: 14px; text-align: center;
  font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--blue-d);
  background: rgba(46,155,255,.08); border: 1px dashed rgba(46,155,255,.35);
}
.b-parts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; flex: none; }
.part-chip {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 14px;
  background: rgba(46,155,255,.09); border: 1px solid rgba(46,155,255,.25); box-shadow: inset 0 1px 0 #fff;
}
.part-chip b { font-size: 19px; color: var(--blue-d); font-weight: 800; letter-spacing: .5px; }
.part-chip span { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.part-plus { font-size: 18px; font-weight: 800; color: var(--ink-3); }
.b-mem {
  flex: none; padding: 12px 16px; border-radius: 14px; font-size: 13px; line-height: 1.7; color: var(--ink-2);
  background: rgba(43,224,168,.08); border: 1px solid rgba(43,224,168,.22);
}
.b-mem b { color: var(--mint-d); }
.b-ex { flex: none; padding: 12px 16px; border-radius: 14px; background: rgba(123,107,255,.07); border: 1px solid rgba(123,107,255,.18); }
.b-ex-en { font-size: 13.5px; font-weight: 700; }
.b-ex-cn { font-size: 12px; color: var(--ink-3); margin-top: 4px; font-weight: 600; }

/* ---- 反馈按钮行 ---- */
.fb-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; max-width: 780px; margin: 16px auto 0; }
.fb-btn {
  height: 56px; border-radius: 18px; border: none; font-size: 15px; font-weight: 800; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .2s, filter .2s; letter-spacing: 1px;
}
.fb-btn small { font-size: 10.5px; font-weight: 700; opacity: .85; letter-spacing: 0; }
.fb-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.fb-btn:active { transform: translateY(0) scale(.98); }
.fb-no { background: linear-gradient(140deg, #FF8A9B, var(--coral)); box-shadow: 0 10px 22px -12px rgba(255,107,126,.95); }
.fb-fuzzy { background: linear-gradient(140deg, #FFC978, var(--amber)); box-shadow: 0 10px 22px -12px rgba(255,176,32,.95); }
.fb-yes { background: linear-gradient(140deg, #5CE3C0, var(--mint)); box-shadow: 0 10px 22px -12px rgba(43,224,168,.95); }
/* 学新词浏览卡的单一「下一个 / 进入测试」按钮 */
.fb-row.single { grid-template-columns: 1fr; max-width: 400px; }
.fb-row.single .fb-btn { height: 62px; }

/* 错词重学引导页的词列表 */
.relearn-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.relearn-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 16px; border-radius: 12px;
  background: #FFEDF0; border: 1px solid rgba(255,107,126,.35);
}
.relearn-chip b { font-size: 15px; }
.relearn-chip span { font-size: 11px; color: var(--ink-2); font-weight: 700; }

/* ---- 复习 / 拼写卡 ---- */
.quiz-card {
  max-width: 700px; padding: 30px 34px; border-radius: 24px;
  background: linear-gradient(158deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.88) 45%, rgba(240,249,255,.95) 100%);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 22px 50px -30px rgba(30,80,150,.55), inset 0 1px 0 #fff;
  display: flex; flex-direction: column; gap: 14px;
}
.quiz-q { display: flex; align-items: center; gap: 14px; font-size: 36px; font-weight: 900; letter-spacing: -.5px; }
.quiz-ph { font-size: 15px; color: var(--ink-2); font-weight: 600; margin: -8px 0 0 4px; }
.quiz-hint-line { font-size: 12.5px; font-weight: 700; color: var(--ink-3); letter-spacing: 1px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz-opt {
  padding: 15px 18px; border-radius: 15px; border: 1.5px solid rgba(46,120,200,.18);
  background: rgba(255,255,255,.85); font-size: 15px; font-weight: 700; color: var(--ink);
  transition: .18s; text-align: left;
}
.quiz-opt:hover { border-color: var(--blue); background: #fff; transform: translateY(-1px); }
.quiz-opt.correct { background: #E5FBF3; border-color: var(--mint); color: var(--mint-d); }
.quiz-opt.wrong { background: #FFEDF0; border-color: var(--coral); color: #E5484D; }
.quiz-opt.dim { opacity: .45; }
.quiz-after { display: flex; flex-direction: column; gap: 12px; }
.q-result { padding: 11px 16px; border-radius: 13px; font-size: 13.5px; font-weight: 800; }
.q-result.ok { background: #E5FBF3; color: var(--mint-d); border: 1px solid rgba(43,224,168,.35); }
.q-result.no { background: #FFEDF0; color: #E5484D; border: 1px solid rgba(255,107,126,.35); }
.quiz-after .fb-row { margin: 0; }

.spell-card { align-items: stretch; }
.fc-pos { font-size: 13px; font-weight: 800; color: #0E8FD6; background: rgba(46,155,255,.12); border: 1px solid rgba(46,155,255,.28); padding: 3px 10px; border-radius: 8px; align-self: flex-start; }
.f-meaning { font-size: 24px; font-weight: 900; }
.spell-hint { font-size: 20px; letter-spacing: 6px; color: var(--ink-3); font-weight: 800; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.spell-input {
  padding: 15px 20px; border-radius: 15px; border: 2px solid rgba(46,120,200,.22); font-size: 22px;
  font-weight: 800; text-align: center; letter-spacing: 2px; outline: none; background: #fff; color: var(--ink);
  font-family: inherit;
}
.spell-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(46,155,255,.15); }
.spell-input:disabled { background: #F2F7FC; color: var(--ink-2); }
.spell-actions { display: flex; gap: 12px; }
.spell-btn {
  flex: 1; padding: 13px; border-radius: 13px; border: none; font-size: 14px; font-weight: 800; color: #fff; transition: .2s;
}
.spell-tip { background: linear-gradient(140deg, #FFD08A, var(--amber)); }
.spell-check { background: linear-gradient(140deg, #5CE3C0, var(--mint)); }
.spell-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* ---- 完成卡 ---- */
.done-card {
  max-width: 520px; margin: 4vh auto 0; padding: 40px 36px; border-radius: 26px; text-align: center;
  background: linear-gradient(158deg, rgba(255,255,255,.97), rgba(240,249,255,.95));
  border: 1px solid rgba(255,255,255,.95); box-shadow: 0 22px 50px -30px rgba(30,80,150,.55);
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.done-emoji { font-size: 52px; }
.done-title { font-size: 21px; font-weight: 900; }
.done-sub { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.done-stats { display: flex; gap: 26px; margin: 10px 0; }
.done-stat { display: flex; flex-direction: column; gap: 3px; }
.done-stat b { font-size: 24px; color: var(--blue-d); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.done-stat span { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
.big-btn {
  width: 100%; padding: 14px; border-radius: 15px; border: none; font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, var(--blue-l), var(--blue));
  box-shadow: 0 10px 24px -10px rgba(46,155,255,.95); transition: .2s;
}
.big-btn:hover { transform: translateY(-1px); }
.big-btn.ghost { background: rgba(46,155,255,.1); color: var(--blue-d); box-shadow: none; border: 1.5px solid rgba(46,155,255,.3); }

/* ============ 认词页 ============ */
.q-panel { max-width: 780px; margin: 0 auto; }
.q-card { text-align: center; padding: 10px 0 4px; }
.q-word { font-size: 46px; font-weight: 900; letter-spacing: -1px; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.recog-opt {
  padding: 17px 18px; border-radius: 15px; border: 1.5px solid rgba(46,120,200,.18);
  background: rgba(255,255,255,.85); font-size: 15px; font-weight: 700; color: var(--ink); transition: .18s; text-align: left;
}
.recog-opt:hover { border-color: var(--blue); background: #fff; transform: translateY(-1px); }
.recog-opt.correct { background: #E5FBF3; border-color: var(--mint); color: var(--mint-d); }
.recog-opt.wrong { background: #FFEDF0; border-color: var(--coral); color: #E5484D; }
.recog-opt.dim { opacity: .45; }
.q-foot { display: flex; justify-content: center; gap: 22px; margin-top: 16px; }
.q-stat { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.q-stat b { color: var(--blue-d); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }
.q-stat.ok b { color: var(--mint-d); }
.q-stat.no b { color: var(--coral); }

/* ============ 词根树 ============ */
.roots-body { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.root-list { display: flex; flex-direction: column; gap: 9px; }
.root-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: 15px; border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.6); text-align: left; transition: .2s;
  box-shadow: 0 8px 20px -14px rgba(30,80,150,.4), inset 0 1px 0 #fff;
}
.root-item:hover { transform: translateY(-1px); }
.root-item.active {
  background: linear-gradient(140deg, rgba(46,155,255,.12), rgba(46,155,255,.04));
  border-color: rgba(46,155,255,.4); box-shadow: 0 10px 24px -12px rgba(46,155,255,.5), inset 0 1px 0 #fff;
}
.root-token { font-size: 16px; font-weight: 900; color: var(--blue-d); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.root-mean { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.root-n {
  font-size: 11px; font-weight: 800; color: #fff; background: var(--blue);
  padding: 3px 9px; border-radius: 8px; white-space: nowrap;
}
.rd-head { display: flex; align-items: baseline; gap: 12px; }
.rd-title { font-size: 22px; font-weight: 900; }
.rd-title:first-letter { color: var(--blue); }
.rd-count { font-size: 12.5px; font-weight: 800; color: var(--blue-d); background: rgba(46,155,255,.1); padding: 4px 11px; border-radius: 9px; }
.rd-desc { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 10px; }
.root-words { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.root-word {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-radius: 14px; background: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.95); cursor: pointer; transition: .18s;
  box-shadow: 0 6px 16px -12px rgba(30,80,150,.4);
}
.root-word:hover { transform: translateY(-1px); background: #fff; }
.rw-en { font-size: 17px; font-weight: 900; }
.rw-formula { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 3px; }
.rw-formula b { color: var(--mint-d); }

/* ============ 生词本 ============ */
.book-filters { display: flex; gap: 9px; margin-bottom: 14px; }
.book-list { display: flex; flex-direction: column; gap: 9px; max-width: 860px; }
.book-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-radius: 15px; background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); cursor: pointer; transition: .18s;
}
.book-item:hover { transform: translateY(-1px); }
.bk-en { font-size: 17px; font-weight: 900; }
.bk-ph { font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.bk-cn { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-top: 3px; }
.bk-side { display: flex; align-items: center; gap: 14px; flex: none; }
.lv-dots { display: flex; gap: 4px; }
.lv-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(46,120,200,.15); }
.lv-dots i.on { background: var(--mint); box-shadow: 0 0 6px rgba(43,224,168,.7); }
.bk-del {
  width: 38px; height: 38px; border-radius: 11px; border: none; background: rgba(255,107,126,.12);
  color: var(--coral); font-size: 14px; font-weight: 800; transition: .2s;
}
.bk-del:hover { background: var(--coral); color: #fff; }

/* ============ 统计页 ============ */
.stats-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; align-items: start; }
.master-body { display: flex; align-items: center; gap: 24px; }
.grade-bars { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.grade-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; }
.grade-name { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.grade-track { position: relative; height: 10px; border-radius: 99px; background: rgba(15,60,110,.09); overflow: hidden; }
.grade-learned { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: rgba(46,155,255,.3); }
.grade-mastered { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #5CE3C0, var(--mint)); }
.grade-num { font-size: 12px; font-weight: 800; color: var(--ink-3); font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* 汇总行（掌握进度面板底部） */
.sum-row { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(46,120,200,.18); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sum-item { text-align: center; }
.sum-item .v { font-size: 16px; font-weight: 900; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.sum-item .l { font-size: 11px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }
.sum-item .v.g { color: var(--mint-d); } .sum-item .v.o { color: #E8890C; }

/* ---- 打卡日历（紧凑 · 大数字 · 填满的成就感） ---- */
.cal-box { max-width: 480px; margin: 0 auto; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; }
.cal-title { font-size: 15px; font-weight: 900; min-width: 96px; text-align: center; }
.cal-nav {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid rgba(46,120,200,.22);
  background: linear-gradient(180deg, #fff, #EAF6FF); color: #0E8FD6; font-size: 15px; font-weight: 900;
}
.cal-nav:hover { transform: scale(1.06); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  aspect-ratio: 1 / .82; border-radius: 10px; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.9);
}
.cal-cell .d { position: absolute; top: 3px; left: 5px; font-size: 9px; font-weight: 700; color: var(--ink-3); line-height: 1; }
.cal-cell .v { font-size: 18px; font-weight: 900; line-height: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.cal-cell.blank { background: transparent; border-color: transparent; }
/* 达标：实心绿 + 白字 + 金杯 = 填满的成就感 */
.cal-cell.done {
  background: linear-gradient(165deg, #3EDDA6 0%, #16C288 70%, #0BA97A 100%);
  border-color: rgba(9,150,112,.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px -6px rgba(16,194,136,.7);
}
.cal-cell.done .d { color: rgba(255,255,255,.8); }
.cal-cell.done .v { color: #fff; text-shadow: 0 1px 3px rgba(0,110,75,.4); }
.cal-cell.done .cup {
  position: absolute; top: 2px; right: 3px; font-size: 11px; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,110,75,.5));
}
/* 未达标：浅红 + 大红数字（已学个数） */
.cal-cell.miss { background: linear-gradient(180deg, #FFF0F2, #FFE9EC); border-color: rgba(255,107,126,.4); }
.cal-cell.miss .v { color: #E5484D; }
.cal-cell.future { opacity: .38; }
.cal-cell.today { box-shadow: 0 0 0 2px var(--blue), 0 6px 14px -8px rgba(46,155,255,.9); }
.cal-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 12px; padding-top: 11px; border-top: 1px dashed rgba(46,120,200,.18); }
.cl-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.cl-sw { width: 15px; height: 15px; border-radius: 5px; flex: none; }
.cl-sw.g { background: linear-gradient(165deg, #3EDDA6, #16C288); border: 1px solid rgba(9,150,112,.55); }
.cl-sw.r { background: #FFE9EC; border: 1px solid rgba(255,107,126,.4); }
.cl-sw.n { background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.9); }

/* ---- 连续打卡奖章条（统计页左列下方） ---- */
.streak-strip {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-top: 16px;
  background: linear-gradient(135deg, rgba(255,249,236,.9), rgba(255,241,214,.75));
  border: 1px solid #FFE3B3; border-radius: 15px;
}
.streak-strip .medal-wrap { width: 52px; }
.streak-strip .num { font-size: 13px; margin-top: -16px; }
.streak-strip .cap { font-size: 7.5px; letter-spacing: 1px; }
.streak-strip .info { flex: 1; }
.streak-strip .t1 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 900; flex-wrap: wrap; }
.streak-strip .t1 .tier {
  padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 900; color: #fff;
  background: linear-gradient(140deg, var(--medal-a), var(--medal-b)); white-space: nowrap;
}
.streak-strip .t2 { font-size: 11.5px; font-weight: 700; color: var(--ink-2); margin-top: 5px; }
.streak-strip .t2 b { color: #E8890C; }
.streak-track { width: 150px; flex: none; }
.streak-track .bar { height: 8px; border-radius: 99px; background: rgba(232,137,12,.15); overflow: hidden; }
.streak-track .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #FFD08A, #F5B301); transition: width .45s ease; }
.streak-track .txt { font-size: 10.5px; font-weight: 700; color: var(--ink-2); margin-top: 4px; text-align: right; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ============ 奖章档位主题（青铜→白银→金牌→铂金→传说） ============ */
.medal-zone[data-tier="bronze"], .streak-strip[data-tier="bronze"] { --medal-a:#F2C49B; --medal-b:#B46B3E; --medal-glow:rgba(190,120,70,.35); }
.medal-zone[data-tier="bronze"] .medal-aura, .streak-strip[data-tier="bronze"] .medal-aura { animation: none; opacity: .5; }
.medal-zone[data-tier="silver"], .streak-strip[data-tier="silver"] { --medal-a:#FDFEFF; --medal-b:#A9B8C6; --medal-glow:rgba(180,200,220,.5); }
.medal-zone[data-tier="gold"], .streak-strip[data-tier="gold"] { --medal-a:#FFE38A; --medal-b:#F5B301; --medal-glow:rgba(255,190,40,.55); }
.medal-zone[data-tier="platinum"], .streak-strip[data-tier="platinum"] { --medal-a:#F2FAFF; --medal-b:#8FB4DE; --medal-glow:rgba(160,200,255,.65); }
.medal-zone[data-tier="platinum"] .medal-aura, .streak-strip[data-tier="platinum"] .medal-aura { animation-duration: 1.9s; }
.medal-zone[data-tier="legend"], .streak-strip[data-tier="legend"] { --medal-a:#FFD98A; --medal-b:#FF7AC8; --medal-glow:rgba(255,120,220,.6); }
.medal-zone[data-tier="legend"] .medal-aura, .streak-strip[data-tier="legend"] .medal-aura {
  background: conic-gradient(from 0deg, #FF6B7E, #FFB020, #2BE0A8, #59C8FF, #7B6BFF, #FF6B7E);
  animation: spin 5s linear infinite, aura 2.2s ease-in-out infinite;
  filter: blur(6px); opacity: .8;
}
@keyframes spin { to { transform: rotate(360deg); } }
.medal-zone[data-tier="legend"] .tier, .streak-strip[data-tier="legend"] .t1 .tier {
  background: linear-gradient(90deg,#FF6B7E,#FFB020,#2BE0A8,#59C8FF,#7B6BFF);
  background-size: 200% 100%; animation: slide 3s linear infinite;
}
@keyframes slide { to { background-position: 200% 0; } }

/* ============ 空状态 ============ */
.empty-box { text-align: center; padding: 46px 20px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty-box.small { padding: 26px 16px; }
.empty-ico { font-size: 42px; }
.empty-title { font-size: 15px; font-weight: 800; color: var(--ink-2); }
.empty-sub { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.empty-box .big-btn { margin-top: 12px; width: auto; padding: 12px 34px; }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(15,37,64,.45); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(560px, 94vw); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(158deg, #fff, #F3FAFF); border-radius: 24px; padding: 28px 30px;
  border: 1px solid rgba(255,255,255,.95); box-shadow: 0 30px 70px -20px rgba(15,37,64,.5);
  animation: modalIn .3s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 11px; border: none;
  background: rgba(15,60,110,.07); color: var(--ink-2); font-size: 14px; font-weight: 800; transition: .2s;
}
.modal-close:hover { background: var(--coral); color: #fff; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

.settings-card .card-block { margin-bottom: 20px; }
.block-title { font-size: 13.5px; font-weight: 800; margin-bottom: 10px; }
.tip-block { background: rgba(46,155,255,.07); border: 1px solid rgba(46,155,255,.18); border-radius: 14px; padding: 14px 16px; }
.tip-block p { font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }
.version-line { text-align: center; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .cols { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .roots-body { grid-template-columns: 240px 1fr; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100%; }
  .content { padding: 16px 14px 110px; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; width: auto; flex-direction: row;
    justify-content: space-around; padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.9); backdrop-filter: blur(18px); border-top: 1px solid rgba(255,255,255,.95);
    box-shadow: 0 -10px 30px -14px rgba(15,37,64,.3);
  }
  .nav-item { padding: 8px 10px; flex: 1; }
  .task-row, .idle-grid { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .quiz-options, .opt-grid { grid-template-columns: 1fr; }
  .roots-body { grid-template-columns: 1fr; }
  .root-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .root-item { flex: none; grid-template-columns: auto auto; }
  .root-mean { display: none; }
  .data-body { flex-direction: column; }
  .f-word { font-size: 40px; }
  .flash-face { padding: 18px 20px; }
  .flashcard.study-card .flash-front { min-height: min(38vh, 320px); }
  .flash-back {
    max-height: calc(100vh - 340px);
    max-height: calc(100dvh - 340px);
  }
  .learn-session { min-height: 60vh; }
  .fb-row { gap: 8px; }
  .fb-btn { height: 50px; font-size: 13.5px; }
}

/* ============================================================
 * 账号系统 · 登录门禁 / 顶栏菜单 / 账号弹窗（v9-login）
 * 类名统一 lg- 前缀，避免与现有 modal / avatar 等冲突
 * ============================================================ */

/* ---------- 头像渐变（10 个预设，顶栏与账号系统共用） ---------- */
.av-0  { background: linear-gradient(140deg, #59C8FF, #2E9BFF); }
.av-1  { background: linear-gradient(140deg, #A78BFA, #7C5CF0); }
.av-2  { background: linear-gradient(140deg, #4FD8C4, #0FB49B); }
.av-3  { background: linear-gradient(140deg, #FFB35A, #F5820B); }
.av-4  { background: linear-gradient(140deg, #7EDD8A, #2FAE5D); }
.av-5  { background: linear-gradient(140deg, #62D9F5, #1FA7C9); }
.av-6  { background: linear-gradient(140deg, #FFD25A, #E8A00B); }
.av-7  { background: linear-gradient(140deg, #FF9ED2, #E8619E); }
.av-8  { background: linear-gradient(140deg, #FF9E80, #F8503A); }
.av-9  { background: linear-gradient(140deg, #A9B7CE, #6C7FA3); }

/* ---------- 通用头像（账号系统） ---------- */
.lg-avatar {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 8px 16px -10px rgba(30,80,150,.5);
}
.lg-avatar svg { width: 24px; height: 24px; color: #fff; }

/* ---------- 顶栏：头像按钮 + 账号菜单 ---------- */
.av-wrap { position: relative; }
#topAvatar { border: none; padding: 0; transition: transform .15s; }
#topAvatar:hover { transform: scale(1.06); }
#topAvatar svg { width: 20px; height: 20px; color: #fff; }
.av-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 232px; z-index: 60;
  background: rgba(255,255,255,.97); border: 1px solid rgba(46,120,200,.18); border-radius: 16px;
  box-shadow: 0 24px 48px -18px rgba(15,37,64,.4); overflow: hidden;
  animation: lgIn .18s ease;
}
.av-menu-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(15,37,64,.08); }
.av-menu-txt { min-width: 0; }
.av-menu-name { font-size: 15px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-menu-sub { font-size: 10.5px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }
.av-menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border: none;
  background: none; font-family: inherit; font-size: 13px; font-weight: 800; color: var(--ink-2);
  cursor: pointer; text-align: left; transition: .12s;
}
.av-menu-item svg { width: 16px; height: 16px; flex: none; }
.av-menu-item:hover { background: #F2F9FF; color: var(--blue-d); }
.av-menu-item.danger { color: #E25A6E; }
.av-menu-item.danger:hover { background: #FFF2F4; color: #D14055; }
.av-menu-sep { height: 1px; background: rgba(15,37,64,.08); margin: 4px 0; }

/* ---------- 登录门禁 ---------- */
.lg-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 24px; overflow-y: auto;
  background: radial-gradient(1400px 900px at 50% -10%, #E4F1FF 0%, #CFE3F7 45%, #BED7EF 100%);
}
.lg-overlay.on { display: flex; animation: lgIn .25s ease; }
@keyframes lgIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.lg-card {
  width: min(400px, 100%); border: 1px solid rgba(255,255,255,.92); border-radius: 22px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(14px); padding: 26px 30px 24px;
  box-shadow: 0 22px 50px -28px rgba(30,80,150,.55), inset 0 1px 0 #fff;
}
.lg-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.lg-brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--blue-l), var(--blue) 55%, var(--blue-d));
  box-shadow: 0 10px 22px -8px rgba(46,155,255,.95), inset 0 1px 0 rgba(255,255,255,.45);
}
.lg-brand-mark svg { width: 21px; height: 21px; }
.lg-brand-name { font-size: 16px; font-weight: 900; letter-spacing: 1px; }
.lg-brand-sub { font-size: 10px; font-weight: 800; color: var(--blue-d); letter-spacing: 2px; margin-top: 1px; }
.lg-title { font-size: 18px; font-weight: 900; letter-spacing: 1px; }
.lg-sub { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 5px; letter-spacing: .5px; }

/* 下拉账号选择 */
.lg-dd { position: relative; margin-top: 18px; }
.lg-dd-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1.5px solid rgba(46,120,200,.28); border-radius: 15px; background: #F9FCFF;
  cursor: pointer; transition: .2s; font-family: inherit;
}
.lg-dd-btn:hover { border-color: rgba(46,155,255,.55); }
.lg-dd-btn.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,155,255,.15); background: #fff; }
.lg-dd-ph { flex: 1; text-align: left; font-size: 14.5px; font-weight: 700; color: var(--ink-3); }
.lg-dd-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.lg-dd-user .lg-dd-name { font-size: 15.5px; font-weight: 800; }
.lg-dd-chev { width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s; flex: none; }
.lg-dd.open .lg-dd-chev { transform: rotate(180deg); }
.lg-dd-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30;
  background: #fff; border: 1px solid rgba(46,120,200,.18); border-radius: 15px;
  box-shadow: 0 24px 48px -18px rgba(15,37,64,.4); overflow: hidden;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: .18s ease;
}
.lg-dd.open .lg-dd-list { opacity: 1; transform: none; pointer-events: auto; }
.lg-dd-scroll { max-height: 264px; overflow-y: auto; }
.lg-dd-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: none;
  border: none; cursor: pointer; font-family: inherit; transition: .12s; text-align: left;
}
.lg-dd-item:hover { background: #F2F9FF; }
.lg-dd-item .lg-avatar { width: 38px; height: 38px; border-radius: 12px; }
.lg-dd-item .lg-avatar svg { width: 21px; height: 21px; }
.lg-dd-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-dd-check { width: 17px; height: 17px; color: var(--blue); opacity: 0; flex: none; }
.lg-dd-item.sel .lg-dd-check { opacity: 1; }
.lg-dd-sep { height: 1px; background: rgba(15,37,64,.1); margin: 6px 0; }
.lg-dd-new { color: var(--blue-d); font-size: 13.5px; font-weight: 800; padding: 12px 16px; }
.lg-dd-new svg { width: 15px; height: 15px; flex: none; }
.lg-dd-empty { padding: 16px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }

/* PIN 区 */
.lg-pinzone { margin-top: 20px; transition: .25s; }
.lg-pinzone.lock { opacity: .4; pointer-events: none; filter: saturate(.3); }
.lg-dots { display: flex; gap: 16px; justify-content: center; margin: 4px 0 18px; }
.lg-dot { width: 15px; height: 15px; border-radius: 50%; background: rgba(15,37,64,.08); border: 2px solid rgba(15,37,64,.14); transition: .15s; }
.lg-dot.fill { background: linear-gradient(140deg, var(--blue-l), var(--blue)); border-color: transparent; transform: scale(1.1); }
.lg-dot.ok { background: var(--mint); border-color: transparent; }
.lg-dot.err { background: var(--coral); border-color: transparent; }
.lg-dots.shake { animation: lgShake .4s; }
@keyframes lgShake { 0%,100%{transform:none} 20%{transform:translateX(-9px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(4px)} }
.lg-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.lg-key {
  height: 56px; border-radius: 15px; border: 1px solid rgba(255,255,255,.9); background: rgba(255,255,255,.85);
  font-size: 22px; font-weight: 800; color: var(--ink); cursor: pointer;
  box-shadow: 0 8px 18px -12px rgba(30,80,150,.5), inset 0 1px 0 #fff; transition: .12s;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; display: grid; place-items: center;
}
.lg-key:hover { background: #fff; }
.lg-key:active { transform: scale(.94); background: rgba(46,155,255,.12); }
.lg-key.ghost { visibility: hidden; }
.lg-key.func { color: var(--blue-d); }

/* 记住我 */
.lg-remember { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; cursor: pointer; user-select: none; }
.lg-remember .lg-box {
  width: 20px; height: 20px; border-radius: 7px; border: 2px solid rgba(46,120,200,.35);
  display: flex; align-items: center; justify-content: center; transition: .15s; flex: none; margin-top: 1px;
}
.lg-remember.on .lg-box { background: linear-gradient(140deg, var(--blue-l), var(--blue)); border-color: transparent; }
.lg-remember .lg-box svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.4); transition: .15s; }
.lg-remember.on .lg-box svg { opacity: 1; transform: scale(1); }
.lg-remember span { font-size: 13px; font-weight: 700; }
.lg-remember small { display: block; font-size: 10.5px; font-weight: 700; color: var(--ink-3); margin-top: 1px; }

/* ---------- 账号弹窗 ---------- */
.lg-mask {
  position: fixed; inset: 0; background: rgba(15,37,64,.32); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 210; padding: 20px;
}
.lg-mask.on { display: flex; }
.lg-modal {
  width: min(380px, 100%); border-radius: 20px; background: rgba(255,255,255,.97);
  border: 1px solid #fff; padding: 24px; box-shadow: 0 30px 70px -20px rgba(15,37,64,.5);
  animation: lgIn .25s ease;
}
.lg-modal-title { font-size: 16.5px; font-weight: 900; text-align: center; }
.lg-modal-sub { font-size: 11px; font-weight: 700; color: var(--ink-3); text-align: center; margin-top: 4px; }
.lg-modal label { display: block; font-size: 11.5px; font-weight: 800; color: var(--ink-2); margin: 14px 0 6px; }
.lg-modal input[type="text"], .lg-modal input[type="password"] {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid rgba(46,120,200,.25);
  font-size: 15px; font-weight: 700; color: var(--ink); background: #F7FBFF; outline: none; transition: .2s;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 4px;
}
.lg-modal input[type="text"] { letter-spacing: 1px; font-family: inherit; }
.lg-modal input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(46,155,255,.15); }
.lg-modal-btns { display: flex; gap: 11px; margin-top: 20px; }
.lg-btn-primary {
  flex: 1; padding: 12px; border: none; border-radius: 14px; cursor: pointer;
  font-size: 14px; font-weight: 900; letter-spacing: 2px; color: #fff; font-family: inherit;
  background: linear-gradient(140deg, var(--blue-l) 0%, var(--blue) 55%, var(--blue-d) 100%);
  box-shadow: 0 14px 32px -12px rgba(46,155,255,.95), inset 0 1px 0 rgba(255,255,255,.45); transition: transform .15s;
}
.lg-btn-primary:active { transform: scale(.97); }
.lg-btn-ghost {
  flex: 1; padding: 12px; border-radius: 14px; border: 1px solid rgba(46,120,200,.25); background: #fff;
  color: var(--blue-d); font-size: 14px; font-weight: 800; cursor: pointer; font-family: inherit; transition: .15s;
}
.lg-btn-ghost:active { transform: scale(.97); }

/* 头像选择网格 */
.lg-av-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 18px; }
.lg-av-tile {
  aspect-ratio: 1; border-radius: 16px; border: none; cursor: pointer; padding: 0; position: relative;
  transition: .15s; display: grid; place-items: center;
}
.lg-av-tile svg { width: 52%; height: 52%; color: #fff; }
.lg-av-tile:hover { transform: translateY(-2px); }
.lg-av-tile.sel { outline: 3px solid var(--blue); outline-offset: 3px; }

@media (max-width: 560px) {
  .lg-card { padding: 22px 20px 20px; }
  .lg-key { height: 50px; }
}

/* ============ 定级问卷 ============ */
@keyframes svIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.sv-overlay {
  position: fixed; inset: 0; z-index: 220; display: grid; place-items: center;
  padding: 20px; background: rgba(10, 30, 55, .48); backdrop-filter: blur(6px);
}
.sv-overlay[hidden] { display: none; }
.sv-card {
  width: min(560px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--panel-strong); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.92); border-radius: 22px;
  box-shadow: 0 32px 70px -30px rgba(15,50,100,.55), inset 0 1px 0 #fff;
  padding: 26px 28px 24px; animation: svIn .3s ease;
}
.sv-kicker { font-size: 11px; font-weight: 800; color: var(--blue-d); letter-spacing: 2.5px; }
.sv-title { font-size: 21px; font-weight: 900; margin: 6px 0 4px; letter-spacing: .3px; }
.sv-sub { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.6; margin-bottom: 18px; }
.sv-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sv-progress .bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(46,120,200,.14); overflow: hidden; }
.sv-progress .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue-l), var(--blue)); transition: width .3s ease; }
.sv-progress .num { font-size: 12px; font-weight: 800; color: var(--ink-2); font-family: ui-monospace, "SF Mono", Menlo, monospace; white-space: nowrap; }
.sv-word { text-align: center; padding: 8px 0 16px; }
.sv-word b { display: block; font-size: 36px; font-weight: 900; letter-spacing: .5px; color: var(--ink); }
.sv-word span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-top: 4px; }
.sv-opts { display: flex; flex-direction: column; gap: 10px; }
.sv-opt {
  display: block; width: 100%; text-align: left; padding: 13px 16px; border-radius: 14px;
  background: rgba(255,255,255,.82); border: 1.5px solid rgba(46,120,200,.16);
  box-shadow: inset 0 1px 0 #fff; transition: .18s; cursor: pointer; font-family: inherit;
}
.sv-opt:hover { border-color: var(--blue); transform: translateY(-1px); }
.sv-opt b { display: block; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.sv-opt small { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 3px; }
.sv-opt:disabled { cursor: default; transform: none; }
.sv-opt.right { background: #E3FBF0; border-color: #2BE0A8; }
.sv-opt.right b, .sv-opt.right small { color: #0FA97E; }
.sv-opt.wrong { background: #FFEDF0; border-color: #FF6B7E; }
.sv-opt.wrong b, .sv-opt.wrong small { color: #E5484D; }
.sv-result { text-align: center; }
.sv-badge {
  width: 84px; height: 84px; margin: 12px auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px; font-weight: 900; color: #fff;
  background: linear-gradient(140deg, var(--blue-l), var(--blue));
  box-shadow: 0 16px 34px -12px rgba(46,155,255,.8), inset 0 2px 0 rgba(255,255,255,.35);
}
.sv-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 16px; }
.sv-chip { font-size: 12px; font-weight: 700; color: var(--ink-2); background: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.95); padding: 6px 14px; border-radius: 10px; }
.sv-note { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.65; background: rgba(46,155,255,.08); border: 1px solid rgba(46,155,255,.18); padding: 10px 14px; border-radius: 12px; text-align: left; }
.sv-btn {
  width: 100%; margin-top: 18px; padding: 13px; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 900; letter-spacing: 2px; color: #fff; font-family: inherit; cursor: pointer;
  background: linear-gradient(140deg, var(--blue-l) 0%, var(--blue) 55%, var(--blue-d) 100%);
  box-shadow: 0 14px 32px -12px rgba(46,155,255,.95), inset 0 1px 0 rgba(255,255,255,.45); transition: transform .15s;
}
.sv-btn:active { transform: scale(.97); }
@media (max-width: 560px) {
  .sv-card { padding: 20px 18px; }
  .sv-word b { font-size: 30px; }
}
