/* =============================================================================
 * components.css —— 统一组件库（学生版 / 教师版 / 个人中心共用同一套）
 * 每个组件都给出 默认 / hover / active / focus / disabled / loading 状态。
 * 只允许用 tokens.css 的变量，禁止写死数值。
 * ========================================================================== */

/* ================================ 做题 / 答题卡（学生 + 教师共用） ================================ */
/* 选项按钮：题干下的 A/B/C/D。三态：默认 / 选中 / 判题后（对/错） */
.opt {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; min-height: var(--tap); padding: var(--s3) var(--s4);
  border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: var(--surface);
  font-size: var(--f-body); color: var(--ink-1); text-align: left;
  transition: all var(--dur-2) var(--ease);
}
.opt:hover { border-color: var(--brand-200); background: var(--brand-50); }
.opt__key {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3);
  font-size: var(--f-sm); font-weight: 700;
}
.opt[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-50); }
.opt[aria-pressed="true"] .opt__key { background: var(--brand); color: #fff; }
.opt.is-right { border-color: var(--green); background: var(--green-50); }
.opt.is-right .opt__key { background: var(--green); color: #fff; }
.opt.is-wrong { border-color: var(--red); background: var(--red-50); }
.opt.is-wrong .opt__key { background: var(--red); color: #fff; }
.opt[disabled] { opacity: 0.6; pointer-events: none; }
.opt__mark { margin-left: auto; flex: 0 0 auto; display: flex; align-items: center; }

/* 题干 */
.q-stem { font-size: var(--f-lg); line-height: var(--lh-loose); color: var(--ink-1); }
.q-stem__no { display: inline-flex; align-items: center; gap: 6px; margin-right: var(--s2); color: var(--brand-dd); font-weight: 700; }

/* 答题卡（题号宫格） */
.q-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.q-nav button { width: 36px; height: 36px; border-radius: var(--r-xs); background: var(--surface-3); font-size: var(--f-sm); color: var(--ink-3); font-family: var(--font-num); }
.q-nav button:hover { background: var(--surface-4); }
.q-nav button.is-done { background: var(--green-50); color: var(--green-d); font-weight: 700; }
.q-nav button.is-on { background: var(--brand); color: #fff; font-weight: 700; }
.q-nav button.is-flag { background: var(--orange-50); color: var(--orange-d); }

/* 底部固定操作条（做题页：上一题 / 下一题 / 交卷） */
.actionbar {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s6);
  border-top: 1px solid var(--line); background: var(--surface);
}
.actionbar__meta { margin-right: auto; font-size: var(--f-sm); color: var(--ink-4); }
@media (max-width: 700px) {
  .actionbar { padding: var(--s3) var(--s4) calc(var(--s3) + var(--pad-safe-b)); }
  .actionbar .btn { flex: 1 1 0; }
}
/* 页面级：让 .actionbar 常驻在内容区底部（内容自身滚动） */
.content__scroll.has-actionbar { padding-bottom: 0; }

/* ================================ 分栏（主 + 侧） ================================ */
/* 学生端统一用 .split-2；教师端历史遗留的 .tch-split 等价（见 teacher.css） */
.split-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 1100px) { .split-2 { grid-template-columns: minmax(0, 1fr); } }

/* 答题进度点（测评 / 闯关用）：已答 / 当前 / 未答 */
.step-dots { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step-dots > i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-4); display: block; }
.step-dots > i.is-done { background: var(--brand); }
.step-dots > i.is-on { width: 20px; border-radius: var(--r-pill); background: var(--brand-dd); }
/* 生命值（闯关）：满 / 失 */
.hearts { display: inline-flex; align-items: center; gap: 4px; }
.hearts svg { width: 20px; height: 20px; color: var(--red); }
.hearts svg.is-off { color: var(--surface-4); }
/* 星级评价 */
.stars { display: inline-flex; align-items: center; gap: 4px; }
.stars svg { width: 22px; height: 22px; color: var(--gold); }
.stars svg.is-off { color: var(--surface-4); }

/* ================================ 欢迎页 / 登录页（bare 皮肤） ================================ */
.splash-title { font-size: var(--f-display); font-weight: 700; color: #fff; letter-spacing: 2px; }
.splash-sub { color: rgba(255, 255, 255, 0.86); }
.auth-card { width: min(460px, 100%); padding: var(--s8); border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-lg); }
@media (max-width: 700px) { .auth-card { padding: var(--s5); } }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; }
.auth-brand__logo { width: 72px; height: 72px; object-fit: contain; }
.role-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  padding: var(--s4) var(--s3); border-radius: var(--r-md);
  border: 1.5px solid var(--line-2); background: #fff;
  transition: all var(--dur-2) var(--ease);
}
.role-card:hover { border-color: var(--brand-200); }
.role-card.is-on { border-color: var(--brand); background: var(--brand-50); }
.role-card__ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-dd); }
.role-card.is-on .role-card__ico { background: var(--brand); color: #fff; }
.code-row { display: flex; gap: var(--s2); align-items: stretch; }
.code-row .input { flex: 1 1 auto; min-width: 0; }
.code-img {
  width: 104px; flex: 0 0 auto; border-radius: var(--r-sm);
  background: var(--surface-3); display: grid; place-items: center;
  font-family: var(--font-num); font-size: var(--f-lg); letter-spacing: 4px; color: var(--ink-3);
  user-select: none; cursor: pointer;
}
.agree { display: flex; align-items: flex-start; gap: var(--s2); font-size: var(--f-xs); color: var(--ink-4); }
.agree input { margin-top: 2px; flex: 0 0 auto; }

/* ================================ 头像 ================================ */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--surface-3); }
.avatar--sm { width: 32px; height: 32px; }
.avatar--lg { width: 56px; height: 56px; }
.avatar--xl { width: 88px; height: 88px; }
.avatar--ring { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }

/* ================================ 按钮 ================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s5);
  border-radius: var(--r-sm);
  font-size: var(--f-body); font-weight: 600; line-height: 1;
  color: var(--ink-1); background: var(--surface-3);
  transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }
.btn__ico { width: 20px; height: 20px; flex: 0 0 auto; }

/* 层级：实心（主操作） > 实心浅色 > 描边 > 文字 */
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.btn--primary:hover { background: var(--brand-d); }
.btn--tonal { background: var(--brand-100); color: var(--brand-dd); box-shadow: none; }
.btn--tonal:hover { background: var(--brand-200); }
.btn--outline { background: transparent; color: var(--brand-dd); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn--outline:hover { background: var(--brand-50); }
.btn--quiet { background: var(--surface-3); color: var(--ink-1); }
.btn--quiet:hover { background: var(--surface-4); }
.btn--text { background: transparent; color: var(--brand-dd); padding: 0 var(--s2); min-height: var(--tap); }
.btn--text:hover { background: var(--brand-50); }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger-soft { background: var(--red-50); color: var(--red-d); }
.btn--ghost { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: inset 0 0 0 1px var(--glass-line); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.26); }
.btn--on-glass { background: #fff; color: var(--brand-dd); box-shadow: var(--sh-sm); }
.btn--outline-inv { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55); }
.btn--sm { min-height: 36px; padding: 0 var(--s4); font-size: var(--f-sm); border-radius: var(--r-xs); }
.btn--lg { min-height: 52px; padding: 0 var(--s8); font-size: var(--f-lg); border-radius: var(--r-md); }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding: 0; width: var(--tap); min-width: var(--tap); }
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 图标按钮：统一 44×44 触控区 */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border-radius: var(--r-sm);
  color: var(--ink-1); transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.icon-btn:hover { background: rgba(82, 67, 55, 0.06); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn--inv { color: #fff; }
.icon-btn--inv:hover { background: rgba(255, 255, 255, 0.18); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn--badge { position: relative; }
.icon-btn--badge::after {
  content: attr(data-count); position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill);
  background: var(--red); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}

/* ================================ 徽章 / 圆点 ================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 var(--s2); border-radius: var(--r-xs);
  font-size: var(--f-xs); font-weight: 600; line-height: 1;
  background: var(--surface-3); color: var(--ink-3);
}
.badge--brand { background: var(--brand-100); color: var(--brand-dd); }
.badge--solid { background: var(--brand); color: #fff; }
.badge--ok { background: var(--green-50); color: var(--green-d); }
.badge--warn { background: var(--orange-50); color: var(--orange-d); }
.badge--dan { background: var(--red-50); color: var(--red-d); }
.badge--gold { background: #FFF7E0; color: var(--gold-d); }
.badge--glass { background: rgba(255, 255, 255, 0.24); color: #fff; }
.badge--lg { height: 26px; padding: 0 var(--s3); font-size: var(--f-sm); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); flex: 0 0 auto; }
.dot--ok { background: var(--green); } .dot--warn { background: var(--orange); }
.dot--dan { background: var(--red); } .dot--brand { background: var(--brand); }
/* 状态三重编码：颜色 + 图标 + 文字（不靠颜色单打独斗） */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--f-sm); font-weight: 600; }
.status--ok { color: var(--green-d); } .status--warn { color: var(--orange-d); }
.status--dan { color: var(--red-d); } .status--info { color: var(--brand-dd); }
.status--idle { color: var(--ink-4); }

/* ================================ Chip / 分段 / 标签页 ================================ */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 var(--s4); border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--ink-3); font-size: var(--f-sm);
  transition: all var(--dur-2) var(--ease);
}
.chip:hover { background: var(--surface-4); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.chip--glass { background: rgba(255, 255, 255, 0.18); color: #fff; }
.chip--glass[aria-pressed="true"] { background: #fff; color: var(--brand-dd); box-shadow: var(--sh-sm); }

.segment { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-sm); }
.segment > button {
  min-height: 36px; padding: 0 var(--s5); border-radius: var(--r-xs);
  font-size: var(--f-sm); font-weight: 600; color: var(--ink-3);
}
.segment > button[aria-selected="true"] { background: #fff; color: var(--ink-1); box-shadow: var(--sh-sm); }
.segment--glass { background: rgba(255, 255, 255, 0.16); }
.segment--glass > button { color: rgba(255, 255, 255, 0.85); }
.segment--glass > button[aria-selected="true"] { background: #fff; color: var(--brand-dd); }

.tabs { display: flex; gap: var(--s6); border-bottom: 1px solid var(--line); }
.tabs > button {
  position: relative; min-height: var(--tap); padding: 0 2px;
  font-size: var(--f-lg); font-weight: 600; color: var(--ink-3);
}
.tabs > button[aria-selected="true"] { color: var(--brand-dd); }
.tabs > button[aria-selected="true"]::after {
  content: ''; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%);
  width: 100%; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand);
}

/* ================================ 卡片 ================================ */
.card {
  background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--sh-sm); padding: var(--s5);
  transition: box-shadow var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
}
.card--flat { box-shadow: none; background: var(--surface-3); }
.card--line { box-shadow: none; box-shadow: var(--sh-inset-line); }
.card--glass {
  background: var(--glass); box-shadow: var(--glass-shadow);
  box-shadow: var(--glass-shadow), inset 0 0 0 1px var(--glass-line-2);
  color: var(--ink-inv); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.card--link { cursor: pointer; }
.card--link:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.card--pad-lg { padding: var(--s6); }
.card__head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
@media (max-width: 700px) { .card__head { flex-wrap: wrap; row-gap: var(--s2); } }
.card__title { font-size: var(--f-h3); font-weight: 700; color: var(--ink-1); }
.card--glass .card__title { color: #fff; }
.card__foot { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.hr { height: 1px; background: var(--line); border: 0; margin: var(--s4) 0; }

/* 图标 + 标题 + 值 的行式信息块 */
.info { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); }
.info__ico { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--brand-50); display: grid; place-items: center; flex: 0 0 auto; }
.info__ico svg { width: 20px; height: 20px; color: var(--brand-dd); }

/* ================================ 列表 ================================ */
.list { display: flex; flex-direction: column; }
.list__item {
  display: flex; align-items: center; gap: var(--s4);
  min-height: 64px; padding: var(--s3) 0; border-bottom: 1px solid var(--line);
}
.list__item:last-child { border-bottom: 0; }
.list__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.list__title { font-size: var(--f-body); font-weight: 600; color: var(--ink-1); }
.list__sub { font-size: var(--f-sm); color: var(--ink-4); }
.list__side { flex: 0 0 auto; display: flex; align-items: center; gap: var(--s2); }
.list--link .list__item { cursor: pointer; border-radius: var(--r-sm); padding-left: var(--s3); padding-right: var(--s3); }
.list--link .list__item:hover { background: var(--brand-50); }

/* ================================ 数据展示 ================================ */
.kpis { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: var(--f-sm); color: var(--ink-4); }
.kpi__val { font-size: var(--f-h1); font-weight: 700; color: var(--ink-1); font-family: var(--font-num); letter-spacing: 0; }
.kpi__val small { font-size: var(--f-sm); font-weight: 500; color: var(--ink-4); margin-left: 2px; }
.kpi--brand .kpi__val { color: var(--brand-dd); }
.kpi--ok .kpi__val { color: var(--green-d); }
.kpi--warn .kpi__val { color: var(--orange-d); }
.kpi--dan .kpi__val { color: var(--red-d); }

.progress { position: relative; height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress__bar { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--brand-l), var(--brand)); transition: width var(--dur-4) var(--ease); }
.progress--lg { height: 14px; }
.progress--glass { background: rgba(255, 255, 255, 0.25); }
.progress--ok .progress__bar { background: linear-gradient(90deg, #7ED321, var(--green)); }
.progress--warn .progress__bar { background: linear-gradient(90deg, var(--orange-l), var(--orange)); }
/* 玻璃底进度条（学生/教师 hub 共用；金色填充，与蓝墙对比清晰） */
.sd-bar { position: relative; height: 14px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.28); overflow: hidden; }
.sd-bar__fill { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, #FFD66B, #FFB930); transition: width var(--dur-4) var(--ease); }
.sd-bar__hint { display: flex; justify-content: space-between; font-size: var(--f-xs); color: rgba(255, 255, 255, 0.88); }

.ring { position: relative; width: 96px; height: 96px; }
.ring__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.ring__val { fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round; }
.ring__text { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--f-h3); font-weight: 700; color: var(--ink-1); fill: currentColor; font-family: var(--font-num); }

.bars { display: flex; align-items: stretch; gap: var(--s3); height: 160px; }
.bars__col { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: var(--s2); min-width: 0; }
.bars__bar { width: 100%; max-width: 36px; border-radius: var(--r-xs) var(--r-xs) 0 0; background: linear-gradient(180deg, var(--brand-l), var(--brand)); }
.bars__bar--mute { background: var(--surface-4); }
.bars__label { font-size: var(--f-xs); color: var(--ink-4); }

.dist { display: flex; flex-direction: column; gap: var(--s2); }
.dist__row { display: flex; align-items: center; gap: var(--s3); }
.dist__name { width: 84px; flex: 0 0 auto; font-size: var(--f-sm); color: var(--ink-3); }
.dist__bar { flex: 1 1 auto; min-width: 0; height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.dist__bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--brand); }
.dist__val { width: 56px; text-align: right; font-size: var(--f-sm); color: var(--ink-3); font-family: var(--font-num); }

.rank-list { display: flex; flex-direction: column; gap: var(--s2); }
.rank-row { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s3); border-radius: var(--r-sm); }
.rank-row:nth-child(odd) { background: var(--surface-2); }
.rank-row__no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: var(--f-xs); font-weight: 700; background: var(--surface-4); color: var(--ink-3); }
.rank-row:nth-child(1) .rank-row__no { background: var(--gold); color: #fff; }
.rank-row:nth-child(2) .rank-row__no { background: #C9D3DE; color: #fff; }
.rank-row:nth-child(3) .rank-row__no { background: #E8B48A; color: #fff; }

/* ================================ 表格 ================================ */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); max-width: 100%; min-width: 0; }
.tbl { min-width: 480px; font-size: var(--f-sm); }
.tbl th, .tbl td { padding: var(--s3) var(--s4); text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
@media (max-width: 1100px) { .tbl th, .tbl td { padding: 10px 12px; } }
.tbl th { background: var(--surface-2); color: var(--ink-3); font-weight: 600; font-size: var(--f-xs); position: sticky; top: 0; z-index: 1; }
.tbl tbody tr:hover { background: var(--brand-50); }
.tbl td.actions { text-align: right; }
.tbl .num { font-family: var(--font-num); text-align: right; }
/* 手机端：表格转「标签 + 值」卡片，不丢表头语义 */
@media (max-width: 700px) {
  .tbl { min-width: 0; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: var(--s3); padding: var(--s2) var(--s3); }
  .tbl td { display: flex; justify-content: space-between; gap: var(--s4); border: 0; padding: 6px 0; white-space: normal; }
  .tbl td::before { content: attr(data-label); color: var(--ink-4); font-size: var(--f-xs); flex: 0 0 auto; }
}
/* 列很多的宽表（如历史组卷 7 列）在平板竖屏也放不下 → 加 .tbl--stack-narrow，按同一规则卡片化 */
@media (min-width: 701px) and (max-width: 1100px) {
  .tbl--stack-narrow { min-width: 0; }
  .tbl--stack-narrow thead { display: none; }
  .tbl--stack-narrow, .tbl--stack-narrow tbody, .tbl--stack-narrow tr, .tbl--stack-narrow td { display: block; width: 100%; }
  .tbl--stack-narrow tr { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: var(--s3); padding: var(--s2) var(--s3); }
  .tbl--stack-narrow td { display: flex; justify-content: space-between; gap: var(--s4); border: 0; padding: 6px 0; white-space: normal; }
  .tbl--stack-narrow td::before { content: attr(data-label); color: var(--ink-4); font-size: var(--f-xs); flex: 0 0 auto; }
  .tbl--stack-narrow td.actions { justify-content: flex-end; }
}

/* ================================ 表单 ================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: var(--f-sm); font-weight: 600; color: var(--ink-1); }
.field__hint { font-size: var(--f-xs); color: var(--ink-4); }
.field__err { font-size: var(--f-xs); color: var(--red-d); display: flex; align-items: center; gap: 4px; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 0 var(--s4);
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  font-size: var(--f-body); color: var(--ink-1);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.textarea { padding: var(--s3) var(--s4); min-height: 96px; line-height: var(--lh); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-5); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-200); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 174, 253, 0.16); }
.input[disabled], .textarea[disabled] { background: var(--surface-3); color: var(--ink-4); cursor: not-allowed; }
.field.is-err .input, .field.is-err .textarea { border-color: var(--red); }
.select { appearance: none; padding-right: var(--s8); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23524337' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }

.search { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4); background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r-pill); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 174, 253, 0.16); }
.search input { flex: 1 1 auto; border: 0; outline: none; min-width: 0; background: transparent; }
.search svg { width: 20px; height: 20px; color: var(--ink-4); flex: 0 0 auto; }
.search--glass { background: rgba(255, 255, 255, 0.2); border-color: transparent; }
.search--glass input { color: #fff; }
.search--glass input::placeholder { color: rgba(255, 255, 255, 0.75); }
.search--glass svg { color: rgba(255, 255, 255, 0.9); }

.check { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); font-size: var(--f-body); color: var(--ink-1); cursor: pointer; }
.check input { appearance: none; width: 22px; height: 22px; border: 1.5px solid var(--line-2); border-radius: 6px; background: #fff; flex: 0 0 auto; display: grid; place-items: center; transition: all var(--dur-2) var(--ease); }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ''; width: 11px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.check input[type="radio"] { border-radius: 50%; }
.check input[type="radio"]:checked::after { content: ''; width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.check[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.switch { display: inline-flex; align-items: center; gap: var(--s3); min-height: var(--tap); cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track { width: 48px; height: 28px; border-radius: var(--r-pill); background: var(--surface-4); position: relative; transition: background var(--dur-2) var(--ease); }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: transform var(--dur-2) var(--ease-spring); }
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.stepper button { width: 40px; min-height: 40px; display: grid; place-items: center; color: var(--ink-1); font-size: 20px; }
.stepper button:hover { background: var(--surface-3); }
.stepper [data-stepper-val] { min-width: 56px; text-align: center; font-family: var(--font-num); font-weight: 600; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 160px; padding: var(--s6); text-align: center;
  border: 2px dashed var(--brand-200); border-radius: var(--r-md); background: var(--brand-50);
  color: var(--ink-3); transition: all var(--dur-2) var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-100); }
.dropzone svg { width: 36px; height: 36px; color: var(--brand); }

/* ================================ 流程 / 反馈 ================================ */
.steps { display: flex; gap: var(--s2); }
.steps__item { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-sm); color: var(--ink-4); font-size: var(--f-sm); }
.steps__item:hover { background: var(--surface-3); }
.steps__no { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-4); color: var(--ink-3); font-size: var(--f-xs); font-weight: 700; flex: 0 0 auto; }
.steps__item.is-done { color: var(--green-d); }
.steps__item.is-done .steps__no { background: var(--green); color: #fff; }
.steps__item[aria-current="step"] { background: var(--brand-100); color: var(--brand-dd); font-weight: 700; }
.steps__item[aria-current="step"] .steps__no { background: var(--brand); color: #fff; }
/* 手机：步骤条横向滚动，且**只显示当前步文字**（否则 4 个中文步骤会被挤成竖排） */
@media (max-width: 700px) {
  .steps { overflow-x: auto; scrollbar-width: none; }
  .steps::-webkit-scrollbar { display: none; }
  .steps__item { flex: 0 0 auto; }
  .steps__text { white-space: nowrap; }
  .steps__item:not([aria-current="step"]) .steps__text { display: none; }
}

.acc { border-bottom: 1px solid var(--line); }
.acc__head { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 56px; text-align: left; font-size: var(--f-body); font-weight: 600; color: var(--ink-1); }
.acc__head svg { width: 20px; height: 20px; margin-left: auto; color: var(--ink-4); transition: transform var(--dur-2) var(--ease); }
.acc__head[aria-expanded="true"] svg { transform: rotate(180deg); }
.acc__body { padding: 0 0 var(--s4); font-size: var(--f-sm); color: var(--ink-3); }
.acc__body[hidden] { display: none; }

.note { display: flex; flex-wrap: wrap; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--brand-50); color: var(--brand-dd); font-size: var(--f-sm); }
.note__ico { width: 20px; height: 20px; flex: 0 0 auto; }
.note > p { flex: 1 1 auto; margin: 0; min-width: 0; }
.note--ok { background: var(--green-50); color: var(--green-d); }
.note--warn { background: var(--orange-50); color: var(--orange-d); }
.note--dan { background: var(--red-50); color: var(--red-d); }

.log { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: var(--f-xs); background: #16202B; color: #C8D6E5; border-radius: var(--r-sm); padding: var(--s3); max-height: 220px; overflow: auto; letter-spacing: 0; }
.log__line { padding: 2px 0; }
.log__line--ok { color: #7BD88F; } .log__line--warn { color: #FFC53D; } .log__line--err { color: #FF7A7E; }

.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s12) var(--s6); text-align: center; }
.empty__art { width: 120px; height: 120px; opacity: 0.9; }
.empty__title { font-size: var(--f-lg); font-weight: 600; color: var(--ink-1); }
.empty__desc { font-size: var(--f-sm); color: var(--ink-4); max-width: 320px; }

.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-4) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-xs); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--brand-200); border-top-color: var(--brand); animation: spin 0.7s linear infinite; }

.toast {
  position: fixed; left: 50%; bottom: calc(32px + var(--pad-safe-b)); transform: translate(-50%, 16px);
  display: flex; align-items: center; gap: var(--s2);
  max-width: min(520px, calc(100vw - 32px)); padding: var(--s3) var(--s5);
  background: rgba(37, 45, 56, 0.94); color: #fff; border-radius: var(--r-pill);
  font-size: var(--f-sm); box-shadow: var(--sh-lg); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
  z-index: var(--z-toast);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast--ok { background: rgba(23, 132, 79, 0.95); }
.toast--warn { background: rgba(191, 96, 0, 0.95); }
.toast--dan { background: rgba(198, 46, 52, 0.95); }

/* ================================ 弹窗 / 抽屉 ================================ */
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: var(--s4); background: rgba(21, 38, 56, 0.42); opacity: 0; pointer-events: none; transition: opacity var(--dur-3) var(--ease); z-index: var(--z-modal); backdrop-filter: blur(2px); }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal__panel {
  width: min(640px, 100%); max-height: min(720px, calc(100vh - 48px));
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  transform: translateY(12px) scale(0.98); transition: transform var(--dur-3) var(--ease-spring);
  overflow: hidden;
}
.modal.is-open .modal__panel { transform: none; }
.modal__panel--sm { width: min(480px, 100%); }
.modal__panel--lg { width: min(880px, 100%); }
.modal__panel--full { width: min(1080px, 100%); max-height: calc(100vh - 48px); }
.modal__head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s4) var(--s4) var(--s6); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.modal__title { font-size: var(--f-h3); font-weight: 700; color: var(--ink-1); flex: 1 1 auto; min-width: 0; }
.modal__body { padding: var(--s6); overflow: auto; flex: 1 1 auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--s3); padding: var(--s4) var(--s6); border-top: 1px solid var(--line); background: var(--surface-2); flex: 0 0 auto; }
/* 手机：弹窗改底部抽屉，按钮通栏 */
@media (max-width: 700px) {
  .modal { place-items: end center; padding: 0; }
  .modal__panel, .modal__panel--sm, .modal__panel--lg, .modal__panel--full {
    width: 100%; max-height: 88vh; border-radius: var(--r-lg) var(--r-lg) 0 0;
    transform: translateY(24px);
  }
  .modal__foot { flex-direction: column-reverse; padding-bottom: calc(var(--s4) + var(--pad-safe-b)); }
  .modal__foot .btn { width: 100%; }
}

/* ================================ 分页 ================================ */
.pager { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.pager button { min-width: 40px; min-height: 40px; border-radius: var(--r-xs); font-size: var(--f-sm); color: var(--ink-1); }
@media (max-width: 700px) { .pager button { min-width: 36px; min-height: 36px; } }
.pager button:hover { background: var(--surface-3); }
.pager button[aria-current="page"] { background: var(--brand); color: #fff; font-weight: 700; }
