/* ==========================================================================
   Quiz · 学习端
   --------------------------------------------------------------------------
   令牌、按钮、卡片、表单、胶囊来自 app.css；这里只写学习端版式：
   首页机型（考次 → 套数）、试卷详情、答题页（材料 + 题目）、我的学习。
   目标：紧凑可读、翻页少、宽屏不浪费。
   ========================================================================== */

/* 返回链接：试卷详情与答题页共用 */
.learn-back {
  display: inline-block;
  font-size: 13px; font-weight: 550; color: var(--muted);
  padding: 6px 10px 6px 0; margin-bottom: 6px;
}
.learn-back:hover { color: var(--text); }

/* ==========================================================================
   首页
   ========================================================================== */
.home-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin: 2px 0 14px;
}
.home-hero > div { min-width: 0; }
.home-hero h1 {
  font-size: clamp(28px, 3.6vw, 42px); line-height: 1.1;
  letter-spacing: -.045em; font-weight: 720; margin: 8px 0 6px;
}
.home-hero p { font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 52em; margin: 0; }
.home-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 工具条：考试分段 + 搜索，一行放完 */
.home-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.home-tools .search {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; padding: 4px 4px 4px 14px;
  background: var(--surface); border-radius: var(--pill-radius);
  box-shadow: var(--shadow-xs);
  min-width: 220px;
  transition: box-shadow .18s, background .18s;
}
/* 焦点画在整个胶囊上，不在内部输入框上截出一个矩形：
   输入框自身没有圆角，若由它显示焦点环就会变成方框。 */
.home-tools .search:focus-within {
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .2), var(--shadow-xs);
}
.home-tools .search input {
  border: 0; background: none; background-color: var(--surface); min-height: 34px; padding: 0;
  font-size: 14px; width: 100%; min-width: 120px; border-radius: inherit;
}
.home-tools .search input:focus,
.home-tools .search input:focus-visible { outline: none; box-shadow: none; border-color: transparent; }
.home-tools .search button {
  border: 0; border-radius: var(--pill-radius); background: var(--ios-dark); color: #fff;
  min-height: 34px; padding: 0 15px; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.home-tools .search button:hover { background: #2C2C2E; }
.home-tools .search .search-icon { color: var(--muted); font-size: 14px; }

.home-year-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.home-year-row .chip-scroller { flex: 1; min-width: 0; }

/* 考次分组 */
.session-list { display: grid; gap: 10px; }
.session {
  background: transparent; border-radius: var(--card-radius);
  padding: 2px 0 4px;
  animation: slide-in .3s var(--ease-out) backwards;
}
.session-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 8px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.session-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; margin: 0; }
.session-head .quiet { font-size: 12px; }
/* 一场考试通常 3（单科）或 6（四六级各 3 套）份，固定 3 列刚好排满两行。 */
.session-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) { .session-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .session-grid { grid-template-columns: minmax(0, 1fr); } }
.paper-tile {
  display: grid; gap: 5px; align-content: start;
  padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 18px rgba(0, 0, 0, .05);
  transition: transform .18s var(--ease), background .18s, box-shadow .18s;
}
/* 默认白底无边框（靠柔和阴影分层），悬停浅灰（与原先的两种颜色对调）。 */
.paper-tile:hover { background: var(--fill); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.paper-tile:active { transform: scale(.99); }
.paper-tile-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.paper-tile-top .pill { background: rgba(var(--brand-rgb), .10); color: var(--brand-text); font-size: 11px; padding: 2px 8px; }
/* 完成度角标推到卡片右上角；按分值累计，练两遍可超过 100%。 */
.paper-tile-progress {
  margin-left: auto; flex: 0 0 auto;
  padding: 2px 8px; border-radius: 999px;
  background: var(--fill-strong); color: var(--text-2);
  font-size: 11px; font-weight: 650; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.paper-tile-progress.is-complete { background: var(--success-bg); color: var(--success-text); }
.paper-tile strong { font-size: 15px; font-weight: 600; letter-spacing: -.015em; line-height: 1.35; }
.paper-tile small { font-size: 12px; color: var(--muted); }
.paper-tile-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); margin-top: 0;
}
.paper-tile-meta span { white-space: nowrap; }
/* 题量与「进入练习」同处一行，省掉一整行高度 */
.paper-tile-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.paper-tile-cta { font-size: 12px; font-weight: 600; color: var(--brand-text); white-space: nowrap; }

.home-empty { margin-top: 4px; }
.home-footnote { font-size: 12px; line-height: 1.8; color: var(--muted); margin: 20px 0 0; }

/* ==========================================================================
   试卷详情
   ========================================================================== */
.paper-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap; margin: 4px 0 18px; }
.paper-hero > div { min-width: 0; }
.paper-hero h1 { font-size: clamp(24px, 3vw, 34px); margin: 8px 0 8px; letter-spacing: -.04em; }
.paper-hero p { color: var(--muted); margin: 0; max-width: 52em; }
.paper-hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; flex-wrap: nowrap; }
.paper-hero-actions > form { display: flex; align-items: center; margin: 0; }
.paper-hero-actions .button { white-space: nowrap; }
.paper-stats { margin-bottom: 16px; }

/* minmax(0,1fr)：默认的 min-width:auto 会让长内容把整列撑出视口。 */
.paper-outline { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.paper-part {
  background: var(--surface); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow); padding: 14px 16px;
  min-width: 0;
}
.paper-part > .row { margin-bottom: 10px; }
.paper-part h2 { font-size: 17px; font-weight: 650; margin: 0; }
.paper-section + .paper-section { margin-top: 4px; }
.paper-section-head {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 6px 0; letter-spacing: .02em;
}
.unit-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 9px 0; border-top: 1px solid var(--line);
}
.unit-row > div { min-width: 0; }
/* 只作用于材料标题区，不要波及右侧操作块里的 strong。 */
.unit-main > strong { font-size: 14px; font-weight: 550; display: block; }
.unit-main > small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.unit-row .button { flex-shrink: 0; }

/* 单题入口与整卷提示：提示紧贴按钮下方，桌面端右对齐、窄屏同样堆叠。 */
.unit-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.unit-main { flex: 1 1 auto; min-width: 0; }

.unit-whole-hint {
  display: flex; align-items: baseline; gap: 0;
  font-size: 11px; line-height: 1.35;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  text-decoration: none; white-space: nowrap;
}
.unit-whole-hint strong {
  display: inline; margin: 0 0 0 3px;
  font-size: inherit; line-height: inherit;
  color: var(--brand-text, var(--brand-color)); font-weight: 650;
}
.unit-whole-hint:hover strong { text-decoration: underline; }

@media (max-width: 640px) {
  .unit-row { gap: 10px; }
  /* 窄屏题量信息单行省略，避免折成三行把每行撑高。 */
  .unit-main > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .unit-whole-hint { font-size: 10.5px; }
}
/* 跳回顶部时短暂高亮真正的「开始整卷练习」按钮，避免用户还要自己找。 */
@keyframes paper-start-flash {
  0% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb, 247 154 62), .55); }
  100% { box-shadow: 0 0 0 14px rgba(var(--brand-rgb, 247 154 62), 0); }
}
.paper-hero-actions .is-flashing { animation: paper-start-flash .9s ease-out 2; }

/* ==========================================================================
   答题页 · 工具栏
   ========================================================================== */
.learn-practice { --pq-gap: 12px; }
.learn-practice .learn-practice-toolbar {
  position: sticky; top: 60px; z-index: 18;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 18px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 8px;
  border-radius: 16px;
  background: rgba(251, 251, 253, .86);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05);
}
.learn-practice .learn-toolbar-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.learn-practice .learn-toolbar-title h1 {
  font-size: 17px; font-weight: 650; letter-spacing: -.02em; margin: 0;
  max-width: 28em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 材料准备完成后标题接收程序焦点，不为非交互标题绘制按钮式焦点框。 */
.learn-practice .learn-toolbar-title h1[tabindex="-1"]:focus { outline: none; }
.learn-practice .learn-toolbar-title .pill { font-size: 11px; padding: 2px 9px; flex-shrink: 1; }
.learn-practice .learn-back {
  font-size: 13px; color: var(--muted); padding: 5px 8px 5px 0; font-weight: 550;
  margin-bottom: 0;
}
.learn-practice .learn-back:hover { color: var(--text); }
.learn-practice .learn-toolbar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.learn-practice .learn-answered {
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 4px 11px; border-radius: var(--pill-radius); background: var(--fill);
  white-space: nowrap;
}
.learn-practice .learn-save-sync {
  display: inline-flex; align-items: center;
  padding: 6px 10px; border: 1px solid transparent; border-radius: var(--pill-radius);
  background: var(--fill); color: var(--muted); font: inherit; cursor: pointer;
}
.learn-practice .learn-save-sync:hover:not(:disabled) { border-color: var(--muted); }
.learn-practice .learn-save-sync:focus-visible { outline: 2px solid var(--ios-blue, #007aff); outline-offset: 3px; }
.learn-practice .learn-save-sync:disabled { cursor: wait; opacity: .65; }
.learn-practice .learn-save-state {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.learn-practice .learn-save-state::before {
  content: ''; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--ios-red);
  transition: background .2s;
}
.learn-practice .learn-save-state[data-save-state="local"]::before { background: #FFCC00; }
.learn-practice .learn-save-state[data-save-state="synced"]::before { background: var(--ios-green); }
.learn-practice .learn-save-detail { font-size: 12px; color: var(--danger-text); overflow-wrap: anywhere; }
/* Both departure phases keep the same silhouette, even on a fast sync. */
.learn-dialog.learn-leave-dialog,
.learn-dialog.learn-sync-dialog {
  box-sizing: border-box; width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px);
  margin: auto; padding: 28px; overflow: auto;
  border: 1px solid var(--line, #e5e5ea); border-radius: 24px;
  background: var(--surface, #fff); color: var(--text, #1c1c1e);
  font-family: var(--font-text); box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
}
.learn-leave-dialog::backdrop,
.learn-sync-dialog::backdrop { background: rgba(28, 28, 30, .36); backdrop-filter: blur(4px); }
.learn-leave-dialog p,
.learn-sync-dialog > p:first-child { margin: 0 0 22px; font-size: 17px; font-weight: 650; line-height: 1.65; overflow-wrap: anywhere; }
.learn-leave-dialog .learn-dialog-actions { display: flex; flex-wrap: wrap; justify-content: stretch; gap: 10px; margin: 0; padding-top: 20px; border-top: 1px solid var(--line, #e5e5ea); }
.learn-leave-dialog .learn-dialog-actions .button { flex: 1 1 140px; min-height: 44px; padding: 10px 14px; border-radius: 13px; font-size: 13px; box-shadow: none; }
.learn-leave-dialog .learn-dialog-actions .button:not(.button-primary) { background: var(--fill, #f2f2f7); border-color: transparent; }
.learn-leave-dialog button:focus-visible { outline: 2px solid var(--brand-text, #8a4b00); outline-offset: 3px; }
.learn-sync-dialog progress { display: block; width: 100%; height: 6px; margin: 0; border: 0; border-radius: 999px; overflow: hidden; appearance: none; background: var(--fill, #f2f2f7); accent-color: var(--brand-color, #f79a3e); }
.learn-sync-dialog progress::-webkit-progress-bar { background: var(--fill, #f2f2f7); border-radius: 999px; }
.learn-sync-dialog progress::-webkit-progress-value { background: var(--brand-color, #f79a3e); border-radius: 999px; }
.learn-sync-dialog progress::-moz-progress-bar { background: var(--brand-color, #f79a3e); border-radius: 999px; }
.learn-sync-dialog > [role="status"] { margin: 14px 0 0; color: var(--text-2, #3a3a3c); font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .learn-dialog.learn-leave-dialog, .learn-dialog.learn-sync-dialog { padding: 22px; border-radius: 20px; }
  .learn-leave-dialog p, .learn-sync-dialog > p:first-child { font-size: 16px; }
}
.learn-practice .learn-zoom {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 2px; border-radius: var(--pill-radius); background: var(--fill);
}
.learn-practice .learn-zoom button {
  border: 0; background: none; min-height: 28px; min-width: 28px;
  border-radius: var(--pill-radius); padding: 0 8px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  --tap-min: 28px;
}
.learn-practice .learn-zoom button:hover { background: var(--surface); }
.learn-practice .learn-zoom [data-zoom-value] {
  min-width: 38px; text-align: center; font-size: 12px;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.learn-practice .learn-practice-toolbar .button {
  min-height: 32px; padding: 4px 12px; font-size: 12px; border-radius: 12px;
}
/* 划词翻译开关：未开启用浅珊瑚底与深红文字，低干扰地提示状态；
   开启后保留蓝底白字表示正在生效；两种状态都不描边。 */
.learn-practice .learn-toolbar-tools .learn-translate-toggle,
.learn-practice .learn-toolbar-tools .learn-layout-toggle {
  border: 0; color: #fff;
}
.learn-practice .learn-toolbar-tools .learn-translate-toggle {
  background: #FEE4E2; color: #B42318; font-weight: 650; letter-spacing: .01em;
  box-shadow: none;
}
.learn-practice .learn-toolbar-tools .learn-translate-toggle:hover { background: #FECDCA; border-color: transparent; }
.learn-practice .learn-toolbar-tools .learn-translate-toggle.is-active,
.learn-practice .learn-toolbar-tools .learn-translate-toggle[aria-pressed="true"] {
  background: #0071E3; color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(0, 113, 227, .24);
}
.learn-practice .learn-toolbar-tools .learn-translate-toggle.is-active:hover { background: #0063C6; }
.learn-practice .learn-toolbar-tools .learn-layout-toggle { background: var(--fill); color: var(--text-2); }
.learn-practice .learn-toolbar-tools .learn-layout-toggle:hover { background: var(--fill-strong); border-color: transparent; }
.learn-practice .learn-toolbar-tools .learn-layout-toggle[aria-pressed="true"] {
  background: rgba(var(--brand-rgb), .12); color: var(--brand-text); border-color: transparent;
}
.learn-practice .learn-toolbar-tools .button-primary {
  background: var(--ios-dark); border-color: var(--ios-dark); color: #fff;
}

/* 结果统计 */
.learn-practice .learn-result-stats { margin-bottom: 12px; }
.learn-result-stats small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* ==========================================================================
   答题页 · 骨架
   ========================================================================== */
/* 答题页是「左目录 + 右正文」的阅读型版式，1440px 外壳在宽屏上会浪费两侧空间，
   单独放宽到与后台工作台一致的 1720px；页头页脚一起放宽，保持左边缘对齐。 */
.has-practice .public-header-inner,
.has-practice .public-main,
.has-practice .public-footer { max-width: 1720px; }
.learn-practice .learn-practice-grid {
  display: grid; grid-template-columns: 216px minmax(0, 1fr);
  gap: 14px; align-items: start;
}
.learn-practice.is-whole-paper .learn-practice-grid { grid-template-columns: 216px minmax(0, 1fr); }

/* 目录 */
.learn-practice .learn-material-nav {
  position: sticky; top: 106px;
  max-height: calc(100dvh - 122px); overflow: auto;
  padding: 8px; border-radius: var(--card-radius);
  background: var(--surface); box-shadow: var(--card-shadow);
  scrollbar-width: thin;
}
.learn-practice .learn-material-nav summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; font-size: 12px; font-weight: 650;
  color: var(--muted); cursor: pointer; list-style: none;
}
.learn-practice .learn-material-nav summary::-webkit-details-marker { display: none; }
.learn-practice .learn-material-nav summary span { font-weight: 500; }
.learn-practice .learn-material-nav nav { display: grid; gap: 1px; padding-bottom: 4px; }
.learn-practice .learn-material-nav h2 {
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin: 12px 10px 4px;
}
.learn-practice .learn-material-nav h3 {
  font-size: 11px; font-weight: 550; color: var(--muted); margin: 6px 10px 2px;
}
.learn-practice .learn-material-nav a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.5; color: var(--text-2);
  transition: background .16s, color .16s;
}
.learn-practice .learn-material-nav a span { min-width: 0; }
.learn-practice .learn-material-nav a small {
  flex-shrink: 0; font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.learn-practice .learn-material-nav a:hover { background: var(--fill); }
.learn-practice .learn-material-nav a.current {
  background: rgba(var(--brand-rgb), .12); color: var(--brand-text); font-weight: 600;
}
.learn-practice .learn-material-nav a.current small { color: var(--brand-text); opacity: .8; }

.learn-practice .learn-paper-body { min-width: 0; display: grid; gap: var(--pq-gap); }

/* 分页：双栏时收起目录（材料占左栏）；整卷连排保留目录栏 */
.learn-practice:not(.is-whole-paper) .learn-practice-grid:has(.layout-columns) { grid-template-columns: minmax(0, 1fr); }
.learn-practice:not(.is-whole-paper) .learn-practice-grid:has(.layout-columns) .learn-material-nav { display: none; }

/* ==========================================================================
   答题页 · 单栏 / 双栏
   ========================================================================== */
.learn-practice .learn-active-unit { min-width: 0; display: grid; gap: var(--pq-gap); }
.learn-practice .learn-active-unit.layout-columns {
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  align-items: start;
}
.learn-practice .learn-active-unit.layout-columns > .learn-practice-footer,
.learn-practice .learn-active-unit.layout-columns > .learn-inline-status,
.learn-practice .learn-active-unit.layout-columns > .learn-result-stats,
.learn-practice .learn-active-unit.layout-columns > .learn-ai {
  grid-column: 1 / -1;
}
.learn-practice .learn-active-unit.layout-columns > .learn-material {
  position: sticky; top: 106px;
  max-height: calc(100dvh - 122px); overflow: auto;
  scrollbar-width: thin;
}
.learn-practice .learn-active-unit.layout-columns > .learn-questions { min-height: 0; }

/* ==========================================================================
   材料卡
   ========================================================================== */
.learn-practice .learn-material {
  padding: 16px 20px 18px;
  border-radius: var(--card-radius);
  background: var(--surface); box-shadow: var(--card-shadow);
}
.learn-practice .learn-material-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.learn-practice .learn-material-head .eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 650; letter-spacing: .05em;
  color: var(--brand-text);
}
.learn-practice .learn-material-head .eyebrow::before {
  content: ''; width: 22px; height: 22px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 3px, transparent 3.5px),
    linear-gradient(145deg, var(--brand-color), color-mix(in oklab, var(--brand-color), #000 16%));
  box-shadow: 0 2px 8px rgba(var(--brand-rgb), .32);
}
.learn-practice .learn-material-head .pill.push { margin-left: auto; }
.learn-practice .learn-material h2 {
  font-size: 19px; font-weight: 650; letter-spacing: -.025em;
  margin: 6px 0 8px;
}
.learn-practice .learn-directions {
  font-size: 12px; line-height: 1.75; color: var(--muted);
  white-space: pre-wrap; margin: 0 0 10px;
}
/* 写作题的 Directions 是原卷上的一个任务说明块：Directions: 左对齐，其后各条
   要求共享同一左缩进、行距紧凑。正文那套「首行缩进 2em + 段间距」会把每条印
   刷行都撑成独立段落，五条要求就散成五块，读起来与原卷相反。 */
.learn-practice .study-text.is-task .exam-para,
.learn-practice .study-text.is-task .exam-para + .exam-para {
  text-indent: 0; margin-top: .15em; padding-left: 1.4em;
}
.learn-practice .study-text.is-task .exam-para.is-heading {
  padding-left: 0; margin-top: 0; margin-bottom: 0;
}
.learn-practice .study-text.is-task .exam-table-wrap { margin: .4em 0 0 1.4em; }
.learn-practice .learn-audio {
  display: grid; gap: 6px;
  margin: 10px 0 14px; padding: 10px 12px;
  background: var(--fill); border-radius: 14px;
}
.learn-practice .learn-audio > span { font-size: 11px; color: var(--muted); }
.learn-practice .learn-audio audio { width: 100%; height: 38px; display: block; }
.learn-practice .learn-audio.is-seeking { animation: audio-flash 1.2s ease-out 2; }
@keyframes audio-flash {
  0% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), .35); }
  100% { box-shadow: 0 0 0 14px rgba(var(--brand-rgb), 0); }
}
.learn-practice .learn-source-image {
  display: block; margin: 10px auto 14px; max-height: 560px;
  object-fit: contain; border-radius: 12px;
}
.learn-practice .learn-paragraphs { display: grid; gap: 12px; }
.learn-practice .learn-paragraph {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px;
}
.learn-practice .learn-paragraph > strong {
  font-size: 12px; font-weight: 700; color: var(--brand-text); padding-top: 6px;
}
.learn-practice .learn-word-bank {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px; padding: 10px; margin-top: 14px;
  background: var(--fill); border-radius: 14px;
}
.learn-practice .learn-word-bank > div {
  display: flex; gap: 8px; align-items: baseline; min-width: 0;
  padding: 5px 8px; border-radius: 9px;
  transition: background .16s;
}
.learn-practice .learn-word-bank > div:hover { background: var(--surface); }
.learn-practice .learn-word-bank strong {
  font-size: 11px; font-weight: 700; color: var(--brand-text); flex-shrink: 0;
}
.learn-practice .learn-word-bank span { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.learn-practice .learn-reference { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.learn-practice .learn-reference summary {
  font-size: 12px; font-weight: 600; color: var(--brand-text);
  cursor: pointer; padding: 6px 0; list-style: none;
}
.learn-practice .learn-reference summary::-webkit-details-marker { display: none; }
.learn-practice .learn-reference summary::before { content: '▸ '; }
.learn-practice .learn-reference[open] summary::before { content: '▾ '; }
.learn-practice .learn-reference .study-text { margin-top: 8px; font-size: 15px; }

/* ==========================================================================
   题目区
   ========================================================================== */
.learn-practice .learn-questions {
  padding: 4px 20px 14px;
  border-radius: var(--card-radius);
  background: var(--surface); box-shadow: var(--card-shadow);
}
.learn-practice .learn-question {
  border: 0; margin: 0; min-width: 0;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
}
.learn-practice .learn-question:last-child { border-bottom: 0; padding-bottom: 4px; }
.learn-practice .learn-question legend {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  width: 100%; float: left; margin-bottom: 8px; padding: 0;
  font-size: 13px; font-weight: 650;
}
.learn-practice .learn-question legend + * { clear: both; }
.learn-practice .learn-q-number {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px; padding: 0 8px;
  border-radius: 8px; background: var(--fill);
  font-size: 12px; font-weight: 700; color: var(--text-2);
  font-variant-numeric: tabular-nums;
  transition: background .16s, color .16s;
}
.learn-practice .learn-q-number.is-audio-link {
  cursor: pointer; color: var(--brand-text);
  background: rgba(var(--brand-rgb), .10);
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px;
}
.learn-practice .learn-q-number.is-audio-link:hover { background: rgba(var(--brand-rgb), .18); }
.learn-practice .learn-q-play {
  border: 0; background: rgba(var(--brand-rgb), .09); color: var(--brand-text);
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: var(--pill-radius); cursor: pointer;
  transition: background .16s, transform .16s;
}
.learn-practice .learn-q-play:hover { background: rgba(var(--brand-rgb), .18); transform: translateY(-1px); }
.learn-practice .learn-question-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.learn-practice .learn-favorite {
  border: 0; background: none; color: var(--muted);
  font-size: 11px; font-weight: 550; padding: 4px 8px; border-radius: 8px;
}
.learn-practice .learn-favorite:hover { background: var(--fill); color: var(--text-2); }
.learn-practice .learn-favorite[aria-pressed="true"] { color: var(--ios-gold); }
.learn-practice .learn-q-ai {
  border: 0; background: rgba(var(--brand-rgb), .10); color: var(--brand-text);
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 8px;
  white-space: nowrap;
}
.learn-practice .learn-q-ai:hover { background: rgba(var(--brand-rgb), .18); }

.learn-practice .learn-stem {
  font-size: 14px; line-height: 1.75; margin: 0 0 8px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* 同句多题（专八改错）：首题标注共用范围，后续题指向首题，不再重复整句 */
.learn-practice .learn-stem-scope,
.learn-practice .learn-stem-shared {
  font-size: 12.5px; line-height: 1.6; margin: -4px 0 8px; color: var(--muted);
}
.learn-practice .learn-stem-scope { margin-top: -6px; }

/* 选项：一行一项，字母徽标 + 文本，选中即品牌色 */
.learn-practice .learn-options { display: grid; gap: 6px; }
.learn-practice .learn-option {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 12px; min-height: 40px;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--fill);
  cursor: pointer; font-size: 14px; line-height: 1.65;
  overflow-wrap: anywhere;
  transition: background .16s, border-color .16s, transform .16s;
}
.learn-practice .learn-option:hover { background: var(--surface); border-color: var(--line); transform: translateY(-1px); }
.learn-practice .learn-option:has(input:checked) {
  background: rgba(var(--brand-rgb), .09);
  border-color: rgba(var(--brand-rgb), .35);
}
.learn-practice .learn-option:has(input:checked) > strong { background: var(--brand-color); color: #fff; }
.learn-practice .learn-option.is-correct {
  background: var(--success-bg); border-color: var(--success-line);
}
.learn-practice .learn-option.is-correct > strong { background: var(--ios-green); color: #fff; }
.learn-practice .learn-option input {
  flex-shrink: 0; margin: 0; width: 15px; height: 15px; align-self: center;
  accent-color: var(--brand-color);
}
.learn-practice .learn-option > strong {
  flex-shrink: 0; display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--surface); color: var(--muted);
  font-size: 11px; font-weight: 700; font-family: inherit;
  align-self: center; transition: background .16s, color .16s;
}
.learn-practice .learn-option > span { min-width: 0; }
.learn-practice .learn-clear {
  border: 0; background: none; color: var(--muted);
  font-size: 12px; padding: 8px 0 0; font-weight: 550;
}
.learn-practice .learn-clear:hover { color: var(--danger-text); }
.learn-practice .learn-select-answer { max-width: 280px; margin-top: 2px; }

/* 纯选项题（选词填空 / 段落匹配）：选项平铺成一行按钮。
   原生 <select> 在移动端点开会弹出输入法并盖住列表，长此以往无法作答。
   桌面端一行放得下就换行；移动端横向滚动，每个按钮保持可点大小。 */
.learn-practice .learn-pick {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-top: 2px;
}
.learn-practice .learn-pick-option {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 40px; padding: 0 12px;
  border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums;
  cursor: pointer; user-select: none;
  transition: border-color .16s, background .16s, color .16s, transform .12s;
}
.learn-practice .learn-pick-option input {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.learn-practice .learn-pick-option:hover { border-color: var(--brand-color); color: var(--brand-text); }
.learn-practice .learn-pick-option:active { transform: scale(.96); }
.learn-practice .learn-pick-option.is-picked {
  border-color: var(--brand-color);
  background: color-mix(in srgb, var(--brand-color) 12%, #fff);
  color: var(--brand-text);
}
/* 原生 radio 被视觉隐藏，点选后必须靠 :has 立即反馈；否则只有服务端渲染时才高亮，
   用户点完看不到任何变化。 */
.learn-practice .learn-pick-option:has(input:checked) {
  border-color: var(--brand-color);
  background: color-mix(in srgb, var(--brand-color) 12%, #fff);
  color: var(--brand-text);
}
.learn-practice .learn-pick-option.is-correct {
  border-color: #34C759;
  background: rgba(52, 199, 89, .12);
  color: #1E7B3C;
}
/* 键盘可达：隐藏原生 radio 后仍要给出清晰的焦点环。 */
.learn-practice .learn-pick-option:has(input:focus-visible) {
  outline: 2px solid var(--brand-color); outline-offset: 2px;
}
@media (max-width: 640px) {
  /* 移动端：单行横滑，避免 26 个字母压成好几行把题目挤出屏幕。 */
  .learn-practice .learn-pick {
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
    padding-bottom: 4px; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .learn-practice .learn-pick::-webkit-scrollbar { display: none; }
  .learn-practice .learn-pick-option { scroll-snap-align: center; min-width: 44px; min-height: 44px; }
}
.learn-practice .learn-question textarea {
  font-family: var(--font-text);
  font-size: 15px; line-height: 1.8; padding: 12px 14px;
  border-radius: 14px; border-color: var(--line); background: var(--surface);
}
.learn-practice .learn-question textarea:focus {
  outline: none; border-color: rgba(var(--brand-rgb), .6);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .10);
}
.learn-practice .learn-question textarea::placeholder {
  font-family: inherit; font-size: 13px; color: var(--muted);
}
.learn-practice .learn-written-answer {
  padding: 10px 14px; background: var(--fill); border-radius: 12px;
}
.learn-practice .learn-written-answer small { display: block; margin-bottom: 4px; }
.learn-practice .learn-written-answer .study-text { font-size: 15px; }

/* 判分反馈 */
.learn-practice .learn-feedback {
  margin-top: 10px; padding: 10px 14px; border-radius: 14px;
  font-size: 12.5px; line-height: 1.7;
  background: var(--fill); color: var(--text-2);
}
.learn-practice .learn-feedback .row { gap: 8px; }
.learn-practice .learn-feedback p { margin: 6px 0 0; }
.learn-practice .learn-feedback.correct { background: var(--success-bg); color: var(--success-text); }
.learn-practice .learn-feedback.incorrect { background: var(--warn-bg); color: var(--warn-text); }
.learn-practice .learn-feedback.pending { background: var(--fill); color: var(--text-2); }
.learn-practice .learn-explanation {
  white-space: pre-wrap; overflow-wrap: anywhere;
  line-height: 1.8; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid rgba(0, 0, 0, .07);
}

/* Current-score AI feedback: plain text, separate from collapsible reference material. */
.learn-practice .learn-ai-feedback { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.learn-practice .learn-ai-feedback h4,
.learn-practice .learn-ai-feedback h5 { font: inherit; font-weight: 650; margin: 0 0 6px; color: var(--text); }
.learn-practice .learn-ai-feedback-text,
.learn-practice .learn-ai-feedback li { white-space: pre-wrap; overflow-wrap: anywhere; }
.learn-practice .learn-ai-feedback ul { margin: 4px 0 8px; padding-left: 1.5em; }
.learn-practice .learn-ai-feedback li + li { margin-top: 4px; }
.learn-practice .learn-ai-feedback-deep { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.learn-practice .learn-ai-feedback-deep > div { margin-top: 10px; }
.learn-practice .learn-ai-feedback [hidden] { display: none; }

/* AI 专属写作模板：与深度诊断同级，保持纯文本换行。 */
.learn-practice .learn-ai-feedback-template {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.learn-practice .learn-ai-feedback-template .learn-ai-feedback-text {
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* 内置写作模板：与参考作答同层级，不抢 AI 评分的视觉重点。 */
.learn-practice .learn-writing-template summary { color: var(--brand-text); }

/* 非 VIP 的定制模板引导卡：只说明差异，不伪造内容。 */
.learn-practice .learn-vip-template {
  margin-top: 12px; padding: 12px 14px;
  border: 1px dashed var(--line); border-radius: 14px;
  background: var(--fill); font-size: 12.5px; line-height: 1.7;
}
.learn-practice .learn-vip-template strong { display: block; color: var(--text); }
.learn-practice .learn-vip-template p { margin: 4px 0 8px; color: var(--muted); }
.learn-practice .learn-vip-template .button { padding: 6px 12px; font-size: 12px; }

/* 题目反馈浮层 */
.learn-practice .learn-report { position: relative; margin: 0; }
.learn-practice .learn-report summary {
  list-style: none; cursor: pointer;
  font-size: 11px; font-weight: 550; color: var(--muted);
  padding: 4px 8px; border-radius: 8px;
}
.learn-practice .learn-report summary::-webkit-details-marker { display: none; }
.learn-practice .learn-report summary:hover { background: var(--fill); color: var(--text-2); }
.learn-practice .learn-report[open] summary { color: var(--danger-text); background: var(--danger-bg); }
.learn-practice .learn-report form {
  position: absolute; z-index: 30; top: calc(100% + 6px); right: 0;
  box-sizing: border-box; width: min(320px, calc(100vw - 16px));
  margin: 0; padding: 12px; min-width: 0; min-height: 0;
  max-height: calc(100dvh - 16px); overflow: auto; overscroll-behavior: contain;
  grid-template-columns: minmax(0, 1fr); align-content: start; overflow-wrap: anywhere;
  border-radius: 16px; background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-lg), 0 0 0 .5px rgba(0, 0, 0, .06);
  gap: 10px; /* No transform animation: placement measures the actual panel bounds. */
}
.learn-practice .learn-report form > .row { gap: 8px; }
.learn-practice .learn-report-reasons { display: grid; gap: 3px; }
.learn-practice .learn-report-reasons label { position: relative; display: block; cursor: pointer; }
.learn-practice .learn-report-reasons input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
}
.learn-practice .learn-report-reasons span {
  display: block; padding: 6px 10px; border-radius: 9px;
  font-size: 12px; color: var(--text-2); background: var(--fill);
  transition: background .14s, color .14s;
}
.learn-practice .learn-report-reasons span:hover { background: var(--fill-strong); }
.learn-practice .learn-report-reasons input:checked + span {
  background: rgba(var(--brand-rgb), .12); color: var(--brand-text); font-weight: 600;
}
.learn-practice .learn-report-reasons input:focus-visible + span {
  outline: 2px solid rgba(var(--brand-rgb), .5); outline-offset: 1px;
}
.learn-practice .learn-report textarea {
  width: 100%; font-size: 12.5px; padding: 8px 10px;
  border-radius: 10px; border-color: var(--line); min-height: 56px;
}
.learn-practice .learn-report .button { min-height: 32px; padding: 5px 14px; font-size: 12px; }
.learn-practice .learn-report-state { font-size: 11px; color: var(--muted); }
.learn-practice .learn-report-state.ok { color: var(--success-text); }
.learn-practice .learn-report-state.error { color: var(--danger-text); }

/* ==========================================================================
   整卷连排
   ========================================================================== */
.learn-practice .learn-paper-part {
  font-size: 12px; font-weight: 700; letter-spacing: .10em; text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 -2px; padding-left: 4px;
}
.learn-practice .learn-paper-section {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; color: var(--brand-text);
  background: rgba(var(--brand-rgb), .10);
  border-radius: var(--pill-radius);
  padding: 4px 14px; margin: 6px 0 -2px;
  width: fit-content;
}
.learn-practice .learn-unit-block {
  display: grid; gap: 8px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
  scroll-margin-top: 112px;
}
.learn-practice .learn-unit-block-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 6px;
}
.learn-practice .learn-unit-block-head h4 {
  font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0;
}
.learn-practice .learn-unit-block-head .pill { font-size: 11px; padding: 1px 9px; }
.learn-practice .learn-unit-block-head .exam-text-button { font-size: 11px; }
.learn-practice .learn-unit-block-head .exam-text-button:hover { color: var(--brand-text); }
.learn-practice .learn-unit-block .learn-active-unit.layout-columns > .learn-material { top: 132px; max-height: calc(100dvh - 148px); }

/* 底部操作条 */
.learn-practice .learn-practice-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--card-shadow);
}
.learn-practice .learn-practice-footer .row { gap: 8px; }
.learn-practice .learn-practice-footer .button { min-height: 38px; font-size: 13px; }
/* 分页模式常驻 AI 悬浮球（桌面 56px 右 22px / 移动 52px 右 16px），给底栏留出
   同宽空档，否则「保存并交卷」会被球压住。窄屏按钮同时收紧，保证三枚仍能
   并排放下（否则底栏会撑出横向滚动）。 */
@media (min-width: 901px) {
  .learn-practice:not(.is-whole-paper) .learn-practice-footer { padding-right: 92px; }
}
@media (max-width: 900px) {
  .learn-practice:not(.is-whole-paper) .learn-practice-footer {
    padding-right: 70px;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .learn-practice .learn-practice-footer .row { gap: 6px; flex-wrap: nowrap; min-width: 0; }
  .learn-practice .learn-practice-footer .button { padding: 8px 9px; font-size: 12px; white-space: nowrap; }
}
.learn-practice .learn-inline-status { font-size: 12px; color: var(--muted); margin: 0; padding: 0 4px; }

/* ==========================================================================
   我的学习
   ========================================================================== */
.profile-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin: 4px 0 16px;
}
.profile-head h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; margin: 6px 0 6px; }
.profile-head p { color: var(--muted); margin: 0; font-size: 14px; }
.profile-head .row { gap: 8px; }

.learn-tabs { margin-bottom: 14px; }

/* History only: keep both review/resume and deletion in view without horizontal swiping. */
@media (max-width: 600px) {
  .learn-history-table { overflow: visible; }
  .learn-history-table table,
  .learn-history-table tbody { display: block; width: 100%; min-width: 0; }
  .learn-history-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .learn-history-table tbody tr { display: grid; gap: 10px; padding: 16px 0; }
  .learn-history-table tbody tr + tr { border-top: 1px solid var(--line); }
  .learn-history-table tbody tr > td {
    display: block; min-width: 0; padding: 0; border: 0;
    white-space: normal; overflow-wrap: anywhere;
  }
  .learn-history-table tbody tr > td[data-label] {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  .learn-history-table td[data-label]::before {
    content: attr(data-label); flex-shrink: 0; color: var(--muted); font-size: 12px;
  }
  .learn-history-table .learn-history-actions > .row { gap: 8px; padding-top: 4px; }
  .learn-history-table .learn-history-actions .button { min-height: 44px; }
}

.learn-mark-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 12px; border-radius: var(--pill-radius);
  background: var(--fill); font-size: 12px; font-weight: 550;
}
.learn-mark-chip button {
  border: 0; background: var(--surface); color: var(--muted);
  width: 22px; height: 22px; border-radius: 50%; line-height: 1;
  font-size: 13px; padding: 0;
  /* 圆钮保持正圆：触屏的 44px 最小高度对它不生效（见 app.css --tap-min）。 */
  --tap-min: 22px;
  display: inline-grid; place-items: center; flex: 0 0 auto;
}
.learn-mark-chip button:hover { color: var(--danger-text); background: var(--danger-bg); }

.learn-vocab-add { margin-bottom: 14px; }
.learn-vocab-add summary {
  cursor: pointer; font-size: 14px; font-weight: 600; list-style: none;
  padding: 2px 0;
}
.learn-vocab-add summary::-webkit-details-marker { display: none; }
.learn-vocab-add summary::before { content: '＋ '; color: var(--brand-text); }
.learn-vocab-add[open] summary { margin-bottom: 14px; }
.learn-vocabulary-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px;
}
.learn-vocabulary-grid h2 {
  font-family: var(--font-text);
  font-size: 22px; letter-spacing: -.02em; margin: 0;
}
.learn-vocabulary-grid blockquote {
  margin: 8px 0 0; padding-left: 12px;
  border-left: 2px solid var(--line);
  color: var(--muted); font-family: var(--font-text); font-style: italic;
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7;
}
.learn-explanation {
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 13px; line-height: 1.75; margin-top: 8px; color: var(--text-2);
}
.learn-vocabulary-grid .button { margin-top: 10px; }

/* Saved words: meaning first, context secondary; scoped independently of AI chat. */
.learn-vocabulary-grid { align-items: start; }
.learn-vocabulary-card { min-width: 0; overflow-wrap: anywhere; }
.learn-vocabulary-card h2 { overflow-wrap: anywhere; }
.learn-vocabulary-card .learn-explanation { font-size: 14px; line-height: 1.8; }
.learn-vocabulary-origin,
.learn-vocabulary-context-label { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.learn-vocabulary-placeholder { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.learn-vocabulary-context { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.learn-vocabulary-context-label { margin-top: 0; }
.learn-vocabulary-grid .learn-vocabulary-preview {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; max-height: 5.1em;
  font-style: normal; margin-top: 8px;
}
.learn-vocabulary-full { margin-top: 9px; font-size: 12px; color: var(--muted); }
.learn-vocabulary-full summary { cursor: pointer; width: fit-content; }
.learn-vocabulary-full > summary > .learn-vocabulary-collapse-label { display: none; }
.learn-vocabulary-full[open] > summary > .learn-vocabulary-expand-label { display: none; }
.learn-vocabulary-full[open] > summary > .learn-vocabulary-collapse-label { display: inline; }
.learn-vocabulary-full summary:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 4px; }
.learn-vocabulary-context-text {
  margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 13px; line-height: 1.8; color: var(--text-2);
}
.learn-vocabulary-card .learn-explanation.is-rich-text { white-space: normal; }
.learn-vocabulary-card .is-rich-text > :first-child { margin-top: 0; }
.learn-vocabulary-card .is-rich-text > :last-child { margin-bottom: 0; }
.learn-vocabulary-card .is-rich-text p { margin: .5em 0; }
.learn-vocabulary-card .is-rich-text :is(h1, h2, h3, h4, h5, h6) {
  margin: .9em 0 .4em; font-family: inherit; font-size: 1em; line-height: 1.5;
}
.learn-vocabulary-card .is-rich-text :is(ul, ol) { padding-left: 1.5em; margin: .5em 0; }
.learn-vocabulary-card .is-rich-text :is(pre, code) {
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: .9em;
}
.learn-vocabulary-card .is-rich-text pre { max-width: 100%; padding: 10px; background: var(--fill); border-radius: 6px; }
.learn-vocabulary-card .is-rich-text table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.learn-vocabulary-card .is-rich-text :is(th, td) { border: 1px solid var(--line); padding: 6px; overflow-wrap: anywhere; text-align: left; }
.learn-vocabulary-card .is-rich-text :is(img, video) { max-width: 100%; height: auto; }
.learn-vocabulary-card .is-rich-text a { overflow-wrap: anywhere; text-decoration: underline; }
.learn-footnote { font-size: 12px; line-height: 1.8; color: var(--muted); margin: 14px 0 0; }

/* ==========================================================================
   材料题目预览
   ========================================================================== */
.material-preview-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 18px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.material-preview-hero h1 { margin: 12px 0 6px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.055em; line-height: 1.08; }
.material-preview-hero p { margin: 0; color: var(--muted); }
.material-preview-kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.material-preview-hero-note { display: grid; gap: 4px; max-width: 260px; padding: 12px 14px; border-radius: 14px; background: rgba(var(--brand-rgb), .09); color: var(--brand-text); font-size: 12px; line-height: 1.6; }
.material-preview-hero-note strong { font-size: 13px; color: var(--text); }
.material-preview-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: 100%; }
.material-preview-flow { padding: 24px; min-width: 0; overflow: hidden; }
.material-preview-flow-text { margin-bottom: 14px; }
.material-preview-flow-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
.material-preview-flow-item > strong { color: var(--text-2); }
.material-preview-number { margin: 24px 0 12px; font-size: 16px; color: var(--brand-text); }
.material-preview-visible { overflow-wrap: anywhere; }
.material-preview-locked { position: relative; overflow: hidden; min-height: 260px; margin: 4px -24px -24px; padding: 24px; isolation: isolate; background: var(--fill); }
.material-preview-blurred { filter: blur(6px); opacity: .45; user-select: none; pointer-events: none; overflow-wrap: anywhere; }
.material-preview-locked::after { content: ''; position: absolute; inset: 0; background: rgba(142,142,147,.16); z-index: 1; pointer-events: none; }
.material-preview-unlock { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; max-width: 100%; }
.material-preview-unlock h2 { margin: 0 0 10px; font-size: 21px; letter-spacing: -.03em; }
.material-preview-unlock p { margin: 0 0 20px; color: var(--text-2); font-size: 14px; }
.material-preview-unlock small { display: block; margin-top: 10px; color: var(--text-2); font-size: 12px; }
.material-preview-unlock form { margin: 0; }
.material-preview-unlock .button:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 4px; }
@media (max-width: 800px) {
  .material-preview-hero { display: grid; align-items: start; gap: 14px; }
  .material-preview-hero-note { max-width: none; }
  .material-preview-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
  .learn-practice .learn-practice-grid { grid-template-columns: 188px minmax(0, 1fr); }
  .learn-practice.is-whole-paper .learn-practice-grid { grid-template-columns: 188px minmax(0, 1fr); }
  .learn-practice .learn-active-unit.layout-columns { grid-template-columns: minmax(0, 48fr) minmax(0, 52fr); }
  .session-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}
@media (max-width: 1000px) {
  .learn-practice .learn-practice-grid,
  .learn-practice.is-whole-paper .learn-practice-grid { grid-template-columns: minmax(0, 1fr); }
  .learn-practice .learn-material-nav {
    position: static; max-height: 300px;
  }
  .learn-practice .learn-material-nav nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
  .learn-practice .learn-active-unit.layout-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .learn-practice .learn-active-unit.layout-columns > .learn-material {
    position: static; max-height: none; overflow: visible;
  }
  .learn-practice .learn-practice-toolbar { top: 0; }
}
@media (max-width: 760px) {
  /* 小屏：答题卡/耗时浮层左右锚定，避免按右侧对齐时左缘出屏。 */
  .learn-sheet, .learn-time-panel { left: 12px; right: 12px; width: auto; }
  .home-hero { margin: 0 0 16px; gap: 14px; }
  .home-hero h1 { font-size: 27px; }
  .home-hero p { font-size: 14px; }
  .home-tools { gap: 10px; }
  .home-tools .search { margin-left: 0; width: 100%; min-width: 0; }
  .home-year-row { margin-bottom: 14px; }
  .session { padding: 12px; border-radius: 18px; }
  .session-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .paper-tile { padding: 11px 12px; }
  .paper-hero { gap: 14px; }
  .paper-hero h1 { font-size: 22px; }
  .paper-part { padding: 12px; }
  .unit-row { gap: 10px; }
  .unit-row .button { font-size: 12px; padding: 7px 12px; min-height: 36px; }

  /* 小屏不固定工具栏：随页面滚动，仍作为答题卡/耗时浮层的定位容器。 */
  .learn-practice .learn-practice-toolbar { position: relative; top: auto; margin: 0 0 8px; padding: 6px; gap: 8px; }
  .learn-practice .learn-toolbar-title h1 { font-size: 15px; max-width: 100%; white-space: normal; }
  .learn-practice .learn-toolbar-tools { gap: 6px; width: 100%; }
  .learn-practice .learn-toolbar-tools .learn-save-sync { order: 3; }
  .learn-practice .learn-zoom { margin-left: auto; }
  .learn-practice .learn-material { padding: 14px 14px 16px; }
  .learn-practice .learn-material h2 { font-size: 18px; }
  .learn-practice .learn-questions { padding: 2px 14px 12px; }
  .learn-practice .learn-question { padding: 12px 0 14px; }
  .learn-practice .learn-option { padding: 8px 10px; font-size: 14px; }
  .learn-practice .learn-word-bank { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; }
  .learn-practice .learn-unit-block { padding: 8px; border-radius: 18px; }
  .learn-practice .learn-practice-footer { padding: 10px 12px; }
  .learn-practice .learn-report textarea { font-size: 16px; }
  .learn-practice .learn-report summary,
  .learn-practice .learn-report-reasons span,
  .learn-practice .learn-report .button { min-height: 44px; }
  .learn-practice .learn-report summary { display: flex; align-items: center; }

  .profile-head { gap: 12px; }
  .profile-head h1 { font-size: 23px; }
  .learn-vocabulary-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .learn-practice .learn-material-nav a { min-height: 44px; }
  .learn-practice .learn-reference summary { min-height: 44px; }
  .learn-practice .learn-favorite, .learn-practice .learn-clear { min-height: 40px; }
  .learn-practice .learn-report summary,
  .learn-practice .learn-report-reasons span,
  .learn-practice .learn-report .button { min-height: 44px; }
  .learn-practice .learn-report summary { display: flex; align-items: center; }
  .learn-practice .learn-report textarea { font-size: 16px; }
  .paper-tile { min-height: 44px; }
}

/* ---- 答题卡（点击「X/Y 已答」弹出） ---- */
.learn-practice .learn-answered {
  border: 0; cursor: pointer; color: var(--text);
  font-family: inherit; transition: background .15s ease, color .15s ease;
}
.learn-practice .learn-answered:hover { background: var(--brand-soft, rgba(0, 122, 255, .12)); color: var(--brand-text, #0a66d0); }
/* 答题卡 / 各题耗时：锚定在工具栏下方的浮层弹窗（父级 .learn-practice-toolbar 为 sticky，即定位容器）。 */
.learn-sheet,
.learn-time-panel {
  position: absolute; top: calc(100% + 8px); right: 14px; z-index: 40;
  width: min(560px, calc(100vw - 32px));
  max-height: min(72vh, 620px); overflow: auto;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line, #d9dce1);
  background: var(--surface, #fff);
  box-shadow: 0 18px 50px rgba(16, 18, 24, .18), 0 2px 8px rgba(16, 18, 24, .08);
  overscroll-behavior: contain;
  animation: learn-pop .16s var(--ease-out, ease-out) both;
}
@keyframes learn-pop {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.learn-sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.learn-sheet-head strong { font-size: 14px; }
.learn-sheet-head span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.learn-sheet-part { font-size: 12.5px; font-weight: 700; margin: 10px 0 4px; color: var(--text); }
.learn-sheet-section { font-size: 12px; color: var(--muted); margin: 6px 0 4px; }
.learn-sheet-unit { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; border-top: 1px solid var(--sep, #F0F1F5); }
.learn-sheet-unit-title { flex: 0 0 150px; font-size: 12px; color: var(--text-2, #4b5563); padding-top: 5px; }
.learn-sheet-questions { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.learn-sheet-q {
  min-width: 32px; height: 26px; padding: 0 7px; border-radius: 7px;
  border: 1px solid var(--line, #d9dce1); background: #fff; color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.learn-sheet-q:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.learn-sheet-q.is-answered { background: var(--brand, #0a84ff); border-color: var(--brand, #0a84ff); color: #fff; }
.learn-sheet-q.is-correct { background: #e6f6ea; border-color: #b7e2c3; color: #1d7a3a; }
.learn-sheet-q.is-wrong { background: #fdecec; border-color: #f3c1c1; color: #c0392b; }
.learn-sheet-q.is-pending { background: #f2f3f5; border-color: #d9dce1; color: var(--muted); }
.learn-question.is-sheet-flash { animation: sheet-flash 1.5s ease; }
@keyframes sheet-flash {
  0%, 60% { box-shadow: 0 0 0 3px rgba(247, 154, 62, .45); border-radius: 12px; }
  100% { box-shadow: none; }
}

/* ---- 答题计时（点击工具栏「⏱ 用时」弹出，与答题卡同款浮层） ---- */
.learn-practice .learn-time-toggle {
  border: 0; cursor: pointer; color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 4px 11px; border-radius: var(--pill-radius); background: var(--fill);
  white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.learn-practice .learn-time-toggle:hover { background: var(--brand-soft, rgba(0, 122, 255, .12)); color: var(--brand-text, #0a66d0); }
.learn-time-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.learn-time-head strong { font-size: 14px; }
.learn-time-head span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.learn-time-part { font-size: 12.5px; font-weight: 700; margin: 10px 0 4px; color: var(--text); }
.learn-time-section { font-size: 12px; color: var(--muted); margin: 6px 0 4px; }
.learn-time-unit { padding: 5px 0; border-top: 1px solid var(--sep, #F0F1F5); }
.learn-time-unit-title { display: block; font-size: 12px; color: var(--text-2, #4b5563); margin-bottom: 2px; }
.learn-time-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 2px 18px; }
.learn-time-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 3px 6px; border: 0; border-radius: 8px; background: none;
  font: inherit; text-align: left; cursor: pointer;
}
.learn-time-row:hover { background: var(--fill, #f2f3f5); }
.learn-time-num {
  flex: 0 1 auto; min-width: 24px; font-size: 12.5px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.learn-time-bar { flex: 1 1 auto; min-width: 36px; height: 5px; border-radius: 3px; background: var(--sep, #F0F1F5); overflow: hidden; }
.learn-time-bar b { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--brand, #0a84ff); opacity: .5; transition: width .3s ease; }
.learn-time-cell { flex: 0 0 auto; min-width: 40px; text-align: right; font-size: 12.5px; color: var(--text-2, #4b5563); font-variant-numeric: tabular-nums; }
.learn-time-row.is-zero .learn-time-num,
.learn-time-row.is-zero .learn-time-cell { color: var(--muted); }

/* Profile only: do not change practice/result cards or shared page utilities. */
.profile-page { width: 100%; max-width: 1200px; min-width: 0; margin: 6px auto 0; }
.profile-page.profile-page-account { max-width: 940px; }
.profile-page:not(.advice-page) .profile-head { align-items: center; gap: 20px; margin: 0 0 14px; }
.profile-page .profile-head > div { min-width: 0; }
.profile-page:not(.advice-page) .profile-head h1 { margin: 3px 0 5px; }
.profile-page .profile-head .profile-intro { max-width: 52em; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.profile-page .profile-head .profile-quota { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.profile-page:not(.advice-page) > .learn-tabs { margin-bottom: 14px; }
.profile-page > .profile-content { display: grid; gap: 14px; min-width: 0; }
.profile-page .profile-content > * { min-width: 0; }
.profile-page .profile-content > .learn-footnote,
.profile-page .profile-content > .learn-vocab-add { margin: 0; }
.profile-page .profile-content > .stack { gap: 20px; }
.profile-page .learn-vocabulary-grid { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.profile-page .mistake-repractice { gap: 16px; }
.profile-page .mistake-repractice > p { flex: 1 1 280px; }
.profile-page .profile-device-list { display: grid; gap: 20px; min-width: 0; }
.profile-page .profile-device-notice,
.profile-page .profile-device-card { gap: 16px 20px; }
.profile-page .profile-device-notice > p { margin: 0; flex: 1 1 240px; }
.profile-page .profile-device-card > div { flex: 1 1 260px; overflow-wrap: anywhere; }
.profile-page .profile-device-card h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 18px; }
.profile-page .profile-device-card .quiet { line-height: 1.7; }
.profile-page .profile-account-form { display: grid; gap: 24px; }
.profile-page .profile-account-details { display: grid; gap: 18px; min-width: 0; }
.profile-page .profile-account-details h2 { margin: 0; font-size: 18px; }
.profile-page .profile-password { border-top: 1px solid var(--line); padding-top: 20px; }
.profile-page .profile-password > summary { cursor: pointer; font-size: 16px; font-weight: 600; }
.profile-page .profile-password > .stack { padding-top: 18px; }
.profile-page .profile-password p { margin: 0; font-size: 13px; line-height: 1.7; }
.profile-page .profile-account-actions { border-top: 1px solid var(--line); padding-top: 20px; }
@media (max-width: 760px) {
  .profile-page:not(.advice-page) .profile-head { align-items: flex-start; gap: 16px; }
  .profile-page .profile-head > .row { flex-basis: 100%; }
  .profile-page:not(.advice-page) > .learn-tabs { margin-bottom: 20px; }
  .profile-page .profile-device-notice > form,
  .profile-page .profile-device-card > form,
  .profile-page .mistake-repractice > form { flex-basis: 100%; margin-left: 0; }
  .profile-page .profile-content .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .profile-page .profile-account-form { gap: 20px; }
}

/* Intro and functional headers: compact without changing the learning workspace. */
.home-hero.page-intro .page-intro-body p { max-width: none; }
.home-hero.page-intro .home-hero-actions { margin-top: 10px; gap: 8px; }
/* 词库覆盖范围这串名字很长，窄屏上会把按钮挤到首屏之外，只隐藏这一段。 */
@media (max-width: 640px) {
    .home-hero .home-intro-covered { display: none; }
}
.home-hero.page-intro .home-hero-actions .button { font-size: 13px; }
.profile-page .profile-head.profile-summary { align-items: center; gap: 12px; margin: 0 0 14px; }
.profile-page .profile-head.profile-summary h1 { margin: 0 0 4px; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.3; }
.profile-page .profile-head.profile-summary .profile-intro { font-size: 14px; line-height: 1.6; }
.profile-page .profile-head.profile-summary .profile-quota { margin-top: 4px; font-size: 13px; line-height: 1.6; }


/* Profile · 页面设置（主题色色板与缩放）：只作用于 .profile-appearance，不改答题页控件。 */
.profile-page .profile-appearance { gap: 26px; }
.profile-page .profile-appearance h2 { margin: 0 0 6px; font-size: 18px; }
.profile-page .profile-appearance > section { display: grid; gap: 10px; min-width: 0; }
.profile-page .profile-appearance > section + section { border-top: 1px solid var(--line); padding-top: 24px; }
.profile-page .profile-appearance .quiet { margin: 0; font-size: 13px; line-height: 1.7; }
.profile-page .appearance-palette {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px; margin: 4px 0 0; padding: 0; border: 0;
}
.profile-page .appearance-palette legend { padding: 0; margin-bottom: 8px; font-size: 12px; }
.profile-page .appearance-swatch {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface); cursor: pointer; font-size: 13px; color: var(--text-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.profile-page .appearance-swatch:hover { border-color: var(--line-strong); background: var(--fill); }
.profile-page .appearance-swatch input {
  position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none;
}
.profile-page .appearance-swatch:has(input:checked) {
  border-color: var(--brand-color); background: rgba(var(--brand-rgb), .08); color: var(--text);
}
.profile-page .appearance-swatch:has(input:focus-visible) {
  outline: 2px solid var(--brand-color); outline-offset: 2px;
}
.profile-page .appearance-dot {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  background: var(--swatch, var(--brand-color));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.profile-page .appearance-swatch.is-site .appearance-dot {
  background: conic-gradient(from 210deg, #2563eb, #059669, #d97706, #dc2626, #7c3aed, #2563eb);
}
.profile-page .appearance-swatch.is-selected .appearance-name { font-weight: 600; }
.profile-page .appearance-hint { color: var(--text-3); }
.profile-page .appearance-preview {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 4px; padding: 14px 16px; border: 1px dashed var(--line-strong);
  border-radius: 14px; background: var(--fill);
}
.profile-page .appearance-preview-pill {
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #fff;
  background: var(--brand-color);
}
.profile-page .appearance-preview-link { font-size: 13px; font-weight: 550; color: var(--brand-text); }
.profile-page .appearance-zoom {
  display: inline-flex; align-items: center; gap: 1px; width: fit-content;
  padding: 3px; border-radius: var(--pill-radius); background: var(--fill);
}
.profile-page .appearance-zoom button {
  border: 0; background: none; min-height: 32px; min-width: 32px;
  border-radius: var(--pill-radius); padding: 0 10px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.profile-page .appearance-zoom button:hover { background: var(--surface); }
.profile-page .appearance-zoom [data-zoom-value] {
  min-width: 48px; text-align: center; font-size: 13px;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
/* 页面设置 · 字体：两列下拉 + 实时预览。预览用与正文相同的字体栈。 */
.profile-page .appearance-font-form { display: grid; gap: 12px; }
.profile-page .appearance-font-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-page .appearance-font-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.profile-page .appearance-font-field select {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
}
.profile-page .appearance-font-field select:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 2px; }
.profile-page .appearance-font-preview {
  display: grid; gap: 8px; margin-top: 2px; padding: 14px 16px;
  border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--fill);
}
.profile-page .appearance-font-preview p { margin: 0; line-height: 1.75; }
.profile-page .appearance-font-preview-latin { font-size: 15px; }
.profile-page .appearance-font-preview-cjk { font-size: 14.5px; }
@media (max-width: 560px) {
  .profile-page .appearance-font-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .profile-page .appearance-palette { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .profile-page .appearance-swatch { padding: 8px 9px; font-size: 12.5px; }
}

/* 清除学习记录（账号设置）：类型勾选与确认弹窗。 */
.profile-page .profile-clear-form h2 { margin: 0; font-size: 18px; }
.profile-page .profile-clear-types { border: 1px solid var(--line); border-radius: 15px; padding: 6px 16px 12px; display: grid; gap: 4px; }
.profile-page .profile-clear-types legend { padding: 0 8px; }
.profile-page .profile-clear-all,
.profile-page .profile-clear-type { display: flex; gap: 10px; align-items: flex-start; padding: 9px 2px; font-size: 14px; line-height: 1.7; cursor: pointer; }
.profile-page .profile-clear-all { border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 600; }
.profile-page .profile-clear-all input,
.profile-page .profile-clear-type input { width: 18px; height: 18px; margin-top: 4px; flex: none; }
.profile-page .profile-clear-type small { font-size: 12px; line-height: 1.6; }
.profile-page .profile-clear-dialog { border: 0; border-radius: var(--card-radius, 22px); padding: 26px; max-width: 420px; width: calc(100vw - 40px); box-shadow: 0 18px 60px rgba(0, 0, 0, .22); }
.profile-page .profile-clear-dialog::backdrop { background: rgba(0, 0, 0, .42); }
.profile-page .profile-clear-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.profile-page .profile-clear-dialog p { margin: 8px 0; font-size: 14px; line-height: 1.7; }
.profile-page .profile-clear-summary { margin: 10px 0; padding: 12px 16px 12px 32px; background: var(--fill, #F5F5F7); border-radius: 13px; font-size: 14px; line-height: 1.9; }
.profile-page .profile-clear-dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* 头像选择：页面上只显示当前头像 + 更换按钮，24 张铺在弹窗里。 */
.profile-page .profile-avatar-current {
  display: flex; align-items: center; gap: 16px; margin-top: 10px;
}
.profile-page .profile-avatar-current > img {
  width: 72px; height: 72px; border-radius: 20px; background: var(--fill, #F5F5F7);
  box-shadow: 0 0 0 2px var(--brand-color, #F79A3E);
}
.profile-page .profile-avatar-current > div { display: grid; gap: 8px; justify-items: start; }
.profile-page .profile-avatar-hint { margin: 0; font-size: 13px; color: var(--muted); }
.profile-page .profile-avatar-dialog { max-width: 560px; }
.profile-page .profile-avatar-dialog .profile-avatar-picker { margin-top: 14px; }
.profile-page .profile-avatar-dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* 头像弹窗内的格子：方形描边，选中的一张套品牌色描边。 */
.profile-page .profile-avatar-picker {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
}
.profile-page .profile-avatar-option { position: relative; cursor: pointer; }
.profile-page .profile-avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.profile-page .profile-avatar-option img {
  display: block; width: 100%; height: auto; aspect-ratio: 1;
  border-radius: 14px; background: var(--fill, #F5F5F7);
  box-shadow: 0 0 0 2px transparent; transition: box-shadow .16s, transform .16s;
}
.profile-page .profile-avatar-option:hover img { transform: translateY(-1px); }
.profile-page .profile-avatar-option:has(input:checked) img {
  box-shadow: 0 0 0 2px var(--brand-color, #F79A3E);
}
.profile-page .profile-avatar-option:has(input:focus-visible) img {
  outline: 2px solid var(--brand-color, #F79A3E); outline-offset: 2px;
}
/* 未开启双重验证时的邮箱验证码区块 */
.profile-page .profile-email-code { display: grid; gap: 10px; margin-top: 12px; }
.profile-page .profile-factor-error { margin: 6px 0 0; font-size: 13px; color: #C0392B; }
