/* ==========================================================================
 * 工程管理系统 · 移动端 H5 —— 设计系统与通用组件
 *
 * 设计基线：375 × 812（iPhone X 逻辑像素），向上自适应到 430，向下兼容 320。
 * 与 PC 端共用同一套品牌色（#2F6BFF）与语义色，保证两端看起来是同一个产品；
 * 但**不引入 antd**：移动端的密度、点击区、滚动方式与桌面表格完全不同，
 * 复用组件库只会把桌面密度硬塞进手机屏。
 *
 * 命名采用 BEM 简化式（block__element、is-* 状态），全局无第三方依赖。
 * ========================================================================== */

/* --------------------------------------------------------------------------
 * 1. 设计令牌
 * ------------------------------------------------------------------------ */
:root {
  /* 品牌 */
  --brand: #2f6bff;
  --brand-700: #1c4fd6;
  --brand-600: #2359ea;
  --brand-100: #dbe5ff;
  --brand-50: #eef3ff;

  /* 中性墨色阶（与 PC 端 --ink-* 对齐） */
  --ink-900: #0f1b33;
  --ink-800: #1e2b45;
  --ink-700: #2b3a55;
  --ink-600: #3d4c68;
  --ink-500: #5c6b85;
  --ink-400: #8a97ab;
  --ink-300: #b6c0d0;

  /* 面与线 */
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --line: #eaeef6;
  --line-strong: #dde4ef;

  /* 语义 */
  --ok: #16a34a;
  --ok-50: #e9f8ef;
  --warn: #d97706;
  --warn-50: #fef4e6;
  --danger: #dc2626;
  --danger-50: #fdecec;
  --violet: #7c5cff;
  --violet-50: #f1edff;
  --teal: #0ea5a5;
  --teal-50: #e5f7f7;

  /* 形状 */
  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;

  /* 阴影：移动端只用两级，再多就显得脏 */
  --sh-1: 0 1px 2px rgba(16, 26, 45, 0.05);
  --sh-2: 0 8px 24px rgba(16, 26, 45, 0.07);
  --sh-3: 0 14px 36px rgba(16, 26, 45, 0.14);

  /* 布局 */
  --gutter: 16px;
  --tabbar-h: 54px;
  --topbar-h: 48px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
 * 2. 基础重置
 * ------------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-800);
  background: #e9edf5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol,
li {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

svg {
  display: block;
}

/* 数字统一等宽，金额纵向对齐才不会抖 */
.num,
.metric__value,
.stat__value,
.amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* --------------------------------------------------------------------------
 * 3. 应用外壳（桌面打开时居中成一列手机宽度，不做假手机边框）
 * ------------------------------------------------------------------------ */
.app {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow-x: hidden;
}

@media (min-width: 480px) {
  body {
    background: #dfe4ee;
  }
  .app {
    box-shadow: 0 0 0 1px rgba(16, 26, 45, 0.06), 0 24px 60px rgba(16, 26, 45, 0.14);
  }
}

.view {
  min-height: 100vh;
  min-height: 100dvh;
}

/* 有 tabbar 的页面底部留出固定栏高度 + 安全区，否则最后一行会被遮住 */
.view.has-tabbar {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
}

/* --------------------------------------------------------------------------
 * 4. 顶栏（二级页面）
 * ------------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding: var(--safe-t) 8px 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(234, 238, 246, 0.9);
}

.topbar__btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink-700);
  transition: background 0.15s var(--ease);
}

.topbar__btn:active {
  background: var(--surface-2);
}

.topbar__title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__title--center {
  text-align: center;
}

.topbar__spacer {
  width: 40px;
  flex: none;
}

/* --------------------------------------------------------------------------
 * 5. Tabbar（4 个常规项 + 中间凸起的「记工」）
 * ------------------------------------------------------------------------ */
.tabbar {
  position: fixed;
  z-index: 40;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: flex-end;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}

.tabbar[hidden] {
  display: none;
}

.tab {
  position: relative;
  flex: 1;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-400);
  font-size: 10.5px;
  letter-spacing: 0.2px;
  transition: color 0.16s var(--ease);
}

.tab.is-active {
  color: var(--brand);
  font-weight: 600;
}

.tab:active {
  opacity: 0.7;
}

.tab__dot {
  position: absolute;
  top: 8px;
  left: 50%;
  margin-left: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 1.5px #fff;
}

/* 中间凸起按钮：不占额外高度，用负位移抬起来，遮住的内容靠 tabbar 上方留白 */
.tab--fab {
  color: var(--ink-400);
}

.tab--fab .tab__fab {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -18px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(140deg, #4b83ff, var(--brand) 55%, var(--brand-700));
  box-shadow: 0 6px 16px rgba(47, 107, 255, 0.36), 0 0 0 3px #fff;
  transition: transform 0.16s var(--ease);
}

.tab--fab:active .tab__fab {
  transform: scale(0.94);
}

.tab--fab.is-active .tab__fab {
  box-shadow: 0 8px 20px rgba(47, 107, 255, 0.48), 0 0 0 3px #fff;
}

/* --------------------------------------------------------------------------
 * 6. 卡片 / 区块标题
 * ------------------------------------------------------------------------ */
.page {
  min-height: 100%;
}

.sec {
  padding: 0 var(--gutter);
  margin-top: 18px;
}

.sec--tight {
  margin-top: 12px;
}

.sec__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sec__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-900);
  letter-spacing: 0.2px;
}

.sec__title small {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-400);
}

.sec__more {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
  color: var(--ink-400);
}

.sec__more:active {
  color: var(--brand);
}

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.card--pad {
  padding: 14px;
}

.card__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 0;
}

.card__title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink-900);
}

.card__bd {
  padding: 12px 14px 14px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 0 14px;
}

/* --------------------------------------------------------------------------
 * 7. 按钮
 * ------------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease), opacity 0.15s;
}

.btn:active {
  transform: scale(0.985);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #4b83ff, var(--brand) 60%, var(--brand-600));
  box-shadow: 0 6px 16px rgba(47, 107, 255, 0.28);
}

.btn--primary:disabled {
  opacity: 0.55;
  box-shadow: none;
}

.btn--ghost {
  color: var(--brand);
  background: var(--brand-50);
}

.btn--line {
  color: var(--ink-600);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: var(--r-sm);
}

/* --------------------------------------------------------------------------
 * 8. 表单
 * ------------------------------------------------------------------------ */
.field {
  margin-bottom: 14px;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-500);
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 15px;
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
  appearance: none;
}

.input::placeholder {
  color: var(--ink-300);
}

.input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

.input-affix {
  position: relative;
}

.input-affix .input {
  padding-right: 54px;
}

.input-affix__btn {
  position: absolute;
  top: 0;
  right: 0;
  height: 48px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  color: var(--ink-400);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
 * 9. 标签 / 徽章
 * ------------------------------------------------------------------------ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tag--brand {
  color: var(--brand-600);
  background: var(--brand-50);
}
.tag--ok {
  color: var(--ok);
  background: var(--ok-50);
}
.tag--warn {
  color: var(--warn);
  background: var(--warn-50);
}
.tag--danger {
  color: var(--danger);
  background: var(--danger-50);
}
.tag--violet {
  color: var(--violet);
  background: var(--violet-50);
}
.tag--teal {
  color: var(--teal);
  background: var(--teal-50);
}
.tag--muted {
  color: var(--ink-500);
  background: #f1f4fa;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* --------------------------------------------------------------------------
 * 10. 列表行
 * ------------------------------------------------------------------------ */
.list {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  position: relative;
  transition: background 0.14s;
}

.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 0;
  height: 1px;
  background: var(--line);
}

.row:active {
  background: var(--surface-2);
}

.row__ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--brand);
  background: var(--brand-50);
}

.row__main {
  flex: 1;
  min-width: 0;
}

.row__title {
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__val {
  flex: none;
  font-size: 13px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

.row__arrow {
  flex: none;
  color: var(--ink-300);
}

/* --------------------------------------------------------------------------
 * 11. 空态 / 骨架 / 加载
 * ------------------------------------------------------------------------ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--ink-400);
  font-size: 13px;
  text-align: center;
}

.empty__art {
  color: var(--ink-300);
  opacity: 0.9;
}

.empty__sub {
  font-size: 12px;
  color: var(--ink-300);
}

.skeleton {
  background: linear-gradient(90deg, #eef1f7 25%, #f6f8fc 37%, #eef1f7 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease infinite;
  border-radius: 8px;
}

@keyframes sk {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--brand-100);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 0;
  color: var(--ink-400);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
 * 12. Toast / 底部弹层
 * ------------------------------------------------------------------------ */
.toast-root {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 26px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 100%;
  max-width: 440px;
  padding: 0 32px;
}

.toast {
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(15, 27, 51, 0.92);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--sh-3);
  animation: toastIn 0.22s var(--ease);
}

.toast--ok {
  background: rgba(18, 122, 62, 0.95);
}

.toast--err {
  background: rgba(178, 32, 32, 0.95);
}

.toast.is-out {
  animation: toastOut 0.2s var(--ease) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

.layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(9, 17, 33, 0.42);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
  pointer-events: auto;
}

.sheet-mask.is-open {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 440px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(9, 17, 33, 0.18);
  transition: transform 0.26s var(--ease);
  pointer-events: auto;
  padding-bottom: var(--safe-b);
}

.sheet.is-open {
  transform: translate(-50%, 0);
}

.sheet__grip {
  width: 34px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: var(--line-strong);
}

.sheet__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
}

.sheet__title {
  font-size: 16px;
  font-weight: 650;
  color: var(--ink-900);
}

.sheet__bd {
  padding: 4px 16px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
 * 13. 动画：路由切换淡入（移动端只做轻位移，不做大幅滑动，避免误以为是原生手势）
 * ------------------------------------------------------------------------ */
.page-enter {
  animation: pageIn 0.2s var(--ease);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------------
 * 14. 可访问性工具
 * ------------------------------------------------------------------------ */

/**
 * 视觉隐藏但保留可交互（记工页的原生日期输入用它）
 * 不能直接 display:none —— 那样 showPicker()/click() 都唤不出系统日历。
 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
 * 15. 滑块验证码（登录页人机校验，见 core/captcha.js）
 *
 * 尺寸体系：画布固定 400×100（服务端出题），实际渲染宽度 = 容器宽度，
 * 缩放比在 JS 里算（scale = 容器宽 / 400）。所以这里横向一律用 100%，
 * 不写死 px —— 写死会让拼图块与缺口在 320 与 430 之间错位。
 * ------------------------------------------------------------------------ */
.cap-host {
  margin-top: 12px;
}

.cap {
  --cap-h: 44px;
}

.cap__stage {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  /* 高度由 JS 按 data.height × scale 写入（画布 400×100，等比）。
     这里**不能**留 min-height 兜底：320 宽时 scale=0.63 只有 63px，
     兜底 72px 会把舞台撑高，背景按 cover 就得横向裁掉一块，
     拼图块与缺口在视觉上就错位了（判题仍会过，因为判的是坐标，更容易被漏掉）。
     舞台在拿到题目之前是 hidden 的，不存在首帧塌陷问题。 */
}

.cap__bg,
.cap__piece {
  position: absolute;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.cap__bg {
  inset: 0;
  width: 100%;
  height: 100%;
  /* fill 而不是 cover：容器宽高比本来就等于画布（400×100），差那半像素的四舍五入
     用 fill 摊掉；cover 一旦容器比例不对就直接裁掉左右，缺口会跑到画面外。 */
  object-fit: fill;
}

/* 抖动用 transform：拼图块的 left/top 是内联样式，改它们会跟拖拽打架 */
.cap__piece.is-shake,
.cap__stage.is-shake .cap__piece {
  animation: cap-shake 0.4s var(--ease);
}

@keyframes cap-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

.cap__mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  color: var(--ink-400);
  background: var(--surface-2);
}

/* 必须显式写这一条：上面给了 `display: grid`，而 UA 的 `[hidden]{display:none}`
   优先级更低 —— 结果 hidden 完全失效，这块半透明遮罩会一直盖在背景图上。
   症状极像"图片没加载"（自然宽高正常、canvas 里也能画出来，页面却是空白块）。 */
.cap__mask[hidden] {
  display: none;
}

.cap__bar {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--cap-h);
  margin-top: 10px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.cap__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--brand-50);
  transition: width 0.06s linear;
}

.cap__text {
  position: relative;
  flex: 1;
  /* 左右都留出把手宽度：通过时把手停在最右，只留左边距的话
     「验证通过」会被把手压掉最后半个字 */
  padding: 0 calc(var(--cap-h) + 6px);
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cap__bar[data-phase='success'] {
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.35);
  background: #f0fdf4;
}

.cap__bar[data-phase='success'] .cap__fill {
  background: #dcfce7;
}

.cap__bar[data-phase='success'] .cap__text {
  color: #15803d;
  font-weight: 600;
}

.cap__bar[data-phase='error'] {
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.3);
  background: #fef2f2;
}

.cap__bar[data-phase='error'] .cap__text {
  color: #b91c1c;
}

.cap__handle {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: var(--cap-h);
  height: var(--cap-h);
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #4b86f7 0%, #2f6bff 100%);
  box-shadow: 0 2px 8px rgba(47, 107, 255, 0.28);
  /* 拖动时不许浏览器接管手势：否则手机上是「页面在滚、滑块不动」 */
  touch-action: none;
  cursor: grab;
  transition: background 0.15s;
}

.cap__handle:disabled {
  cursor: default;
}

.cap__handle[data-phase='success'] {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.28);
}

.cap__handle[data-phase='error'] {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.26);
}

.cap__handle[data-phase='checking'] {
  background: linear-gradient(135deg, #93b4f8 0%, #6f92e8 100%);
}

.cap__spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: cap-spin 0.7s linear infinite;
}

@keyframes cap-spin {
  to { transform: rotate(360deg); }
}

.cap__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  font-size: 10.5px;
  color: var(--ink-300);
}

.cap__refresh {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  padding: 2px 0;
  border: 0;
  background: none;
  font-size: 10.5px;
  color: var(--brand);
}

.cap__refresh svg {
  /* 全局 svg{display:block} 会把图标顶到单独一行 */
  display: inline-block;
}
