/* ============================================================================
   app.css —— 代打卡 · 设计系统
   浅色 / 移动优先 / 零外部依赖
   ========================================================================== */

:root {
  --bg:        #f3f5f9;
  --bg-grad:   radial-gradient(1200px 600px at 50% -10%, #e8ecff 0%, transparent 60%);
  --surface:   #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #f1f3f8;

  --ink:    #12141a;
  --ink-2:  #59606e;
  --ink-3:  #8d93a1;

  --line:   #e8eaf0;
  --line-2: #dfe2ea;

  --brand:      #4f46e5;
  --brand-2:    #6366f1;
  --brand-3:    #8b5cf6;
  --brand-soft: #eef0ff;
  --brand-ink:  #3730c4;

  --ok:      #0f9d58;
  --ok-soft: #e6f7ee;
  --warn:      #d98224;
  --warn-soft: #fdf3e3;
  --err:      #dc3545;
  --err-soft: #fdecee;

  --r-xs: 8px;
  --r-sm: 11px;
  --r:    16px;
  --r-lg: 22px;

  --sh-1: 0 1px 2px rgba(16,20,30,.04), 0 2px 8px rgba(16,20,30,.035);
  --sh-2: 0 4px 14px rgba(16,20,30,.06), 0 14px 38px rgba(16,20,30,.07);
  --sh-brand: 0 6px 18px rgba(79,70,229,.28);

  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

html, body { overflow-x: hidden; max-width: 100vw; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- 布局 ---------- */
.app {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px calc(92px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(20px + env(safe-area-inset-top)) 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-3) 100%);
  box-shadow: var(--sh-brand);
  display: grid; place-items: center;
  color: #fff;
  flex: none;
}

.brand-title { font-size: 17px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; }
.brand-sub   { font-size: 12px; color: var(--ink-3); letter-spacing: .2px; }

.avatar-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-3) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 3px 10px rgba(79,70,229,.3);
  transition: transform .14s var(--ease);
}
.avatar-btn:active { transform: scale(.94); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--sh-1);
  border: 1px solid rgba(255,255,255,.7);
  overflow: hidden;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 14px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: .6px;
  text-transform: uppercase;
  margin: 0;
}

/* ---------- 主视觉卡 ---------- */
.hero {
  position: relative;
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #6d5cf6 55%, #8b5cf6 100%);
  box-shadow: 0 10px 28px rgba(79,70,229,.32), 0 2px 6px rgba(79,70,229,.2);
  overflow: hidden;
}

/* ★★★ 2026-11-27 20:42：装饰圆必须 pointer-events:none
 *
 * 用户反馈：「紧急打卡那个按钮，他的图层上面是不是有个球？
 *              点球那个地方的时候，紧急打卡点不进去」
 *
 * 真相：
 *   .hero::before 是 right:30px bottom:-80px 的 150x150 圆，
 *   它恰好盖在 #urgentBtn（紧急打卡）的右侧。
 *   伪元素默认会拦截鼠标事件 —— 26 个采样点里有 10 个点拿到的是 div.hero。
 *
 *   .hero-actions（晚打卡 / 上课签到）有 z-index:1 保护，没事；
 *   #urgentBtn 在 .hero-actions 外面，没有 z-index → 被盖。
 *
 * 修法：两个装饰异常都加 pointer-events:none，
 *       纯视觉装饰，不拦任何点击。
 *
 * 同时给 #urgentBtn 加 position:relative + z-index:1，双保险。
 */
.hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -70px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  pointer-events: none;            /* ★ 装饰圆不拦点击 */
}

.hero::before {
  content: "";
  position: absolute;
  right: 30px; bottom: -80px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;            /* ★ 就是这个圈盖住了紧急打卡 */
}

/* ★ 紧急打卡按钮：抬到装饰圈上面，双保险 */
#urgentBtn {
  position: relative;
  z-index: 1;
}

.hero-label { font-size: 12.5px; opacity: .82; letter-spacing: .3px; }
.hero-value { font-size: 34px; font-weight: 700; letter-spacing: -1px; margin: 2px 0 4px; }
.hero-note  { font-size: 12.5px; opacity: .8; }

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

/* ---------- 按钮 ---------- */
button { font-family: inherit; cursor: pointer; border: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .18s;
  box-shadow: 0 2px 6px rgba(79,70,229,.22);
}
.btn:hover  { background: #463ddb; }
.btn:active { transform: scale(.972); }

.btn-light {
  background: rgba(255,255,255,.18);
  color: #fff;
  box-shadow: none;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25);
}
.btn-light:hover { background: rgba(255,255,255,.26); }

.btn-ghost {
  background: var(--surface-3);
  color: var(--ink);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--line); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: var(--r-xs); flex: none; white-space: nowrap; }
.btn-danger { background: var(--err-soft); color: var(--err); box-shadow: none; }
.btn-danger:hover { background: #fbdde0; }

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

.label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: .2px;
}

.input, select.input, textarea.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-2);
  outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
  appearance: none;
}

.input::placeholder { color: #b3b8c4; }

.input:focus {
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.1);
}

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238d93a1' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.hint {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 8px;
  line-height: 1.55;
}

/* ---------- 分段控件（类型切换） ---------- */
.seg {
  display: flex;
  gap: 4px;
  background: var(--surface-3);
  padding: 4px;
  border-radius: 13px;
  margin-bottom: 16px;
}

.seg-item {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  transition: all .18s var(--ease);
}

.seg-item.on {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--sh-1);
}

/* ---------- 账号卡 ---------- */
.acc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 9px;
  min-width: 0;
  overflow: hidden;
  transition: border-color .16s;
}
.acc-row:hover { border-color: var(--line-2); }

.acc-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 15px;
  flex: none;
}

.acc-main { flex: 1 1 0; min-width: 0; overflow: hidden; }
.acc-no {
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--ink-2);
  letter-spacing: .2px;
  white-space: nowrap;
  flex: none;
}
.badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge.ok   { background: var(--ok-soft);   color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err  { background: var(--err-soft);  color: var(--err); }
.badge.info { background: var(--brand-soft);color: var(--brand); }

/* ---------- 任务时间线 ---------- */
.timeline { position: relative; }

.tl-item {
  position: relative;
  padding: 0 0 18px 26px;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line-2);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--surface);
  z-index: 1;
  pointer-events: none;      /* 装饰圆点，不拦点击 */
}
.tl-item::after {
  content: "";
  position: absolute;
  left: 9px; top: 16px; bottom: 0;
  width: 1.5px;
  background: var(--line);
  pointer-events: none;      /* 装饰连线，不拦点击 */
}
.tl-item:last-child::after { display: none; }

.tl-item.ok::before   { background: var(--ok); }
.tl-item.fail::before,
.tl-item.expired::before { background: var(--err); }
.tl-item.running::before,
.tl-item.pending::before { background: var(--warn); }
.tl-item.cancelled::before { background: var(--line-2); }
.tl-item.cancelled { opacity: .55; }

.tl-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.tl-title {
  font-size: 14.5px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-time  { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-meta  { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.tl-err   { font-size: 12.5px; color: var(--err); margin-top: 4px; }
.lock-tip {
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--surface-3);
  padding: 4px 10px;
  border-radius: 100px;
}

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 26px 16px;
  color: var(--ink-3);
  font-size: 13.5px;
}
.empty-icon {
  width: 46px; height: 46px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: var(--surface-3);
  display: grid; place-items: center;
  color: var(--ink-3);
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: flex;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(18px) saturate(180%);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0;
  background: none;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 12px;
  transition: color .16s;
}
.tab.on { color: var(--brand); }
.tab svg { width: 21px; height: 21px; }

.tab-icon { position: relative; display: grid; place-items: center; }
.tab-dot {
  position: absolute;
  top: -1px; right: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--err);
  border: 2px solid rgba(255,255,255,.9);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  background: #1a1d24;
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 2000;
  max-width: 86vw;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 抽屉（弹层） ---------- */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(12,14,20,.42);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease);
  z-index: 950;
}
.sheet-mask.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%; max-width: 520px;
  /* ★★★ 2026-11-26 第三次修（前两次都没解决，用户说两台手机都跳）
     
     之前的问题：
       1. 用 max-height: 92dvh —— dvh 在 Android WebView 里键盘弹起时不变，
          所以弹窗高度是「整屏的 92%」，被 bottom 推上去后顶部超出屏幕，
          底部还露出页面内容。
       2. 用 sheet.style.bottom = kb 往上推 —— 这会让弹窗整体位移，
          视觉上就是「跳一下」，而且弹窗和键盘之间会留空隙。
     
     现在的做法：
       · 不用 max-height，改用 top: auto + bottom 由 JS 控制
       · JS 里同时设置 top 和 bottom，让弹窗精确填满「屏幕顶到键盘上沿」
       · 去掉 overflow-y: auto 的依赖，改成 flex 布局让内容自己滚
       · transition 保留，keyboard 变化时平滑过渡 */
  max-height: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  transition: transform .28s var(--ease), bottom .2s ease-out, max-height .2s ease-out;
  z-index: 951;
  box-shadow: 0 -8px 40px rgba(0,0,0,.16);
}

/* 内容区自己滚，不许撑破弹窗 */
.sheet > #sheetBody {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* 不弹键盘时：最高占 88% 屏高 */
/* ★★★ 2026-11-27 22:01：修「横条飞出屏幕」
 *
 * 用户：「上课签到那个，点出来，上面往下拉的横条，
 *       都飞到屏幕外面去了，根本没办法拉下来」
 *
 * 原因：
 *   移动浏览器的 vh = 「大视口」（含地址栏）。
 *   实际可见区 = 视口 - 地址栏 - 状态栏。
 *   所以 88vh 按大视口算出的高度 > 实际可见区，
 *   sheet 底部贴 0、高度又太大 → 顶部（连同横条）超出屏幕上方。
 *
 * 修法：
 *   · 优先用 dvh（动态视口，跟着地址栏变化），vh 做 fallback
 *   · 比例 88 → 82，给状态栏和圆角留空间
 *   · JS 里再按 clientHeight 显式算一次（双保险）
 */
.sheet {
  max-height: 82vh;      /* fallback：老 WebView */
  max-height: 82dvh;     /* 现代：跟着地址栏变 */
}
.sheet.on { transform: translate(-50%, 0); }

.sheet-grip {
  width: 38px; height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  margin: 6px auto 16px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
  margin: 0 0 4px;
}
.sheet-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }

/* ---------- 日期选择 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 8px 13px;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all .16s var(--ease);
}
.chip:hover { background: var(--line); }
.chip.on {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-2);
}
.chip.weekend { color: #a06a1a; background: #fdf6ea; }
.chip.weekend.on { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }

/* ---------- 骨架屏 ---------- */
.skel {
  background: linear-gradient(90deg, #eef0f5 25%, #f6f7fa 50%, #eef0f5 75%);
  background-size: 200% 100%;
  animation: skel 1.3s infinite;
  border-radius: var(--r-xs);
}
@keyframes skel { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---------- 余额卡 ---------- */
.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--r);
  background: linear-gradient(135deg, #1c1f2b 0%, #2a2f42 100%);
  color: #fff;
  cursor: pointer;
  transition: transform .14s var(--ease);
  box-shadow: 0 6px 18px rgba(20,24,40,.18);
}
.balance-card:active { transform: scale(.985); }

.balance-label { font-size: 11.5px; opacity: .62; letter-spacing: .5px; }
.balance-num   { font-size: 25px; font-weight: 700; letter-spacing: -.8px; margin-top: 1px; }

.balance-btn {
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 13px;
  font-weight: 600;
  flex: none;
}

/* ---------- 收款码 ---------- */
.qr-img {
  display: block;
  width: 100%;
  max-width: 260px;
  margin: 16px auto 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(20,30,50,.1);
}

/* ---------- 日历 ---------- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; }
.cal-nav {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  display: grid; place-items: center;
}
.cal-nav:hover { background: var(--line); color: var(--ink); }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.cal-week span {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid transparent;
  display: grid;
  place-items: center;
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: background .13s, color .13s, transform .1s;
}
.cal-cell.empty { background: transparent; }
.cal-cell:hover:not(:disabled):not(.empty) { background: var(--line); }
.cal-cell:active:not(:disabled) { transform: scale(.94); }
.cal-cell.past { color: var(--ink-3); opacity: .35; cursor: default; }
/* 周末/假日不染色了 —— 用「班」「休」小字标出来就够 */
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--brand-2); }
.cal-cell.on { background: var(--brand); color: #fff; box-shadow: none; }


/* 每格标「班」或「休」 */
.cal-work {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ok);
  opacity: .85;
}
.cal-work.rest { color: var(--ink-3); opacity: .7; }
.cal-cell.on .cal-work { color: rgba(255,255,255,.9); opacity: 1; }

.cal-dot {
  position: absolute;
  bottom: 5px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

.cal-quick {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.cal-quick .chip { padding: 7px 14px; font-size: 12.5px; }
.switch-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  user-select: none;
  transition: border-color .16s;
}
.switch-row:hover { border-color: var(--line-2); }
.switch-row input { display: none; }

.switch-box {
  width: 44px; height: 26px;
  border-radius: 13px;
  background: var(--line-2);
  position: relative;
  flex: none;
  transition: background .2s var(--ease);
}
.switch-box::after {
  content: "";
  position: absolute;
  left: 3px; top: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16,20,30,.24);
  transition: transform .2s var(--ease);
  /* 2026-11-27：开关滑块是装饰，点击事件要能穿到 <label> 上；
     否则点白色小圆那里时 toggle 不生效 */
  pointer-events: none;
}
.switch-row input:checked + .switch-box { background: var(--brand); }
.switch-row input:checked + .switch-box::after { transform: translateX(18px); }

/* 今天已经过了的节次 */
.switch-row.is-passed { opacity: .6; }
.switch-row.is-passed .switch-text { color: var(--ink-3); }
.passed-tag {
  font-size: 10.5px;
  font-weight: 700;
  font-style: normal;
  color: var(--err);
  background: var(--err-soft);
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 8px;
  white-space: nowrap;
}

.switch-text { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.switch-text em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--warn);
  margin-left: 6px;
}

/* ---------- 价格行 ---------- */
.price-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--brand-soft);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--brand-ink);
}
.price-line b { font-size: 19px; font-weight: 700; letter-spacing: -.4px; }
.price-line span { font-size: 12px; opacity: .7; }
.price-line .price-sub { font-size: 12px; opacity: .75; }
.price-line.bad { background: var(--err-soft); color: var(--err); }
.price-line.bad .price-sub { opacity: 1; font-weight: 600; }

.price-promo {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(79,70,229,.2);
  font-size: 12px;
  font-weight: 600;
  opacity: .85;
}
.price-line.bad .price-promo { border-top-color: rgba(229,72,77,.25); }

/* ---------- 优惠横幅 ---------- */
.promo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #fff4e2 0%, #ffe9cf 100%);
  border: 1px solid #f7dcb4;
  font-size: 13px;
  font-weight: 600;
  color: #8a5a12;
}
.promo-badge {
  flex: none;
  padding: 3px 9px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}

/* ---------- 惩罚状态卡片 ---------- */
.penalty-card {
  background: linear-gradient(135deg, #fff5f5 0%, #ffeaea 100%);
  border: 1px solid #f8c9c9;
}
.penalty-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--err);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.penalty-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #a33;
  white-space: pre-wrap;
}

/* ---------- 注销危险提示 ---------- */
.danger-box {
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: #fff5f5;
  border: 1px solid #f8c9c9;
}
.danger-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--err);
  margin-bottom: 8px;
}
.danger-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.85;
  color: #a33;
}
.danger-list li { margin-bottom: 4px; }
.danger-list b { color: #8a1c1c; }

/* ---------- 通知铃铛 ---------- */
.bell {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
  color: var(--ink-2);
  flex: none;
  transition: background .16s, color .16s;
}
.bell:hover { background: var(--line); color: var(--ink); }
.bell-dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--err);
  border: 2px solid var(--surface);
}

/* ---------- 通知列表 ---------- */
.notice-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.notice-item:last-child { border-bottom: 0; padding-bottom: 0; }
.notice-item:first-child { padding-top: 4px; }

.notice-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.notice-title { font-size: 14.5px; font-weight: 600; }
.notice-item.unread .notice-title::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 7px;
  vertical-align: middle;
}
.notice-time { font-size: 11.5px; color: var(--ink-3); flex: none; }
.notice-del {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  display: grid; place-items: center;
  flex: none;
  transition: background .14s, color .14s;
}
.notice-del:hover { background: var(--err-soft); color: var(--err); }
.notice-body {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 5px;
  line-height: 1.6;
  white-space: pre-wrap;
}
/* 列表里只露两行，点进去看全文 */
.notice-body.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.notice-thumb-tip { font-size: 11.5px; color: var(--brand); margin-top: 6px; }

.notice-img {
  display: block;
  width: 100%;
  border-radius: 12px;
  margin: 14px 0;
  border: 1px solid var(--line);
}
.notice-full {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 反馈选图 ---------- */
.fb-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.fb-pick:hover { background: var(--line); }

.fb-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.fb-thumb {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-3);
}
.fb-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.fb-thumb-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
} .fb-thumb-del:hover { background: var(--err); }

textarea.input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}
.notice-item.urgent .notice-title { color: var(--err); }
.notice-item.warn .notice-title { color: var(--warn); }

/* ---------- 密码输入框（带可见切换） ---------- */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 46px; }
.pwd-eye {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  display: grid; place-items: center;
}
.pwd-eye:hover { background: var(--surface-3); color: var(--ink-2); }

/* ---------- 设置项 ---------- */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.set-row:last-child { border-bottom: 0; }
.set-row .v { color: var(--ink-3); font-size: 13px; }

/* ---------- 文字按钮 ---------- */
.link-btn {
  background: none;
  border: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.link-btn:hover { background: var(--brand-soft); }

/* ---------- 工具类 ---------- */
.row { display: flex; gap: 10px; align-items: center; }
.row-tight { display: flex; gap: 7px; align-items: center; }
.grow { flex: 1; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.hide { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 响应式 ---------- */
@media (max-width: 400px) {
  .app { padding-left: 13px; padding-right: 13px; }
  .hero-value { font-size: 30px; }
}

/* ---------- 充值唯一金额 ---------- */
.pay-amount-box {
  text-align: center;
  padding: 18px 16px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  margin-bottom: 14px;
}
.pay-amount-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #4338ca;
  margin-bottom: 6px;
}
.pay-amount {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: #3730a3;
  font-variant-numeric: tabular-nums;
}
.pay-amount-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #5b52c9;
}

/* ---------- 自定义金额校验 ---------- */
.field-error {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--err);
  padding-left: 2px;
}
.hide { display: none !important; }

/* ---------- 支付记录（余额下面那条小的） ---------- */
.pay-history {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pay-hist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 11.5px;
}
.pay-hist-amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  min-width: 58px;
}
.pay-hist-amt.ok { color: var(--ok); }
.pay-hist-amt.err { color: var(--err); }
.pay-hist-state { color: var(--ink-2); }
.pay-hist-time {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 11px;
}

/* ---------- IP 白名单面板（后台） ---------- */
.ip-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.ip-now {
  font: 600 17px ui-monospace, Consolas, monospace;
  color: var(--brand);
  margin-top: 3px;
}
.ip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.ip-val {
  font: 600 13px ui-monospace, Consolas, monospace;
  color: var(--ink);
}
.ip-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}
.ip-tag.me { background: #dcfce7; color: #15803d; }
.ip-tag.env { background: #fef3c7; color: #a16207; }

.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rule-table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-3);
  font-size: 11.5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.rule-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--ink-2);
}
.rule-table td.ok { color: var(--ok); font-weight: 600; }
.rule-table td.err { color: var(--err); font-weight: 600; }

/* ---------- 楼栋分区 + 搜索 ---------- */
.bld-search {
  margin-bottom: 12px;
  font-size: 13.5px;
}
.bld-group { margin-bottom: 12px; }
.bld-group:last-child { margin-bottom: 0; }
.bld-zone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .4px;
  margin-bottom: 7px;
}
.bld-zone span {
  font-weight: 600;
  color: var(--ink-3);
  opacity: .6;
  font-size: 10.5px;
}
.bld-zone::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
  margin-left: 4px;
}

/* ---------- 后台惩罚分级行 ---------- */
.pen-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pen-row > div { flex: 1; }
.pen-row b { font-size: 12.5px; }

/* ---------- 紧急打卡 ---------- */
.btn-urgent {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(239,68,68,.32);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-urgent:active { transform: scale(.985); }

.urgent-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--err);
  margin-bottom: 4px;
}

/* ---------- 邀请码 ---------- */
.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.invite-code {
  font: 700 17px/1.3 ui-monospace, Consolas, monospace;
  letter-spacing: 1.5px;
  color: var(--brand);
  margin-top: 3px;
  user-select: all;
}

/* ---------- 后台页头：登录/退出按钮要显眼 ---------- */
#actionBtn {
  font-weight: 600;
  min-width: 68px;
}
#actionBtn.need-login {
  background: linear-gradient(135deg, #6b5cff, #5546e8) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 3px 12px rgba(107,92,255,.35);
}
#actionBtn.need-login:hover { filter: brightness(1.08); }

/* ---------- 日历：法定假日角标 ---------- */
.cal-cell { position: relative; }
.cal-rest {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8.5px;
  line-height: 1;
  color: var(--err);
  font-weight: 700;
  white-space: nowrap;
  opacity: .85;
}
.cal-cell.on .cal-rest { color: #fff; opacity: 1; }


/* ---------- 充值记录：查看全部 ---------- */
.pay-hist-more {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  color: var(--brand);
  font: 600 12.5px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.pay-hist-more:active { opacity: .7; }

/* ---------- 注册前的免责声明 ---------- */
.disc-box {
  max-height: 46vh;
  overflow-y: auto;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.75;
  -webkit-overflow-scrolling: touch;
}
.disc-block { margin-bottom: 18px; }
.disc-block:last-of-type { margin-bottom: 8px; }
.disc-title {
  font-weight: 800;
  font-size: 13.5px;
  margin-bottom: 6px;
  color: var(--ink);
}
.disc-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
}
.disc-list li { margin-bottom: 7px; }
.disc-list li b { color: var(--ink); font-weight: 700; }
.disc-end {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  opacity: .6;
  margin-top: 4px;
}

.disc-agree {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13.5px;
  cursor: not-allowed;
  opacity: .55;
}
.disc-agree.ready { cursor: pointer; opacity: 1; border-color: var(--brand); }
.disc-agree input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.disc-agree input:disabled { cursor: not-allowed; }

/* ==========================================================================
   登录页（全屏）
   ========================================================================== */
.login-page {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #4f46e5 0%, #6b5cff 42%, #8b7cff 100%);
  padding: 24px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.login-page.hide { display: none; }

/* 登录页开着时主界面藏起来 */
.app.behind-login { visibility: hidden; }

.login-wrap {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-brand { text-align: center; color: #fff; }
.login-logo {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.22);
}
.login-name {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin-bottom: 6px;
}
.login-slogan {
  font-size: 12.5px;
  color: rgba(255,255,255,.72);
  letter-spacing: .3px;
}

.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 20px 24px;
  box-shadow: 0 18px 50px rgba(23, 18, 78, .28);
}

.login-foot {
  text-align: center;
  font-size: 11.5px;
  color: rgba(255,255,255,.55);
  letter-spacing: .3px;
}

/* ==========================================================================
   动效层
   --------------------------------------------------------------------------
   原则：只动 transform 和 opacity —— 这两个能走 GPU 合成，不触发重排重绘。
   时长控制在 150~360ms，缓动统一用 ease-out 系，进去快出来慢。
   系统开了「减少动态效果」的话全部关掉。
   ========================================================================== */

/* ---------- 入场：卡片依次浮上来 ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 首屏的几块依次浮起，间隔 45ms，最长不超过 180ms 延迟 */
[data-anim="stagger"] { animation: fadeUp .34s cubic-bezier(.22,.9,.28,1) both; }
[data-anim="stagger"]:nth-child(1) { animation-delay: 0ms; }
[data-anim="stagger"]:nth-child(2) { animation-delay: 45ms; }
[data-anim="stagger"]:nth-child(3) { animation-delay: 90ms; }
[data-anim="stagger"]:nth-child(4) { animation-delay: 130ms; }
[data-anim="stagger"]:nth-child(5) { animation-delay: 165ms; }
[data-anim="stagger"]:nth-child(n+6) { animation-delay: 180ms; }

/* ---------- 页面切换：换个 tab 轻轻淡入 ---------- */
@keyframes paneIn {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.pane-enter { animation: paneIn .24s cubic-bezier(.22,.9,.28,1) both; }

/* ---------- 弹窗：从底部滑上来 ----------
   ★ 关键：必须带上 translate(-50%, …)。
   .sheet 靠 left:50% + translateX(-50%) 居中，animation 里的 transform
   会**整个覆盖**掉元素的 transform 声明，写成 translate3d(0, …) 的话
   水平居中就丢了，弹窗会整体偏到屏幕右半侧。 */
@keyframes sheetUp {
  from { transform: translate(-50%, 100%); }
  to   { transform: translate(-50%, 0); }
}
.sheet.on { animation: sheetUp .3s cubic-bezier(.2,.85,.24,1) both; }

/* ---------- 遮罩：淡入 ---------- */
.mask.on { animation: fadeIn .2s ease-out both; }

/* ---------- 按钮按下：轻微缩一下 ---------- */
.btn:active,
.chip:active,
.seg-item:active,
.balance-btn:active,
.cal-cell:not(:disabled):active {
  transform: scale(.965);
  transition: transform .08s ease-out;
}

/* 按钮松开回弹（只在有 transform 的元素上，跟上面的 :active 配对） */
.btn, .chip, .seg-item, .balance-btn, .cal-cell {
  transition: transform .16s cubic-bezier(.34,1.4,.5,1),
              background .16s, color .16s, border-color .16s, box-shadow .16s;
}

/* ---------- 数字变化：轻轻跳一下 ---------- */
@keyframes numPop {
  0%   { transform: scale(1); }
  38%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.num-pop { animation: numPop .42s cubic-bezier(.34,1.4,.5,1); }

/* ---------- 余额到账：闪一下绿光 ---------- */
@keyframes balanceGlow {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70%  { box-shadow: 0 0 0 14px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.balance-glow { animation: balanceGlow .9s ease-out; }


/* ---------- 加载态：三个点依次跳 ---------- */
@keyframes dotJump {
  0%, 60%, 100% { transform: translate3d(0,0,0); opacity: .45; }
  30%           { transform: translate3d(0,-4px,0); opacity: 1; }
}
.loading-dots { display: inline-flex; gap: 4px; align-items: center; }
.loading-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; display: block;
  animation: dotJump 1.1s ease-in-out infinite;
}
.loading-dots i:nth-child(2) { animation-delay: .14s; }
.loading-dots i:nth-child(3) { animation-delay: .28s; }

/* ---------- 列表项：新加进来的时候淡入 ---------- */
@keyframes rowIn {
  from { opacity: 0; transform: translate3d(-6px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.row-enter { animation: rowIn .26s cubic-bezier(.22,.9,.28,1) both; }

/* ---------- toast：滑下来 ----------
   同样要带 translateX(-50%)，否则会偏右半个屏幕。 */
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.toast.on { animation: toastIn .26s cubic-bezier(.2,.9,.28,1) both; }

/* ---------- 日历格子：选中时轻轻弹一下 ---------- */
@keyframes cellPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.cal-cell.on { animation: cellPop .28s cubic-bezier(.34,1.4,.5,1); }

/* ==========================================================================
   系统开了「减少动态效果」就把这些都关掉
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}



/* ==========================================================================
   账号异常（黑名单）
   ========================================================================== */
.blocked-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  margin-bottom: 14px;
}
.blocked-banner.top { margin-bottom: 16px; }

.blocked-icon {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
  line-height: 1;
}

.blocked-title {
  font-size: 14.5px; font-weight: 800; color: #991b1b;
  margin-bottom: 3px;
}
.blocked-text {
  font-size: 12.5px; color: #b91c1c; line-height: 1.6;
}
.blocked-sub {
  font-size: 11.5px; color: #dc2626; opacity: .85; margin-top: 4px;
}

/* 被禁的按钮：灰掉并且不响应 */
.btn.is-blocked,
.btn:disabled.is-blocked {
  opacity: .42;
  filter: grayscale(.7);
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   白名单相关
   ========================================================================== */
.wl-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,.26);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2px;
  vertical-align: middle;
}

.wl-quota {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.wl-quota > div {
  flex: 1;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wl-quota b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   sheet 底部按钮吸底
   --------------------------------------------------------------------------
   弹窗内容超过 88dvh 时，最后那排按钮会被切在可视区外，用户不知道要滚。
   把按钮组成一个 sticky 容器贴在弹窗底部，内容区自己滚，按钮永远看得见。
   ========================================================================== */
.sheet-actions {
  position: sticky;
  bottom: 0;
  margin: 0 -20px;                 /* 抵消 .sheet 的左右 padding，铺满宽度 */
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  /* 上方渐隐，暗示内容还在上面可以滚 */
  box-shadow: 0 -12px 20px -8px rgba(0,0,0,.08);
  z-index: 1;
}

.sheet-actions .btn { margin-top: 8px; }
.sheet-actions .btn:first-child { margin-top: 0; }

/* ==========================================================================
   表单校验失败的视觉反馈
   --------------------------------------------------------------------------
   光弹 toast 不够 —— 2 秒就消失，用户回头看不到，以为"点了没反应"。
   输入框标红 + 轻微抖动 + 自动聚焦，把注意力引到出问题的那一格。
   ========================================================================== */
.input.invalid {
  border-color: #e5484d !important;
  box-shadow: 0 0 0 3px rgba(229,72,77,.12) !important;
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

.input.shake { animation: fieldShake .38s ease-in-out; }


/* ==========================================================================
   层级约定（改动前必读）
   --------------------------------------------------------------------------
   z-index 是这个项目最容易踩的坑：
     .login-page   900    全屏登录页，必须能盖住主界面
     .sheet-mask   950    弹层遮罩 —— 必须高于登录页
     .sheet        951    弹层本体 —— 必须高于遮罩
     .toast        2000   提示 —— 必须高于一切

   历史教训：弹层原来是 60/61，被 z-index 900 的登录页整个盖住。
   用户点登录后会看到按钮变成「登录中…」又恢复，因为弹窗确实弹了但看不见。
   ========================================================================== */

/* ============================================================================
   键盘弹起时收紧弹窗排版（2026-11-26）
   ----------------------------------------------------------------------------
   JS 的 syncSheetToKeyboard 在软键盘弹起时给 .sheet 加 .kb-open 类。
   目的：让输入框和主按钮尽量靠近键盘，别让说明文字占掉半屏。

   实测场景（改密码弹窗）：
     弹窗 0~265，输入框 140~185，265~320 是 Edge 密码提示条，320+ 是键盘
     输入框到键盘中间有 80px 的按钮 + 说明文字 —— 收紧这些能省出来
   ============================================================================ */

.sheet.kb-open {
  /* 顶部圆角小一点，少占高度 */
  border-radius: 18px 18px 0 0;
  padding-top: 6px;
}

.sheet.kb-open .sheet-grip {
  margin: 2px auto 8px;
}

.sheet.kb-open .sheet-title {
  font-size: 15.5px;
  margin-bottom: 4px;
}

.sheet.kb-open .sheet-sub {
  font-size: 12px;
  margin-bottom: 10px;
}

/* 说明文字收紧（不是完全藏，还能扫一眼） */
.sheet.kb-open .hint {
  font-size: 11.5px;
  line-height: 1.4;
  margin-top: 6px;
}

/* 字段之间的间距收紧 */
.sheet.kb-open .field {
  margin-bottom: 10px;
}

.sheet.kb-open .field .label {
  margin-bottom: 4px;
}

/* 按钮区收紧 */
.sheet.kb-open .btn-block {
  margin-top: 10px;
}

.sheet.kb-open .btn.mt-8 {
  margin-top: 8px;
}

/* 长说明块（notice-full）在键盘弹起时折叠成一行提示 */
.sheet.kb-open .notice-full {
  font-size: 11.5px;
  line-height: 1.45;
  padding: 8px 10px;
  margin: 8px 0;
}
/* ★ 2026-11-27 21:47：已选中但已过期的日期（可以点击取消） */
.cal-cell.past-on {
  opacity: .85;
  cursor: pointer;
}
.cal-cell.past-on .cal-d {
  text-decoration: line-through;
}