/* 扣子风格：默认红紫渐变 + 菱形纹理 + 白卡片（首页等全站） */

html {
  min-height: 100%;
}

body.app-root {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #16213e;
  /* 斜向渐变：fixed 贴视口，长页不随内容拉伸，避免与 fixed 纹理错位产生「横向拼缝」 */
  background: linear-gradient(125deg,
    #ff3b54 0%,
    #e11d48 22%,
    #a21caf 62%,
    #4c1d95 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
}

body.app-root::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  /* 细密菱形格纹：与 body 渐变同为 fixed，整页一体 */
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.04) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-attachment: fixed;
}

/* 排行榜页（body 由 Rankings 设 page-soft-shell）：紫粉→深紫渐变 + 菱形纹，与顶栏「排行榜」紫胶囊同系；fixed 防长页拼缝 */
body.app-root.page-soft-shell {
  background-color: #8029a8;
  background-image:
    radial-gradient(ellipse 100% 85% at 10% 15%, rgba(236, 72, 153, 0.22) 0%, transparent 52%),
    radial-gradient(ellipse 90% 70% at 92% 75%, rgba(99, 102, 241, 0.18) 0%, transparent 48%),
    linear-gradient(102deg,
      #b0269c 0%,
      #a21caf 32%,
      #8629ad 58%,
      #7029a3 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #16213e;
}

body.app-root.page-soft-shell::before {
  opacity: 0.28;
  background-size: 24px 24px;
  background-attachment: fixed;
}

/* 排行榜页标题区在深色底上：提高可读性 */
body.app-root.page-soft-shell .profile-page-head .profile-page-title,
body.app-root.page-soft-shell .rank-page-head .profile-page-title {
  color: #fafafa;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

body.app-root.page-soft-shell .profile-page-head .profile-page-lead,
body.app-root.page-soft-shell .rank-page-lead {
  color: #ede9fe;
}

body.app-root.page-soft-shell .profile-page-head .profile-back {
  color: #fde68a !important;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

body.app-root.page-soft-shell .profile-page-head .profile-back:hover {
  color: #fef9c3 !important;
}

/* 英雄资料 / 用户明细：全站默认红紫渐变底（不用排行榜紫底 page-soft-shell） */
body.app-root.page-profile {
  background: linear-gradient(125deg,
    #ff3b54 0%,
    #e11d48 22%,
    #a21caf 62%,
    #4c1d95 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.app-root.page-profile::before {
  opacity: 0.35;
  background-size: 24px 24px;
  background-attachment: fixed;
}

body.app-root.page-profile .main-shell {
  padding-top: 10px;
  padding-bottom: 32px;
}

body.app-root.page-profile .rank-page.profile-page,
body.app-root.page-profile .profile-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 4px 12px 32px;
}

.profile-hero-card .reward-hero-card__head {
  margin-bottom: 0;
}

.profile-hero-card__logo {
  background: linear-gradient(145deg, #fce7f3, #f472b6);
  border-color: #fbcfe8;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.28);
}

.profile-hero-card__logo--audit {
  background: linear-gradient(145deg, #e0e7ff, #818cf8);
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* 仅英雄词汇库页：固定全屏氛围渐变 + 点阵（长页无拼接缝）；需 body 带 .page-mastered-lib */
html:has(body.app-root.page-mastered-lib) {
  background: #12081f;
}

body.app-root.page-mastered-lib {
  min-height: 100vh;
  background-color: #12081f;
  background-image:
    radial-gradient(ellipse 140% 90% at 15% -10%, rgba(244, 63, 94, 0.55), transparent 58%),
    radial-gradient(ellipse 120% 85% at 95% 15%, rgba(99, 102, 241, 0.42), transparent 55%),
    radial-gradient(ellipse 100% 80% at 50% 110%, rgba(168, 85, 247, 0.35), transparent 52%),
    linear-gradient(160deg, #1a0b2e 0%, #12081f 28%, #0c1526 62%, #1a0828 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
}

body.app-root.page-mastered-lib::before {
  opacity: 0.32;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: 0 0;
  background-repeat: repeat;
  background-attachment: fixed;
}

body.app-root > form {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶栏 */
.top-bar {
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  padding: 10px 16px;
}

.top-bar-inner {
  max-width: min(1280px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

/* 全站顶栏「训练基地」链到 Home（各页无需再单独放返回） */
.nav-home-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 11px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.32) 0%, rgba(79, 70, 229, 0.26) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-home-ico {
  font-size: 1.15em;
  line-height: 1;
  flex-shrink: 0;
}

.nav-home-text {
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.nav-home-link:hover {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.45) 0%, rgba(99, 102, 241, 0.38) 100%);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 3px 12px rgba(79, 70, 229, 0.35);
  color: #fff !important;
}

.nav-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 200px;
  justify-content: center;
}

.nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* 顶栏右侧「英雄/管理员」身份：低调衬于深色条上（不用高饱和蓝红渐变） */
.top-bar .nav-user .nav-role-pill {
  flex-shrink: 1;
  min-width: 0;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #e2e8f0 !important;
}

.top-bar .nav-user .nav-role-pill--student {
  background: rgba(148, 163, 184, 0.12) !important;
  border-color: rgba(148, 163, 184, 0.18);
}

.top-bar .nav-user .nav-role-pill--admin {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(248, 113, 113, 0.18);
}

.user-tag {
  color: #e2e8f0;
  font-size: 13px;
}

.nav-logout,
.nav-login {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
}

.nav-logout:hover,
.nav-login:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 胶囊状态（顶栏） */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pill-ico { font-style: normal; margin-right: 2px; }

.pill-red {
  background: linear-gradient(180deg, #ff5c6c, #e11d48);
}

.pill-blue {
  background: linear-gradient(90deg, #7dd3fc, #3b82f6 45%, #1d4ed8);
}

/* 顶栏「选择 / 听写」计数：听写保持青绿；「选择」与年级对调配色后为蓝色（见 Site.Master 胶囊 class） */
.pill-green {
  background: linear-gradient(90deg, #2dd4bf, #22c55e 55%, #15803d);
}

.top-bar a.pill {
  outline: none;
}

.top-bar a.pill:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.pill-orange {
  background: linear-gradient(90deg, #fde047, #f59e0b 50%, #ea580c);
}

.pill-gold {
  font-size: 14px;
  line-height: 1.15;
  padding-top: 4px;
  padding-bottom: 4px;
  background: linear-gradient(180deg, #fcd34d, #f59e0b);
  box-shadow: 0 3px 0 #b45309;
}

/* 金色「战 绩」：顶栏 a.pill 默认白字会盖住，须单独提高对比度 */
.top-bar a.pill.pill-gold,
.top-bar a.pill.pill-gold:link,
.top-bar a.pill.pill-gold:visited,
.top-bar a.pill.pill-gold:hover,
.top-bar a.pill.pill-gold:active,
a.pill.pill-gold,
a.pill.pill-gold:link,
a.pill.pill-gold:visited,
a.pill.pill-gold:hover,
a.pill.pill-gold:active {
  color: #7c1d0a !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.pill-gold .pill-ico-gold {
  color: #c2410c;
  font-size: 1.05em;
  line-height: 1;
  text-shadow: 0 0 1px #fff, 0 1px 2px rgba(124, 45, 18, 0.45);
}

/* 排行榜入口胶囊 */
.pill-rank {
  background: linear-gradient(135deg, #c084fc, #9333ea 45%, #6b21a8);
  box-shadow: 0 2px 8px rgba(107, 33, 168, 0.35);
}

/* 排行榜表头：可点击排序 */
.rank-sort {
  color: inherit;
  text-decoration: none !important;
  font-weight: 800;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.rank-sort:hover {
  border-bottom-color: rgba(37, 99, 235, 0.4);
}

thead .rank-sort--on {
  border-bottom-color: #2563eb;
  color: #1d4ed8;
}

.rank-row--me {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.22), transparent);
}

.rank-page thead th {
  white-space: nowrap;
}

/* 排行榜页：与商城/战绩一致的卡片布局 */
body.app-root.page-rankings .main-shell {
  padding-top: 12px;
}

body.app-root.page-rankings .rank-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 4px 12px 32px;
}

.rank-hero-card__logo {
  background: linear-gradient(145deg, #fef3c7, #fbbf24);
  border-color: #fcd34d;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.rank-period-panel {
  margin-bottom: 12px;
}

.rank-period-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rank-period-tabs .rank-period-tab {
  text-align: center;
  padding: 10px 6px;
  font-size: 13px;
  border-radius: 12px;
}

.rank-period-desc {
  margin: 10px 2px 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.rank-sort-panel {
  margin-bottom: 14px;
}

.rank-sort-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rank-sort-tabs .reward-tab {
  text-align: center;
  padding: 10px 8px;
  font-size: 13px;
  border-radius: 12px;
}

.rank-list-card {
  padding: 12px 14px 16px;
  margin-bottom: 0;
}

.rank-list-card .profile-table-wrap {
  margin: 0;
}

/* 排行榜页：与顶栏留白收紧；返回与标题同一行，标题在整行内居中（旧结构保留兼容） */
body.app-root.page-soft-shell .main-shell {
  padding-top: 10px;
  padding-bottom: 32px;
}

.rank-page.profile-page {
  padding-top: 4px;
  padding-bottom: 32px;
}

.rank-page-head {
  margin-bottom: 12px;
}

.rank-page-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  min-height: 2.5rem;
}

.rank-page-head-row .profile-back {
  justify-self: start;
  margin-bottom: 0;
}

.rank-page-head-row .profile-page-title {
  grid-column: 2;
  margin: 0;
  text-align: center;
  justify-self: center;
  max-width: min(420px, 52vw);
  line-height: 1.2;
}

.rank-page-head-balance {
  grid-column: 3;
  min-width: 0;
}

.rank-page-lead {
  margin-top: 10px;
}

/* 排行榜说明：突出「听写已掌握」「选择题已掌握」与「点击表头」 */
.rank-page-lead .rank-lead-metric {
  font-size: 1.1em;
  font-weight: 800;
}

.rank-page-lead .rank-lead-sort-hint {
  font-size: 1.06em;
  font-weight: 800;
}

.rank-page-lead .rank-lead-sort-hint strong {
  font-weight: 800;
}

/* 排名列：奖牌 + 序号 */
.rank-table .rank-col-pos,
.rank-table .rank-pos-cell {
  width: 4.25em;
  text-align: center;
  white-space: nowrap;
}

.rank-pos-cell {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.rank-table .rank-medal {
  display: inline-block;
  margin-right: 3px;
  font-size: 1.2em;
  line-height: 1;
  vertical-align: -0.12em;
}

.rank-table .rank-metric-xp {
  font-weight: 700;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}

/* 手机端：表头隐藏时仍可用上方排序卡片切换 */
.rank-mobile-sort {
  display: none;
}

@media (max-width: 640px) {
  .rank-period-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rank-period-tabs .rank-period-tab {
    font-size: 12px;
    padding: 9px 5px;
  }

  .rank-period-desc {
    font-size: 11px;
    margin-top: 8px;
  }

  .rank-sort-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rank-sort-tabs .reward-tab {
    font-size: 12px;
    padding: 9px 6px;
  }

  .reward-hero-card__toolbar--quick {
    justify-content: flex-end;
    border-bottom: 1px solid #e8ecf4;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .rank-hero-card .reward-hero-card__head {
    margin-bottom: 0;
  }

  .rank-hero-card {
    padding: 12px 14px 14px;
  }

  /* 手机端隐藏「电脑端可点击表头…」说明，减少占行 */
  .rank-hero-card .reward-hero-card__hint {
    display: none;
  }

  body.app-root.page-rankings .rank-list-card.box {
    padding: 12px 10px 14px;
  }

  .rank-table-wrap {
    overflow-x: visible;
  }

  .rank-page .profile-user-table.rank-table {
    min-width: 0;
    width: 100%;
    table-layout: auto;
  }

  .rank-page .rank-table thead {
    display: none;
  }

  .rank-page .rank-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 14px;
    border-radius: 14px;
    border: 2px solid #dbeafe;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.1);
  }

  .rank-page .rank-table tbody tr:last-child {
    margin-bottom: 0;
  }

  /* 前三名：金 / 银 / 铜（非本人时） */
  .rank-page .rank-table .rank-row--top1:not(.rank-row--me) {
    border-color: #fbbf24;
    box-shadow: 0 6px 22px rgba(245, 158, 11, 0.22);
  }

  .rank-page .rank-table .rank-row--top1:not(.rank-row--me) .rank-pos-cell {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 55%, #fff 100%);
  }

  .rank-page .rank-table .rank-row--top2:not(.rank-row--me) {
    border-color: #94a3b8;
    box-shadow: 0 5px 18px rgba(100, 116, 139, 0.18);
  }

  .rank-page .rank-table .rank-row--top2:not(.rank-row--me) .rank-pos-cell {
    background: linear-gradient(135deg, #f1f5f9 0%, #f8fafc 55%, #fff 100%);
  }

  .rank-page .rank-table .rank-row--top3:not(.rank-row--me) {
    border-color: #fb923c;
    box-shadow: 0 5px 18px rgba(234, 88, 12, 0.16);
  }

  .rank-page .rank-table .rank-row--top3:not(.rank-row--me) .rank-pos-cell {
    background: linear-gradient(135deg, #ffedd5 0%, #fff7ed 55%, #fff 100%);
  }

  /* 排名、英雄：通栏 */
  .rank-page .rank-table .rank-pos-cell,
  .rank-page .rank-table .rank-hero-cell {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: none;
    box-sizing: border-box;
  }

  .rank-page .rank-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: auto !important;
    max-width: none;
    padding: 10px 12px;
    text-align: right;
    border: none;
    border-bottom: 1px solid #eef2f7;
    box-sizing: border-box;
  }

  /* 名字后：两列网格（年级|积分、等级|闯关、选择|听写），标题左、数值右 */
  .rank-page .rank-table tbody td.rank-cell-grid {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100% !important;
    padding: 9px 10px;
    text-align: right;
    border-right: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    font-variant-numeric: tabular-nums;
  }

  .rank-page .rank-table tbody td.rank-cell-grid:nth-child(even) {
    border-right: none;
  }

  .rank-page .rank-table tbody td.rank-metric-dict {
    border-bottom: none;
  }

  .rank-page .rank-table tbody td.rank-cell-grid::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    text-align: left;
  }

  .rank-page .rank-table .rank-pos-cell {
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 70%, #fff 100%);
    font-size: 1.15rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
  }

  .rank-page .rank-table .rank-pos-cell .rank-medal {
    font-size: 1.45em;
  }

  .rank-page .rank-table .rank-pos-cell::before {
    display: none;
  }

  .rank-page .rank-table .rank-hero-cell {
    justify-content: space-between;
    font-weight: 800;
    font-size: 1.08rem;
    color: #0f172a;
    text-align: right;
    background: #f8fafc;
    padding-top: 11px;
    padding-bottom: 11px;
    border-bottom: 1px solid #e2e8f0;
  }

  .rank-page .rank-table .rank-hero-cell::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: #1e3a8a;
    text-align: left;
  }

  .rank-page .rank-table .rank-metric-xp {
    font-weight: 700;
    color: #b45309;
  }

  .rank-page .rank-table .rank-metric-mc {
    font-weight: 700;
    color: #2563eb;
  }

  .rank-page .rank-table .rank-metric-dict {
    font-weight: 700;
    color: #059669;
  }

  /* 本人卡片：琥珀高亮，与前三名奖牌色区分 */
  .rank-page .rank-table .rank-row--me {
    position: relative;
    border-color: #f59e0b;
    border-width: 2px;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 42%);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.28), inset 0 0 0 1px rgba(253, 224, 71, 0.45);
  }

  .rank-page .rank-table .rank-row--me::after {
    content: "我";
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 4px 11px 5px 14px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 0 12px 0 10px;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
    pointer-events: none;
  }

  .rank-page .rank-table .rank-row--me .rank-pos-cell {
    background: linear-gradient(135deg, #fde68a 0%, #fef3c7 45%, #fffbeb 100%);
    border-bottom-color: #fcd34d;
  }

  .rank-page .rank-table .rank-row--me .rank-hero-cell {
    background: linear-gradient(90deg, #fffbeb, #fff);
  }

  .rank-page .rank-table .rank-row--me .rank-hero-cell::before {
    color: #b45309;
  }
}

@media (max-width: 480px) {
  .rank-page-head-row .profile-page-title {
    font-size: 1.35rem;
    max-width: 46vw;
  }

  .rank-page-head-row .profile-back {
    font-size: 13px;
  }
}

/* 顶栏一排：小圆角矩形（非全圆胶囊），颜色仍用各 .pill-* 渐变 */
.top-bar .pill,
.top-bar button.pill-click {
  border-radius: 8px;
}

/* 统计胶囊为链接时保持外观（含 :link/:visited，避免浏览器默认下划线） */
.top-bar a.pill,
.top-bar a.pill:link,
.top-bar a.pill:visited,
.top-bar a.pill:hover,
.top-bar a.pill:active,
a.pill,
a.pill:link,
a.pill:visited {
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-underline-offset: 0 !important;
  cursor: pointer;
  color: #fff !important;
}

a.pill:hover {
  filter: brightness(1.08);
  text-decoration: none !important;
  color: #fff !important;
}

/* —— 电脑端：顶栏单行、整体居中聚拢（左右不贴边）；教材名完整显示 —— */
@media (min-width: 1025px) {
  .top-bar-inner {
    flex-wrap: nowrap;
    justify-content: center;
    max-width: 100%;
    gap: 8px 10px;
  }

  .nav-home-link {
    flex-shrink: 0;
  }

  .nav-pills-wrap {
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: center;
    overflow: visible;
  }

  /* 覆盖 .pill 默认 max-width:220px，教材等功能胶囊显示全称 */
  .nav-pills-wrap > .pill,
  .nav-pills-wrap > button.pill-click,
  .nav-pills-wrap > a.pill {
    flex-shrink: 0;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  .nav-user {
    margin-left: 0;
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
  }

  /* 仅用户名过长时省略，避免整行被撑破 */
  .nav-user .nav-role-pill {
    max-width: 220px;
  }
}

/* —— 手机 / 窄屏：顶栏两行 + 主区贴边（须放在 .pill 基础样式之后，避免被覆盖） —— */
@media (max-width: 1024px) {
  .top-bar {
    padding: 6px 6px 8px;
  }

  .top-bar-inner {
    display: grid;
    max-width: none;
    width: 100%;
    /* 第二列可收缩，避免 grid 子项 min-width:auto 把整行撑破导致胶囊换行 */
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 6px 8px;
    align-items: center;
  }

  /* 第一行：训练基地 + 学号/退出（与 DOM 顺序无关，用网格固定位置） */
  .nav-home-link {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    font-size: 13px;
    padding: 6px 11px 6px 9px;
    gap: 5px;
    max-width: 42vw;
  }

  .nav-home-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-home-ico {
    font-size: 1.1em;
  }

  .nav-user {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .nav-user .nav-role-pill {
    font-size: 11px;
    padding: 5px 9px;
    max-width: min(56vw, 200px);
  }

  .user-tag {
    font-size: 12px;
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-logout,
  .nav-login {
    padding: 5px 10px;
    font-size: 12px;
    flex-shrink: 0;
  }

  /* 第二行：教材类胶囊自动换行（约两行），避免横向滑动 */
  .nav-pills-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: visible;
    overflow-y: visible;
    padding: 4px 2px 6px;
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .top-bar .pill,
  .nav-pills-wrap .pill {
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    flex: 0 0 auto;
    font-size: 12px;
    padding: 6px 10px;
    line-height: 1.2;
  }

  /* 战绩略大一号，收紧行高/上下边距，避免顶栏第二行被撑高 */
  .top-bar .pill.pill-gold,
  .nav-pills-wrap .pill.pill-gold,
  .top-bar .pill.pill-shop,
  .nav-pills-wrap .pill.pill-shop {
    font-size: 13px;
    line-height: 1.12;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .nav-pills-wrap > a.pill,
  .nav-pills-wrap > button.pill-click,
  .nav-pills-wrap > span.pill {
    flex: 0 0 auto;
  }

  .main-shell {
    padding: 10px 6px 28px;
  }

  .box {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 18px 12px;
    border-radius: 14px;
  }

  .hero-card {
    max-width: none;
    width: 100%;
    padding: 16px 10px 20px;
  }

  body.app-root.page-home .main-shell {
    padding-top: 8px;
  }

  body.app-root.page-home .hero-card {
    padding-top: 10px;
    padding-bottom: 18px;
  }

  .hero-mascot {
    width: 88px;
    height: 88px;
    margin-top: 4px;
    margin-bottom: 12px;
  }

  .hero-actions {
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: stretch;
    margin-top: 4px;
    max-width: none;
    width: 100%;
  }

  .hero-btn {
    padding: 12px 8px;
    font-size: 14px;
    border-radius: 12px;
  }

  .auth-spidey-wrap {
    max-width: none;
    width: 100%;
    padding: 0 2px;
    box-sizing: border-box;
  }

  .auth-spidey-card-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  body.app-root.page-auth-spidey .main-shell {
    padding-left: 6px;
    padding-right: 6px;
  }

  .stats-quest {
    max-width: none;
    padding: 0 2px;
  }

  .stats-quest-hero,
  .stats-quest-cal-card,
  .stats-quest-day-card,
  .stats-quest-detail-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .mastered-lib {
    max-width: none;
    padding: 0 2px;
  }

  .mastered-lib-hero {
    margin-left: -6px;
    margin-right: -6px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .mastered-lib-body.box {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* 排行榜列表区：与英雄词汇库白卡片内边距一致，避免表格外圈留白过大 */
  body.app-root.page-rankings .rank-page,
  body.app-root.page-rankings .profile-page,
  body.app-root.page-profile .rank-page.profile-page,
  body.app-root.page-profile .profile-page {
    padding-left: 2px;
    padding-right: 2px;
  }

  body.app-root.page-rankings .rank-list-card.box {
    padding: 12px 10px 14px;
  }

  .word-quiz-shell {
    max-width: none !important;
  }

  .box.word-quiz-shell {
    padding-top: 8px;
  }

  .word-quiz-topbar {
    gap: 4px 6px;
    padding: 0 2px 8px;
    grid-template-rows: 26px;
  }

  .word-quiz-title-inline {
    font-size: 13px;
  }

  .word-quiz-progress-wrap {
    font-size: 12px;
  }

  .word-quiz-progress-hint-long {
    display: none;
  }

  .word-quiz-progress-hint-short {
    display: inline;
  }

  .word-quiz-topbar-actions {
    min-height: 24px;
  }

  .word-quiz-next-btn.button,
  input.word-quiz-next-btn.button,
  button.word-quiz-next-btn.button,
  .word-quiz-topbar-actions input.dict-submit-btn.button {
    padding: 2px 8px !important;
    font-size: 12px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    height: 24px !important;
  }
}

/* 单词测验顶栏：手机端不显示「未掌握」说明，保持单行三列不额外占高 */
@media (max-width: 640px) {
  .box.word-quiz-shell {
    padding-top: 6px;
  }

  .word-quiz-topbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: 26px;
    gap: 4px 6px;
    padding: 0 2px 8px;
  }

  .word-quiz-title-inline {
    grid-column: 1;
    grid-row: 1;
    font-size: 13px;
  }

  .word-quiz-progress-wrap {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    font-size: 12px;
    white-space: nowrap;
  }

  .word-quiz-topbar-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .word-quiz-progress-hint {
    display: none !important;
  }

  .word-quiz-next-btn.button,
  input.word-quiz-next-btn.button,
  button.word-quiz-next-btn.button,
  .word-quiz-topbar-actions input.dict-submit-btn.button {
    padding: 2px 8px !important;
    font-size: 12px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    height: 24px !important;
  }

  .word-quiz-topbar-actions {
    min-height: 24px;
  }
}

/* 主内容区 */
.main-shell {
  flex: 1;
  padding: 24px 16px 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 通用白卡片 */
.box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 24px 28px;
  max-width: 960px;
  margin: 0 auto 20px;
  box-sizing: border-box;
}

/* 首页：顶栏与白卡片、标题区留白收紧 */
body.app-root.page-home .main-shell {
  padding-top: 12px;
}

/* 首页主视觉卡片（电脑端宽度与排行榜 .rank-page / .box 一致） */
.hero-card {
  text-align: center;
  max-width: 960px;
  width: 100%;
  padding: 32px 28px 36px;
}

body.app-root.page-home .hero-card {
  padding-top: 16px;
  padding-bottom: 32px;
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

body.app-root.page-home .hero-head {
  margin-bottom: 4px;
}

.hero-icon {
  font-size: 28px;
  line-height: 1;
}

.hero-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1e1b4b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-sub {
  margin: 0 0 14px;
  font-size: 15px;
  color: #475569;
}

body.app-root.page-home .hero-sub {
  margin-bottom: 10px;
}

/* 首页：未解锁英雄（扣子风，掌握词数 &lt; 100） */
.home-hero-locked {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 28px 40px;
  text-align: center;
  border-radius: 20px;
  border: 4px solid #e63946;
  background: linear-gradient(165deg, #ffffff 0%, #eff6ff 55%, #f8fafc 100%);
  box-shadow: 0 12px 40px rgba(30, 27, 75, 0.12);
  overflow: hidden;
}

.home-hero-locked__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #e63946, #fff, #1d3557);
}

.home-hero-locked__deco {
  position: absolute;
  opacity: 0.18;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.home-hero-locked__deco--tr {
  top: 12px;
  right: 16px;
  font-size: 3.5rem;
}

.home-hero-locked__deco--bl {
  bottom: 12px;
  left: 16px;
  font-size: 2.5rem;
}

.home-hero-locked__icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ef4444, #dc2626);
  border: 4px solid #fff;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  line-height: 1;
}

.home-hero-locked__title {
  margin: 0 0 12px;
  font-size: 1.65rem;
  font-weight: 800;
  color: #dc2626;
}

.home-hero-locked__msg {
  margin: 0 0 24px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #475569;
}

.home-hero-locked__msg strong {
  color: #1e293b;
}

.home-hero-locked__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(180deg, #dc2626, #b91c1c);
  border: 2px solid #f87171;
  box-shadow: 0 6px 18px rgba(185, 28, 28, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-hero-locked__btn:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(185, 28, 28, 0.45);
}

.home-hero-locked__btn-ico {
  font-size: 1.35rem;
  line-height: 1;
}

/* 首页：战绩四格（浅色，融入白卡片） */
.home-quest-stats {
  margin: 0 0 18px;
  padding: 12px 10px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.home-quest-stats__cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
}

.home-stat-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 88px;
  flex: 1 1 88px;
  max-width: 140px;
  padding: 10px 12px 9px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(30, 27, 75, 0.06);
}

.home-stat-chip-k {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.03em;
}

.home-stat-chip-v {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e1b4b;
  margin-top: 4px;
  line-height: 1.2;
}

.home-stat-chip--lv .home-stat-chip-v {
  color: #2563eb;
}

.home-stat-chip--xp .home-stat-chip-v {
  color: #ca8a04;
}

.home-stat-chip--days .home-stat-chip-v {
  color: #ea580c;
}

/* 靶心装饰 */
.hero-mascot {
  width: 120px;
  height: 120px;
  margin: 8px auto 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #38bdf8 0%, #0ea5e9 35%, #0369a1 100%);
  box-shadow: inset 0 -6px 16px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(14, 165, 233, 0.45);
  position: relative;
}

.hero-mascot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 6px #e11d48, 0 0 0 10px #fff, 0 0 0 14px #e11d48;
  background: radial-gradient(circle at 45% 40%, #fecaca 0%, #ef4444 40%, #b91c1c 100%);
}

.hero-mascot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 44%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #1e3a8a;
  box-shadow: 12px 10px 0 -2px #1e40af;
}

.hero-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
  margin-top: 8px;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.hero-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 14px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none !important;
  color: #fff !important;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: transform .12s, box-shadow .12s;
  box-sizing: border-box;
  text-align: center;
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12), 0 12px 28px rgba(0, 0, 0, 0.25);
}

.hero-btn-red {
  background: linear-gradient(180deg, #ff5c6c, #dc2626);
}

.hero-btn-blue {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.hero-btn-green {
  background: linear-gradient(180deg, #34d399, #059669);
}

/* 单词学习 + 单词测试 并排一行，词汇量测试独占下一行（全端与手机端一致） */
.hero-actions--triple {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  max-width: 520px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  flex-direction: unset;
  flex-wrap: unset;
}

.hero-actions--triple .hero-btn {
  flex: none;
  width: auto;
  min-width: 0;
  font-size: 15px;
  padding: 14px 10px;
}

.hero-actions--triple .hero-btn-green {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .hero-actions--triple {
    gap: 8px;
    max-width: none;
  }

  .hero-actions--triple .hero-btn {
    padding: 12px 8px;
  }
}

.vocab-stage-actions .quiz-mode-choice {
  width: 100%;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.quiz-mode-choice-vocab-primary {
  background: linear-gradient(135deg, #22c55e, #15803d) !important;
}

.quiz-mode-choice-vocab-junior {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
}

.quiz-mode-choice-vocab-senior {
  background: linear-gradient(135deg, #a78bfa, #6d28d9) !important;
}

.console-card h3 {
  margin-top: 0;
  color: #1e1b4b;
  font-size: 1.1rem;
}

.page-foot {
  text-align: center;
  padding: 8px 16px 24px;
}

.page-foot a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  text-decoration: underline;
}

.page-foot a:hover {
  color: #fff;
}

.home-hint {
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  margin: 0 16px 8px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* 首页大按钮：支持 button 与 a 同款（勿设 width:auto，否则与 a 标签 flex 分栏时易一大一小） */
button.hero-btn {
  border: none;
  outline: none;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  flex: 1 1 0;
}

button.hero-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

/* 首页 — 测验模式弹窗（用 ID 提高优先级，避免 role=dialog 等把 display 改成 block 导致整段铺在页面下方） */
#modalQuizMode.quiz-mode-modal {
  display: none !important;
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  flex-direction: row;
}

#modalQuizMode.quiz-mode-modal.is-open {
  display: flex !important;
}

.quiz-mode-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.quiz-mode-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 22px;
  padding: 28px 22px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  text-align: center;
  box-sizing: border-box;
}

.quiz-mode-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(145deg, #60a5fa, #7c3aed);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.quiz-mode-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.quiz-mode-sub {
  margin: 0 0 22px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.quiz-mode-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-mode-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  text-decoration: none !important;
  color: #fff !important;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: transform .12s, filter .12s;
}

.quiz-mode-choice:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.quiz-mode-choice-mc {
  background: linear-gradient(135deg, #f43f5e, #b91c1c);
}

.quiz-mode-choice-dict {
  background: linear-gradient(135deg, #6366f1, #7c3aed 55%, #5b21b6);
}

.quiz-mode-choice-ico {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.quiz-mode-choice-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.quiz-mode-choice-line1 {
  font-size: 17px;
  font-weight: 800;
}

.quiz-mode-choice-line2 {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.95;
  line-height: 1.35;
}

.quiz-mode-cancel {
  margin-top: 18px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px;
  font-family: inherit;
}

.quiz-mode-cancel:hover {
  color: #334155;
}

/* 单词测验：UpdatePanel 异步区外包层 + 请求中轻微遮罩（非整页白屏） */
.word-quiz-page-wrap {
  position: relative;
}

.word-quiz-page-wrap--busy .box.word-quiz-shell {
  opacity: 0.96;
  transition: opacity 0.12s ease;
}

.word-quiz-btn--pending,
.word-quiz-page-wrap--busy .dict-submit-btn,
.word-quiz-page-wrap--busy .word-quiz-next-btn {
  opacity: 0.72;
  pointer-events: none;
  cursor: wait;
}

.word-quiz-busy-toast {
  font-size: 14px;
  font-weight: 700;
  color: #1e40af;
}

.word-quiz-busy-toast--fixed {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 99997;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #bfdbfe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
  pointer-events: none;
}

.word-quiz-page-wrap .word-quiz-busy-toast:not(.word-quiz-busy-toast--fixed) {
  display: none;
}

.word-quiz-async-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 99998;
  pointer-events: none;
  background: linear-gradient(90deg, #93c5fd, #2563eb 40%, #60a5fa);
  background-size: 220% 100%;
  animation: word-quiz-async-shimmer 0.7s linear infinite;
}

@keyframes word-quiz-async-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* 单词测验白卡片：收紧标题上方留白 */
.box.word-quiz-shell {
  padding-top: 12px;
}

/* 单词测验 — 顶栏：左标题 | 中进度 | 右下一题（三列网格，网页端进度居中） */
.word-quiz-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: 28px;
  align-items: center;
  gap: 6px 10px;
  padding: 2px 2px 10px;
  margin: 0 0 14px;
  border-bottom: 1px solid #e8ecf4;
  box-sizing: border-box;
}

.word-quiz-title-inline {
  grid-column: 1;
  justify-self: start;
  text-align: left;
  font-weight: 800;
  font-size: 15px;
  color: #1e1b4b;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-quiz-progress-wrap {
  grid-column: 2;
  justify-self: center;
  font-size: 14px;
  color: #64748b;
  text-align: center;
  white-space: nowrap;
}

.word-quiz-topbar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  flex-shrink: 0;
  /* 答题前也占位，避免「下一题」出现后整行被 input 默认高度撑高 */
  min-height: 26px;
}

.word-quiz-progress-wrap strong {
  color: #0f172a;
  font-weight: 800;
}

/* 顶栏「下一题」「提交本题」：紧凑小号（同格切换，避免底栏遮挡） */
.word-quiz-next-btn.button,
input.word-quiz-next-btn.button,
button.word-quiz-next-btn.button,
.word-quiz-topbar-actions input.dict-submit-btn.button {
  margin: 0 !important;
  padding: 2px 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  min-height: 26px !important;
  max-height: 26px !important;
  height: 26px !important;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 2px 0 rgba(29, 78, 216, 0.85) !important;
}

.word-quiz-topbar-actions input.dict-submit-btn.button {
  box-shadow: 0 2px 0 #9f1239 !important;
}

.word-quiz-next-btn.button.secondary,
input.word-quiz-next-btn.button.secondary {
  box-shadow: 0 2px 0 #1d4ed8 !important;
}

.word-quiz-progress-done {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
}

.word-quiz-progress-hint {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.word-quiz-progress-hint-short {
  display: none;
}

/* 测验完成 — 扣子风格结果页 */
.word-quiz-shell.quiz-summary-mode {
  max-width: 640px;
}

.quiz-result-wrap {
  margin: 0 0 8px;
}

.quiz-result-hero {
  text-align: center;
  margin-bottom: 20px;
}

.quiz-result-hero-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #4ade80, #16a34a);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.35);
}

.quiz-result-hero-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
}

.quiz-result-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.quiz-result-stat {
  flex: 1 1 100px;
  max-width: 160px;
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.quiz-result-stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.quiz-result-stat-lbl {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
  opacity: 0.95;
}

.quiz-result-stat--ok {
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  color: #047857;
}

.quiz-result-stat--bad {
  background: linear-gradient(180deg, #fef2f2, #fecaca);
  color: #b91c1c;
}

.quiz-result-stat--mst {
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.quiz-result-accuracy {
  text-align: center;
  font-size: 14px;
  color: #64748b;
  margin: 0 0 20px;
}

.quiz-result-accuracy strong {
  color: #0f172a;
}

/* 错误明细：默认折叠（HTML5 details） */
.quiz-result-wrong {
  margin-bottom: 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8ecf4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.quiz-result-wrong-sum {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
  user-select: none;
}

.quiz-result-wrong-sum::-webkit-details-marker {
  display: none;
}

.quiz-result-wrong-sum::after {
  content: "▼";
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
  transition: transform .2s;
}

.quiz-result-wrong[open] .quiz-result-wrong-sum::after {
  transform: rotate(-180deg);
}

.quiz-result-wrong-ico {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-result-wrong-body {
  padding: 0 16px 14px;
  border-top: 1px solid #f1f5f9;
}

.quiz-result-empty {
  margin: 12px 0;
  color: #64748b;
  font-size: 14px;
}

.quiz-result-wrong-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.quiz-result-wrong-row:last-child {
  border-bottom: none;
}

.quiz-result-wrong-main strong {
  color: #0f172a;
  font-weight: 800;
}

.quiz-result-wrong-meta {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.quiz-result-wrong-pick {
  color: #64748b;
  font-size: 13px;
  text-align: right;
  flex-shrink: 0;
}

.quiz-result-wrong-pick span {
  color: #dc2626;
  font-weight: 700;
}

/* 答题详情 */
.quiz-result-detail-card {
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8ecf4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  overflow: hidden;
}

.quiz-result-detail-h {
  padding: 14px 16px;
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
}

.quiz-result-detail-scroll {
  max-height: 280px;
  overflow-y: auto;
  padding: 8px 12px 12px;
}

.quiz-result-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 10px;
  font-size: 14px;
}

.quiz-result-detail-row:nth-child(even) {
  background: #f8fafc;
}

.quiz-result-detail-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.quiz-result-detail-ico--ok {
  background: #dcfce7;
  color: #16a34a;
}

.quiz-result-detail-ico--bad {
  background: #fee2e2;
  color: #dc2626;
}

.quiz-result-detail-txt {
  flex: 1;
  min-width: 0;
  color: #0f172a;
  font-weight: 600;
}

.quiz-result-detail-tr {
  color: #64748b;
  font-weight: 600;
  margin-left: 6px;
}

.quiz-result-detail-ix {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
  flex-shrink: 0;
}

.quiz-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 8px;
}

.quiz-result-btn {
  min-width: 140px;
  padding: 12px 22px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer;
  margin: 0 !important;
  box-shadow: none !important;
}

.quiz-result-btn-primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
}

.quiz-result-btn-secondary {
  background: linear-gradient(180deg, #6ee7b7, #34d399) !important;
  color: #065f46 !important;
  border: 1px solid #6ee7b7 !important;
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.35) !important;
}

.quiz-result-btn:disabled,
.quiz-result-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.word-quiz-shell .quiz-done {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 600;
  font-size: 15px;
}

/* —— 选择题模式（扣子风格：悬停蓝框浅底、选对绿/选错红、右侧勾叉、详情卡） —— */
.word-quiz-shell.mc-mode {
  max-width: 560px;
}

.mc-quiz-head {
  text-align: center;
  margin-bottom: 4px;
}

.mc-quiz-word {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.mc-quiz-phon {
  margin: 0 0 18px;
  font-size: 0.95rem;
  color: #64748b;
}

/* 音标 + 发音按钮（测验 / 学习共用 .es-speak-btn） */
.quiz-phon-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  vertical-align: middle;
}

.quiz-phon-row--mute .quiz-phon-text {
  opacity: 0.85;
}

.quiz-phon-text {
  font-family: "Segoe UI", "Lucida Sans Unicode", "Arial Unicode MS", sans-serif;
  letter-spacing: 0.02em;
}

.es-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(135deg, #60a5fa 0%, #6366f1 50%, #a855f7 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.45);
  transition: transform 0.1s, filter 0.12s;
}

.es-speak-btn:hover {
  filter: brightness(1.08);
}

.es-speak-btn:active {
  transform: scale(0.94);
}

.es-speak-ico {
  font-size: 16px;
  line-height: 1;
}

.dict-quiz-head {
  text-align: center;
  margin-bottom: 8px;
}

.dict-quiz-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.dict-quiz-phon-label {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.dict-quiz-phon {
  margin-top: 0;
}

.dict-fb {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
}

.dict-fb--ok {
  color: #15803d;
}

.dict-fb--wrong {
  color: #b91c1c;
}

.dict-fb-extra {
  margin: 0;
  font-size: 14px;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dict-fb-extra-k {
  font-weight: 700;
  color: #64748b;
}

/* 听写：释义 + 拼写格 + 提交 居中，与上方标题区一致 */
.word-quiz-shell--dict .dict-quiz-hint-wrap {
  text-align: center;
  margin: 12px 0 8px;
}

.word-quiz-shell--dict .dict-spell-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.dict-spell-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.dict-spell-submitted {
  width: 100%;
  text-align: center;
}

.dict-spell-submitted-line {
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}

.dict-spell-submitted .dict-spell-user {
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
}

/* 听写提交后：判题反馈（正确/再听发音等）居中 */
.word-quiz-shell--dict .dict-feedback-block {
  text-align: center;
  width: 100%;
  margin: 0 auto 16px;
  padding: 0 8px;
  box-sizing: border-box;
}

.word-quiz-shell--dict .dict-feedback-block .dict-fb {
  margin-left: auto;
  margin-right: auto;
}

.word-quiz-shell--dict .dict-feedback-block .dict-fb-extra {
  justify-content: center;
}

.dict-spell-label-row {
  width: 100%;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
}

.dict-tile-strip-root {
  width: 100%;
  display: flex;
  justify-content: center;
}

.dict-tile-strip {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.dict-tile-input {
  box-sizing: border-box;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  text-align: center;
  font-size: 1.28rem;
  font-weight: 800;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  background: #fafafa;
  color: #0f172a;
  text-transform: none;
  line-height: 1;
}

.dict-tile-input:focus {
  outline: none;
  border-color: #6366f1;
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: #fff;
}

.dict-tile--gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 2.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #64748b;
}

.dict-tile-focus-hint {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #6366f1;
  cursor: pointer;
  user-select: none;
}

/* 手机端：常用非字母字符一键输入（系统键盘仍由 inputmode= latin 尽量调起拉丁布局） */
.dict-touch-keys {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  padding: 6px 0 2px;
}

@media (max-width: 768px) {
  .dict-touch-keys {
    display: flex;
  }
}

.dict-touch-key {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 2px solid #c7d2fe;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  color: #312e81;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dict-touch-key:active {
  transform: scale(0.97);
  filter: brightness(0.96);
}

.dict-touch-key--space {
  min-width: 88px;
}

/* 听写：触摸设备页内英文键盘（readonly + inputmode=none） */
.dict-vk-root {
  display: none;
  width: 100%;
  max-width: 100%;
  margin: 10px 0 0;
  padding: 12px 10px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #dce8f4 0%, #c8d6e8 100%);
  border: 1px solid #a8b9ce;
  box-sizing: border-box;
}

.dict-vk-inner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.dict-vk-mode .dict-touch-keys {
  display: none !important;
}

.dict-vk-mode .dict-vk-root {
  display: block;
}

.dict-vk-topline {
  margin: 0 0 12px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.dict-vk-topline-hint {
  font-weight: 600;
  color: #475569;
  flex-shrink: 0;
}

.dict-vk-fallback-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.dict-vk-restore-wrap {
  width: 100%;
  text-align: center;
  margin: 10px 0 6px;
}

.dict-vk-restore-line {
  margin: 0 0 8px;
  font-size: 13px;
  color: #475569;
}

.dict-vk-restore-btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 2px solid #818cf8;
  background: #eef2ff;
  color: #312e81;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dict-vk-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 6px;
}

.dict-vk-row-actions {
  margin-bottom: 0;
  margin-top: 4px;
  gap: 6px;
}

.dict-vk-key {
  min-width: 30px;
  height: 38px;
  padding: 0 6px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 1px 0 #94a3b8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex: 0 0 auto;
}

.dict-vk-key:active {
  transform: scale(0.96);
  background: #e0e7ff;
}

.dict-vk-key--wide {
  min-width: 64px;
  font-size: 13px;
}

.dict-vk-key--sym {
  min-width: 36px;
  font-size: 16px;
}

.dict-tile--vk-sel {
  border-color: #6366f1 !important;
  border-style: solid !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35) !important;
  background: #eef2ff !important;
}

/* 听写 + 页内键盘：手机端收紧白卡片边距，键盘铺满且键位自适应不换行 */
@media (max-width: 768px) {
  .main-shell:has(.word-quiz-page-wrap) {
    padding-left: 5px;
    padding-right: 5px;
  }

  .main-shell .word-quiz-page-wrap .box.word-quiz-shell--dict {
    padding: 10px 6px 14px;
  }

  .dict-vk-mode .dict-vk-root {
    width: 100%;
    max-width: none;
    margin: 8px 0 0;
    padding: 10px 6px 12px;
    border-radius: 12px;
    background: linear-gradient(180deg, #d0e0f0 0%, #b8cce2 55%, #a8bdd4 100%);
    border-color: #8fa3bc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 2px 8px rgba(71, 85, 105, 0.1);
  }

  .dict-vk-topline {
    margin-bottom: 10px;
    font-size: 12px;
    gap: 4px;
  }

  .dict-vk-inner > .dict-vk-row {
    display: grid;
    width: 100%;
    gap: 5px;
    margin-bottom: 5px;
    justify-content: stretch;
  }

  .dict-vk-inner > .dict-vk-row:nth-of-type(1) {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .dict-vk-inner > .dict-vk-row:nth-of-type(2) {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  .dict-vk-inner > .dict-vk-row:nth-of-type(3) {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .dict-vk-inner > .dict-vk-row-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1.6fr);
    margin-bottom: 0;
  }

  .dict-vk-key {
    min-width: 0;
    width: 100%;
    height: 42px;
    padding: 0 2px;
    font-size: 18px;
    font-weight: 800;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 0 #cbd5e1;
    color: #0f172a;
  }

  .dict-vk-key--sym {
    font-size: 20px;
  }

  .dict-vk-key--wide {
    min-width: 0;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
  }

  .dict-vk-key:active {
    box-shadow: 0 1px 0 #94a3b8;
    transform: translateY(1px);
  }
}

@media (max-width: 640px) {
  .main-shell .word-quiz-page-wrap .box.word-quiz-shell--dict {
    padding: 8px 4px 12px;
  }

  .dict-vk-mode .dict-vk-root {
    padding: 8px 4px 10px;
  }

  .dict-vk-key {
    height: 40px;
    font-size: 17px;
  }
}

.dict-spell-hidden-input {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.dict-submit-btn.dict-submit--locked {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.mc-choice-panel {
  margin: 8px 0 16px;
}

.mc-quiz-ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Repeater 生成的 div 行（非 ul/li） */
.mc-quiz-ul > .mc-opt {
  margin: 0;
  padding: 0;
}

.mc-quiz-ul .mc-opt-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.mc-quiz-ul .mc-opt-label span.mc-opt-native {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.mc-quiz-ul .mc-opt-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.mc-quiz-ul .mc-opt-label--picked {
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

.mc-quiz-ul .mc-opt--locked .mc-opt-label {
  cursor: default;
  opacity: 0.88;
}

.mc-quiz-ul .mc-opt-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

/* 未锁定时：悬停蓝框 + 浅蓝底 */
.mc-quiz-ul:not(.mc-quiz-ul--locked) .mc-opt .mc-opt-label:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 1px 0 rgba(59, 130, 246, 0.15);
}

.mc-quiz-ul:not(.mc-quiz-ul--locked) .mc-opt .mc-opt-label:active {
  background: #dbeafe;
}

/* 答完后锁定 */
.mc-quiz-ul--locked .mc-opt .mc-opt-label {
  cursor: default;
}

.mc-quiz-ul--locked .mc-opt .mc-opt-label:hover {
  box-shadow: none;
}

/* 选对 */
.mc-quiz-ul .mc-opt.mc-opt--correct .mc-opt-label {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
}

.mc-quiz-ul .mc-opt.mc-opt--correct .mc-opt-label::after {
  content: "\2713";
  font-size: 1.2rem;
  font-weight: 800;
  color: #16a34a;
  line-height: 1;
  margin-left: 10px;
  flex-shrink: 0;
}

/* 选错 */
.mc-quiz-ul .mc-opt.mc-opt--wrong .mc-opt-label {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.mc-quiz-ul .mc-opt.mc-opt--wrong .mc-opt-label::after {
  content: "\2715";
  font-size: 1.1rem;
  font-weight: 800;
  color: #dc2626;
  line-height: 1;
  margin-left: 10px;
  flex-shrink: 0;
}

/* 其余选项弱化 */
.mc-quiz-ul .mc-opt.mc-opt--neutral .mc-opt-label {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #64748b !important;
  opacity: 0.92;
}

/* 答题后详情区 */
.mc-detail-wrap {
  margin-top: 4px;
}

.mc-detail {
  border-radius: 14px;
  padding: 16px 18px;
  border-width: 1px;
  border-style: solid;
  box-sizing: border-box;
}

.mc-detail--correct {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.mc-detail--wrong {
  background: #fef2f2;
  border-color: #fecaca;
}

.mc-detail-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
}

.mc-detail-col p {
  margin: 6px 0;
}

.mc-detail-k {
  color: #64748b;
  font-weight: 600;
}

.mc-detail-v {
  color: #0f172a;
  font-weight: 600;
}

@media (max-width: 520px) {
  .mc-detail-inner {
    grid-template-columns: 1fr;
  }
}

/* 表单按钮（内页） */
.button {
  background: #e11d48;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin: 4px;
  box-shadow: 0 3px 0 #9f1239;
}

.button:hover {
  filter: brightness(1.05);
}

.button.secondary {
  background: #2563eb;
  box-shadow: 0 3px 0 #1d4ed8;
}

.err { color: #b91c1c; margin: 8px 0; font-weight: 600; }

@media (max-width: 640px) {
  .nav-pills-wrap {
    justify-content: flex-start;
  }

  .nav-user {
    margin-left: 0;
    width: auto;
    justify-content: flex-end;
  }

  .hero-title {
    font-size: 1.35rem;
  }
}

/* 顶栏可点击胶囊（教材 / 年级） */
button.pill-click {
  cursor: pointer;
  font: inherit;
  border: none;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

button.pill-click:focus {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

/* 教材 / 年级（居中卡片弹窗）— 扣子风格，不依赖外层 flex 易失效的场景 */
.modal-root {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  min-height: 100%;
  z-index: 99999;
  box-sizing: border-box;
}

/* 教材：左侧白面板 + 右侧点击关闭区 */
.modal-root--drawer {
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-root--drawer:not(.is-open) {
  display: none !important;
}

.modal-root--drawer.is-open {
  display: flex !important;
}

.picker-sheet--drawer {
  width: 400px;
  max-width: 92vw;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 12px 0 48px rgba(0, 0, 0, 0.28);
  border-radius: 0 22px 22px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
}

.picker-dismiss {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

/* 教材抽屉：ID 提高优先级，避免 WebForms/浏览器默认把 aside 显示成无背景纯文字 */
#modalSeries aside.picker-sheet--drawer,
#modalSeries aside.picker-sheet.picker-sheet--drawer {
  background-color: #ffffff !important;
  background-image: none !important;
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-orient: vertical !important;
  -webkit-box-direction: normal !important;
  -ms-flex-direction: column !important;
  flex-direction: column !important;
  width: 400px !important;
  max-width: 92vw !important;
  min-height: 100vh !important;
  height: auto !important;
  box-sizing: border-box !important;
  -ms-flex-negative: 0 !important;
  flex-shrink: 0 !important;
  box-shadow: 12px 0 48px rgba(0, 0, 0, 0.28) !important;
  border-radius: 0 22px 22px 0 !important;
  overflow: hidden !important;
  position: relative !important;
  z-index: 2 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#modalSeries .picker-sheet-head,
#modalSeries .picker-sheet-body {
  background-color: #ffffff !important;
}

#modalSeries .picker-sheet-body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

#modalSeries .picker-dismiss {
  -webkit-box-flex: 1 !important;
  -ms-flex: 1 1 auto !important;
  flex: 1 1 auto !important;
  min-width: 48px !important;
  min-height: 100vh !important;
  -ms-flex-item-align: stretch !important;
  align-self: stretch !important;
  cursor: pointer !important;
}

#modalSeries .picker-row,
#modalGrade .picker-row {
  box-sizing: border-box !important;
}

/* 教材 / 年级弹窗白卡片（居中） */
#modalSeries .picker-sheet--dialog,
#modalGrade .picker-sheet--dialog {
  background-color: #ffffff !important;
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-orient: vertical !important;
  -ms-flex-direction: column !important;
  flex-direction: column !important;
  max-height: 88vh !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35) !important;
  position: relative !important;
  z-index: 2 !important;
  overflow: hidden !important;
}

#modalSeries .picker-sheet-head,
#modalSeries .picker-sheet-body,
#modalGrade .picker-sheet-head,
#modalGrade .picker-sheet-body {
  background-color: #ffffff !important;
}

#modalSeries .picker-sheet-title,
#modalGrade .picker-sheet-title {
  flex: 1 1 auto;
}

/* 年级：半透明遮罩 + 居中白卡片 */
.modal-root--dialog {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-root--dialog:not(.is-open) {
  display: none !important;
}

.modal-root--dialog.is-open {
  display: flex !important;
}

.picker-scrim {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 0;
  cursor: pointer;
}

.picker-sheet--dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e8ecf4;
  flex-shrink: 0;
  background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
}

.picker-sheet-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e1b4b;
  letter-spacing: 0.02em;
}

.picker-sheet-x {
  flex-shrink: 0;
  border: none;
  background: #eef2f7;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #475569;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.picker-sheet-x:hover {
  background: #e2e8f0;
}

.picker-sheet-body {
  padding: 12px 16px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.picker-empty {
  text-align: center;
  color: #64748b;
  padding: 24px 12px;
}

.picker-group {
  margin-bottom: 18px;
}

.picker-group-title {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: none;
  margin: 14px 4px 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #e2e8f0;
  text-align: left;
}

.picker-row {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  background: #fafbfc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.picker-row:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
}

.picker-row-current {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-color: #60a5fa;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.18);
}

.picker-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.picker-row-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.35;
}

.picker-row-meta {
  font-size: 12px;
  color: #64748b;
}

.picker-badges {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

@media (max-width: 400px) {
  .picker-badges {
    gap: 6px;
  }

  .picker-badges .badge {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    font-size: 11px;
    padding: 3px 6px;
  }
}

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.badge-mc {
  background: linear-gradient(90deg, #7dd3fc, #3b82f6 45%, #1d4ed8);
}

.badge-dict {
  background: linear-gradient(90deg, #2dd4bf, #22c55e 55%, #15803d);
}

.picker-bar {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.picker-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  /* 与顶栏「选择」一致：选择题掌握进度用蓝渐变 */
  background: linear-gradient(90deg, #7dd3fc, #3b82f6 50%, #1d4ed8);
  transition: width .2s;
}

/* —— 单词学习（扣子风格：8 词网格 + 换一批 + 故事按钮） —— */
.word-learn-card {
  max-width: 920px;
  padding: 22px 24px 28px;
  background: #fff;
  position: relative;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.word-learn-card--busy .word-learn-refresh {
  opacity: 0.72;
  pointer-events: none;
}

.word-learn-loading {
  padding: 8px 0 16px;
}

.word-learn-loading-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 16px;
  margin-bottom: 12px;
}

.word-learn-loading-card {
  min-height: 168px;
  border-radius: 16px;
  background: linear-gradient(110deg, #f1f5f9 8%, #e2e8f0 18%, #f1f5f9 33%);
  background-size: 200% 100%;
  animation: word-learn-shimmer 1.1s ease-in-out infinite;
}

.word-learn-loading-tip {
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

@keyframes word-learn-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.es-page-busy {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.88);
}

.es-page-busy[hidden] {
  display: none !important;
}

.es-page-busy-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 28px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}

.es-page-busy-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  animation: es-page-busy-spin 0.75s linear infinite;
}

.es-page-busy-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

@keyframes es-page-busy-spin {
  to { transform: rotate(360deg); }
}

.word-learn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.word-learn-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.word-learn-title-ico {
  font-size: 22px;
  line-height: 1;
}

.word-learn-title-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e1b4b;
  letter-spacing: 0.02em;
}

.word-learn-refresh {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 800;
  color: #fff !important;
  cursor: pointer;
  background: linear-gradient(180deg, #ff5c6c, #e11d48);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  font-family: inherit;
}

.word-learn-refresh:hover {
  filter: brightness(1.05);
}

.word-learn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 16px;
  margin-bottom: 22px;
}

.word-learn-wcell {
  position: relative;
  box-sizing: border-box;
  padding: 14px 14px 16px;
  border: 1px solid #ff4d4f;
  border-radius: 10px;
  background: #fff;
  min-height: 200px;
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.12);
}

/* S3：自然拼读常见字母组合高亮 */
.word-learn-phone {
  color: #a21caf;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(162, 28, 175, 0.35);
  text-underline-offset: 3px;
}

/* S3：卡片翻面（正面英+音；背面中文+例句） */
.word-learn-flip {
  perspective: 960px;
}

.word-learn-flip-inner {
  position: relative;
  min-height: 188px;
  transform-style: preserve-3d;
  transition: transform 0.55s ease;
}

.word-learn-wcell--flipped .word-learn-flip-inner {
  transform: rotateY(180deg);
}

.word-learn-flip-face {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  padding-right: 22px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.word-learn-flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #fffbeb 0%, #fef3c7 100%);
  border-radius: 10px;
  padding: 12px 12px 12px 14px;
  border: 1px dashed #f59e0b;
  min-height: 188px;
  max-height: 240px;
  overflow-y: auto;
}

.word-learn-back-head {
  font-size: 12px;
  font-weight: 800;
  color: #b45309;
  margin-bottom: 8px;
}

.word-learn-back-zh {
  font-size: 15px;
  font-weight: 800;
  color: #be123c;
  line-height: 1.4;
  margin-bottom: 10px;
}

.word-learn-back-ex-label {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}

.word-learn-back-ex {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #44403c;
  font-family: Georgia, "Times New Roman", serif;
}

.word-learn-flip-toggle {
  width: 100%;
  margin-top: 10px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.word-learn-flip-toggle:hover {
  background: #e2e8f0;
}

.word-learn-flip-toggle--back {
  margin-top: 12px;
}

.word-learn-wcell-spider {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 16px;
  line-height: 1;
  opacity: 0.85;
}

.word-learn-en {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  padding-right: 22px;
  margin-bottom: 4px;
}

.word-learn-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.word-learn-ph-bracket {
  font-family: "Segoe UI", "Lucida Sans Unicode", "Arial Unicode MS", sans-serif;
}

.word-learn-zh {
  font-size: 14px;
  font-weight: 700;
  color: #ff4d4f;
  line-height: 1.35;
}

/* S1：中文默认隐藏 + 显示按钮 */
.word-learn-s1-hint {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin: -8px 0 16px;
  padding: 10px 12px;
  background: #f1f5f9;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.word-learn-zh-all-btn {
  margin-left: 10px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-family: inherit;
}

.word-learn-zh-all-btn:hover {
  background: #e2e8f0;
}

.word-learn-zh-block {
  min-height: 2.2em;
  margin-bottom: 8px;
}

.word-learn-zh-reveal {
  width: 100%;
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.word-learn-zh-reveal:hover {
  background: #dbeafe;
}

.word-learn-zh-reveal[hidden] {
  display: none !important;
}

.word-learn-grid--zh-all .word-learn-zh-reveal {
  display: none !important;
}

.word-learn-grid--zh-all .word-learn-zh-text {
  display: block !important;
}

/* S2：认识 / 不熟 */
.word-learn-mark-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.word-learn-mark {
  flex: 1;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.word-learn-mark--strong {
  color: #fff;
  background: linear-gradient(180deg, #22c55e, #15803d);
  box-shadow: 0 2px 0 #14532d;
}

.word-learn-mark--weak {
  color: #fff;
  background: linear-gradient(180deg, #f97316, #c2410c);
  box-shadow: 0 2px 0 #9a3412;
}

.word-learn-mark:disabled {
  opacity: 0.65;
  cursor: wait;
}

.word-learn-wcell--strong {
  border-color: #22c55e;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
}

.word-learn-wcell--weak {
  border-color: #f97316;
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.25);
}

/* 未点「认识/不熟」：虚线灰框，与已标区分 */
.word-learn-wcell--self-none {
  border-style: dashed;
  border-color: #94a3b8;
  background: #fafafa;
  box-shadow: 0 2px 8px rgba(148, 163, 184, 0.2);
}

.word-learn-self-badge {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 999px;
  line-height: 1.35;
}

.word-learn-self-badge--none {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.word-learn-self-badge--strong {
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.word-learn-self-badge--weak {
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fdba74;
}

.word-learn-mark--picked {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 0 0 2px rgba(15, 23, 42, 0.35);
}

/* 学习能量提示（自评 / 翻面 +1） */
.word-learn-energy-toast {
  box-sizing: border-box;
  margin: 0;
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  background: #e0f2fe;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: opacity .28s ease, max-height .35s ease, margin .28s ease, padding .28s ease, border-color .28s ease;
  pointer-events: none;
}

.word-learn-energy-toast--on {
  margin: 0 0 14px;
  padding: 8px 12px;
  max-height: 64px;
  opacity: 1;
  border-color: #38bdf8;
}

.word-learn-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

.word-learn-quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.word-learn-quiz-btn:hover {
  text-decoration: none;
  filter: brightness(0.98);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.word-learn-quiz-btn--mc {
  color: #1d4ed8;
  background: linear-gradient(180deg, #f0f7ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
}

.word-learn-quiz-btn--mc:hover {
  color: #1e40af;
}

.word-learn-quiz-btn--dict {
  color: #047857;
  background: linear-gradient(180deg, #f0fdf8 0%, #d1fae5 100%);
  border-color: #a7f3d0;
}

.word-learn-quiz-btn--dict:hover {
  color: #065f46;
}

.word-learn-quiz-btn-short {
  display: none;
}

.word-learn-quiz-hint {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin: 0 0 8px;
}

.word-learn-quiz-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.word-learn-quiz-link:hover {
  text-decoration: underline;
}

.word-learn-story-wrap {
  text-align: center;
  margin-top: 4px;
}

.word-learn-story-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 260px;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(to right, #ff4d4f, #4096ff);
  box-shadow: 0 6px 20px rgba(64, 150, 255, 0.25);
}

.word-learn-story-btn:hover {
  filter: brightness(1.04);
}

.word-learn-story-ico {
  font-size: 18px;
  opacity: 0.95;
}

/* 预制故事展示区 */
.word-learn-story-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  text-align: left;
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #c7d2fe;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
}

.word-learn-story-panel-head {
  font-size: 15px;
  font-weight: 800;
  color: #312e81;
  margin-bottom: 10px;
}

.word-learn-story-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #1e293b;
  font-family: Georgia, "Times New Roman", serif;
}

.word-learn-story-text--en {
  margin-bottom: 14px;
}

.word-learn-story-batch {
  color: #c41d7f;
  font-weight: 800;
  background: linear-gradient(180deg, #fff0f6 0%, #ffe4ec 100%);
  padding: 1px 5px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(196, 29, 127, 0.2);
}

.word-learn-story-zh-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}

.word-learn-story-zh-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.word-learn-story-zh-label {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0;
}

.word-learn-translate-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.word-learn-translate-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.word-learn-translate-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.word-learn-story-text--zh {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: #334155;
}

.word-learn-story-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 900px) {
  .word-learn-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .word-learn-loading-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .word-learn-quiz-actions {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0 2px;
  }

  .word-learn-quiz-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 10px;
    white-space: nowrap;
  }

  .word-learn-quiz-btn-long {
    display: none;
  }

  .word-learn-quiz-btn-short {
    display: inline;
  }

  .word-learn-story-btn {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    box-sizing: border-box;
  }
}

@media (max-width: 420px) {
  .word-learn-grid {
    grid-template-columns: 1fr;
  }

  .word-learn-quiz-btn {
    padding: 7px 8px;
    font-size: 12px;
  }
}

/* —— 英雄词汇库（已掌握）页 —— */
.mastered-lib {
  max-width: 960px;
  margin: 0 auto;
}

.mastered-lib-hero {
  margin: -8px -12px 20px;
  padding: 0 12px 18px;
  border-radius: 18px;
  background: linear-gradient(90deg, #6a1b9a 0%, #2196f3 50%, #ad1457 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.mastered-lib-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px 12px 12px;
  text-align: center;
}

.mastered-lib-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.mastered-lib-logo-inner {
  font-size: 22px;
  line-height: 1;
}

.mastered-lib-brand-title {
  margin: 0;
  padding: 0;
  flex: 0 1 auto;
  max-width: 100%;
  font-size: clamp(1.02rem, 4.2vw, 1.22rem);
  font-weight: 800;
  line-height: 1.38;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  letter-spacing: 0.02em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mastered-lib-mode-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 12px 12px;
  flex-wrap: wrap;
}

.mastered-lib-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none !important;
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: filter 0.12s, transform 0.1s, box-shadow 0.12s;
}

.mastered-lib-mode-btn:hover {
  filter: brightness(1.08);
}

.mastered-lib-mode-btn.is-active {
  border-color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.mastered-lib-mode-btn--mc.is-active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
}

.mastered-lib-mode-btn--dict.is-active {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
}

.mastered-lib-mode-ico {
  font-size: 15px;
  line-height: 1;
}

.mastered-lib-search-wrap {
  padding: 0 4px 2px;
}

.mastered-lib-search-box {
  max-width: 640px;
  margin: 0 auto;
}

.mastered-lib-search-hint {
  margin-top: 10px;
  padding: 0 4px;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.mastered-lib-search-inner {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid rgba(251, 191, 36, 0.65);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.mastered-lib-search-field {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid #1e88e5;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
}

.mastered-lib-search-ico {
  font-size: 16px;
  line-height: 1;
  opacity: 0.85;
  flex-shrink: 0;
}

.mastered-lib-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none !important;
  outline: none !important;
  background: transparent;
  font-size: 15px;
  padding: 10px 0;
  color: #0f172a;
}

.mastered-lib-search-input::placeholder {
  color: #94a3b8;
}

.mastered-lib-search-clear {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #e53935;
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0 -4px 0 0;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}

.mastered-lib-search-clear:hover {
  background: rgba(229, 57, 53, 0.1);
  color: #c62828;
}

.mastered-lib-search-submit {
  flex-shrink: 0;
  border: none;
  border-radius: 12px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #e53935 0%, #3f51b5 100%);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  transition: filter 0.12s, transform 0.08s;
}

.mastered-lib-search-submit:hover {
  filter: brightness(1.06);
}

.mastered-lib-search-submit:active {
  transform: translateY(1px);
}

.mastered-lib-body {
  margin-top: 0;
}

@media (max-width: 520px) {
  .mastered-lib-hero {
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .mastered-lib-brand {
    padding: 14px 8px 10px;
  }

  .mastered-lib-logo {
    width: 38px;
    height: 38px;
  }

  .mastered-lib-logo-inner {
    font-size: 20px;
  }

  .mastered-lib-brand {
    gap: 10px;
    align-items: center;
  }

  .mastered-lib-brand-title {
    font-size: 1.05rem;
    line-height: 1.4;
  }

  .mastered-lib-mode-nav {
    gap: 8px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .mastered-lib-mode-btn {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    padding: 8px 12px;
    font-size: 13px;
  }

  .mastered-lib-search-submit {
    width: 100%;
  }
}

/* 英雄资料：表单与用户管理表 */
.profile-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 4px 12px 32px;
}

.profile-page-head {
  margin-bottom: 18px;
}

.profile-back {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: #e11d48 !important;
  text-decoration: none !important;
  margin-bottom: 8px;
}

.profile-back:hover {
  text-decoration: underline !important;
}

.profile-page-title {
  font-size: 1.75rem;
  margin: 0 0 6px;
  color: #0f172a;
}

.profile-page-lead {
  margin: 0;
  color: #64748b;
  font-size: 15px;
}

.profile-card,
.profile-admin-box {
  margin-bottom: 20px;
}

.profile-card-h {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: #1e293b;
}

.profile-field {
  margin-bottom: 14px;
}

.profile-field label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
}

.profile-input {
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 15px;
}

.profile-readonly {
  padding: 10px 12px;
  background: #f1f5f9;
  border-radius: 10px;
  max-width: 400px;
  color: #334155;
  font-weight: 600;
}

.profile-field--sid {
  margin-bottom: 14px;
}

.profile-sid-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #475569;
}

.profile-sid-label,
.profile-sid-hint {
  font-weight: 700;
  font-size: 13px;
  color: #475569;
}

.profile-sid-value {
  color: #e11d48;
  font-weight: 800;
  font-size: 16px;
  margin: 0 0.2em;
}

.profile-hero-title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  margin-bottom: 6px;
}

.profile-hero-title-row .reward-hero-card__title {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 1.35rem;
}

.profile-guide-btn {
  display: inline-block;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none !important;
  color: #9f1239 !important;
  background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid #fdba74;
  box-shadow: 0 2px 0 #ea580c;
}

.profile-guide-btn:hover {
  filter: brightness(0.98);
}

@media (max-width: 640px) {
  .profile-hero-title-row .reward-hero-card__title {
    font-size: 1.15rem;
  }

  .profile-guide-btn {
    padding: 7px 10px;
    font-size: 12px;
  }
}

.profile-hint {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 12px;
}

.profile-actions {
  margin-top: 8px;
}

.profile-err {
  margin-top: 12px;
}

.profile-admin-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 0;
}

.profile-admin-top .profile-card-h {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.profile-admin-note {
  font-size: 13px;
  color: #64748b;
  margin: 12px 0 14px;
  line-height: 1.55;
  clear: both;
}

.profile-admin-audit-btn {
  display: inline-block;
  text-decoration: none;
  white-space: nowrap;
  margin: 0;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .profile-admin-top {
    flex-wrap: nowrap;
    gap: 8px 10px;
  }

  .profile-admin-top .profile-card-h {
    font-size: 1.05rem;
    line-height: 1.3;
  }

  .profile-admin-audit-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 13px;
  }
}

.profile-admin-actions {
  white-space: nowrap;
}

.profile-admin-actions .profile-edit-link + .profile-edit-link {
  margin-left: 10px;
}

.admin-audit-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
}

.admin-audit-field {
  margin-bottom: 0;
  min-width: 200px;
}

.admin-audit-field--btn .button {
  margin-top: 0;
}

.admin-audit-select {
  max-width: 360px;
}

.admin-audit-meta {
  margin-bottom: 12px;
}

.admin-audit-kv th {
  width: 42%;
  text-align: left;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
}

.admin-audit-kv td {
  color: #1e293b;
}

/* 用户明细：两列 KV 表不占横向滚动；多列表格与电脑端一样单行 + 横向滑动 */
.admin-audit-page .admin-audit-kv-wrap {
  overflow-x: visible;
}

.admin-audit-page .admin-audit-kv.profile-user-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.admin-audit-page .admin-audit-scroll-table.profile-user-table {
  min-width: 680px;
  width: max-content;
}

.admin-audit-page .admin-audit-scroll-table th,
.admin-audit-page .admin-audit-scroll-table td {
  white-space: nowrap;
}

.admin-audit-page .admin-audit-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-audit-page .admin-audit-meta {
  word-break: break-word;
}

@media (max-width: 640px) {
  .admin-audit-page .admin-audit-kv.profile-user-table,
  .admin-audit-page .admin-audit-kv.profile-user-table tbody {
    display: block;
    width: 100%;
  }

  .admin-audit-page .admin-audit-kv.profile-user-table tr {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 10px 4px;
    border-bottom: 1px solid #e2e8f0;
  }

  .admin-audit-page .admin-audit-kv.profile-user-table tr:last-child {
    border-bottom: none;
  }

  .admin-audit-page .admin-audit-kv.profile-user-table th,
  .admin-audit-page .admin-audit-kv.profile-user-table td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border-bottom: none;
    background: transparent;
    vertical-align: middle;
  }

  .admin-audit-page .admin-audit-kv.profile-user-table th {
    flex: 1 1 auto;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    white-space: normal;
  }

  .admin-audit-page .admin-audit-kv.profile-user-table td {
    flex: 0 0 auto;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
  }

  .admin-audit-page .admin-audit-scroll-table.profile-user-table {
    min-width: 720px;
  }
}

.profile-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-user-table {
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

.profile-user-table th,
.profile-user-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.profile-user-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.profile-edit-link {
  font-weight: 700;
  color: #2563eb !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.profile-edit-link:hover {
  text-decoration: underline !important;
}

.top-bar .nav-user a.nav-role-pill {
  text-decoration: none !important;
  cursor: pointer;
}

.top-bar .nav-user a.nav-role-pill:hover {
  filter: brightness(1.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.mastered-page {
  max-width: 960px;
}

.mastered-page-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8ecf4;
}

.mastered-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.mastered-table-wrap {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  overflow-x: auto;
}

.mastered-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  font-size: 14px;
  background: #fff;
}

.mastered-table thead tr {
  background: linear-gradient(180deg, #e8f0fe, #dbeafe);
}

.mastered-table thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 800;
  color: #1e3a8a;
  border-bottom: 2px solid #bfdbfe;
  border-right: 1px dashed #cbd5e1;
}

.mastered-table thead th:last-child {
  border-right: none;
}

.mastered-table tbody td {
  padding: 10px 14px;
  vertical-align: top;
  color: #1e293b;
  border-right: 1px dashed #e2e8f0;
  border-bottom: 1px solid #e8ecf4;
}

.mastered-table tbody td:last-child {
  border-right: none;
}

.mastered-table tbody tr:last-child td {
  border-bottom: none;
}

.mastered-row--a {
  background: #f0f9ff;
}

.mastered-row--b {
  background: #ecfdf5;
}

.mastered-row:hover td {
  filter: brightness(0.98);
}

.mastered-ph-cell {
  vertical-align: middle !important;
}

.mastered-table-ph.word-learn-ph {
  justify-content: flex-start;
  margin: 0;
  gap: 6px;
  flex-wrap: nowrap;
}

.mastered-table-ph .es-speak-btn {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(99, 102, 241, 0.35);
}

.mastered-table-ph .es-speak-ico {
  font-size: 12px;
}

/* 英雄词库五列：单词 / 音标 / 释义 / 词性 / 例句 */
.mastered-th-word,
.mastered-td-word {
  width: 15%;
}

.mastered-th-phon,
.mastered-ph-cell {
  width: 21%;
}

.mastered-th-trans,
.mastered-td-trans {
  width: 13%;
}

.mastered-th-pos,
.mastered-td-pos {
  width: 7%;
}

.mastered-th-ex,
.mastered-td-ex {
  width: 35%;
}

.mastered-cell-word {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #dc2626;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.mastered-cell-trans {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.45;
}

.mastered-cell-pos {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  line-height: 1.4;
}

.mastered-table-ph .word-learn-ph-bracket {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.mastered-cell-ex {
  font-size: 13px;
  line-height: 1.55;
  color: #57534e;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
}

.mastered-cell-ex-empty {
  font-style: normal;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .mastered-table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
  }

  .mastered-table {
    table-layout: auto;
  }

  .mastered-table thead {
    display: none;
  }

  .mastered-table tbody tr {
    display: grid;
    /* 释义占宽列，词性约 28%（释义过长时不挤占） */
    grid-template-columns: minmax(0, 1fr) minmax(52px, 28%);
    margin-bottom: 14px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.09);
  }

  .mastered-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .mastered-table tbody tr.mastered-row--a {
    border-color: #93c5fd;
    box-shadow: 0 5px 18px rgba(37, 99, 235, 0.12);
  }

  .mastered-table tbody tr.mastered-row--b {
    border-color: #6ee7b7;
    box-shadow: 0 5px 18px rgba(5, 150, 105, 0.1);
  }

  /* 单词、音标、例句：通栏 */
  .mastered-table tbody .mastered-td-word,
  .mastered-table tbody .mastered-ph-cell,
  .mastered-table tbody .mastered-td-ex {
    grid-column: 1 / -1;
  }

  .mastered-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: auto !important;
    max-width: none;
    padding: 10px 12px;
    font-size: 13px;
    border-right: none;
    border-bottom: 1px solid #e8ecf4;
    box-sizing: border-box;
  }

  .mastered-table tbody td:last-child {
    border-bottom: none;
  }

  .mastered-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 2.6em;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    line-height: 1.5;
    padding-top: 2px;
    text-align: left;
  }

  /* 释义 | 词性：一行两列，标题与内容均靠左 */
  .mastered-table tbody td.mastered-cell-grid {
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px 6px;
    width: 100% !important;
    padding: 9px 8px;
    text-align: left;
    border-right: 1px solid #e8ecf4;
    overflow: hidden;
  }

  .mastered-table tbody td.mastered-td-pos {
    border-right: none;
    padding-left: 6px;
    padding-right: 6px;
  }

  .mastered-table tbody td.mastered-cell-grid::before {
    flex: 0 0 auto;
    padding-top: 0;
    text-align: left;
  }

  .mastered-table tbody td.mastered-cell-grid > * {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    word-break: break-word;
  }

  .mastered-table tbody td.mastered-td-pos > * {
    flex: 0 1 auto;
    font-size: 12px;
  }

  .mastered-table tbody .mastered-td-word {
    padding: 12px 14px;
    background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 50%, #fff 100%);
    border-bottom: 1px solid #fecaca;
  }

  .mastered-table tbody .mastered-td-word::before {
    color: #b91c1c;
  }

  .mastered-table tbody tr.mastered-row--a .mastered-td-word {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #fff 100%);
    border-bottom-color: #bfdbfe;
  }

  .mastered-table tbody tr.mastered-row--a .mastered-td-word::before {
    color: #1d4ed8;
  }

  .mastered-table tbody tr.mastered-row--b .mastered-td-word {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 50%, #fff 100%);
    border-bottom-color: #a7f3d0;
  }

  .mastered-table tbody tr.mastered-row--b .mastered-td-word::before {
    color: #047857;
  }

  .mastered-table tbody td > * {
    flex: 1 1 auto;
    min-width: 0;
  }

  .mastered-ph-cell {
    vertical-align: top !important;
  }

  .mastered-table-ph.word-learn-ph {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .mastered-table-ph .word-learn-ph-bracket {
    white-space: normal;
    word-break: normal;
    flex: 1 1 auto;
    min-width: 0;
  }

  .mastered-table-ph .es-speak-btn {
    width: 28px;
    height: 28px;
    margin-left: auto;
    flex-shrink: 0;
  }

  .mastered-cell-word {
    font-size: 1.05rem;
  }

  .mastered-cell-trans {
    font-size: 14px;
    word-break: normal;
  }

  .mastered-td-ex {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
  }

  .mastered-td-ex::before {
    flex: 0 0 2.6em;
    padding-top: 2px;
  }

  .mastered-td-ex .mastered-cell-ex {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    text-align: left;
    word-break: break-word;
  }

  .mastered-row--a,
  .mastered-row--b {
    background: #fff;
  }
}

/* 已掌握 — 底部分页 */
.mastered-pager {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e8ecf4;
}

.mastered-pager-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 20px;
}

.mastered-pager-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  color: #fff !important;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  box-shadow: 0 3px 0 #1d4ed8;
  transition: filter .12s;
}

.mastered-pager-btn:hover {
  filter: brightness(1.06);
}

.mastered-pager-btn--disabled {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  cursor: default;
}

.mastered-pager-info {
  font-size: 14px;
  color: #64748b;
}

.mastered-pager-info strong {
  color: #0f172a;
  font-weight: 800;
}

/* —— 登录 / 注册：蜘蛛侠主题（扣子风，仅 body.page-auth-spidey） —— */
body.app-root.page-auth-spidey {
  min-height: 100vh;
  background: linear-gradient(180deg, #ef4444 0%, #f43f5e 42%, #fda4af 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.app-root.page-auth-spidey::before {
  opacity: 0.28;
  background-attachment: fixed;
}

body.app-root.page-auth-spidey .main-shell {
  background: transparent;
  padding-top: 20px;
  padding-bottom: 48px;
}

.auth-spidey-wrap {
  max-width: 440px;
  margin: 0 auto;
}

.auth-spidey-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.14),
    0 4px 16px rgba(0, 0, 0, 0.08);
}

.auth-spidey-card-accent {
  height: 4px;
  background: linear-gradient(90deg, #ef4444 0%, #3b82f6 100%);
}

.auth-spidey-card-body {
  position: relative;
  padding: 28px 32px 26px;
  background: #fff;
}

.auth-spidey-card-deco {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 52px;
  line-height: 1;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

.auth-spidey-brand {
  text-align: center;
  padding: 0 8px;
}

.auth-spidey-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 45%, #7c3aed 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.auth-spidey-title {
  margin: 0 0 8px;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.35;
  background: linear-gradient(90deg, #ef4444 0%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .auth-spidey-title {
    color: #dc2626;
    background: none;
  }
}

.auth-spidey-sub {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}

.auth-spidey-tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 20px;
  padding: 4px;
  background: #eef2f7;
  border-radius: 999px;
}

.auth-spidey-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none !important;
  color: #1e3a8a !important;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

a.auth-spidey-tab:hover {
  background: rgba(255, 255, 255, 0.65);
}

.auth-spidey-tab--on {
  background: #ef4444 !important;
  color: #fff !important;
  cursor: default;
}

.auth-spidey-err-wrap {
  min-height: 0;
  margin-bottom: 6px;
}

.auth-spidey-err.err:empty {
  display: none;
}

.auth-spidey-field {
  margin-bottom: 16px;
}

.auth-spidey-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #334155;
}

input.auth-spidey-input,
.auth-spidey-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 15px;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-spidey-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-spidey-input::placeholder {
  color: #94a3b8;
}

input.auth-spidey-submit,
.auth-spidey-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  color: #fff !important;
  background: linear-gradient(90deg, #ef4444 0%, #2563eb 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
  transition: filter 0.12s, transform 0.08s;
}

.auth-spidey-submit:hover {
  filter: brightness(1.05);
}

.auth-spidey-submit:active {
  transform: translateY(1px);
}

.auth-spidey-foot {
  margin: 22px 0 0;
  text-align: center;
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}

.auth-spidey-foot a {
  color: #2563eb !important;
  font-weight: 800;
  text-decoration: none !important;
}

.auth-spidey-foot a:hover {
  text-decoration: underline !important;
}

@media (max-width: 480px) {
  .auth-spidey-card-body {
    padding: 24px 20px 22px;
  }

  .auth-spidey-title {
    font-size: 1.25rem;
  }
}

/* —— 测验结算：本局能量 —— */
.quiz-result-xp-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 45%, #fcd34d 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.quiz-result-xp-ico {
  font-size: 2rem;
  line-height: 1;
}

.quiz-result-xp-body {
  flex: 1;
  min-width: 0;
}

.quiz-result-xp-label {
  font-size: 12px;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quiz-result-xp-num {
  font-size: 1.75rem;
  font-weight: 900;
  color: #b45309;
  line-height: 1.1;
}

.quiz-result-xp-hint {
  margin-top: 4px;
  font-size: 13px;
  color: #78350f;
  font-weight: 600;
}

/* —— 冒险战绩页：金→橙→右端偏红；菱形略大、线条更淡（fixed 防拼缝） —— */
body.app-root.page-stats-quest {
  min-height: 100vh;
  background-color: #c2410c;
  background-image: linear-gradient(90deg,
    #a16207 0%,
    #b45309 14%,
    #ca8a04 36%,
    #d97706 56%,
    #ea580c 74%,
    #dc2626 92%,
    #b91c1c 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.app-root.page-stats-quest::before {
  opacity: 0.24;
  background-attachment: fixed;
  /* 比上一版略强，仍能看清菱形；格距介于密/疏之间，减轻脏感 */
  background-size: 26px 26px;
  background-position: 0 0, 0 13px, 13px -13px, -13px 0;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.09) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.09) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.055) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.055) 75%);
}

body.app-root.page-stats-quest .main-shell {
  background: transparent;
  padding-top: 16px;
  padding-bottom: 48px;
}

.stats-quest {
  max-width: 920px;
  margin: 0 auto;
}

.stats-quest-hero {
  margin-bottom: 20px;
  padding: 22px 22px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(99, 102, 241, 0.35) 50%, rgba(236, 72, 153, 0.22) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.stats-quest-hero-inner {
  text-align: center;
}

.stats-quest-brand {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fefce8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  margin-bottom: 14px;
}

.stats-quest-brand-ico {
  margin-right: 6px;
}

.stats-quest-hero-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
}

.stats-quest-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stats-quest-chip-k {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.04em;
}

.stats-quest-chip-v {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fefce8;
  margin-top: 4px;
}

.stats-quest-chip--lv .stats-quest-chip-v {
  color: #fde047;
}

.stats-quest-chip--xp .stats-quest-chip-v {
  color: #fcd34d;
}

.stats-quest-chip--fire .stats-quest-chip-v {
  color: #fb923c;
}

.stats-quest-ai-hint {
  margin: 14px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.85);
  font-weight: 600;
}

.stats-quest-cal-card,
.stats-quest-day-card,
.stats-quest-detail-card {
  margin-bottom: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.stats-quest-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stats-quest-cal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #1e1b4b;
}

.stats-quest-cal-nav {
  font-size: 14px;
  font-weight: 800;
  color: #4f46e5 !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.stats-quest-cal-nav:hover {
  text-decoration: underline !important;
}

.stats-cal {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.stats-cal th {
  padding: 8px 4px;
  color: #64748b;
  font-weight: 800;
}

.stats-cal td {
  padding: 4px;
  vertical-align: middle;
  text-align: center;
  height: 52px;
}

.stats-cal-pad {
  border: none;
  background: transparent;
}

.stats-cal-cell--sel {
  background: rgba(99, 102, 241, 0.12);
  border-radius: 10px;
}

.stats-cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 4px;
  border-radius: 10px;
  text-decoration: none !important;
  color: #0f172a !important;
  font-weight: 800;
  transition: background 0.12s, transform 0.1s;
}

.stats-cal-day:hover {
  background: rgba(99, 102, 241, 0.15);
}

.stats-cal-cell--has .stats-cal-day {
  background: linear-gradient(180deg, #fef9c3, #fde047);
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.35);
}

.stats-cal-cell--has.stats-cal-cell--sel .stats-cal-day {
  outline: 3px solid #6366f1;
}

.stats-cal-day--empty {
  opacity: 0.75;
  font-weight: 700;
}

.stats-cal-badge {
  font-size: 10px;
  font-weight: 900;
  color: #92400e;
  background: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.2;
}

.stats-quest-cal-tip {
  margin: 12px 0 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.stats-quest-day-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 900;
  color: #312e81;
}

.stats-quest-session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-quest-session-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
  text-decoration: none !important;
  color: inherit !important;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.1s, box-shadow 0.12s;
}

button.stats-quest-session-row {
  appearance: none;
  -webkit-appearance: none;
}

/* 战绩：异步加载占位（避免空白被误认为无记录） */
.stats-quest-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 120px;
  padding: 28px 16px;
  margin: 8px 0 4px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1px dashed #cbd5e1;
}

/* 手机端 WebKit：flex 会盖过 hidden 属性，必须显式隐藏 */
.stats-quest-loading[hidden],
.stats-quest-loading.stats-quest-loading--off {
  display: none !important;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
}

.stats-quest-block--off {
  display: none !important;
}

.stats-quest-loading-text {
  font-size: 15px;
  font-weight: 700;
  color: #475569;
}

.stats-quest-loading-spin {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: stats-quest-spin 0.7s linear infinite;
}

@keyframes stats-quest-spin {
  to { transform: rotate(360deg); }
}

.stats-quest-session-row:hover {
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.stats-quest-session-time {
  font-weight: 900;
  color: #0f172a;
  min-width: 44px;
}

.stats-quest-session-mode {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff !important;
}

.stats-quest-session-mode--mc {
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.stats-quest-session-mode--dict {
  background: linear-gradient(90deg, #a855f7, #ec4899);
}

.stats-quest-session-dur,
.stats-quest-session-acc {
  font-size: 13px;
  color: #475569;
  font-weight: 700;
}

.stats-quest-session-pts {
  margin-left: auto;
  font-weight: 900;
  color: #b45309;
  font-size: 15px;
}

.stats-quest-muted {
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.stats-quest-detail-head {
  margin-bottom: 12px;
}

.stats-quest-back {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
  color: #4f46e5 !important;
  text-decoration: none !important;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.stats-quest-back:hover {
  color: #3730a3 !important;
  text-decoration: underline !important;
}

.stats-quest-detail-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #1e1b4b;
}

.stats-quest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 13px;
  color: #475569;
}

.stats-quest-meta strong {
  color: #0f172a;
}

.stats-quest-wrong-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-quest-wrong-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 6px 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: linear-gradient(180deg, #fff1f2, #fff);
}

.stats-quest-wrong-no {
  grid-row: 1 / span 2;
  grid-column: 1;
  font-weight: 900;
  color: #e11d48;
  font-size: 14px;
  align-self: center;
}

.stats-quest-wrong-main {
  grid-column: 2;
}

.stats-quest-wrong-main strong {
  font-size: 1.05rem;
  color: #0f172a;
}

.stats-quest-wrong-meta {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.stats-quest-wrong-pick {
  grid-column: 2;
  font-size: 13px;
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 560px) {
  /* 手机端保持一条记录单行横向排列（与网页版一致），极窄屏可横向轻滑查看 */
  .stats-quest-session-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px 8px;
    padding: 10px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .stats-quest-session-time {
    font-size: 15px;
    flex-shrink: 0;
  }

  .stats-quest-session-mode {
    flex-shrink: 0;
    font-size: 11px;
    padding: 3px 8px;
  }

  .stats-quest-session-dur,
  .stats-quest-session-acc {
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .stats-quest-session-pts {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* ========== 能量商城 / 我的卡包 ========== */
/* 商城胶囊：蜜桃珊瑚斜渐变（战绩为竖向金黄，二者可区分） */
.pill-shop {
  background: linear-gradient(135deg, #fff7ed 0%, #fdba74 42%, #fb7185 100%);
  box-shadow: 0 3px 0 #be123c, inset 0 1px 0 rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(190, 24, 93, 0.28);
}

.top-bar a.pill.pill-shop,
.top-bar a.pill.pill-shop:link,
.top-bar a.pill.pill-shop:visited,
.top-bar a.pill.pill-shop:hover,
.top-bar a.pill.pill-shop:active,
a.pill.pill-shop,
a.pill.pill-shop:link,
a.pill.pill-shop:visited,
a.pill.pill-shop:hover,
a.pill.pill-shop:active {
  color: #9a3412 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.top-bar a.pill.pill-shop:hover,
a.pill.pill-shop:hover {
  filter: brightness(1.06);
  color: #7c2d12 !important;
}

.pill-shop .pill-ico {
  color: #e11d48;
  text-shadow: 0 0 1px #fff, 0 1px 2px rgba(190, 24, 93, 0.35);
}

.home-stat-chip--spend .home-stat-chip-v,
.stats-quest-chip--spend .stats-quest-chip-v {
  color: #ea580c;
}

/* 四个入口：2×2 网格，整体居中 */
.hero-actions--quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  max-width: 520px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  flex-direction: unset;
  flex-wrap: unset;
}

.hero-actions--quad .hero-btn {
  flex: none;
  width: auto;
  min-width: 0;
  font-size: 15px;
  padding: 14px 12px;
}

.hero-btn-gold {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f !important;
  border: 2px solid #d97706;
}

.stats-quest-shop-link {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.stats-quest-shop-btn {
  color: #c2410c !important;
  font-weight: 800;
}

/* 商城 / 卡包 / 兑换记录：主区与顶栏间距约为默认一半 */
body.app-root.page-reward-shop .main-shell,
body.app-root.page-my-rewards .main-shell,
body.app-root.page-reward-history .main-shell {
  padding-top: 12px;
}

body.app-root.page-reward-shop .reward-page,
body.app-root.page-my-rewards .reward-page,
body.app-root.page-reward-history .reward-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 4px 12px 32px;
}

/* —— 商城/卡包页：头部信息卡（白底分层，避免叠在渐变背景上发乱） —— */
.reward-hero-card {
  margin-bottom: 14px;
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
}

.reward-hero-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e8ecf4;
}

/* 返回：纯文字样式，不做超链接外观 */
.reward-hero-card__back {
  font-size: 14px;
  font-weight: 700;
  color: #64748b !important;
  text-decoration: none !important;
  cursor: pointer;
}

.reward-hero-card__back:hover,
.reward-hero-card__back:focus {
  color: #64748b !important;
  text-decoration: none !important;
}

.reward-hero-card__quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 360px;
}

/* 快捷入口：与能量块同风格的卡片按钮 */
.reward-quick-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
  border: 2px solid #e2e8f0;
  background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 100%);
  color: #334155 !important;
  text-align: center;
  line-height: 1.25;
  transition: filter 0.12s, transform 0.08s;
}

.reward-quick-tile:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.reward-quick-tile--wallet {
  border-color: #93c5fd;
  background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af !important;
}

.reward-quick-tile--history {
  border-color: #c4b5fd;
  background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 100%);
  color: #5b21b6 !important;
}

.reward-quick-tile--shop {
  border-color: #fdba74;
  background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 100%);
  color: #9a3412 !important;
}

.reward-hero-card__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.reward-hero-card__logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff7ed, #fdba74);
  border: 2px solid #fed7aa;
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.25);
}

.reward-hero-card__logo--wallet {
  background: linear-gradient(145deg, #eff6ff, #93c5fd);
  border-color: #bfdbfe;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.reward-hero-card__logo--history {
  background: linear-gradient(145deg, #f5f3ff, #c4b5fd);
  border-color: #ddd6fe;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.reward-hero-card__title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.reward-hero-card__lead {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.reward-hero-card__lead strong {
  color: #c2410c;
  font-weight: 800;
}

.reward-hero-card__hint {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.reward-hero-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.reward-stat-tile {
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
}

.reward-stat-tile--spend {
  border-color: #fdba74;
  background: linear-gradient(160deg, #fffbeb 0%, #ffedd5 100%);
}

.reward-stat-tile--total {
  border-color: #fde68a;
  background: linear-gradient(160deg, #fefce8 0%, #fef9c3 100%);
}

.reward-stat-tile__label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 4px;
}

.reward-stat-tile__value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.1;
  color: #0f172a;
}

.reward-stat-tile--spend .reward-stat-tile__value {
  color: #c2410c;
}

.reward-stat-tile--total .reward-stat-tile__value {
  color: #a16207;
}

.reward-stat-tile__ico {
  font-size: 1.15rem;
}

.reward-stat-tile__sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

/* 分类 Tab 独立面板 */
.reward-tabs-panel {
  margin-bottom: 16px;
  padding: 12px 14px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.reward-tabs-panel__label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reward-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.reward-tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155 !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
  border: 1px solid #e2e8f0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.reward-tab:hover {
  background: #e2e8f0;
}

.reward-tab--on {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

/* 卡包/记录页沿用旧结构时的兼容 */
.reward-page-hero {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.1);
}

.reward-page-title {
  margin: 8px 0 4px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
}

.reward-page-lead {
  margin: 0 0 12px;
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
}

.reward-balance-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.reward-balance-row--compact {
  padding-top: 8px;
  border-top: 1px solid #e8ecf4;
}

.reward-balance {
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #e2e8f0;
}

.reward-balance--spend {
  border-color: #fdba74;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}

.reward-balance-k {
  display: block;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}

.reward-balance-v {
  font-size: 1.35rem;
  font-weight: 900;
}

.reward-nav-links {
  margin-left: auto;
  font-size: 14px;
  font-weight: 800;
}

.reward-nav-links a {
  color: #2563eb !important;
  text-decoration: none !important;
}

.reward-nav-links a:hover {
  text-decoration: underline !important;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.reward-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.reward-card-art {
  flex: 0 0 72px;
  height: 72px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: linear-gradient(145deg, #fef9c3, #fde68a);
}

.reward-card-body {
  flex: 1;
  min-width: 0;
}

.reward-card-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #0f172a;
}

.reward-card-desc {
  margin: 0 0 10px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

.reward-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reward-card-cost {
  font-weight: 900;
  color: #ea580c;
  font-size: 15px;
}

.reward-btn-buy {
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #78350f;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.reward-btn-disabled {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
}

.reward-msg {
  margin-top: 12px;
  color: #dc2626;
  font-weight: 700;
}

.reward-msg:empty {
  display: none;
}

.reward-msg--ok {
  color: #16a34a;
}

.reward-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
}

.reward-wallet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reward-wallet-item {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 2px solid #e2e8f0;
  text-decoration: none !important;
  color: inherit !important;
}

.reward-wallet-emoji {
  font-size: 1.8rem;
  text-align: center;
}

.reward-wallet-name {
  font-weight: 800;
  color: #0f172a;
}

.reward-wallet-sn {
  font-size: 12px;
  color: #94a3b8;
  font-family: monospace;
}

.reward-wallet-st {
  font-size: 12px;
  font-weight: 800;
  color: #2563eb;
  white-space: nowrap;
}

.reward-ticket {
  position: relative;
  padding: 20px 18px 16px;
  border-radius: 18px;
  background: #fff;
  border: 3px dashed #cbd5e1;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

.reward-ticket-stars {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  color: #fbbf24;
  font-size: 12px;
  letter-spacing: 4px;
}

.reward-ticket-main {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}

.reward-ticket-art {
  font-size: 3rem;
  flex: 0 0 auto;
}

.reward-ticket-text h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.reward-ticket-text p {
  margin: 0;
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
}

.reward-ticket-cut {
  margin: 14px 0 10px;
  border-top: 2px dashed #cbd5e1;
}

.reward-ticket-barcode {
  display: flex;
  justify-content: center;
  gap: 3px;
  height: 36px;
  align-items: flex-end;
}

.reward-ticket-barcode span {
  display: inline-block;
  width: 4px;
  background: #334155;
  border-radius: 1px;
}

.reward-ticket-barcode span:nth-child(1) { height: 28px; }
.reward-ticket-barcode span:nth-child(2) { height: 22px; }
.reward-ticket-barcode span:nth-child(3) { height: 32px; }
.reward-ticket-barcode span:nth-child(4) { height: 18px; }

.reward-ticket-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}

.reward-detail-actions {
  margin-top: 16px;
}

.reward-detail-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}

.reward-detail-actions .reward-detail-btn {
  flex: 1 1 calc(50% - 5px);
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  white-space: normal;
  word-break: keep-all;
}

.reward-detail-actions a.reward-detail-btn {
  color: #fff;
}

.reward-detail-actions .reward-detail-btn--back {
  background: #64748b;
  box-shadow: 0 3px 0 #475569;
}

.reward-detail-actions .reward-detail-btn--back:hover {
  filter: brightness(1.08);
}

.reward-pin-form {
  margin: 12px 0;
  max-width: 100%;
}

.reward-pin-form .reward-detail-btn {
  width: 100%;
  margin-top: 8px;
}

.reward-hint {
  font-size: 14px;
  color: #475569;
}

.reward-hint.warn {
  color: #b45309;
  font-weight: 700;
}

.reward-theme--r01 .reward-card-art,
.reward-theme--r01.reward-wallet-item { background: linear-gradient(145deg, #fecaca, #fef08a); }
.reward-theme--r02 .reward-card-art { background: linear-gradient(145deg, #bbf7d0, #fef08a); }
.reward-theme--r03 .reward-card-art { background: linear-gradient(145deg, #e9d5ff, #fbcfe8); }
.reward-theme--r04 .reward-card-art { background: linear-gradient(145deg, #bfdbfe, #fef9c3); }

/* 兑换记录 */
.reward-history-box {
  padding: 12px 14px 16px;
}

.reward-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reward-history-row {
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
}

.reward-history-main {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none !important;
  color: inherit !important;
}

.reward-history-main:hover {
  background: #f8fafc;
}

.reward-history-emoji {
  font-size: 1.75rem;
  text-align: center;
}

.reward-history-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.reward-history-name {
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
}

.reward-history-meta {
  font-size: 13px;
  color: #64748b;
}

.reward-history-balance {
  font-size: 12px;
  color: #94a3b8;
}

.reward-history-cost {
  font-weight: 900;
  font-size: 1.1rem;
  color: #ea580c;
  white-space: nowrap;
}

.reward-history-summary {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 14px;
  color: #475569;
}

@media (max-width: 1024px) {
  body.app-root.page-reward-shop .main-shell,
  body.app-root.page-my-rewards .main-shell,
  body.app-root.page-reward-history .main-shell {
    padding-top: 5px;
  }
}

@media (max-width: 640px) {
  body.app-root.page-reward-shop .reward-page,
  body.app-root.page-my-rewards .reward-page,
  body.app-root.page-reward-history .reward-page {
    padding-top: 2px;
  }

  .reward-hero-card {
    padding: 7px 12px 12px;
    border-radius: 16px;
  }

  .reward-hero-card__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-bottom: 6px;
    margin-bottom: 8px;
  }

  .reward-hero-card__quick {
    width: 100%;
    max-width: none;
  }

  .reward-quick-tile {
    padding: 8px 6px;
    font-size: 12px;
  }

  .reward-hero-card__head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .reward-hero-card__logo {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .reward-hero-card__title {
    font-size: 1.3rem;
  }

  /* 手机端能量两格并排，不竖向分行 */
  .reward-hero-card__stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .reward-stat-tile {
    padding: 10px 8px;
  }

  .reward-stat-tile__label {
    font-size: 11px;
  }

  .reward-stat-tile__value {
    font-size: 1.25rem;
  }

  .reward-stat-tile__sub {
    font-size: 10px;
  }

  .reward-tabs-panel {
    padding: 10px 12px 12px;
  }

  .reward-tab {
    font-size: 13px;
    padding: 7px 12px;
  }

  .reward-detail-actions__btns {
    flex-direction: column;
    gap: 8px;
  }

  .reward-detail-actions .reward-detail-btn {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .reward-history-main {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
  }

  .reward-history-cost {
    grid-column: 2;
    justify-self: start;
  }

  .reward-nav-links {
    margin-left: 0;
    width: 100%;
  }
  .reward-wallet-item {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
  }

  .reward-wallet-sn,
  .reward-wallet-st {
    grid-column: 2;
  }
}

@media (max-width: 480px) {
  .hero-actions--quad {
    gap: 8px;
    max-width: none;
  }

  .hero-actions--quad .hero-btn {
    font-size: 14px;
    padding: 12px 8px;
  }
}

/* ========== 200 句语境学习 SentenceLearn ========== */
.page-sentence-learn .box.ctx-sent-card {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.ctx-sent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ctx-sent-head-ico { font-size: 28px; }

.ctx-sent-title {
  margin: 0;
  font-size: 22px;
  color: #1e3a5f;
}

.ctx-sent-sub {
  margin: 0 0 12px;
  color: #475569;
  font-size: 15px;
}

/* 已完成 / 待复习句：始终并排两列，卡片内标签与数字同一行 */
.ctx-sent-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  max-width: 440px;
  width: 100%;
  box-sizing: border-box;
}

.ctx-sent-stat {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.ctx-sent-stat-k {
  font-size: 13px;
  color: #92400e;
  white-space: nowrap;
  flex-shrink: 0;
}

.ctx-sent-stat-v {
  font-size: 17px;
  font-weight: 800;
  color: #78350f;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .ctx-sent-stats {
    max-width: none;
    gap: 8px;
  }

  .ctx-sent-stat {
    padding: 8px 10px;
    gap: 4px;
  }

  .ctx-sent-stat-k {
    font-size: 12px;
  }

  .ctx-sent-stat-v {
    font-size: 15px;
  }
}

.ctx-sent-hint {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.55;
}

.ctx-sent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 62vh;
  overflow-y: auto;
}

.ctx-sent-list-link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ctx-sent-list-link:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.ctx-sent-list-item--done .ctx-sent-list-link {
  border-left: 4px solid #22c55e;
}

.ctx-sent-list-no {
  display: block;
  font-weight: 700;
  color: #b45309;
  font-size: 14px;
}

.ctx-sent-list-preview {
  display: block;
  font-size: 13px;
  color: #334155;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctx-sent-list-meta {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.ctx-sent-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ctx-sent-back {
  font-size: 14px;
  color: #2563eb;
  text-decoration: none;
}

.ctx-sent-detail-no {
  font-weight: 800;
  color: #b45309;
}

.ctx-sent-detail-unit {
  font-size: 13px;
  color: #64748b;
}

.ctx-sent-detail-topic {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
}

.ctx-sent-grammar {
  margin: 0 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}

.ctx-sent-grammar-summary {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  list-style: none;
}

.ctx-sent-grammar-summary::-webkit-details-marker {
  display: none;
}

.ctx-sent-grammar-body {
  padding: 0 14px 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  white-space: pre-wrap;
}

.ctx-sent-en-wrap {
  position: relative;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border-radius: 14px;
  padding: 16px 14px 14px;
  margin-bottom: 12px;
}

.ctx-sent-speak-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: auto;
  height: auto;
  min-height: 36px;
  padding: 8px 14px;
  margin-bottom: 10px;
  border-radius: 999px;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  font-size: 14px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: none;
}

.ctx-sent-speak-all .es-speak-ico {
  flex-shrink: 0;
}

.ctx-sent-en {
  font-size: 17px;
  line-height: 1.65;
}

.ctx-sent-kw {
  color: #fbbf24;
  font-weight: 700;
  border-bottom: 1px dashed rgba(251, 191, 36, 0.6);
}

.ctx-sent-zh-block { margin-bottom: 16px; }

.ctx-sent-zh-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
}

.ctx-sent-zh {
  margin: 10px 0 0;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 10px;
  line-height: 1.65;
  color: #334155;
}

.ctx-sent-words-title {
  margin: 0 0 10px;
  font-size: 16px;
  color: #1e293b;
}

.ctx-sent-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.ctx-sent-word {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.ctx-sent-word--strong { border-color: #86efac; background: #f0fdf4; }
.ctx-sent-word--weak { border-color: #fca5a5; background: #fef2f2; }

.ctx-sent-word-en {
  font-weight: 800;
  color: #0f172a;
}

.ctx-sent-word-ph {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0;
}

.ctx-sent-word-zh-text {
  font-size: 14px;
  color: #334155;
  margin: 6px 0;
}

.ctx-sent-word-zh-btn {
  font-size: 12px;
  border: none;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  padding: 0;
}

.ctx-sent-mark-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.ctx-sent-mark {
  flex: 1;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 6px 4px;
  font-size: 13px;
  cursor: pointer;
}

.ctx-sent-mark--picked.ctx-sent-mark--strong {
  background: #22c55e;
  color: #fff;
  border-color: #16a34a;
}

.ctx-sent-mark--picked.ctx-sent-mark--weak {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}

.ctx-sent-actions {
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
}

.ctx-sent-done-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  margin-bottom: 10px;
}

.ctx-sent-done-btn--on {
  background: linear-gradient(135deg, #86efac, #22c55e);
  color: #14532d;
}

.ctx-sent-quiz-row,
.ctx-sent-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ctx-sent-quiz-btn {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 11px 10px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.ctx-sent-quiz-btn--mc {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff !important;
}

.ctx-sent-quiz-btn--dict {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #fff !important;
}

.ctx-sent-nav-btn {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  text-decoration: none;
  color: #334155;
  font-size: 14px;
}

.ctx-sent-nav-btn--next {
  margin-left: auto;
}

.ctx-sent-continue-wrap {
  margin: 0 0 14px;
}

.ctx-sent-continue-btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.ctx-sent-continue-btn:hover {
  filter: brightness(1.05);
  color: #fff;
}

.ctx-sent-section-title {
  margin: 16px 0 10px;
  font-size: 1rem;
  color: #334155;
}

.ctx-sent-review-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.ctx-sent-review-link {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 14px;
  text-decoration: none;
  line-height: 1.45;
}

.ctx-sent-review-link:hover {
  background: #fef3c7;
}

.ctx-sent-unit {
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}

.ctx-sent-unit-summary {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  list-style: none;
}

.ctx-sent-unit-summary::-webkit-details-marker {
  display: none;
}

.ctx-sent-unit[open] .ctx-sent-unit-summary {
  border-bottom: 1px solid #e2e8f0;
  background: #f1f5f9;
}

.ctx-sent-unit .ctx-sent-list {
  margin: 0;
  padding: 8px;
  background: #fff;
}

.ctx-sent-kw {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.ctx-sent-kw:focus {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

.ctx-sent-kw-pop {
  position: relative;
  margin-bottom: 12px;
  padding: 12px 36px 12px 14px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.ctx-sent-kw-pop-word {
  font-size: 1.1rem;
  font-weight: 700;
  color: #92400e;
}

.ctx-sent-kw-pop-ph {
  font-size: 13px;
  color: #78716c;
  margin-top: 4px;
}

.ctx-sent-kw-pop-zh {
  font-size: 14px;
  color: #1e293b;
  margin-top: 8px;
  line-height: 1.5;
}

.ctx-sent-kw-pop-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: #fde68a;
  color: #78350f;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.stats-quest-chip--ctx .stats-quest-chip-v {
  color: #b45309;
}

.ctx-sent-progress-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.ctx-sent-progress-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(#f59e0b calc(var(--ctx-pct, 0) * 1%), #e2e8f0 0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.22);
}

.ctx-sent-progress-ring-inner {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.ctx-sent-progress-ring-v {
  font-size: 15px;
  font-weight: 800;
  color: #b45309;
}

.ctx-sent-progress-ring-k {
  font-size: 11px;
  color: #78716c;
}

.ctx-sent-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 10px;
}

.ctx-sent-section-head .ctx-sent-section-title {
  margin: 0;
}

.ctx-sent-section-link {
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
}

.ctx-sent-section-link:hover {
  text-decoration: underline;
}

.ctx-sent-hub-quiz-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ctx-sent-quiz-btn {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.ctx-sent-quiz-btn--mc {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

.ctx-sent-quiz-btn--dict {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
}

.ctx-sent-quiz-btn:hover {
  filter: brightness(1.06);
  color: #fff;
}

.ctx-sent-unit-quiz {
  margin: 0;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
}

.ctx-sent-unit-quiz-link {
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
  text-decoration: none;
}

.ctx-sent-unit-quiz-link:hover {
  text-decoration: underline;
}

.ctx-sent-cloze-btn {
  float: right;
  margin: 0 0 8px 8px;
}

.ctx-sent-kw--cloze {
  display: inline-block;
  vertical-align: baseline;
  text-decoration: none;
}

.ctx-sent-cloze-inp {
  width: 5em;
  max-width: 120px;
  padding: 2px 6px;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  background: #fffbeb;
  color: #1e293b;
  font-size: 14px;
  font-family: inherit;
}

.ctx-sent-cloze-inp--ok {
  border-color: #22c55e;
  background: #ecfdf5;
}

.ctx-sent-cloze-inp--bad {
  border-color: #ef4444;
  background: #fef2f2;
}

.stats-quest-sent-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}

.stats-quest-sent-head {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
}

.stats-quest-sent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-quest-sent-link {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 14px;
  text-decoration: none;
}

.stats-quest-sent-link:hover {
  background: #fef3c7;
}

.ctx-sent-admin-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.ctx-sent-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ctx-sent-admin-table th,
.ctx-sent-admin-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.ctx-sent-admin-table th {
  background: #f1f5f9;
  white-space: nowrap;
}

.ctx-sent-admin-preview {
  max-width: 360px;
  line-height: 1.45;
  color: #334155;
}

.ctx-sent-admin-source {
  max-width: 120px;
  font-size: 12px;
  color: #64748b;
}

.ctx-sent-admin-row--off {
  opacity: 0.72;
  background: #f8fafc;
}

.ctx-sent-admin-actions {
  white-space: nowrap;
}

.ctx-sent-admin-toggle {
  font-size: 13px;
}

.ctx-sent-admin-map-row td {
  padding-top: 0;
  border-top: none;
  background: #fff;
}

.ctx-sent-admin-map {
  margin: 0 0 8px;
}

.ctx-sent-admin-map summary {
  cursor: pointer;
  font-size: 13px;
  color: #2563eb;
  padding: 4px 0 8px;
}

.ctx-sent-admin-map-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ctx-sent-admin-map-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
}

.ctx-sent-admin-map-item--key {
  background: #fffbeb;
  border-color: #fde68a;
}

.ctx-sent-admin-map-ord {
  color: #94a3b8;
  min-width: 1.5em;
}

.ctx-sent-admin-map-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fcd34d;
  color: #78350f;
}
