/* ============================================================
   作业闯关 · 视觉系统 v4「闯关手账」
   纸感底色 + 深墨状态卡 + 高对比科目色牌 + 大号触控区
   ============================================================ */

:root {
  /* 纸 */
  --paper: #f6f1e6;
  --paper-2: #efe7d6;
  --card: #fffdf8;

  /* 墨 */
  --ink: #14213d;
  --ink-2: #3b4863;
  --muted: #6a7382;
  --line: #e8dfcd;
  --line-2: #dccfb8;

  /* 主色 */
  --coral: #cf451f;
  --coral-deep: #a83713;
  --coral-soft: #fcece5;
  --gold: #d99a18;
  --gold-soft: #fbf1d6;
  --mint: #1f9d6b;
  --mint-soft: #e3f5ec;
  --blue: #3568d4;
  --blue-soft: #e9effb;
  --danger: #cf3f3f;
  --danger-soft: #fceaea;

  /* 兼容旧变量名 */
  --bg: var(--paper);
  --primary: var(--ink);
  --primary-dark: #0b1730;
  --primary-soft: #eef1f7;
  --accent: var(--coral);
  --accent-soft: var(--coral-soft);
  --ok: var(--mint);
  --ok-soft: var(--mint-soft);

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 11px;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 10px 24px -18px rgba(20, 33, 61, 0.55);
  --shadow-lg: 0 24px 60px -22px rgba(20, 33, 61, 0.4);
  --shadow-ink: 0 14px 30px -14px rgba(20, 33, 61, 0.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(20, 33, 61, 0.055) 1px, transparent 0),
    radial-gradient(760px 420px at 100% -6%, rgba(228, 85, 45, 0.10) 0%, rgba(228, 85, 45, 0) 60%),
    radial-gradient(600px 380px at -10% 6%, rgba(217, 154, 24, 0.10) 0%, rgba(217, 154, 24, 0) 62%);
  background-size: 22px 22px, auto, auto;
  color: var(--ink);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }
.hidden { display: none !important; }
::selection { background: var(--gold-soft); }

/* ---------------- 登录 ---------------- */
.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 20px 54px;
  max-width: 540px;
  margin: 0 auto;
}

.brand-badge {
  width: 92px; height: 92px;
  border-radius: 30px;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-size: 44px;
  position: relative;
  box-shadow: var(--shadow-ink);
  transform: rotate(-4deg);
  animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand-badge::after {
  content: "";
  position: absolute;
  top: 6px; right: 6px; bottom: 6px; left: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.32);
  border-radius: 24px;
}

.brand-title { font-size: 30px; font-weight: 800; letter-spacing: 2px; margin: 22px 0 4px; }
.brand-title::after {
  content: "";
  display: block;
  width: 46px; height: 4px;
  margin: 10px auto 0;
  border-radius: 99px;
  background: var(--coral);
}
.brand-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 28px; letter-spacing: 0.3px; }
.role-grid { width: 100%; display: grid; gap: 12px; }

.role-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.role-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.role-card:active { transform: scale(0.985); }

.role-emoji { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 27px; flex: 0 0 auto; border: 1.5px solid transparent; }
.role-emoji.parent { background: var(--gold-soft); border-color: #efdca8; }
.role-emoji.student { background: var(--blue-soft); border-color: #cddcf7; }
.role-name { font-weight: 800; font-size: 17px; letter-spacing: 0.2px; }
.role-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.role-arrow { margin-left: auto; color: var(--line-2); font-size: 22px; font-weight: 700; }

.pin-box { width: 100%; display: grid; gap: 10px; margin-top: 4px; }
.pin-input {
  width: 100%;
  height: 56px;
  border-radius: 15px;
  border: 1.5px solid var(--line-2);
  background: var(--card);
  letter-spacing: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.pin-input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(20, 33, 61, 0.08); }

/* ---------------- 按钮 ---------------- */
.btn {
  border-radius: 14px;
  min-height: 48px;
  padding: 12px 18px;
  font-size: 15.5px;
  font-weight: 700;
  background: var(--ink);
  color: #fff;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  box-shadow: var(--shadow-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  letter-spacing: 0.3px;
}
.btn:hover { background: #0d1930; }
.btn:active { transform: scale(0.972); }
.btn.lg { min-height: 54px; font-size: 16.5px; border-radius: 16px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: none; border: 1.5px solid var(--line-2); }
.btn.ghost:hover { background: #fbf7ee; }
.btn.ghost[disabled] { color: #b3b9c4; border-color: var(--line); background: #fbf8f1; }
.btn.plain { background: var(--coral-soft); color: var(--coral-deep); box-shadow: none; border: 1.5px solid #f6d3c4; }
.btn.dashed { background: transparent; border: 1.5px dashed var(--line-2); color: var(--ink-2); box-shadow: none; min-height: 46px; }
.btn.dashed:hover { background: #fbf6ec; border-color: var(--ink); color: var(--ink); }
.btn.plain:hover { background: #fce2d7; }
.btn.tiny { min-height: 34px; padding: 6px 11px; font-size: 12.5px; border-radius: 10px; box-shadow: none; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.hint { color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.6; }

/* ---------------- 外壳 ---------------- */
.app { max-width: 540px; margin: 0 auto; padding: 0 18px 118px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 12px;
  background: linear-gradient(180deg, var(--paper) 58%, rgba(246, 241, 230, 0));
  backdrop-filter: blur(6px);
}
.topbar-title { font-size: 21px; font-weight: 800; letter-spacing: 1px; }
.topbar-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  letter-spacing: 1.5px;
}
.topbar-spacer { flex: 1; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 13px;
  background: var(--card);
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  font-size: 15px;
  color: var(--ink-2);
  transition: transform 0.14s ease, background 0.14s ease;
  flex: 0 0 auto;
}
.icon-btn svg { width: 19px; height: 19px; display: block; }
.icon-btn:hover { background: #fbf6ec; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.spinning svg { animation: icon-spin 0.7s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }

/* ---------------- 卡片 / 区块 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
}

/* ---------------- 学生端状态卡 ---------------- */
.hero {
  position: relative;
  background: var(--ink);
  color: #fdfbf6;
  border-radius: var(--radius-xl);
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-ink);
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid #0b1730;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.14) 1px, transparent 0);
  background-size: 18px 18px;
  opacity: 0.5;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  width: 190px; height: 190px;
  right: -92px; top: -104px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 85, 45, 0.55), rgba(228, 85, 45, 0) 68%);
}
.hero-warm {
  background: var(--coral);
  border-color: #c2431f;
  box-shadow: 0 16px 34px -16px rgba(196, 67, 31, 0.6);
  cursor: default;
}
.hero-warm::after { background: radial-gradient(circle, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 68%); }
.hero-top { display: flex; align-items: center; gap: 12px; position: relative; }
.hero-avatar {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  display: grid; place-items: center;
  font-size: 27px;
  flex: 0 0 auto;
}
.hero-name { font-weight: 800; font-size: 17.5px; letter-spacing: 0.3px; }
.hero-streak { font-size: 12px; opacity: 0.82; margin-top: 1px; }
.hero-streak .fire {
  display: inline-block;
  transform-origin: 50% 80%;
  animation: fire-wiggle 1.6s ease-in-out infinite;
}
@keyframes fire-wiggle {
  0%, 100% { transform: scale(1) rotate(-4deg); }
  50% { transform: scale(1.22) rotate(4deg); }
}
.hero-points { margin-left: auto; text-align: right; position: relative; display: grid; gap: 3px; }
.hero-points b {
  font-size: 33px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  font-feature-settings: "tnum";
  display: inline-block;
  background: linear-gradient(180deg, #fff3c4 8%, #ffd27a 48%, #f5a623 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pts-glow 2.8s ease-in-out infinite;
}
.hero-points b.pop {
  animation: pts-pop 0.62s cubic-bezier(0.2, 1.6, 0.4, 1), pts-glow 2.8s ease-in-out 0.62s infinite;
}
@keyframes pts-pop {
  0% { transform: scale(1); }
  38% { transform: scale(1.24) rotate(-2.5deg); }
  70% { transform: scale(0.97); }
  100% { transform: scale(1); }
}
@keyframes pts-glow {
  0%, 100% { filter: drop-shadow(0 2px 5px rgba(255, 190, 80, 0.28)); }
  50% { filter: drop-shadow(0 3px 14px rgba(255, 205, 95, 0.75)); }
}
.hero-points span {
  font-size: 11px;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 99px;
  padding: 2px 8px;
}

.hero-progress { margin-top: 16px; position: relative; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  opacity: 0.78;
  margin-bottom: 8px;
}
.progress-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ffd27a, #ffb347); transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

.seg-track { display: flex; gap: 5px; }
.seg-tick {
  flex: 1;
  height: 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  overflow: hidden;
}
.seg-tick.on { background: #ffd27a; }
.seg-tick.on::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
}
.hero-stats { display: flex; gap: 26px; margin-top: 18px; position: relative; }
.hero-stats b { font-size: 24px; font-weight: 800; display: block; line-height: 1.15; font-feature-settings: "tnum"; }
.hero-stats span { font-size: 11px; opacity: 0.8; letter-spacing: 0.4px; }
.hero-note {
  margin-top: 14px;
  font-size: 12.5px;
  position: relative;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 11px;
  border-radius: 11px;
}
.hero-note.reward-note {
  background: linear-gradient(120deg, rgba(255, 210, 122, 0.28), rgba(255, 179, 71, 0.18));
  border: 1px solid rgba(255, 214, 130, 0.55);
  font-weight: 700;
  letter-spacing: 0.2px;
}
.hero-note.reward-note b { color: #ffd27a; font-size: 15px; }

/* ---------------- 今日小结 ---------------- */
.day-summary {
  margin: 12px 2px 2px;
  background: linear-gradient(120deg, #fff8ec, #fff2dc);
  border: 1.5px dashed #e8c88a;
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 5px;
}
.ds-title {
  font-size: 11px;
  font-weight: 800;
  color: #b07818;
  letter-spacing: 1.5px;
}
.ds-main { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.55; }
.ds-main b {
  color: var(--coral);
  font-size: 18px;
  font-weight: 800;
  padding: 0 2px;
  font-feature-settings: "tnum";
}
.ds-main b + b, .ds-main b ~ b { color: #b07818; }
.ds-sub { font-size: 12.5px; color: #8a6410; line-height: 1.5; }
.ds-sub.done {
  color: #1d7a4c;
  font-weight: 700;
  background: rgba(52, 199, 123, 0.12);
  border-radius: 9px;
  padding: 6px 9px;
  margin-top: 2px;
}

.section-head { display: flex; align-items: center; gap: 8px; margin: 24px 2px 10px; }
.section-head h2 {
  font-size: 16px;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-head h2::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--coral);
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.section-head .sub {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.stat {
  background: var(--card);
  border-radius: var(--radius);
  padding: 13px 10px 12px;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}
.stat b { display: block; font-size: 23px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; font-feature-settings: "tnum"; }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 0.4px; }
.stat.ok b { color: var(--mint); }
.stat.accent b { color: var(--coral); }

/* 今日任务预计用时 */
.stat-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 11px 15px;
  background: linear-gradient(120deg, #fff8ec, #fff2dc);
  border: 1.5px dashed #e8c88a;
  border-radius: 14px;
}
.stat-line-ico { font-size: 15px; line-height: 1; }
.stat-line-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #8a6410;
  letter-spacing: 0.3px;
}
.stat-line b {
  margin-left: auto;
  font-size: 18px;
  font-weight: 800;
  color: var(--coral);
  letter-spacing: -0.3px;
  font-feature-settings: "tnum";
}
.stat-line-sub {
  font-size: 11px;
  color: #a58548;
  border-left: 1px solid #e8d7b4;
  padding-left: 8px;
  margin-left: 2px;
}

/* 积分暂停条：只加分不扣分时，在统计下方提示一次 */
.freeze-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 13px;
  background: linear-gradient(180deg, #f4f6fb, #eef1f7);
  border: 1.5px solid #dfe5f0;
  border-radius: 14px;
}
.freeze-dot {
  width: 7px; height: 7px;
  border-radius: 99px;
  background: var(--ink-2);
  box-shadow: 0 0 0 4px rgba(59, 72, 99, 0.1);
  flex: 0 0 auto;
}
.freeze-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.freeze-copy b { font-size: 13px; font-weight: 800; color: var(--ink); letter-spacing: 0.2px; }
.freeze-copy span { font-size: 11.5px; color: var(--muted); }
.freeze-act {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1.5px solid #cfd7e6;
  border-radius: 10px;
  background: #fff;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.2px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.freeze-act:active { transform: scale(0.97); border-color: var(--ink-2); }

/* 多孩家庭：任务页顶部的「看谁的」切换 */
.kid-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.kid-filter::-webkit-scrollbar { display: none; }
.kid-filter-label { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; letter-spacing: 0.3px; }
.kid-filter .chip { flex: 0 0 auto; font-weight: 700; }
.kid-filter .chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* 宝贝积分卡 */
.kid-card { display: flex; align-items: center; gap: 13px; }
.kid-del { flex: 0 0 auto; align-self: flex-start; }

/* ---------------- 任务卡 ---------------- */
.task-list { display: grid; gap: 10px; }

.task-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 12px 13px 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.28s ease both;
}
.task-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--sb, var(--coral));
}
.task-card.done { background: #fbfaf5; }
.task-card.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.task-card.done::before { opacity: 0.45; }

.sub-bar { display: none; }
.sub-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sb, var(--coral)); flex: 0 0 auto; }

.sub-tile {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--sb-bg, var(--coral-soft));
  display: grid; place-items: center;
  flex: 0 0 auto;
  border: 1.5px solid rgba(20, 33, 61, 0.06);
}
.sub-tile i { width: 12px; height: 12px; border-radius: 50%; background: var(--sb, var(--coral)); display: block; }

.task-main { flex: 1; min-width: 0; }
.task-line { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.task-line .task-title { flex: 1 1 auto; }
.task-meta .tag { font-size: 11px; margin-top: 0; }
.task-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  color: var(--ink);
  /* 票根已挪到右侧按钮旁，标题可以安全地截成两行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.42;
  word-break: break-word;
  min-width: 0;
}
.task-line .tag { flex: 0 0 auto; margin-top: 3px; }
.task-detail {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.task-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f4efe4;
  border: 1px solid #ebe2d1;
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}
.meta-chip.pts { background: var(--gold-soft); border-color: #efdfb4; color: #8a6410; }
.meta-chip.dl { background: #fdeee7; border-color: #f5cdbb; color: #b3451f; font-weight: 700; }
.meta-chip.dl.hot {
  background: #c2431f;
  border-color: #c2431f;
  color: #fff7ef;
  font-weight: 800;
  box-shadow: 0 2px 8px -2px rgba(194, 67, 31, 0.45);
}

.tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2.5px 7px;
  border-radius: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}
.tag-red { background: var(--danger-soft); color: #a83232; border-color: #f3cfcf; }
.tag-amber { background: var(--gold-soft); color: #8a6410; border-color: #eddbaa; }
.tag-blue { background: var(--blue-soft); color: #2b539f; border-color: #cfdcf6; }
.tag-green { background: var(--mint-soft); color: #16774f; border-color: #c4e9d8; }
.tag-kid { background: #f1ece0; color: var(--ink-2); border-color: var(--line); font-weight: 700; }

.task-action { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.task-act-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }

.check-btn {
  border-radius: 12px;
  min-height: 42px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 800;
  background: var(--coral);
  color: #fff;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 16px -10px rgba(196, 67, 31, 0.9);
  transition: transform 0.14s ease, background 0.14s ease;
  white-space: nowrap;
}
.check-btn:hover { background: var(--coral-deep); }
.check-btn:active { transform: scale(0.94); }
.check-btn.undo { background: transparent; color: var(--muted); box-shadow: none; border: 1.5px solid var(--line-2); font-weight: 700; }

.mini-actions { display: flex; gap: 6px; }
.mini-btn {
  min-width: 34px; height: 34px;
  padding: 0 9px;
  border-radius: 9px;
  background: #f6f1e6;
  border: 1px solid #e8dfcd;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  display: grid; place-items: center;
  flex: 0 0 auto;
  transition: background 0.14s ease, color 0.14s ease;
}
.mini-btn:hover { background: var(--gold-soft); color: #8a6410; }
.mini-btn.del { color: #a83232; }
.mini-btn.del:hover { background: var(--danger-soft); color: var(--danger); }
.mini-btn.off-btn { width: auto; padding: 0 10px; font-size: 12px; background: #f6f1e6; }
.mini-btn.on-btn { background: var(--mint-soft); color: #16774f; border-color: #c4e9d8; }

.done-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #16774f;
  background: var(--mint-soft);
  border: 1px solid #c4e9d8;
  border-radius: 9px;
  padding: 6px 9px;
  white-space: nowrap;
}

/* 待处理（逾期其他任务） */
.settle-box {
  display: grid;
  gap: 8px;
  background: #fdf6e8;
  border: 1.5px dashed #e8cfa0;
  border-radius: var(--radius);
  padding: 11px;
}
.settle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
}
.settle-main { flex: 1; min-width: 0; }
.settle-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* 固定作业 */
.tpl-list { display: grid; gap: 8px; }
.tpl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  box-shadow: var(--shadow);
}
.tpl-item.off { opacity: 0.55; }
.tpl-main { flex: 1; min-width: 0; }

/* ---------------- 空状态 ---------------- */
.empty {
  text-align: center;
  padding: 30px 16px;
  background: var(--card);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-emoji { font-size: 34px; margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 3px; }

/* ---------------- 表单 ---------------- */
.field { display: grid; gap: 8px; }
.field > label { font-size: 13px; font-weight: 800; color: var(--ink-2); letter-spacing: 0.3px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.input.num {
  text-align: center;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.5px;
  -moz-appearance: textfield;
  appearance: textfield;
  font-feature-settings: "tnum";
}
.input.num::-webkit-outer-spin-button,
.input.num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.input, .textarea, select.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2);
  background: #fdfaf3;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.input:focus, .textarea:focus { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(20, 33, 61, 0.07); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.6; }

/* 日期折叠：默认一行，点开才展开月历（避免弹层被撑高、选中文字/回车时视图乱跳） */
.date-pill {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2);
  background: #fdfaf3;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.date-pill::before { content: "📅"; font-size: 15px; flex: 0 0 auto; }
.date-pill #date-pill-text { flex: 1; min-width: 0; }
.date-pill .date-pill-edit {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--coral);
  background: #fdeee7;
  border: 1px solid #f2cfbe;
  border-radius: 99px;
  padding: 3px 9px;
}
.date-pill.open { border-color: var(--ink); background: #fff; }
.date-pill:active { background: #f7f1e4; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 10px;
  background: #f6f1e6;
  border: 1.5px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
  transition: all 0.14s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover { border-color: var(--line-2); background: #fdf8ee; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sub-chip.active { background: var(--sb-bg); color: var(--sb-ink, var(--ink)); border-color: var(--sb); }
.chip.add {
  min-height: 32px;
  padding: 0 10px;
  margin-left: 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  background: transparent;
  border: 1.5px dashed var(--line-2);
  border-radius: 9px;
  flex: 0 0 auto;
}
.chip.add:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.seg { display: flex; background: #f1ebdd; border-radius: 13px; padding: 4px; gap: 4px; border: 1.5px solid var(--line); }
.seg-btn { flex: 1; min-height: 40px; padding: 8px 6px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.seg-btn.active { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(20, 33, 61, 0.1); }

.stepper { display: flex; align-items: center; gap: 10px; }
.step-btn {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: #f1ebdd;
  border: 1.5px solid var(--line);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.step-val { min-width: 58px; text-align: center; font-weight: 800; font-size: 17px; }

/* 日历（自绘，避免系统弹层漂移） */
.cal { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 10px 9px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav { width: 32px; height: 32px; border-radius: 9px; background: #f6f1e6; border: 1px solid var(--line); color: var(--ink-2); font-size: 16px; display: grid; place-items: center; }
.cal-title { font-weight: 800; font-size: 14px; letter-spacing: 0.4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; font-weight: 700; }
.cal-cell { aspect-ratio: 1 / 1; border-radius: 9px; font-size: 13px; display: grid; place-items: center; color: var(--ink); font-weight: 600; }
.cal-cell.ghost { visibility: hidden; }
.cal-cell:hover { background: #f6f1e6; }
.cal-cell.today { color: var(--coral); font-weight: 800; box-shadow: inset 0 0 0 1.5px #f0c6b6; }
.cal-cell.sel { background: var(--ink); color: #fff; font-weight: 800; }
.cal-foot { margin-top: 8px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* 上传 */
.upload { display: block; cursor: pointer; }
.upload-preview {
  width: 140px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 1.5px dashed var(--line-2);
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  background: #fdfaf3;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 详情 */
.detail-subject { display: flex; align-items: center; gap: 8px; background: var(--sb-bg); border-radius: 12px; padding: 11px 13px; color: var(--sb-ink, var(--ink)); border: 1.5px solid rgba(20, 33, 61, 0.06); }
.detail-meta { font-size: 12.5px; color: var(--muted); }
.detail-text {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.75;
  background: #fdfaf3;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  max-height: 42vh;
  overflow: auto;
}

/* ---------------- 商品格子 ---------------- */
.goods-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.goods {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  animation: rise 0.3s ease both;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.goods:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.goods-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f4eee1;
  display: grid; place-items: center;
  font-size: 58px;
  border-bottom: 1.5px solid var(--line);
}
.goods-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.goods-edit { position: absolute; top: 7px; right: 7px; }
.goods-edit .mini-btn { background: rgba(255, 253, 248, 0.92); backdrop-filter: blur(4px); }
.goods-body { padding: 10px 11px 12px; display: grid; gap: 5px; }
.goods-title { font-size: 14.5px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.goods-desc { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }
.goods-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2px; }
.goods-cost { color: var(--coral-deep); font-weight: 800; font-size: 18px; font-feature-settings: "tnum"; }
.goods-cost small { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.goods-stock { font-size: 10.5px; color: var(--muted); }
.goods .btn.tiny { min-height: 38px; font-size: 13px; border-radius: 10px; margin-top: 4px; }
.goods .btn.ghost[disabled] { opacity: 1; background: #f3eee2; border-color: #e4d9c4; color: #8a8f9a; font-weight: 700; }

/* 钱包 */
.wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(120deg, #fdf3dd, #fffaf0 62%);
  border: 1.5px solid #ecd9ab;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.wallet-ico {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid #ecd9ab;
  display: grid; place-items: center;
  font-size: 24px;
  flex: 0 0 auto;
}
.wallet-label { font-size: 11.5px; color: #8a6410; font-weight: 700; letter-spacing: 0.5px; }
.wallet-num { font-size: 29px; font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -0.6px; font-feature-settings: "tnum"; }
.wallet-side { font-size: 11px; color: #9a7c44; text-align: right; line-height: 1.5; border-left: 1.5px dashed #e6d3a6; padding-left: 12px; }
.wallet-side b { font-size: 15px; color: #8a6410; }

/* ---------------- 记录 / 流水 ---------------- */
.record {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  box-shadow: var(--shadow);
}
.record-ico {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #f4eee1;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  font-size: 19px;
  flex: 0 0 auto;
  overflow: hidden;
}
.record-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.record-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.record-main { flex: 1; min-width: 0; }
.record-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-time { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 8px; white-space: nowrap; letter-spacing: 0.3px; }
.badge.wait { background: var(--gold-soft); color: #8a6410; border: 1px solid #eddbaa; }
.badge.done { background: var(--mint-soft); color: #16774f; border: 1px solid #c4e9d8; }
.badge.lock { background: #ece4d2; color: #6d7280; border: 1px solid #ddd2bc; }

.log-list { display: grid; gap: 7px; }
.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 11px 13px;
  box-shadow: var(--shadow);
}
.log-main { flex: 1; min-width: 0; }
.log-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-amt { font-weight: 800; font-size: 16px; font-feature-settings: "tnum"; }
.log-amt.plus { color: #16774f; }
.log-amt.minus { color: #a83232; }

.avatar-sq {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--gold-soft);
  border: 1.5px solid #ecd9ab;
  display: grid; place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
}

/* ---------------- 里程碑 ---------------- */
.milestone {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
}
.milestone.locked { opacity: 0.8; }
.milestone.reached { border-color: #eddbaa; background: linear-gradient(100deg, #fff9ec, var(--card) 62%); }
.milestone.claimed { border-color: #c4e9d8; background: #fbfefc; }
.ms-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; background: #f4eee1; border: 1.5px solid var(--line); flex: 0 0 auto; }
.milestone.reached .ms-icon { background: var(--gold-soft); border-color: #ecd9ab; }
.ms-main { flex: 1; min-width: 0; }
.ms-title { font-weight: 800; font-size: 14px; }
.ms-desc { font-size: 12px; color: var(--muted); margin-top: 1px; }
.ms-pts { font-size: 11px; font-weight: 800; color: var(--coral-deep); margin-top: 3px; letter-spacing: 0.2px; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 500px;
  background: var(--ink);
  border-radius: 20px;
  box-shadow: 0 16px 34px -16px rgba(20, 33, 61, 0.7);
  display: flex;
  padding: 6px;
  gap: 4px;
  z-index: 30;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.tab {
  flex: 1;
  min-height: 52px;
  padding: 7px 4px 5px;
  border-radius: 15px;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: rgba(255, 253, 248, 0.74);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  transition: all 0.18s ease;
  position: relative;
}
.tab .tab-ico { width: 22px; height: 22px; display: grid; place-items: center; }
.tab .tab-ico svg { width: 21px; height: 21px; display: block; }
.tab.active { background: var(--paper); color: var(--ink); }
.tab-badge {
  position: absolute;
  top: 3px;
  right: calc(50% - 22px);
  background: var(--coral);
  color: #fff;
  font-size: 9px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: grid; place-items: center;
  padding: 0 4px;
  border: 1.5px solid var(--ink);
}

/* ---------------- 弹层 ---------------- */
/* 弹层打开时锁住背景页面，避免在弹层里滚动/选中文字时整页跟着动 */
body.sheet-open {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.sheet-mask {
  position: fixed;
  /* 钉在「真正看得见」的区域：软键盘弹出时 visualViewport 变矮，弹层跟着变矮，
     而不是被键盘挡住或整块上移再弹回（那种位移就是用户说的「跳出页面」） */
  top: 0; right: 0; bottom: 0; left: 0;
  top: var(--vvt, 0px);
  bottom: auto;
  height: var(--vvh, 100dvh);
  background: rgba(16, 24, 42, 0.42);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.2s ease;
}
.sheet {
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  padding: 0;
  max-height: calc(var(--vvh, 100vh) - 8px);
  /* 头 / 内容 / 底三段的弹层：只有中间那段滚，头和按钮永远在框里。
     以前是整块滚动 + sticky 按钮，滚动容器的裁剪在桌面浏览器上会漏内容到卡片外，
     而且窗口一矮按钮就被顶出屏幕。 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  overflow-anchor: none;
  animation: slideUp 0.28s cubic-bezier(0.3, 1, 0.5, 1);
  box-shadow: 0 -14px 50px rgba(16, 24, 42, 0.28);
}
.sheet::before {
  content: "";
  flex: 0 0 auto;
  width: 44px; height: 5px;
  margin: 9px auto 0;
  border-radius: 99px;
  background: var(--line-2);
}
.sheet-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 18px 8px;
  background: var(--paper);
  z-index: 2;
}
.sheet-head h3 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: 0.5px; }
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;               /* 关键：不加这句，flex 子项不肯收缩，内容会顶出去 */
  display: grid;
  gap: 16px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 18px 10px;
}
/* 底部按钮固定：内容再长也一直在框里，不用先滑到底 */
.sheet-foot {
  flex: 0 0 auto;
  margin: 0;
  display: grid;
  gap: 9px;
  padding: 10px 18px calc(14px + env(safe-area-inset-bottom));
  background: var(--paper);
  box-shadow: 0 -12px 18px -14px rgba(16, 24, 42, 0.42);
}

/* 兼容：旧逻辑会给弹层补 need-pad，现在按钮不在滚动区里了，不需要 */
.sheet.need-pad { padding-bottom: 0; }

/* ---------------- 大屏（电脑 / 平板横屏）：弹层变成居中对话框 ----------------
   以前在电脑上也是「从底部升起」的抽屉，窗口一矮就顶出屏幕、底部内容永远够不着。
   这里改成居中、高度不超过窗口、内容在框内滚动，并且能按住标题栏拖动。
   注意：桌面端 html 有 zoom，弹层高度必须用 --vvh（已按 zoom 折算过），不能用 100vh。 */
@media (min-width: 900px) {
  .sheet-mask { align-items: center; padding: 18px; }
  .sheet {
    max-width: 620px;
    max-height: calc(var(--vvh, 100vh) - 36px);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(16, 24, 42, 0.32);
    animation: sheetPop 0.2s cubic-bezier(0.3, 1, 0.5, 1);
  }
  .sheet::before { display: none; }   /* 桌面不需要那个小把手 */
  .sheet-head { padding: 18px 22px 10px; }
  .sheet-body { padding: 2px 22px 10px; }
  .sheet-foot { padding: 10px 22px 16px; }
  .sheet.dragging { animation: none; }
}
@media (min-width: 900px) and (pointer: fine) {
  .sheet-head { cursor: grab; }
  .sheet.dragging .sheet-head { cursor: grabbing; }
  .sheet-head h3 { user-select: none; }
}
@keyframes sheetPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------- 应用内确认框 ---------------- */
.confirm-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(16, 24, 42, 0.46);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: grid; place-items: center;
  padding: 26px;
  opacity: 0;
  transition: opacity 0.16s ease;
}
.confirm-mask.show { opacity: 1; }
.confirm-card {
  width: 100%; max-width: 336px;
  background: var(--paper);
  border-radius: 22px;
  padding: 22px 20px 16px;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--line);
  transform: scale(0.96);
  transition: transform 0.16s ease;
}
.confirm-mask.show .confirm-card { transform: scale(1); }
.confirm-title { font-size: 17px; font-weight: 800; line-height: 1.4; letter-spacing: 0.3px; }
.confirm-text { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 9px; margin-top: 20px; }
.confirm-actions .btn { flex: 1; padding: 12px; font-size: 14.5px; min-height: 46px; }
.btn.danger { background: var(--danger); box-shadow: 0 12px 24px -14px rgba(207, 63, 63, 0.9); }
.btn.danger:hover { background: #b53535; }

/* 周报 */
.week-chart { display: flex; align-items: flex-end; gap: 9px; height: 96px; margin-top: 6px; }
.week-col { flex: 1; display: grid; justify-items: center; gap: 6px; height: 100%; align-content: end; }
.week-bar { width: 100%; max-width: 26px; border-radius: 7px 7px 3px 3px; background: #f1ebdd; position: relative; overflow: hidden; transition: height 0.5s ease; min-height: 5px; }
.week-bar i { position: absolute; left: 0; bottom: 0; width: 100%; background: linear-gradient(180deg, #f0a15a, var(--coral)); border-radius: 7px 7px 3px 3px; display: block; }
.week-label { font-size: 10.5px; color: var(--muted); }
.week-label.today { color: var(--coral-deep); font-weight: 800; }

/* 日期切换 */
.date-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 7px 9px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.date-switch .ds-label { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 7px; letter-spacing: 0.3px; }
.date-switch .ds-label small { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.date-switch .mini-btn { width: 38px; height: 38px; font-size: 19px; background: #f6f1e6; }

/* 飘字 / toast */
.float-pts {
  position: fixed;
  z-index: 90;
  font-size: 24px;
  font-weight: 800;
  color: #16774f;
  pointer-events: none;
  animation: floatUp 1s ease forwards;
  text-shadow: 0 6px 18px rgba(31, 157, 107, 0.35);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fdfbf6;
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 13px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.26s cubic-bezier(0.3, 1, 0.5, 1);
  max-width: 84vw;
  text-align: center;
  box-shadow: 0 18px 40px -18px rgba(20, 33, 61, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); } to { transform: none; } }
@keyframes pop { from { transform: scale(0.7) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.9); }
  22% { opacity: 1; transform: translateY(-14px) scale(1.08); }
  100% { opacity: 0; transform: translateY(-72px) scale(1); }
}

@media (min-width: 720px) {
  .goods-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------- 批量上架商品 ---------------- */
.head-acts { display: inline-flex; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.head-acts .chip.add { margin-left: 0; }

.batch-drop {
  border: 2px dashed var(--line-2);
  border-radius: 16px;
  background: #fdfaf3;
  padding: 18px 14px;
  display: grid;
  gap: 5px;
  place-items: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.batch-drop:active { border-color: var(--coral); background: #fff8ef; }
.batch-drop-ico { font-size: 26px; line-height: 1; }
.batch-drop b { font-size: 14px; letter-spacing: 0.2px; }
.batch-drop-s { font-size: 12px; color: var(--muted); line-height: 1.55; max-width: 280px; }

.batch-list { display: grid; gap: 10px; margin-top: 12px; }
.batch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  animation: rise 0.2s ease;
}
.batch-thumb {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 11px;
  overflow: hidden;
  background: #f4eee1;
  flex: 0 0 auto;
}
.batch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.batch-state {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(20, 33, 61, 0.62);
  letter-spacing: 0.3px;
}
.batch-state.hidden { display: none; }
.batch-row.uploading .batch-state { background: rgba(20, 33, 61, 0.62); }
.batch-row.done .batch-state { background: rgba(31, 122, 90, 0.9); }
.batch-row.fail .batch-state { background: rgba(207, 69, 31, 0.9); }
.batch-row.locked .batch-main { opacity: 0.5; }

.batch-main { flex: 1; min-width: 0; display: grid; gap: 7px; }
.batch-main .batch-name { min-height: 38px; padding: 8px 10px; font-size: 14.5px; font-weight: 700; }
.batch-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.batch-num { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.batch-num > span { flex: 0 0 auto; }
.batch-num input.input {
  min-height: 34px;
  height: 34px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 9px;
}
.batch-del { align-self: center; flex: 0 0 auto; }

/* ---------------- 平板 / 学习机横屏：整体等比放大，别让内容缩成中间一条 ---------------- */
@media (min-width: 900px) {
  html { zoom: 1.18; }
  .app { max-width: 620px; }
  .tabbar { max-width: 580px; }
}
@media (min-width: 1280px) {
  html { zoom: 1.34; }
}

/* 13 英寸学习机横屏（约 1100–1200 CSS px）：再放宽一点，别留太多白 */
@media (min-width: 1000px) {
  .app { max-width: 700px; }
  .tabbar { max-width: 660px; }
}

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

/* ============ 老 Safari（iOS 15 以下）兼容兜底 ============ */
/* 老系统不认识 aspect-ratio，方形约束失效会导致商品图拉成细长条。
   这里用固定高度兜底：支持的浏览器走上面的 aspect-ratio，老系统走这里。 */
@supports not (aspect-ratio: 1 / 1) {
  .goods-thumb { height: 200px; }
  .upload-preview { height: 140px; }
  .cal-cell { height: 44px; }
}

/* ============ 商品图放大查看 ============ */
.goods-thumb.zoomable { cursor: pointer; position: relative; }
.goods-thumb.zoomable::after { content: '🔍'; position: absolute; top: 7px; left: 7px; font-size: 13px; background: rgba(255,253,248,.92); border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(20,33,61,.18); }
body.img-lock { overflow: hidden; }
.img-zoom {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 90;
  background: rgba(8, 11, 20, 0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 26px 20px; animation: zoomIn 0.18s ease both;
}
@keyframes zoomIn { from { opacity: 0; } to { opacity: 1; } }
.img-zoom img { max-width: 94%; max-height: 76%; border-radius: 18px; box-shadow: 0 18px 60px rgba(0,0,0,0.5); background: #fff; display: block; }
.img-zoom-title { margin-top: 16px; color: #fff; font-size: 16px; font-weight: 800; text-align: center; }
.img-zoom-tip { display: block; margin-top: 6px; color: rgba(255,255,255,0.55); font-size: 12px; font-weight: 400; }
.img-zoom-close {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.16); color: #fff;
  font-size: 16px; cursor: pointer;
}

/* ============================================================
   成长页 · 燃爆成绩单（gz- 前缀）
   ============================================================ */

/* 金色横幅 */
.gz-note {
  background: linear-gradient(135deg, #fff8e8, #fdf3e0);
  border: 1.5px solid #f0e2c4;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #6b5323;
  margin: 14px 0 12px;
}
.gz-note b { color: #8a5d06; font-weight: 800; }

/* 四张成就卡 */
.gz-badges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gz-badge {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 13px 13px 12px;
  box-shadow: 0 2px 0 rgba(20, 33, 61, 0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
/* 角落光晕 */
.gz-badge::before {
  content: "";
  position: absolute;
  right: -30px; bottom: -34px;
  width: 96px; height: 96px;
  border-radius: 50%;
  opacity: 0.6;
}
.gz-b-gold::before { background: radial-gradient(circle, #f9dfa0, transparent 68%); }
.gz-b-blue::before { background: radial-gradient(circle, #c9daf9, transparent 68%); }
.gz-b-mint::before { background: radial-gradient(circle, #b3e5cb, transparent 68%); }
.gz-b-plum::before { background: radial-gradient(circle, #ddcdf7, transparent 68%); }

.gz-fire { position: absolute; top: 10px; right: 11px; font-size: 14px; display: inline-block; }
.gz-ico {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 7px;
  box-shadow: 0 2px 6px rgba(20, 33, 61, 0.08);
}
.gz-tt { font-size: 13px; font-weight: 900; letter-spacing: 0.3px; margin-bottom: 3px; }
.gz-num { font-size: 26px; font-weight: 900; line-height: 1; letter-spacing: -0.5px; }
.gz-num small { font-size: 12px; font-weight: 800; margin-left: 2px; letter-spacing: 0; }
.gz-lb { font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }

.gz-b-gold .gz-ico { background: linear-gradient(135deg, #fdf1cf, #f7d98a); }
.gz-b-gold .gz-num, .gz-b-gold .gz-tt { color: #b47c0a; }
.gz-b-blue .gz-ico { background: linear-gradient(135deg, #e3ecfd, #c4d5f7); }
.gz-b-blue .gz-num, .gz-b-blue .gz-tt { color: var(--blue); }
.gz-b-mint .gz-ico { background: linear-gradient(135deg, #dff4e9, #a9dfc4); }
.gz-b-mint .gz-num, .gz-b-mint .gz-tt { color: var(--mint); }
.gz-b-plum .gz-ico { background: linear-gradient(135deg, #ece2fb, #d5c2f5); }
.gz-b-plum .gz-num, .gz-b-plum .gz-tt { color: #7b4bd1; }

/* 悬停：整卡浮起 + 角标动效 */
.gz-badge:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(20, 33, 61, 0.12); }
.gz-b-gold:hover .gz-fire { animation: gz-burn 0.5s ease-in-out infinite; }
@keyframes gz-burn {
  0%, 100% { transform: scale(1) rotate(-4deg); }
  30% { transform: scale(1.3) rotate(5deg); filter: brightness(1.3); }
  65% { transform: scale(1.1) rotate(-7deg); }
}
.gz-b-blue:hover .gz-fire { animation: gz-zap 0.55s ease-in-out infinite; }
@keyframes gz-zap {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.8; filter: drop-shadow(0 0 6px #f5c451); }
}
.gz-b-mint:hover .gz-fire { animation: gz-twinkle 0.65s ease-in-out infinite; }
@keyframes gz-twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.4) rotate(25deg); opacity: 1; filter: drop-shadow(0 0 6px #b3e5cb); }
}
.gz-b-plum:hover .gz-fire { animation: gz-glow 1s ease-in-out infinite; }
@keyframes gz-glow {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.22) translateY(-3px); filter: drop-shadow(0 0 7px #d5c2f5); }
}
/* 触屏兜底：点一下也触发 */
.gz-badge:active .gz-fire { animation-duration: 0.4s; }

/* 维度切换 */
.gz-seg {
  display: flex; gap: 6px;
  background: var(--paper-2);
  border-radius: 13px;
  padding: 4px;
  margin: 18px 0 12px;
}
.gz-seg button {
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.gz-seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(20, 33, 61, 0.12); }

/* 卡片头 / 图表 */
.gz-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.gz-card-head b { font-size: 14.5px; }
.gz-card-head span { font-size: 11.5px; color: var(--muted); }
.gz-chart { width: 100%; height: auto; display: block; margin-top: 8px; }

/* 四路进度条 */
.gz-subj { display: grid; gap: 11px; margin-top: 10px; }
.gz-row { display: grid; grid-template-columns: 64px 1fr 48px; align-items: center; gap: 9px; }
.gz-name { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.gz-bar { height: 11px; border-radius: 7px; background: var(--paper-2); overflow: hidden; }
.gz-bar i { display: block; height: 100%; border-radius: 7px; transition: width 0.5s ease; }
.gz-val { font-size: 12px; font-weight: 800; text-align: right; color: var(--ink-2); }

/* 坚持日历 */
.gz-heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.gz-heat .gz-wd { font-size: 10px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.gz-cell { height: 30px; border-radius: 6px; background: var(--paper-2); }
.gz-cell.l1 { background: #e6efe6; }
.gz-cell.l2 { background: #bfe0cb; }
.gz-cell.l3 { background: #7cc79a; }
.gz-cell.l4 { background: #2f9e6a; }
.gz-cell.empty { background: transparent; }
.gz-cell.future { opacity: 0.35; }
.gz-legend {
  display: flex; align-items: center; gap: 5px;
  justify-content: flex-end;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--muted);
}
.gz-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* 底部总结 */
.gz-insight {
  background: linear-gradient(135deg, #fff8e8, #fdf3e0);
  border: 1.5px solid #f0e2c4;
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 12.8px;
  line-height: 1.7;
  color: #6b5323;
  margin: 14px 0 6px;
}
.gz-insight b { color: #8a5d06; }

/* 防止成长页标题/小字把页面撑出横向滚动 */
.section-head { min-width: 0; }
.section-head h2 { min-width: 0; }
.section-head .sub { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gz-badges, .gz-seg, .gz-row { min-width: 0; }

/* 图表空状态 */
.gz-empty {
  padding: 26px 10px 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.8;
}
.gz-empty span { font-size: 12px; font-weight: 500; color: var(--muted); }

/* ============================================================
   提醒弹框：学生端「快到期了」 / 家长端「兑换待安排」
   头部色带 + 可滚动清单 + 固定按钮，矮窗口下按钮也不会被挤出屏
   ============================================================ */
.notice-mask {
  position: fixed;
  left: 0; right: 0;
  /* 桌面端 html 有 zoom，必须用折算过的 --vvh，否则框比窗口高 */
  top: var(--vvt, 0px);
  height: var(--vvh, 100dvh);
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 42, 0.46);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.notice-mask.show { opacity: 1; }
body.notice-open { overflow: hidden; }

.notice-card {
  width: 100%;
  max-width: 388px;
  max-height: calc(var(--vvh, 100vh) - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.975);
  transition: transform 0.24s cubic-bezier(0.3, 1, 0.5, 1);
}
.notice-mask.show .notice-card { transform: none; }

/* 顶部色带：图标 + 小标题 + 大字标题 */
.notice-band {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 18px 15px;
  background: linear-gradient(135deg, #fdf1d8, #fdf8ee);
  border-bottom: 1.5px solid #f0e0bd;
}
.notice-mask.tone-gift .notice-band {
  background: linear-gradient(135deg, #fdece4, #fdf8f2);
  border-bottom-color: #f5d8c9;
}
.notice-ico {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 16px -10px rgba(20, 33, 61, 0.55);
  animation: noticeSwing 2.6s ease-in-out infinite;
}
@keyframes noticeSwing {
  0%, 62%, 100% { transform: rotate(0deg); }
  70% { transform: rotate(-9deg); }
  78% { transform: rotate(8deg); }
  86% { transform: rotate(-4deg); }
}
.notice-hd { min-width: 0; }
.notice-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #96702a;
  margin-bottom: 3px;
}
.notice-mask.tone-gift .notice-kicker { color: #b1583a; }
.notice-title {
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: 0.2px;
  word-break: break-word;
}
.notice-title b { color: var(--coral-deep); }

/* 中间：唯一滚动区 */
.notice-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 18px 16px;
}
.notice-lead {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.68;
  color: var(--ink-2);
}
.notice-lead b { color: var(--coral-deep); }
.notice-list { display: grid; gap: 8px; }
/* 还没滚到底：底部渐隐，提示下面还有条目 */
.notice-body.more {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 30px), transparent);
}

.ni-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 13px;
  background: #fbf7ec;
  border: 1px solid var(--line);
}
.ni-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 99px; }
.ni-ico {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 16px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.ni-ico img { width: 100%; height: 100%; object-fit: cover; }
.ni-main { flex: 1; min-width: 0; }
.ni-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.ni-meta { font-size: 10.8px; color: var(--muted); margin-top: 3px; }
.ni-tag {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 7px;
  white-space: nowrap;
  background: var(--blue-soft);
  color: #2b539f;
}
.ni-tag.hot { background: var(--danger-soft); color: #a83232; }
.ni-tag.over { background: #9d2b2b; color: #fff; }

/* 底部按钮：固定，不跟着内容滚 */
.notice-foot {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--line);
  background: var(--card);
}
.notice-foot .btn { min-height: 48px; font-size: 15px; }
.notice-foot .btn.ghost { font-size: 13.5px; min-height: 42px; }

/* 学生端顶栏的提醒铃铛 */
.icon-btn.bell { position: relative; }
.bell-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  display: grid; place-items: center;
  border-radius: 99px;
  background: var(--coral);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(207, 69, 31, 0.4);
}

/* 兑换小票上的「撤销」：比 ✕ 温和一些，但要能一眼看见 */
.mini-btn.undo-btn {
  width: auto;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 700;
  color: #8a5a12;
  background: #fbf3e2;
  border-color: #eddcbb;
}
.mini-btn.undo-btn:hover { background: var(--gold-soft); color: #7a4f07; }

/* ============================================================
   兑换礼盒动画（学生端）
   时间轴：0.05s 礼物升起 → 1.02s 盒盖落下 → 1.36s 系蝴蝶结
           → 1.23s 彩纸炸开 → 1.68s 文字弹出 → 4.3s 自动收起
   ============================================================ */
.gift-anim {
  position: fixed;
  left: 0; right: 0;
  top: var(--vvt, 0px);
  height: var(--vvh, 100dvh);
  z-index: 120;
  display: grid;
  place-items: center;
  background: radial-gradient(115% 72% at 50% 42%, rgba(13, 17, 28, 0.965), rgba(6, 9, 16, 0.985));
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  opacity: 0;
  transition: opacity 0.26s ease;
  overflow: hidden;
  cursor: pointer;
}
.gift-anim.show { opacity: 1; }
.gift-anim.out { opacity: 0; }
body.gift-open { overflow: hidden; }

.ga-stage { position: relative; width: 320px; height: 330px; }

/* ---- 文案 ---- */
.ga-copy { position: absolute; top: 0; left: 0; right: 0; text-align: center; z-index: 9; }
.ga-title {
  font-size: 26px; font-weight: 900; letter-spacing: 1.2px; color: #fff;
  text-shadow: 0 8px 22px rgba(255, 146, 88, 0.35);
  opacity: 0;
  animation: gaPop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 1.68s forwards;
}
.ga-tada { display: inline-block; animation: gaTada 1.1s ease 2.2s both; }
.ga-sub {
  margin-top: 9px; font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  animation: gaUp 0.45s ease 1.9s forwards;
}
.ga-name {
  margin-top: 7px; font-size: 12.5px; color: rgba(255, 255, 255, 0.58);
  opacity: 0;
  animation: gaUp 0.45s ease 2.04s forwards;
}

/* ---- 飞进来的礼物 ---- */
.ga-fly {
  position: absolute;
  left: 50%; bottom: 176px;
  width: 84px; height: 84px; margin-left: -42px;
  display: grid; place-items: center;
  z-index: 3;
  opacity: 0;
  animation: gaFly 1.2s cubic-bezier(0.32, 0.8, 0.4, 1) 0.05s forwards;
}
.ga-fly img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.ga-emoji { font-size: 50px; line-height: 1; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.5)); }

/* ---- 盒子 ---- */
.ga-box {
  position: absolute;
  left: 50%; bottom: 30px;
  width: 168px; height: 114px;
  transform: translateX(-50%);
  animation: gaThump 0.44s ease 1.5s;
}
.ga-body {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 9px 9px 18px 18px;
  background: linear-gradient(158deg, #ff9a74 0%, #ef5c3c 46%, #c93a25 100%);
  box-shadow: 0 22px 40px -14px rgba(0, 0, 0, 0.8), inset 0 -12px 20px -12px rgba(0, 0, 0, 0.55);
  z-index: 2;
}
.ga-rv {
  position: absolute; left: 50%; top: -4px; bottom: 0;
  width: 34px; margin-left: -17px;
  background: linear-gradient(90deg, #ffe9a8, #f7c74f 45%, #dda12c);
}
.ga-rh {
  position: absolute; left: -4px; right: -4px; top: 50%;
  height: 28px; margin-top: -14px;
  background: linear-gradient(180deg, #ffeeb8, #f6c250 50%, #d99e28);
}
.ga-lid {
  position: absolute; left: -9px; right: -9px; top: -32px;
  height: 38px; border-radius: 11px;
  background: linear-gradient(180deg, #ffab8b, #ee5c3d 62%, #d34228);
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.7);
  z-index: 5;
  opacity: 0;
  animation: gaLid 0.55s cubic-bezier(0.22, 1.4, 0.42, 1) 1.02s forwards;
}
.ga-lid-r {
  position: absolute; left: 50%; top: -3px; bottom: -3px;
  width: 34px; margin-left: -17px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ffe9a8, #f7c74f 45%, #dda12c);
}

/* ---- 蝴蝶结：SVG 画的丝带环 + 飘带 + 结 ---- */
.ga-bow {
  position: absolute; left: 50%; top: -76px;
  width: 110px; height: 82px; margin-left: -55px;
  z-index: 6;
  opacity: 0;
  animation: gaBow 0.5s cubic-bezier(0.2, 1.7, 0.4, 1) 1.36s forwards;
}
.ga-bow svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.28)); }

/* ---- 彩纸 ---- */
.ga-sparks {
  position: absolute; left: 50%; bottom: 152px;
  width: 0; height: 0;
  z-index: 7;
}
.ga-sparks i {
  position: absolute; left: -5.5px; top: -5.5px;
  width: 11px; height: 11px;
  border-radius: 2px;
  background: #ffd76a;
  opacity: 0;
  animation: gaSpark 1.35s cubic-bezier(0.2, 0.7, 0.3, 1) var(--dl, 1.2s) forwards;
}
.ga-sparks i:nth-child(3n) { background: #ff8f6b; }
.ga-sparks i:nth-child(3n + 1) { background: #7fd6ff; border-radius: 50%; }

.ga-hint {
  position: absolute; left: 0; right: 0;
  bottom: 26px;
  bottom: calc(26px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.36);
  opacity: 0;
  animation: gaUp 0.4s ease 2.7s forwards;
}

/* ---- 关键帧 ---- */
@keyframes gaFly {
  0%   { opacity: 0; transform: translateY(160px) scale(0.5) rotate(-14deg); }
  20%  { opacity: 0; transform: translateY(66px) scale(0.72) rotate(-8deg); }
  36%  { opacity: 1; transform: translateY(-4px) scale(1.05) rotate(4deg); }
  58%  { opacity: 1; transform: translateY(-34px) scale(1.12) rotate(7deg); }
  86%  { opacity: 1; transform: translateY(26px) scale(0.55) rotate(0deg); }
  100% { opacity: 0; transform: translateY(44px) scale(0.2) rotate(0deg); }
}
@keyframes gaLid {
  0%   { opacity: 0; transform: translateY(-112px) rotate(-9deg); }
  62%  { opacity: 1; transform: translateY(5px) rotate(1.5deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg); }
}
@keyframes gaBow {
  0%   { opacity: 0; transform: scale(0.25) rotate(-26deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes gaThump {
  0%, 100% { transform: translateX(-50%) translateY(0) scaleY(1); }
  35%      { transform: translateX(-50%) translateY(6px) scaleY(0.92); }
  70%      { transform: translateX(-50%) translateY(-1px) scaleY(1.02); }
}
@keyframes gaSpark {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.3) rotate(0deg); }
  8%   { opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(0.9) rotate(300deg); }
}
@keyframes gaPop {
  0%   { opacity: 0; transform: scale(0.62) translateY(10px); }
  62%  { opacity: 1; transform: scale(1.06) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes gaUp {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes gaTada {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30%      { transform: scale(1.34) rotate(-12deg); }
  60%      { transform: scale(1.18) rotate(10deg); }
}

/* 矮窗口（横屏 iPad、小手机）整体缩小，别把盒子挤出屏幕 */
@media (max-height: 600px) { .ga-stage { transform: scale(0.82); } }
@media (max-height: 460px) { .ga-stage { transform: scale(0.64); } }

/* 图片加载失败时的 emoji 占位，跟着容器大小走 */
.img-fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  font-size: 1.7em;
  line-height: 1;
}
.ga-fly .img-fb { font-size: 46px; }

/* ============================================================
   积分票根（学生端 / 家长端统一：跟在标题末尾的一张撕口小票）
   ============================================================ */
.pts-stub {
  --stub-notch: 4.5px;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  margin: 0 2px 0 4px;
  padding: 5px 11px 4px;
  border-radius: 4px;
  --stub-tone: linear-gradient(177deg, #fce8b6 0%, #f7d488 52%, #efc268 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 52%),
    var(--stub-tone);
  /* 左右两个撕口：真挖孔（跟着卡片灰化/底色走，不会露白边） */
  -webkit-mask-image:
    radial-gradient(circle at 0 50%, #0000 var(--stub-notch), #000 calc(var(--stub-notch) + 0.5px)),
    radial-gradient(circle at 100% 50%, #0000 var(--stub-notch), #000 calc(var(--stub-notch) + 0.5px));
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle at 0 50%, #0000 var(--stub-notch), #000 calc(var(--stub-notch) + 0.5px)),
    radial-gradient(circle at 100% 50%, #0000 var(--stub-notch), #000 calc(var(--stub-notch) + 0.5px));
  mask-composite: intersect;
  /* mask 之后 box-shadow 会被裁掉，改用 drop-shadow 顺着缺口投影 */
  filter: drop-shadow(0 2px 2.5px rgba(150, 105, 20, 0.4));
  transform: rotate(-6deg);
  vertical-align: middle;
  line-height: 1;
  user-select: none;
}

.pts-stub b {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.6px;
  color: #7c4b06;
  font-variant-numeric: tabular-nums;
}
.pts-stub em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-indent: 0.8px;
  color: #a2711f;
  margin-top: 3px;
}
/* 已得 / 未得：同一张票根，褪色处理 */
.pts-stub.got { --stub-tone: linear-gradient(177deg, #f5ecd6 0%, #e9d9b7 55%, #ddc99f 100%); }
.pts-stub.got b { color: #8a7442; }
.pts-stub.got em { color: #a8946a; }
.pts-stub.void { --stub-tone: linear-gradient(177deg, #eceef1 0%, #e0e3e8 55%, #d3d7dd 100%); }
.pts-stub.void b { color: #7b8494; }
.pts-stub.void em { color: #98a0ad; }

.task-card.done .pts-stub { filter: drop-shadow(0 2px 2px rgba(120, 95, 45, 0.28)); }

@media (max-width: 520px) {
  .pts-stub { min-width: 44px; padding: 4px 8px 3px; margin: 0 1px 0 2px; }
  .pts-stub b { font-size: 16px; }
  .pts-stub em { font-size: 8px; letter-spacing: 1.2px; }
  .task-action { gap: 4px; }
}


/* ============================================================
   新增：失效任务 / 附件 / 学科耗时 / 固定任务统计
   ============================================================ */

/* ---- 失效任务（当日失效：灰色 + 未完成） ---- */
.tag-gray { background: #eef0f3; color: #6a7382; border-color: #dde1e7; }
.task-card.expired { filter: grayscale(0.55); opacity: 0.62; }
.task-card.expired .task-title { text-decoration: line-through; text-decoration-color: rgba(90, 98, 110, 0.6); }
.done-stamp.dim { background: #eef0f3; color: #6a7382; box-shadow: none; }
.seg-tick.off { background: #c9ced6; }

/* ---- 家长端失效小图标（与编辑/删除同排） ---- */
.mini-btn.expire { color: #a83232; }
.mini-btn.expire.on { background: var(--danger-soft); border-color: #f3cfcf; }

/* ---- 附件入口 chip（任务卡 meta 行） ---- */
.att-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3.5px 9px; border-radius: 99px;
  background: var(--blue-soft); border: 1px solid #cfdcf6;
  color: #2b539f; font-size: 11.5px; font-weight: 800;
  cursor: pointer; flex: 0 0 auto;
}
.att-chip:active { transform: scale(0.94); }

/* ---- 附件上传（布置任务表单） ---- */
.att-list { display: grid; gap: 6px; margin-bottom: 8px; }
.att-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 10px;
  background: var(--paper-2); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-del {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px;
  border: none; background: transparent; color: #a83232;
  font-size: 12px; cursor: pointer;
}
.att-del:active { transform: scale(0.9); }

/* ---- 附件查看器 ---- */
.attach-viewer {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(13, 17, 28, 0.72);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  z-index: 90; display: grid; place-items: center; padding: 18px;
}
.av-panel {
  width: min(680px, 100%); max-height: 86vh;
  background: var(--paper); border-radius: 20px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(10, 14, 24, 0.6);
}
.av-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.av-head b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-body { overflow-y: auto; padding: 14px 16px; display: grid; gap: 12px; min-height: 0; }
.av-fig { margin: 0; }
.av-fig img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; }
.av-fig figcaption { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.av-file {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.av-file-ico { font-size: 20px; }
.av-file-name { flex: 1 1 auto; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-file-open { font-size: 12px; font-weight: 800; color: var(--primary); flex: 0 0 auto; }
/* 音频附件：内联播放器，和附件行风格一致 */
.av-audio { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.av-audio audio { flex: 1 1 220px; min-width: 180px; height: 38px; }
.av-tip { padding: 9px 16px 12px; font-size: 11px; color: var(--muted); text-align: center; }

/* ---- 成长页：学科耗时 / 固定任务统计 ---- */
.gz-seg.slim { margin: 0 0 10px; }
.gz-seg.slim button { padding: 6px 0; font-size: 12px; }
.gz-subj .gz-row { grid-template-columns: 78px 1fr auto; }
.gz-row.fixed { grid-template-columns: 1fr auto; }
.gz-row.fixed .gz-name { display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gz-val.b b { font-size: 14px; color: var(--ink); }
.head-sort {
  cursor: pointer; font-size: 11.5px; font-weight: 800; white-space: nowrap;
  padding: 4px 12px; border-radius: 99px;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-2);
}
.head-sort:active { transform: scale(0.94); }

/* ---- 学生端日期栏 ---- */
.date-switch.student { margin: 2px 0 10px; }

/* ---------------- 打开即弹窗：验证码门 ---------------- */
.gate-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: rgba(20, 33, 61, 0.42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: gateIn 0.18s ease-out both;
}
@keyframes gateIn { from { opacity: 0 } to { opacity: 1 } }
.gate-card {
  width: min(370px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 20px 16px;
  box-shadow: 0 24px 60px rgba(20, 33, 61, 0.28);
  display: grid; gap: 11px;
  text-align: center;
  animation: gateCardIn 0.22s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes gateCardIn {
  from { transform: translateY(12px) scale(0.97); opacity: 0 }
  to { transform: none; opacity: 1 }
}
.gate-badge { font-size: 42px; line-height: 1; }
.gate-title { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: 0.5px; }
.gate-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 2px; }
.gate-hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin-top: 2px; }
.gate-link {
  background: none; border: 0; padding: 8px 0 2px;
  color: var(--muted); font-size: 12.5px;
  text-decoration: underline; text-underline-offset: 3px;
}
.gate-card .pin-input { letter-spacing: 10px; }
