/* ============================================================
   课时记账本 · 设计系统 v4
   配色沿用最初那套（iOS 蓝 + 浅灰底 + 白卡），排版用 2026-11 改版后的：
   大留白、大圆角、大标题。两者各管一头，互不干扰。
   ============================================================ */

:root {
  /* 强调色只有一种：iOS 系统蓝。其余颜色只表达语义 */
  --primary: #1B6DFF;
  --primary-weak: rgba(27, 109, 255, .10);
  --primary-tint: rgba(27, 109, 255, .14);
  --primary-hover: #1657CC;
  --primary-glow: rgba(27, 109, 255, .30);
  --link: #1B6DFF;

  /* 语义色：绿=已上/扣课，橙=欠费/提醒，红=删除，紫=调课 */
  --green: #34c759;
  --green-weak: rgba(52, 199, 89, .12);
  /* 收入绿（正绿，不是翡翠绿）：财报、记账类产品里「进账」的通行色相。
     同一色阶分两档——大字用 500/600 档够醒目，13px 小字用 700 档才够清楚 */
  --income: #00A870;
  --amber: #ff9500;
  --amber-weak: rgba(255, 149, 0, .12);
  --amber-text: #a85c00;
  --danger: #ff3b30;
  --danger-weak: rgba(255, 59, 48, .10);
  /* 实心危险按钮用的红：比 --danger 深一档，白字才够得着 4.5:1 */
  --danger-solid: #d92d20;
  --purple: #af52de;
  --purple-weak: rgba(175, 82, 222, .12);

  /* 文字：主 / 次 / 三级 */
  --text: #000000;
  --text-2: #8a8a8e;
  --text-3: #c4c4c6;
  --hint: #5f5f68;

  /* 页面底色比白卡深一档，卡片才有边界 */
  --bg: #F4F5F7;
  --card: #ffffff;
  --fill: #f2f2f7;
  --fill-2: #e1e2e8;
  --field: #e1e2e8;
  --sep: rgba(60, 60, 67, .13);
  --card-line: rgba(20, 22, 26, .06);
  --cal-cell: rgba(120, 120, 128, .05);

  /* 列表的呼吸节奏：全 App 只在这里定义一次，各行只引用。
     卡片左右留白 16、行上下 13、主标题到副标题 4、副标题到第三行 7。
     以前各处 12/14/18 混着写，同一屏里行与行的间距看着不匀。 */
  --card-x: 16px;
  --row-y: 16px;
  --gap-sub: 5px;
  --gap-extra: 8px;
  /* 副标题用的灰：比正文淡一档，但还读得清（--text-3 是占位符色，太浅） */
  --text-sub: #97979c;

  /* 圆角这一档是 2026-11 改版定的，比原来大：卡片 18、输入框 14 */
  --radius: 22px;
  --radius-lg: 28px;
  --radius-sm: 14px;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4C8DFF;
    --primary-weak: rgba(76, 141, 255, .18);
    --primary-tint: rgba(76, 141, 255, .26);
    --primary-hover: #6BA4FF;
    --primary-glow: rgba(76, 141, 255, .38);
    --link: #4C8DFF;
    --green: #30d158;
    --green-weak: rgba(48, 209, 88, .18);
    --income: #2FD08A;
    --amber: #ff9f0a;
    --amber-weak: rgba(255, 159, 10, .18);
    --amber-text: #ffb340;
    --danger: #ff453a;
    --danger-weak: rgba(255, 69, 58, .18);
    --danger-solid: #e5484d;
    --purple: #bf5af2;
    --purple-weak: rgba(191, 90, 242, .18);
    --text: #ffffff;
    --text-2: #98989d;
    --text-3: #48484a;
    --text-sub: #8e8e93;
    --hint: #a9a9af;
    --bg: #000000;
    --card: #1c1c1e;
    --fill: #2c2c2e;
    --fill-2: #3a3a3c;
    --field: #2c2c2e;
    --sep: rgba(84, 84, 88, .6);
    --card-line: rgba(255, 255, 255, .09);
    --cal-cell: rgba(255, 255, 255, .055);
  }
  html { color-scheme: dark; }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  /* 中文优先苹方/鸿蒙/小米，西文走 SF Pro / Segoe；字距统一收紧一点，
     同样的字号看起来更"紧实"，标题尤其明显 */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -.015em;
  /* 全局数字等宽：金额、课时、日期列一排时位数对齐，不左右抖 */
  font-variant-numeric: tabular-nums;
}

/* 旧浏览器不支持全局声明的，数字组件单独兜底 */
.num, .hero-num, .h-num, .stu-balance .n, .stat-cell .n, .ios-end-num,
.cdp-amt, .money, .cal-mini-row b, .income-num, .pkg-amt {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}


::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }

/* 页面切换：不做整页上浮，只做极短的淡入 */
.page { animation: pageIn .18s ease both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ 登录 ============ */
/* 苹果式：品牌在上、分组列表在中间、主按钮通栏、底部一句脚注。
   一屏里只有两个白块（列表 + 按钮），别的都交给留白 */
.login-view {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg);
}
/* margin:auto 让卡片在剩余空间里居中，脚注自然被顶到最下面 */
.login-card { width: 100%; max-width: 330px; margin: auto 0; text-align: center; }
.login-brand { padding: 6px 0 26px; }
.login-logo { width: 56px; height: 56px; margin: 0 auto; border-radius: 14px; overflow: hidden; }
.login-logo svg { width: 100%; height: 100%; display: block; }
/* 深色模式下黑底图标会整个人间蒸发：把底板提亮一档 */
@media (prefers-color-scheme: dark) { .login-logo svg rect { fill: var(--fill-2); } }
.login-card h1 { font-size: 19px; font-weight: 600; margin: 12px 0 0; letter-spacing: -.015em; }
.login-sub { color: var(--text-2); font-size: 13px; margin: 4px 0 0; }

.login-card form { text-align: left; }
/* 分组列表：几个输入共用一张白卡，中间一条发丝线，不再各占一块 */
.lg-card {
  background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: inset 0 0 0 0.5px var(--card-line);
}
.lg-row { display: flex; align-items: center; min-height: 52px; padding: 0 16px; }
.lg-row + .lg-row { border-top: .5px solid var(--sep); }
.lg-input {
  flex: 1; min-width: 0; border: 0; outline: none; background: none;
  font-family: inherit; font-size: 16.5px; color: var(--text);
  padding: 13px 0; -webkit-appearance: none; appearance: none;
}
.lg-input::placeholder { color: var(--text-3); }
/* 邀请码：等宽 + 大字距，像输入一个口令 */
.lg-input-invite {
  text-align: center; letter-spacing: .18em; font-size: 19px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase;
}
/* 行尾动作（获取验证码 / 59s 后重发）：纯文字，不用按钮的壳 */
.lg-trail {
  flex: none; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 15px; color: var(--primary);
  padding: 6px 0 6px 12px;
}
.lg-trail:disabled { color: var(--text-2); cursor: default; }
/* 主按钮：通栏 + 12 圆角，是这一页的终点；胶囊留给下面的次要入口 */
.lg-submit {
  display: block; width: 100%; margin: 10px 0 0; padding: 14px 16px;
  border: 0; border-radius: 12px; background: #07C160; color: #fff;
  font-family: inherit; font-size: 16.5px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lg-submit:active { opacity: .86; background: #06AD56; }
.lg-submit:disabled { opacity: .55; }
.login-switch { display: block; margin: 14px auto 0; font-size: 14px; color: var(--primary); }
/* 邀请码还没输入时占位文字不要把字距撑开，不然「邀请码」三个字会散架 */
.lg-input-invite:placeholder-shown { letter-spacing: .02em; }
/* 登录卡片里的错误行比弹窗里窄一档：只在登录卡片收紧，别动弹窗表单 */
.login-card .field-error { min-height: 12px; margin-top: 4px; }

/* 底部脚注：11px 一行，贴在屏幕最下方，不算表单的一部分 */
/* 全局错误（验证码不对、网络失败之类）：出现在卡片里、按钮下面 */
.login-error { color: var(--danger); font-size: 13px; line-height: 1.5; margin: 10px 0 0; }
/* 邀请码、设置密码这两步：独立面板，文字左对齐，标题居中 */
#inviteStep, #pwdStep { text-align: left; }
#inviteStep .login-sub, #pwdStep .login-sub { margin: 0 0 14px; text-align: center; }
#inviteStep .login-switch { text-align: center; }
/* 「以后再说」：比主按钮轻一档的灰色文字，允许跳过 */
#pwdStep .login-skip { display: block; margin: 12px auto 0; font-size: 13px; color: var(--text-2); }
#pwdStep .login-skip:hover { color: var(--text); }

.field-error { color: var(--danger); font-size: 12px; min-height: 16px; margin-top: 6px; }

/* ============ 控件 ============ */
.input, select.input, textarea.input {
  width: 100%; border: none; border-radius: 14px; padding: 14px 16px;
  font-size: 17px; font-family: inherit; background: var(--field); color: var(--text);
}
.input::placeholder { color: var(--text-2); }
.input:focus { outline: 3px solid var(--primary-weak); }
textarea.input { resize: vertical; min-height: 64px; }
/* 备注弹层：一行说明这是哪一节，下面一块能写几行的输入区 */
.note-sub { font-size: 13px; color: var(--text-2); margin: 0 2px 10px; line-height: 1.45; }
textarea.input.note-area { resize: vertical; min-height: 88px; line-height: 1.55; padding: 12px 14px; white-space: pre-wrap; overflow-y: auto; }
/* 弹窗底色是浅灰，输入框再用同一档灰就糊了。改白底，边界靠对比而不是边框。 */
/* 弹层是浅灰底，输入框用白色：形状靠底色对比出来，不加边框 */
.modal-sheet .input,
.modal-sheet .dfield,
.modal-sheet .cpick-btn { background: var(--card); }

/* ---------- 自研日期选择器（替掉浏览器自带的粗糙面板） ---------- */
.dwrap { position: relative; }
.dfield {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; cursor: pointer;
}
.dtext { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dtext.ph { color: var(--text-2); }
.dicon { width: 18px; height: 18px; color: var(--text-2); flex-shrink: 0; }

.dpop {
  position: fixed; z-index: 90;
  background: var(--card); border-radius: 16px;
  padding: 10px 10px 6px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .20), 0 0 0 .5px rgba(0, 0, 0, .06);
  animation: dpIn .16s cubic-bezier(.32, .72, 0, 1);
}
@keyframes dpIn { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.dhead { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.dtitle { font-size: 15px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dnav {
  border: none; background: none; color: var(--primary);
  width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.dnav:active { background: var(--field); }
.dnav svg { width: 15px; height: 15px; }
.dweek { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 0 2px; }
.dweek span { text-align: center; font-size: 11px; color: var(--text-2); font-weight: 500; }
.dgrid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dcell {
  height: 36px; border: none; background: none; border-radius: 999px;
  font-size: 15px; color: var(--text); font-family: inherit; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dcell.out { opacity: .32; }
.dcell.today { color: var(--primary); font-weight: 600; }
.dcell.sel { background: var(--primary); color: #fff; font-weight: 600; opacity: 1; }
.dcell:active:not(.sel) { background: var(--field); }
/* 月份网格：四列三行，跟日期面板同一套配色（选中实心蓝、本月蓝字） */
.mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 2px 0 8px; }
.mcell {
  height: 42px; border: none; background: none; border-radius: 10px;
  font-size: 14.5px; color: var(--text); font-family: inherit; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.mcell.now { color: var(--primary); font-weight: 600; }
.mcell.sel { background: var(--primary); color: #fff; font-weight: 600; }
.mcell:active:not(.sel) { background: var(--field); }
.dfoot { display: flex; gap: 8px; margin-top: 4px; padding-top: 4px; border-top: .5px solid var(--sep); }
.dbtn {
  flex: 1; border: none; background: none; color: var(--primary);
  font-size: 15px; font-family: inherit; padding: 9px; border-radius: 10px; cursor: pointer;
}
.dbtn:active { background: var(--field); }
.dbtn.primary { font-weight: 600; }

/* ---------- 原生下拉 / 时间框换成的自绘浮层 ---------- */
.pwrap { position: relative; width: 100%; }
.time-row > .pwrap { width: auto; flex: 1 1 0; min-width: 0; }
.native-hidden { display: none !important; }
.pwrap .dtext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ppop {
  position: fixed; z-index: 90;
  background: var(--card); border-radius: 14px; padding: 6px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .20), 0 0 0 .5px rgba(0, 0, 0, .06);
  max-height: 264px; overflow-y: auto;
  animation: dpIn .14s cubic-bezier(.32, .72, 0, 1);
}
.pitem {
  display: block; width: 100%; border: none; background: none;
  text-align: left; font-family: inherit; font-size: 16px; color: var(--text);
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
}
.pitem.on { color: var(--primary); font-weight: 600; background: var(--primary-weak); }
.pitem:active:not(.on) { background: var(--field); }

/* 时间：时 / 分 两列点选 */
.ppop.tpop { padding: 8px; max-height: none; overflow: visible; }
/* 月份面板跟日期面板用同一套内边距和圆角，别让人看出是两个组件 */
.ppop.mpock { padding: 10px 10px 6px; border-radius: 16px; max-height: none; overflow: visible; }
.tpick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; height: 200px; }
.tcol { overflow-y: auto; scrollbar-width: none; }
.tcol::-webkit-scrollbar { display: none; }
.titem {
  display: block; width: 100%; border: none; background: none;
  font-family: inherit; font-size: 15px; color: var(--text);
  padding: 8px 0; border-radius: 8px; cursor: pointer;
  font-variant-numeric: tabular-nums; text-align: center;
}
.titem.on { background: var(--primary); color: #fff; font-weight: 600; }
.titem:active:not(.on) { background: var(--field); }
/* 金额 / 次数输入框已改用 type="text" + inputmode：
   这样没有上下箭头，鼠标滚轮也不会把数值滚掉，这里只是兜底旧样式 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.time-row { display: flex; gap: 8px; }
.time-row > .input { flex: 1 1 0; width: auto; min-width: 0; }

.btn {
  border: none; border-radius: 14px; padding: 15px 20px;
  font-size: 17px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: opacity .12s, transform .1s;
}
.btn:active { transform: scale(.98); opacity: .85; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; border-radius: 14px; }
/* 深色模式的主色是近白，白字就看不见了 */
@media (prefers-color-scheme: dark) { .btn.primary { color: #0b0b0c; } }
.btn.ghost { background: var(--card); color: var(--primary); box-shadow: inset 0 0 0 .5px var(--sep); }
/* 次要按钮（iOS tinted）：跟实心主按钮并排时两个都有底色，靠浓淡分层级，不靠描边 */
/* 次要按钮（iOS tinted）：跟实心主按钮并排时两个都有底色，靠浓淡分层级 */
.btn.tinted { background: var(--primary-tint); color: var(--primary); }
.btn.danger { background: var(--card); color: var(--danger); box-shadow: inset 0 0 0 .5px var(--sep); }
.btn.plain { background: var(--field); color: var(--text); }
.btn.wechat { background: #07c160; color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 14px; font-size: 15px; border-radius: 999px; }

.link-btn {
  border: none; background: none; color: var(--primary);
  font-size: 15px; cursor: pointer; font-family: inherit; padding: 4px 0;
}
.link-btn:hover { color: var(--primary-hover); }
/* 管理入口不写字，用小皇冠：盒子做成定宽定高的方格，
   靠 place-items 居中，才能和旁边「刘老师 / 退出」在同一水平中线上 */
#adminBtn { padding: 0; width: 24px; height: 24px; display: grid; place-items: center; }
#adminBtn svg {
  width: 21px; height: 21px; display: block; transform: translateY(1px);
  /* 金色是填充色，不是线条色：给它一点极薄的落地影，小尺寸下才有金属感 */
  filter: drop-shadow(0 .5px .6px rgba(150, 96, 6, .35));
}
#adminBtn:active svg { opacity: .7; }

/* ============ 骨架 ============ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  /* 右侧是文字（退出），左侧是方块图标，同样的 16px 看起来会偏右，所以右边多让 6px */
  padding: 10px 22px 10px 16px; min-height: 52px;
  border-bottom: 0.5px solid var(--sep);
}

/* 断网提示条：长在顶栏里，跟着一起粘在顶部。用负外边距铺满整宽，
   这样它看起来是顶栏「多出来的一行」，而不是飘在别处的一块 */
.net-bar {
  flex: 1 0 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: -10px -22px 9px -16px;
  padding: 6px 16px;
  font-size: 12.5px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em;
  background: rgba(255, 159, 10, .16);
  color: #8f5600;
}
.net-bar svg {
  width: 15px; height: 15px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
/* 恢复时同一根条换绿，亮不到两秒就收起，不用另一套元素 */
.net-bar.is-ok { background: rgba(52, 199, 89, .15); color: #1a7a3c; }
.net-retry {
  margin-left: 2px; padding: 2px 9px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .72); color: inherit;
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.net-retry:active { background: rgba(255, 255, 255, .95); }
.net-bar.is-ok .net-retry { display: none; }

@media (prefers-color-scheme: dark) {
  .net-bar { background: rgba(255, 159, 10, .2); color: #ffc069; }
  .net-bar.is-ok { background: rgba(48, 209, 88, .2); color: #6fe08a; }
  .net-retry { background: rgba(255, 255, 255, .16); }
  .net-retry:active { background: rgba(255, 255, 255, .3); }
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; letter-spacing: -.02em; }

/* 顶栏用正式图标（黑底四点一线）；26px 下线会细得看不见，所以线宽比正式图标粗一档 */
.brand-logo {
  width: 26px; height: 26px; flex: 0 0 auto; display: block; overflow: hidden;
}
.brand-logo svg { width: 100%; height: 100%; display: block; }
@media (prefers-color-scheme: dark) {
  .brand-logo { border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
}
.user-info { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-2); }
.user-info .user-name {
  /* 名字是按钮：点了能改，但不该长得像按钮 */
  background: none; border: none; padding: 0; font: inherit; color: var(--text);
  max-width: 112px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; gap: 4px;
}
.user-info .user-name #userNameText {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-info .user-name.custom { font-weight: 500; }
.user-info .user-name:active { opacity: .5; }

.container { max-width: 720px; margin: 0 auto; padding: 0 16px 96px; }
@media (min-width: 700px) { .container { max-width: 680px; padding-bottom: 108px; } }

/* 大标题：34px 加粗 —— 苹果最大的一档 */
/* 营收页最底下的版本号：一行小灰字，不发烫、不抢眼，滑到底才看见 */
.app-ver { padding: 6px 0 26px; text-align: center; font-size: 11px; color: var(--text-3); letter-spacing: .02em; }
.page-title {
  font-size: 32px; font-weight: 700; letter-spacing: -.021em;
  margin: 18px 0 14px; line-height: 1.18;
}
/* 标题右边挂一个「＋ 添加」：学生页唯一的常驻添加入口 */
.page-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.page-title-row .page-title { margin: 18px 0 14px; }
.page-title-row .stu-add { font-size: 15px; font-weight: 500; flex: 0 0 auto; }

/* 学生页多选：标题右侧两个动作、行首圆形勾、底部操作条 */
.title-acts { display: flex; gap: 16px; align-items: baseline; }
.pk {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 10px; font-size: 12px; color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(60, 60, 67, .34);
}
.pk.on { background: var(--primary); box-shadow: none; }
.stu-pickbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 60; display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 9px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
}
.spb-n { flex: 1 1 auto; font-size: 13px; color: var(--text-2); }
.stu-pickbar .btn { flex: 0 0 auto; padding: 9px 18px; }
/* 多选时给列表尾部留出操作条的高度，别把最后一个学生挡住 */
.stu-wrap.picking { padding-bottom: 76px; }
.cls-pick-hint { font-size: 13px; color: var(--text-2); margin: 0 0 8px 2px; }

/* 归档学生：不摆操作按钮，只留一句说明 */
.arch-note {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--field); color: var(--text-2); font-size: 12.5px; line-height: 1.5;
}

/* 班级管理：列表行 + 底部新建行（iOS 的分组列表写法） */
.cls-row .ios-title { font-size: 17px; letter-spacing: -.01em; }
.cls-row .ios-sub { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.cls-new {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 0 14px;
  background: var(--card); border-radius: var(--radius);
}
.cls-input {
  flex: 1 1 auto; min-width: 0; border: none; outline: none; background: none;
  font-family: inherit; font-size: 17px; color: var(--text); padding: 14px 0;
}
.cls-input::placeholder { color: var(--text-2); }
.cls-add-btn {
  flex: 0 0 auto; border: none; background: none; font-family: inherit;
  font-size: 16px; font-weight: 500; color: var(--primary); padding: 8px 0 8px 6px; cursor: pointer;
}
.cls-add-btn:disabled { color: var(--text-3); }

/* 班级里勾选学生：一屏列完，右侧年级淡字 */
.cls-pick { max-height: 52vh; overflow: auto; margin: 2px 0 0; }
.cls-pick-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 2px; border-bottom: .5px solid var(--sep); cursor: pointer;
}
.cls-pick-row:last-child { border-bottom: none; }
.cls-pick-row input { width: 20px; height: 20px; accent-color: var(--primary); flex: 0 0 auto; margin: 0; }
.cls-pick-name { font-size: 16px; letter-spacing: -.01em; }
.cls-pick-meta { margin-left: auto; font-size: 12.5px; color: var(--text-2); }

/* 分组标题：13px 灰色小字，不再是彩色竖条 */
.section-title {
  font-size: 13px; font-weight: 400; color: var(--text-2);
  /* 上边距 26 → 20：卡片靠描边已经能分层，标题不需要再用大留白"隔开" */
  margin: 20px 0 8px 16px; letter-spacing: .01em;
  display: flex; align-items: center; gap: 6px;
}
.section-title.tint-blue, .section-title.tint-green,
.section-title.tint-amber, .section-title.tint-purple { color: var(--text-2); }

/* ============ 分组列表（核心组件） ============ */
/* 学生列表按首字母分组：字母吸顶，右边一列索引可点可划 */
.stu-block { scroll-margin-top: 58px; }
.stu-block + .stu-block { margin-top: 10px; }
.stu-sec {
  /* 不吸顶：吸顶会把下面那张卡片的名字切掉一半，反而更难认 */
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
  color: var(--text-sub); padding: 18px 0 6px 4px;
}
/* 有索引条时整页往左收一点，别让字母压在卡片和箭头上 */
.stu-wrap.has-index { padding-right: 15px; }
.stu-index {
  position: fixed; right: 2px; top: 50%; transform: translateY(-50%);
  z-index: 26; display: flex; flex-direction: column; align-items: center;
  padding: 6px 1px; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.stu-index button {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 10px; line-height: 1.35; font-weight: 600;
  color: var(--primary); padding: 1px 2px;
}
.stu-index button:active { opacity: .45; }

.ios-group {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
}
.ios-group + .ios-group { margin-top: 18px; }

.ios-row {
  position: relative; width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; min-height: 44px;
  background: none; border: none; font-family: inherit; text-align: left;
  color: var(--text); font-size: 17px; cursor: pointer;
}
.ios-row:active { background: var(--fill); }
.ios-row + .ios-row::before,
.ios-row + .ios-static::before,
.ios-static + .ios-row::before,
.ios-static + .ios-static::before {
  content: ""; position: absolute; left: 16px; right: 0; top: 0;
  height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top;
}
.ios-row.has-ic::before, .ios-static.has-ic::before { left: 60px; }
.ios-static { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 44px; font-size: 17px; }
.ios-static.wrap { align-items: flex-start; padding-top: 13px; padding-bottom: 13px; }
/* 可点的统计行，按下给个反馈 */
.ios-static.is-clickable { cursor: pointer; }
.ios-static.is-clickable:active { background: var(--fill); }

.ios-main { flex: 1 1 auto; min-width: 0; }
/* 班级标签单独占一行：跟名字挤在一行时，第二个标签会掉到下一行并缩进去，看着错位 */
.ios-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.ios-tags .tag { margin: 0; }
.detail-tags .tag { margin-right: 0; }

.ios-title { display: block; font-size: 17.5px; line-height: 1.3; letter-spacing: -.01em; }
/* 每门课一行；课名特别长时在这一行里省略，绝不让文字顶到右边的「剩余」上 */
.ios-sub .si {
  display: block; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.ios-sub { display: block; font-size: 12px; color: var(--text-sub); line-height: 1.45; margin-top: var(--gap-sub); }
/* 中文默认哪儿都能断，会出现「线 / 上【初三数学】」这种，改成整块换行 */
.ios-sub, .record-item .meta, .cdp-course, .pkg-mid, .pkg-date, .db-sum, .list-item, .bal-chip {
  word-break: keep-all; overflow-wrap: anywhere;
}
.ios-sub.inline { display: inline; margin-top: 0; }

.ios-end { flex: 0 0 auto; text-align: right; margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ios-end-lab { font-size: 11px; color: var(--text-2); line-height: 1.3; }
.ios-end-num { font-size: 17px; line-height: 1.25; }
.ios-end-num.warn { color: var(--amber); }
.ios-end-num.zero { color: var(--danger); }
/* 金额下面补一行「欠几节」，左边就不用再写一遍负数了 */
.ios-end-sub { font-size: 11px; color: var(--text-3); line-height: 1.3; }

.ios-chev { flex: 0 0 auto; width: 8px; height: 13px; color: var(--text-3); }
.ios-chev.right { margin-left: 4px; }

/* 头像：苹果用灰底黑字，不上彩色 */
.avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 500; color: var(--text);
  background: var(--fill-2);
}
.avatar.lg { width: 56px; height: 56px; font-size: 24px; }

/* 图标方块：设置那种彩色小方块 */
.ios-ic {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff;
}
.ios-ic.blue { background: var(--primary); }
.ios-ic.orange { background: var(--amber); }
.ios-ic.green { background: var(--green); }
.ios-ic.gray { background: var(--text-2); }

/* ============ 兼容旧结构 ============ */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 4px var(--card-x); margin-bottom: 0;
  border: none; box-shadow: none;
}
.card + .card { margin-top: 18px; }
.card.tint-blue, .card.tint-green, .card.tint-amber, .card.tint-purple {
  background: var(--card); border: none; box-shadow: none;
}
.card.clickable { cursor: pointer; }
.card.clickable:active { transform: scale(.995); }

/* 卡片描边：所有直接铺在页面底色上的白色面，统一 0.5px 内描边。
   白卡与浅灰底的明度差太小，光靠色差看不出边界，加一层描边才有"卡片"的实体感。
   放内阴影而不是 border，是因为 border 会吃到内边距、让文字相对分组标题偏 0.5px。 */
.ios-group, .hero, .quick-row, .db, .cal-panel, .cal-card,
.income-hero, .lock-bar,
.card, .card.tint-blue, .card.tint-green, .card.tint-amber, .card.tint-purple {
  box-shadow: inset 0 0 0 .5px var(--card-line);
}

.empty {
  text-align: center; color: var(--text-sub); font-size: 14.5px;
  padding: 22px 16px; line-height: 1.6;
}

/* 页面级空状态：细线插图 + 一句事实 + 第一个动作按钮 */
.empty-block { text-align: center; padding: 52px 20px 34px; }
.empty-block .eb-ico { width: 54px; height: 54px; color: var(--text-3); }
.empty-block .eb-text {
  font-size: 14.5px; color: var(--text-2); margin: 12px 0 20px;
  line-height: 1.6; white-space: pre-line;
}
.empty-block .eb-btn { min-width: 168px; }

.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: var(--row-y) 0; font-size: 17px;
  border-bottom: 0.5px solid var(--sep);
}
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .money { color: var(--income); font-weight: 400; }

.record-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0; border-bottom: 0.5px solid var(--sep);
}
.record-item:last-child { border-bottom: none; }
/* 名字后面可能跟一颗「预约」胶囊：用 flex 居中，
   vertical-align: middle 对中文大字会偏上，看着不齐 */
.record-item .who {
  font-size: 17px; font-weight: 400;
  display: flex; align-items: center; gap: 7px; min-width: 0;
}
.record-item .meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.record-item .right { margin-left: auto; text-align: right; flex-shrink: 0; }
/* 首页「今日固定课」：跟待上那一行同一套——✓ + ⋯，
   请假/调课/补课/试听 都收进 ⋯，一行只占两颗点。
   尺寸跟日历明细里的那两颗完全一致（26px 热区 / ✓ 11px / ⋯ 15px） */
.sch-acts { display: flex; align-items: center; gap: 8px; }
.sch-acts .sch-check {
  width: 26px; min-width: 26px; height: 26px; padding: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sch-check svg { width: 11px; height: 11px; display: block; }
.sch-check svg path {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
/* 三点不再垫灰底：只留图标本身 */
.sch-more {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 999px;
  background: none; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.sch-more svg { width: 15px; height: 15px; display: block; }
.sch-more:active { background: none; color: var(--text); opacity: .55; }
.record-item > .lesson-badge + div { min-width: 0; flex: 1 1 auto; }
.record-item > div:not(.right):not(.avatar) { flex: 1 1 auto; min-width: 0; }
.record-item.is-dup { background: var(--amber-weak); }

/* 学生档案：上课记录按科目分块。抬头一行「学科标签 + 课程 + 剩余次数」，
   块里的记录就不再重复课名，只留日期、时间和状态 */
.rec-group .record-item:last-child { border-bottom: none; }
.rec-group + .rec-group { border-top: 0.5px solid var(--sep); }
.rec-group-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 13px 0 5px; font-size: 13px; font-weight: 500; color: var(--hint);
}
.rec-group:first-child .rec-group-head { padding-top: 2px; }
/* 抬头下第一条不用再顶一次 11px 的上内边距，否则标题和内容之间空得像两段 */
.rec-group-head + .record-item { padding-top: 7px; }
/* 学科胶囊跟 13px 的抬头文字不是一条基线，单独按中线对齐 */
.rec-group-head .subj-tag { align-self: center; flex: 0 0 auto; margin: 0 6px 0 0; }
.rg-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-bal { flex-shrink: 0; font-size: 12px; font-weight: 400; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rg-bal.is-owe { color: var(--danger); }

.rec-meta { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; }
.rec-course, .rec-when { white-space: nowrap; }

/* 第 N 次课：不用渐变球，改成灰色数字 */
.lesson-badge {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; color: var(--text-2);
  background: var(--field); font-variant-numeric: tabular-nums;
}
/* 请假 / 试听不排课次：用同尺寸字符徽标占位，左侧颗粒度与序号完全对齐 */
.lesson-badge.is-mark {
  font-size: 10.5px; font-weight: 600; line-height: 1;
  font-variant-numeric: normal; letter-spacing: 0;
}
.lesson-badge.is-mark.leave { background: var(--primary-weak); color: var(--primary); }
.lesson-badge.is-mark.resched { background: var(--purple-weak); color: var(--purple); }
.lesson-badge.is-mark.trial { background: var(--amber-weak); color: var(--amber); }

/* ============ 标签 ============ */
/* 胶囊默认右侧留 5px：标签后面几乎总要跟文字或按钮（班课+课名、状态+⋯），
   不留就会让胶囊底色直接贴到字上。已经用 flex gap 排版的容器单独清零 */
.tag {
  display: inline-block; font-size: 12px; line-height: 1.35;
  padding: 1px 7px; border-radius: 6px; margin-right: 5px;
  background: var(--field); color: var(--text-2); vertical-align: 1px;
}
/* 建了但没用的课（没排课/没卖包/没记录）：跟欠费同一档警告色，挂在课名最后面 */
.tag.tag-unused { background: var(--amber-weak); color: var(--amber-text); margin-left: 6px; margin-right: 0; }
/* 正常：浅绿底 + 健康绿字（补课同色系）。请假保持中性灰，不去抢眼 */
.tag.normal { background: var(--green-weak); color: var(--green); }
.tag.makeup { background: var(--green-weak); color: var(--green); }
.tag.leave  { background: var(--primary-weak); color: var(--primary); }
.tag.resched { background: var(--purple-weak); color: var(--purple); }
.tag.trial  { background: var(--amber-weak); color: var(--amber); }
.tag.warn   { background: var(--amber-weak); color: var(--amber); }
.tag.danger { background: var(--danger-weak); color: var(--danger); }
.tag.kind-one, .tag.kind-class { background: var(--field); color: var(--text-2); }
.tag.cls-tag { background: var(--field); color: var(--text-2); }
.tag-dup { color: var(--amber); font-size: 12px; }
/* 收款方式：一个浅色小胶囊（微信 / 现金 / 支付宝）。
   绿色 = 钱已到账，琥珀 = 还没收 */
.pm {
  display: inline-block; white-space: nowrap; vertical-align: 1px;
  padding: 0 5px; border-radius: 5px;
  font-size: 11.5px; line-height: 17px;
  background: var(--green-weak); color: var(--income);
}
.pm.is-unpaid { background: var(--amber-weak); color: var(--amber-text); }

/* ============ 首页 ============ */
/* 顶部一整块：日期 + 今天/明天几节课。就这两行，别再往里塞东西。
   上边距 2 → 16：大标题贴着顶栏太挤，iOS 的大标题（large title）下面也留一截 */
.today-head { margin: 16px 0 0; }
.th-l { min-width: 0; }
.today-head .t { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; }
.today-head .d { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text-2); margin-top: 6px; white-space: nowrap; }
/* 数字比前面的字更深一点：一眼先看到 3 和 2，这是 iOS 那种「标签浅、数值重」的写法 */
.today-head .d b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
/* 「今天 3 节课 · 明天 2 节课」中间那个小圆点 */
.st-dot { flex: none; width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* 收入不再用渐变卡，回到白底大数字 */
.hero {
  background: var(--card); border-radius: var(--radius);
  color: var(--text); padding: 16px; margin-top: 14px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.hero::before, .hero::after { display: none; }
.hero-flex { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; width: 100%; }
.hero .h-lab { font-size: 13px; color: var(--text-2); }
.hero .h-num { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
/* 首页两个数字：等分两列，中间一条细分隔线（本月收入已挪到统计页） */
.hero.two { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 0; padding: 14px 0; }
.hero.two .h-item { display: flex; flex-direction: column; align-items: flex-start; padding-left: 16px; }
.hero.two .h-item + .h-item { border-left: 1px solid var(--sep); }
.hero.two .h-item b { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero.two .h-item span { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.hero-side { display: flex; gap: 20px; flex-shrink: 0; padding-bottom: 4px; }
.hero-side .h-item { display: flex; flex-direction: column; align-items: flex-end; }
.hero-side .h-item b { font-size: 20px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hero-side .h-item span { font-size: 11px; color: var(--text-2); }

/* 快捷入口：变成设置里那种带图标的行 */
.quick-row {
  display: block; background: var(--card); border-radius: var(--radius);
  overflow: hidden; margin-top: 14px;
}
.quick-btn {
  position: relative; width: 100%; display: flex; align-items: center; gap: 14px;
  background: none; border: none; font-family: inherit; cursor: pointer;
  padding: 15px var(--card-x); min-height: 56px;
  font-size: 17px; font-weight: 500; letter-spacing: -.02em; color: var(--text); text-align: left;
}
.quick-btn:active { background: var(--fill); }
.quick-btn + .quick-btn::before {
  content: ""; position: absolute; left: 60px; right: 0; top: 0;
  height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top;
}
.quick-btn .ic {
  flex: 0 0 auto; width: 30px; height: 30px; margin: 0; border-radius: 7px;
  font-size: 15px; display: flex; align-items: center; justify-content: center;
}
/* 图形不占满 30px 底板：留 5px 呼吸位，图标才不会"顶到框上" */
.quick-btn .ic svg { width: 20px; height: 20px; display: block; }
.quick-btn:nth-child(1) .ic { background: var(--primary); }
.quick-btn:nth-child(2) .ic { background: var(--green); }
.quick-btn:nth-child(3) .ic { background: var(--amber); }
/* 第四项是后加的「预约课程」：紫色跟日历里的调课一个色系，一眼和记课分开 */
.quick-btn:nth-child(4) .ic { background: var(--purple); }
.quick-btn > .ic { order: 0; }
.quick-btn { justify-content: flex-start; }
.quick-btn::after {
  content: ""; margin-left: auto; width: 8px; height: 8px;
  border-right: 1.5px solid var(--text-3); border-top: 1.5px solid var(--text-3);
  transform: rotate(45deg); flex-shrink: 0;
}

/* ============ 学生页 ============ */
.search-row { margin: 0 0 14px; position: relative; }
.search-row .input {
  background: var(--fill-2); padding-left: 36px; font-size: 17px; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 16px 16px;
}
/* 清空按钮：iOS 那颗灰圆叉，只有输入了字才出现 */
.search-clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0; border: 0; background: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); cursor: pointer;
}
.search-clear svg { width: 17px; height: 17px; display: block; fill: currentColor; }
.search-clear svg path { fill: none; stroke: var(--card); stroke-width: 1.7; stroke-linecap: round; }
.stu-balance { margin-left: auto; text-align: right; white-space: nowrap; }
.stu-balance .n { font-size: 17px; font-weight: 400; line-height: 1.25; }
.stu-balance .u { font-size: 11px; color: var(--text-2); line-height: 1.3; }

/* 档案头部：顶部对齐。头像/名字/编辑按钮三者不再垂直居中——文字一多，
   居中的头像就会飘到中间，看起来像错位。 */
.detail-head { display: flex; align-items: flex-start; gap: 14px; }
.detail-head .avatar.lg { margin-top: 1px; }
.detail-head .btn { margin-top: 2px; flex-shrink: 0; padding: 6px 12px; font-size: 15px; }
.detail-info { min-width: 0; flex: 1 1 auto; padding-top: 2px; }
.detail-name { font-size: 22px; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.detail-name .tag { font-weight: 400; }
/* 性别跟在名字右边：比名字小两三号、灰字，不加底色，不跟名字抢视线 */
.detail-sex { font-size: 15px; font-weight: 400; color: var(--text-2); letter-spacing: 0; margin-left: 6px; }
/* 学校跟在性别后面，用普通灰字而不是胶囊，免得一行里全是色块 */
.detail-school { font-size: 13px; font-weight: 400; color: var(--text-2); letter-spacing: 0; }
.detail-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
/* 班级标签单独一行，不和名字抢那一行的宽度；稍收紧让两个常见班名能并排 */
.detail-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.detail-tags .tag { font-size: 11.5px; padding: 1px 6px; }

.bal-grid { display: flex; flex-direction: column; }
.bal-chip {
  display: flex; align-items: center; gap: 12px;
  padding: var(--row-y) 0; font-size: 17px; min-height: 52px;
  border-bottom: 0.5px solid var(--sep);
  background: none; border-radius: 0;
}
.bal-chip:last-child { border-bottom: none; }
/* 余额行第三行：每次多长、一节多少钱。比正文再淡一档，只做参考 */
.bal-chip .k { color: var(--text-2); font-size: 17px; flex: 1; min-width: 0; }
.bal-chip.warn, .bal-chip.danger { background: none; }

/* 课时包：和上下其他卡片一样是白卡，区块之间只靠留白和 0.5px 分隔线区分，
   不再给这一块单独加底色（加底色会让它比别处重，抢注意力） */
.pkg-item {
  background: none; border-radius: 0; padding: var(--row-y) 0; margin-bottom: 0;
  border-bottom: 0.5px solid var(--sep); box-shadow: none;
}
.pkg-item:last-child { border-bottom: none; margin-bottom: 0; }
.pkg-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pkg-course { flex: 1; min-width: 0; font-size: 17.5px; line-height: 1.35; letter-spacing: -.01em; word-break: break-word; }
.pkg-top .money { flex-shrink: 0; font-size: 17px; line-height: 1.3; color: var(--income); font-weight: 400; }
.pkg-mid { display: block; margin-top: var(--gap-sub); font-size: 12px; color: var(--text-sub); }
.pkg-mid .pkg-qty { color: var(--text-2); font-weight: 400; }
/* 用完的课时包不删（它是一笔收款），只压灰并挂在折叠里 */
.pkg-item.is-done { opacity: .52; }
.pkg-done {
  margin-left: 8px; padding: 1px 6px; border-radius: 5px;
  font-size: 11.5px; font-weight: 400; vertical-align: 2px;
  /* 白卡上必须有底色，否则这个标签等于没有：跟名字胶囊用同一档灰 */
  background: var(--fill-2); color: var(--text-2);
}
/* 这笔包的名字（或「第 N 笔」）：一叠课时包里最先要扫到的标签。
   档案页里它站在底部那行最左边（日期换成周几写在它右边），
   明细弹窗里还贴在课程名后面——两处位置不同，视觉只在这里定义一次 */
.pkg-name {
  padding: 1px 6px; border-radius: 5px;
  font-size: 12px; font-weight: 500; vertical-align: middle;
  /* 包名用提醒色：一叠课时包里，名字是最先要扫到的那个标签 */
  background: var(--amber-weak); color: var(--amber-text);
  display: inline-block; max-width: 46%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; flex: none;
}
/* 往期折叠：结课的包一律收在这行后面，点一下才展开。
   一行灰字居中，不抢在用的那几笔；热区靠上下 14px 的留白撑开 */
.pkg-more {
  display: block; width: 100%; border: 0; background: none; padding: 14px 0;
  font-family: inherit; font-size: 13px; color: var(--text-2);
  text-align: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pkg-more:active { color: var(--primary); }
/* 一笔在用的都没有（整个学生都结课了）：这行就是卡片里的唯一内容，
   上下收一点，别让卡片显得空 */
.pkg-more.is-only { padding: 10px 0; }
/* 固定上课时间行：周几+时间、课程名两行，右边是修改/删除。
   和课时包、余额用同一套节奏（行 13、标题副标题 4） */
.sch-item {
  display: flex; align-items: center; gap: 10px;
  padding: var(--row-y) 0;
  border-bottom: 0.5px solid var(--sep);
}
.sch-item:last-of-type { border-bottom: none; }
.sch-main { flex: 1 1 auto; min-width: 0; }
.sch-when { font-size: 17.5px; line-height: 1.3; letter-spacing: -.02em; }
.sch-course {
  font-size: 12px; color: var(--text-sub); margin-top: var(--gap-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 预约弹窗的「哪天」：四段分段控件（今天/明天/后天/其他）+ 下面一行日期。
   分段和日期框同宽、间距 10px，看起来是一组，不再是三个胶囊漂在灰块里 */
.apt-seg { grid-template-columns: repeat(4, 1fr); margin-bottom: 0; }
.apt-date { margin-top: 10px; }

/* 首页「待上」：未来几天约好的课。
   排布直接沿用「本周课程」那一套（.week-lesson / .wl-when / .wl-course / .wl-sub），
   首页这两块字体层级、行距才对得上，不再是你大我小两种语言 */
.apt-row {
  display: flex; align-items: center; gap: 12px;
  padding: var(--row-y) 0;
  border-bottom: 0.5px solid var(--sep);
  cursor: pointer;
}
.apt-row:last-of-type { border-bottom: none; }
.apt-row.week-lesson { padding: var(--row-y) 0; align-items: center; }
/* 左边那列是「哪天 + 几点」，靠左读起来更顺（本周课程是纯数字才右对齐） */
.apt-row .wl-when { flex: 0 0 54px; text-align: left; }
.apt-row .wl-when .wl-t1 { color: var(--purple); }
/* 已经过去还没记：换成提醒色，扫一眼就知道这条欠着 */
.apt-row .wl-when .wl-t1.is-past { color: var(--amber-text); }
/* 「预约」标签：尺寸跟「一对一 / 班课」那个一致，只换颜色 */
/* 注意权重：`.wl-sub .wl-kind`（灰底）在后面定义，这里必须写全前缀才盖得住，
   否则「预约」跟「一对一」一样是灰底 */
.wl-sub .wl-kind.apt { background: rgba(175, 82, 222, .13); color: var(--purple); }
.wl-sub .wl-kind.warn { background: var(--amber-weak); color: var(--amber-text); }
.apt-note { color: var(--text-3); }
/* 今日课程那一行的「预约」（贴在学生名后面）：跟待上那颗是同一颗胶囊，
   垂直方向对着字的中线，不贴着基线往下坠 */
.apt-tag {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  padding: 1px 7px; border-radius: 999px;
  font-size: 11px; line-height: 1.5; font-weight: 400;
  background: rgba(175, 82, 222, .13); color: var(--purple);
}
.apt-tag.warn { background: var(--amber-weak); color: var(--amber-text); }

/* 点开一笔课时包：这一包认领了哪几节课，归档后那些课就收在这里 */
.pkg-item[data-pkg] { cursor: pointer; }
/* 抬头：课程名 + 实收。日期只写一次（包名就是收款日期），放在下面那行 */
.pkg-d-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pkg-d-course { min-width: 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.pkg-d-course .pkg-done { margin-left: 7px; }
.pkg-d-amount { flex: none; font-size: 17px; color: var(--income); font-variant-numeric: tabular-nums; }
.pkg-d-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 13px; color: var(--text-2); }
.pkg-d-meta .pkg-name { margin: 0; max-width: none; }
.pkg-d-when { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 这块内容分两段白卡：用掉几次的进度、归进来的那几节课 */
.pkg-d-card { margin-top: 14px; background: var(--card); border-radius: 16px; padding: 14px 16px; }
.pdp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pdp-lab { font-size: 14px; color: var(--text-2); }
.pdp-num { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pdp-num i { font-style: normal; font-size: 14px; font-weight: 400; color: var(--text-3); }
.pdp-bar { margin-top: 11px; height: 4px; border-radius: 2px; background: var(--field); overflow: hidden; }
.pdp-bar i { display: block; height: 100%; border-radius: 2px; background: var(--primary); transition: width .28s ease; }
.pkg-d-list { padding: 2px 16px; }
.pkg-d-empty {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 26px 0 24px; color: var(--text-3); font-size: 13.5px;
}
.pkg-d-empty svg { width: 30px; height: 30px; opacity: .5; }
.pkg-rec {
  display: flex; align-items: baseline; gap: 8px; padding: 13px 0;
  border-bottom: 0.5px solid var(--sep);
}
.pkg-rec:last-child { border-bottom: none; }
.pr-date { font-size: 14.5px; color: var(--text); }
.pr-time { font-size: 14.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pkg-rec .tag { margin-left: auto; margin-right: 0; }
/* 记录行尾的 ⋯：比状态标签低一档存在感，别抢「正常/请假」 */
.pkg-rec .row-menu { width: 22px; height: 22px; margin: 0 0 0 2px; opacity: .55; }
.pkg-rec .row-menu svg { width: 15px; height: 15px; }
.pr-no {
  flex: 0 0 auto; min-width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-2); background: var(--field);
  font-variant-numeric: tabular-nums; align-self: center;
}

/* ---------- 归档：长按多选上课记录 → 归进课时包 ---------- */
.rec-row { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.sheet-detail.is-picking .rec-row { cursor: pointer; }
.sheet-detail.is-picking .rec-row .tag,
.sheet-detail.is-picking .rec-row .row-menu { opacity: .35; pointer-events: none; }
/* 选中：底色左右各外扩 8px，序号不贴着色块边缘；内容位置不动 */
.sheet-detail .rec-row.is-picked {
  background: var(--primary-weak); border-radius: 10px;
  margin-left: -8px; margin-right: -8px;
  padding-left: 8px; padding-right: 8px;
}
.sheet-detail .rec-row.is-picked .lesson-badge { background: var(--primary); color: #fff; opacity: 1; }
/* 底部操作条：贴在弹窗底边，滚动时不动 */
.rec-selbar {
  position: sticky; bottom: 0; z-index: 6;
  display: flex; align-items: center; gap: 12px;
  margin: 14px -16px -18px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); box-shadow: 0 -0.5px 0 var(--sep);
}
.rec-selbar .sel-count { flex: 1 1 auto; font-size: 15px; color: var(--text); }
.rec-selbar .link-btn { font-size: 15px; color: var(--text-2); padding: 6px 2px; }
.rec-selbar .btn.sm { padding: 8px 16px; font-size: 15px; border-radius: 10px; }
/* 没进多选态时必须真藏起来：display:flex 会盖掉浏览器对 [hidden] 的默认隐藏 */
.rec-selbar[hidden] { display: none; }

/* 记录底部那句「另有 N 节已归入课时包」 */
.rec-archived {
  padding: 11px 0 2px; margin-top: 4px; border-top: 0.5px solid var(--sep);
  font-size: 12.5px; line-height: 1.5; color: var(--hint);
}

/* 选包：归进哪一笔课时包 */
.arch-list { border-top: 0.5px solid var(--sep); margin-top: 12px; }
.arch-pick {
  display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
  padding: 12px 2px; border: none; border-bottom: 0.5px solid var(--sep);
  background: none; font-family: inherit; text-align: left; cursor: pointer; color: var(--text);
}
.arch-pick:last-child { border-bottom: none; }
.arch-pick:active { background: var(--fill-2); }
.ap-main { flex: 1 1 auto; min-width: 0; }
.ap-title { display: block; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.ap-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.ap-left { flex: 0 0 auto; font-size: 13px; color: var(--primary); }
/* 上过课但没买课时包的课：不算「余额」，只在余额卡片底下提一句，提醒该收这笔钱 */
.bal-owe {
  margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--sep);
  font-size: 12.5px; line-height: 1.55; color: var(--hint);
}
.bal-owe b { color: var(--amber); font-weight: 500; }
.pkg-bot {
  display: flex; align-items: center; gap: 8px;
  margin-top: var(--gap-extra); font-size: 12px; color: var(--text-sub);
}
.pkg-bot .pkg-ops { margin-left: auto; }
.pkg-date { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-ops { display: flex; gap: 16px; flex-shrink: 0; }
.pkg-ops .link-btn { font-size: 15px; padding: 2px 0; white-space: nowrap; }
.pkg-ops .edit-pkg, .pkg-ops .edit-rec, .pkg-ops .edit-sch { color: var(--primary); }
/* 结课 = 把这一期账封存起来，是这一块里唯一"有事发生"的动作：
   给它一块琥珀底的胶囊，夹在灰字和蓝字中间一眼就能找到。 */
.pkg-ops .close-pkg {
  color: var(--amber-text); background: var(--amber-weak);
  padding: 3px 9px; border-radius: 7px;
}
.pkg-ops .unclose-pkg { color: var(--text-2); }
/* 归档是收拾，不是主操作，也不危险：用中性灰，别跟蓝色的「编辑」抢 */
.pkg-ops .arch-pkg, .pkg-ops .unarch-pkg { color: var(--text-2); }
.pkg-ops .del-pkg, .pkg-ops .del-sch { color: var(--danger); }
.pkg-ops .del-pkg:hover, .pkg-ops .del-sch:hover { color: var(--danger); opacity: .7; }

/* 记录行尾的「⋯」：代替原来常驻的「修改 删除」，
   行内多出 60 多像素，课程名能完整显示不再被按钮压住 */
.row-menu {
  flex: 0 0 auto; width: 26px; height: 26px; margin-left: -4px;
  border: 0; background: none; padding: 0; border-radius: 999px;
  color: var(--text-2); opacity: .75;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.row-menu svg { width: 15px; height: 15px; }
/* 放进右侧竖列时：宽度让位给标签，圆点居中即可 */
.sheet-detail .row-menu { width: 28px; height: 24px; margin: 0; }
.row-menu:active { background: var(--field); opacity: 1; }

/* 修改锁：一整行，右边一个开关样式的按钮 */
.lock-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--card); font-size: 15px; color: var(--text-2);
}
.lock-bar .lock-ic { font-size: 15px; line-height: 1; display: flex; align-items: center; }
.lock-bar .lock-ic svg { width: 16px; height: 16px; opacity: .9; }
/* 行内小图标：跟文字同色、贴基线，替掉原来那些大小不一的 emoji */
.ico-inline { width: 13px; height: 13px; vertical-align: -1.5px; margin-right: 1px; opacity: .65; }
.lock-bar .lock-txt { flex: 1; min-width: 0; line-height: 1.35; color: var(--text); }
.lock-btn {
  flex-shrink: 0; border: none; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 400; padding: 4px 0;
  background: none; color: var(--primary);
}
.lock-bar.is-open .lock-txt { color: var(--green); }
.lock-bar.is-open .lock-btn { color: var(--primary); }


.unit-price {
  display: inline-block; padding: 0; background: none;
  color: var(--text-2); font-size: 13px; line-height: 1.4; white-space: nowrap;
}

/* ============ 日历 ============ */
.cal-card { background: var(--card); border-radius: var(--radius); padding: 10px 8px 8px; }
.cal-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; padding: 0 4px; }
/* 翻页键贴着月份标题成一组，别被标题的 flex 撑到两头 */
.cal-navgroup { display: flex; align-items: center; gap: 0; min-width: 0; }
/* 36px 的点击区保留，但让字形往标题靠 5px，透视上才是一组 */
.cal-navgroup .cal-nav:first-child { margin-right: -5px; }
.cal-navgroup .cal-nav:last-child { margin-left: -5px; }
.cal-nav {
  border: none; background: none; color: var(--primary); cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  font-size: 20px; line-height: 1; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.cal-nav:active { background: var(--fill); }
.cal-title {
  flex: 0 1 auto; min-width: 0; border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 20px; font-weight: 700; color: var(--text); padding: 0 3px; letter-spacing: -.03em;
  text-align: left; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cal-today {
  border: none; background: none; color: var(--primary); cursor: pointer;
  font-size: 15px; font-weight: 400; font-family: inherit;
  padding: 6px 8px; border-radius: 8px; flex-shrink: 0;
  margin-left: auto;
}

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0 3px; margin: 6px 0 3px; }
.cal-week span {
  text-align: center; font-size: 12.5px; color: var(--hint); font-weight: 500;
  letter-spacing: .04em; text-indent: .04em; line-height: 1.55;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 3px; }
/* 固定高度是这一版的关键：每行等高，整月才有一张表的感觉 */
.cal-day {
  position: relative; height: 47px;
  /* 格子本身不上底色：31 个灰块看着像 31 个按钮。状态只由数字和符号表达 */
  border: none; background: none; font-family: inherit; cursor: pointer;
  border-radius: 12px; padding: 5px 2px 3px; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: background .12s;
}
.cal-day.is-blank { background: none; pointer-events: none; }
.cal-day:active:not(.is-blank) { background: var(--fill); }
/* 有课/选中的日子给一块极淡的底，扫一眼能看出「哪几格有事」 */
.cal-day.has-lesson { background: var(--cal-cell); }
.cal-num {
  font-size: 15.5px; font-weight: 400; line-height: 1; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  /* 数字没有下伸部，line-box 居中后看起来偏高，补半像素回到视觉中心 */
  padding-bottom: 2px; box-sizing: border-box;
}
/* 今天：实心圆。选中但非今天：只圈住数字，不动格子底色（苹果在月视图里就这么做） */
.cal-day.is-today .cal-num { background: var(--primary); color: #fff; font-weight: 500; }
.cal-day.is-sel .cal-num { box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--primary); font-weight: 500; }
.cal-day.is-today.is-sel .cal-num { box-shadow: 0 0 0 3px var(--primary-weak); color: #fff; }

/* 点「今天」：格子轻轻回弹 + 光环扩散一次，告诉眼睛「回到这里了」 */
@keyframes calPulse {
  0% { transform: scale(.92); }
  40% { transform: scale(1.05); }
  70% { transform: scale(.995); }
  100% { transform: scale(1); }
}
@keyframes calHalo {
  0% { box-shadow: 0 0 0 0 var(--primary-glow); }
  60% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.cal-day.is-pulse { animation: calPulse .46s cubic-bezier(.32, .72, 0, 1); z-index: 1; }
.cal-day.is-pulse .cal-num { animation: calHalo .62s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .cal-day.is-pulse, .cal-day.is-pulse .cal-num { animation: none; }
}

/* 法定节假日：不再染格子，只在数字下面写一个小色块（同 iOS 月视图）。
   格子里还有三行课时，「休 / 班」这种单字光靠灰字容易被忽略，给个底色才看得见 */
.cal-hol {
  align-self: center; font-size: 9.5px; font-weight: 500; color: var(--danger);
  line-height: 1; margin-top: 1px; max-width: 100%; padding: 1px 4px; border-radius: 4px;
  background: var(--danger-weak);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 调休上班日「班」和节假日「休」用同一套样式：同样的字号、圆角、淡红底。
   以前「班」用中性灰，压在灰格子上几乎看不出是块标签，和「休」也不是一个东西 */
/* 窄屏一行只放得下一件事：这天有课就先显示符号，节假日名让给下面的明细 */
@media (max-width: 699px) {
  .cal-day.has-lesson .cal-hol { display: none; }
}

/* 状态符号：窄屏只排符号，宽屏符号跟在每行前面
 * 勾/叉/圈是 12 格内的 SVG，统一 1.7 描边 + 圆头，轻重才一致 */
/* 一行最多 3 个符号，多了显示 +N：宁可少画一个，也不让格子变高、行高不齐 */
.cal-syms {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: center;
  gap: 1.5px; height: 10px; width: 100%; overflow: hidden;
}
.cal-sym {
  font-style: normal; flex: 0 0 auto;
  width: 9px; height: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 600; line-height: 1;
  font-variant-numeric: normal;
}
.cal-more {
  flex: 0 0 auto; font-size: 9px; font-weight: 500; color: var(--text-2);
  line-height: 1; letter-spacing: 0; margin-left: .5px;
}
.cal-sym svg { width: 100%; height: 100%; display: block; }
.cal-sym svg path, .cal-sym svg circle, .cal-sym svg rect {
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.cal-sym.is-done  { color: var(--green); }
.cal-sym.is-todo  { color: var(--danger); }
.cal-sym.is-miss  { color: var(--amber); }
.cal-sym.is-leave { color: var(--primary); }
.cal-sym.is-resched { color: var(--purple); }
.cal-sym.is-trial { color: var(--green); }
.cal-mini { display: none; flex-direction: column; gap: 1px; width: 100%; overflow: hidden; }
.cal-mini-row {
  display: flex; align-items: baseline; gap: 3px;
  font-size: 11px; line-height: 1.35; color: var(--text);   /* 已记：整行深色 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-mini-row b { font-weight: 400; color: inherit; }
/* 行首符号：跟窄屏那排是同一套，垂直居中在行内 */
.cal-mini-row .cal-sym { align-self: center; transform: translateY(.3px); }
/* 还没记的固定课：整行降到次级的灰，扫一眼就是「深色=记过了 / 灰色=还没记」 */
.cal-mini-row.is-plan { color: var(--text-2); }
.cal-more { font-size: 10px; color: var(--text-2); align-self: flex-start; }

@media (min-width: 700px) {
  .cal-day { height: auto; min-height: 88px; padding: 7px 6px 5px; align-items: flex-start; gap: 3px; }
  .cal-syms { display: none; }
  .cal-mini { display: flex; }
}

/* 图例与本月概览提到日历格子上面：先知道符号是什么意思，再往下看格子 */
/* 图例 + 本月概览在日历格子下面：一条细分隔线，像卡片的脚注 */
.cal-meta {
  padding: 9px 4px 5px; margin-top: 7px;
  border-top: 0.5px solid var(--sep);
}
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 5px 14px; justify-content: center;
  font-size: 10.5px; color: var(--text-2); letter-spacing: .01em;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
/* 四个符号统一 11px 方框；? 是文字，字重和字号单独压一下，才跟勾/叉/框一样重 */
.cal-legend .cal-sym {
  width: 11px; height: 11px; border-radius: 0;
  font-size: 9px; font-weight: 700;
}
.cal-sum { text-align: center; font-size: 12px; color: var(--text-2); margin-top: 5px; letter-spacing: .01em; }
/* 日历下方：本月漏记次数，0 次时也显示（灰），有漏记转琥珀色 */
.cal-miss {
  margin-top: 10px; text-align: center;
  font-size: 12.5px; color: var(--text-sub);
}
.cal-miss b { font-weight: 400; font-variant-numeric: tabular-nums; }
.cal-miss.has { color: var(--amber-text); }

/* 本月逐日明细 */
.db {
  background: var(--card); border-radius: var(--radius);
  padding: 2px 16px; margin-bottom: 14px;
  transition: box-shadow .15s;
}
.db.is-sel { box-shadow: 0 0 0 2px var(--primary), inset 0 0 0 .5px var(--card-line); }
.db.is-past .db-d { color: var(--text); }
.db-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 0 9px; border-bottom: 0.5px solid var(--sep);
}
.db-d { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.db-w { font-size: 13px; color: var(--text-2); }
.db-hol { font-size: 12px; color: var(--danger); background: none; padding: 0; }
.db-hol.is-work { color: var(--text-2); background: none; }
/* 和「本周课程」里的「今天」同一档：这俩是同一个标记，粗细不该两样 */
.db-badge { font-size: 12px; font-weight: 700; color: var(--primary); background: none; padding: 0; }
.db-sum { margin-left: auto; font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cdp-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cdp-amt { font-size: 15px; font-weight: 400; color: var(--income); }
.cdp-plan-tag { font-size: 12px; color: var(--text-2); background: none; padding: 0; margin-left: 0; }

.cal-panel { background: var(--card); border-radius: var(--radius); padding: 0 16px; }
.cdp-head {
  font-size: 13px; color: var(--text-2);
  padding: 11px 0 9px; border-bottom: 0.5px solid var(--sep);
}
.cdp-list { display: flex; flex-direction: column; }
.cdp-item {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 0; border-bottom: 0.5px solid var(--sep);
}
.cdp-item:last-child { border-bottom: none; }
.cdp-time { flex-shrink: 0; width: 54px; display: flex; flex-direction: column; gap: 0; }
.cdp-time b {
  font-size: 15px; font-weight: 400; color: var(--text);
  line-height: 1.25; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.cdp-time span { font-size: 11px; color: var(--text-2); line-height: 1.2; font-variant-numeric: tabular-nums; }
.cdp-body { flex: 1; min-width: 0; }
.cdp-who { font-size: 17px; line-height: 1.3; }
/* 名字后面的学科：比正文小一号、带颜色，位置在姓名右侧同一个基线上。
   跟 17px 的姓名并排，胶囊要收一点，不然会把行撑高 */
.cdp-who .subj-tag { margin: 0 0 0 6px; }
.cdp-course {
  font-size: 13px; color: var(--text-2); margin-top: 1px;
  display: flex; align-items: baseline; gap: 3px; flex-wrap: wrap; line-height: 1.4;
}
.cdp-cname { color: var(--text-2); font-weight: 400; }
/* 「课名 · 120 分钟」中间那个点：两侧留 3px，比正文里的空格紧一点 */
.cdp-dot, .cdp-dur { flex: 0 0 auto; }
/* 备注单独一行：跟课名那行同一档灰字，比它小半号 */
.cdp-note {
  font-size: 12.5px; color: var(--text-2); margin-top: 2px;
  line-height: 1.4; word-break: break-word;
  white-space: pre-wrap;   /* 上课内容里的换行和序号要留住 */
}
.cdp-right { flex-shrink: 0; }
.cdp-acts { display: flex; gap: 8px; align-items: center; }
/* 已记那行的状态标签可以点：点了就地换状态、或者取消这节，不用回学生档案。
   首页「今日固定课」「今日记录」和日历明细三处都用同一颗标签，样式统一放这里 */
button.tag-btn {
  border: 0; cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  /* .tag 那 5px 是留给「胶囊 + 课名」并排的，单独成按钮时反而会顶着右边缘 */
  margin-right: 0;
}
button.tag-btn:active { opacity: .55; }

/* 待上这两颗是顺手一点的快捷键，做成 26px 小圆点/小胶囊；
   原来 15px 的大按钮跟学生名字一样抢眼，整行重心全跑到右边去了 */
.cdp-acts .cal-do.btn.sm {
  height: 26px; min-width: 26px; padding: 0; font-size: 12px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cdp-acts .cal-do.is-check { width: 26px; }
/* 原来的「假」胶囊换成「⋯」：请假 / 调课 / 试听 收进菜单，一行只占 26px。
   跟首页、记录行用同一颗：不垫灰底，只留图标 */
.cdp-acts .cdp-more {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 999px;
  background: none; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.cdp-acts .cdp-more svg { width: 15px; height: 15px; display: block; }
.cdp-acts .cdp-more:active { background: none; color: var(--text); opacity: .55; }
.cdp-acts .cal-do svg { width: 11px; height: 11px; display: block; }
.cdp-acts .cal-do svg path {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.cdp-item.is-plan .cdp-time b { color: var(--text-2); }
.cdp-item.is-plan .cdp-who { color: var(--text); }

/* ============ 统计 ============ */
.month-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 14px;
  background: var(--sep); border-radius: var(--radius); overflow: hidden; }
.stat-cell { background: var(--card); padding: 14px 8px; text-align: center; }
.stat-cell .n { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.stat-cell .l { font-size: 11px; color: var(--text-2); margin-top: 2px; }
@media (max-width: 480px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
/* 只有两个真要紧的数，请假/试听缩成一行小字 */
.stat-grid.two { grid-template-columns: repeat(2, 1fr); margin-bottom: 8px; }
.stat-grid.two .stat-cell { padding: 18px 12px; }
.stat-foot { font-size: 12.5px; color: var(--text-sub); text-align: center; margin: 0 0 6px; }

/* ============ 营收页分段（iOS segmented control）============
   灰色胶囊容器，选中段白底小滑块，切换时滑块平移过去 */
.seg {
  display: grid; grid-template-columns: repeat(2, 1fr);
  background: var(--fill); border-radius: 10px;
  padding: 2px; margin-bottom: 14px;
}
.seg-btn {
  border: none; background: none; font-family: inherit;
  font-size: 14px; font-weight: 500; color: var(--text);
  padding: 7px 0; border-radius: 8px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease;
}
.seg-btn.is-on {
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .04);
  font-weight: 600;
}

/* ============ 收入 ============ */
.income-filter { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.income-filter select {
  flex: 0 1 auto; width: auto; max-width: 100%;
  border-radius: 999px; padding: 10px 20px; font-size: 15px; font-weight: 500;
}
.income-hero {
  background: var(--card); color: var(--text); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.income-hero .lab { font-size: 13px; color: var(--text-2); }
.income-hero .num { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.income-hero .row { display: flex; gap: 28px; font-size: 11px; color: var(--text-2); }
.income-hero .row b { font-size: 15px; font-weight: 400; display: block; margin-top: 1px; color: var(--income); font-variant-numeric: tabular-nums; }
/* 待收：还没收到的钱，用红色提醒，和收入形成对照 */
.income-hero .row .owe { margin-left: auto; text-align: right; }
.income-hero .row .owe b { color: var(--danger); }
/* 营收数字只算到账的，这块单独说清「还有几笔没收到」，免得以为漏记了 */
.unpaid-note {
  margin-top: 12px; padding-top: 10px; border-top: 0.5px solid var(--sep);
  font-size: 12.5px; line-height: 1.5; color: var(--amber-text);
}
/* 本月收款：左边谁 + 哪天交的、哪门课，右边金额 + 买了多少次 */
.pay-row .pay-main { flex: 1; min-width: 0; }
.pay-row .pay-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); margin-top: 2px;
}
.pay-row .pay-course { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-row .pay-meta .pm { flex: 0 0 auto; }
.pay-row .pay-right { flex: 0 0 auto; text-align: right; }
.pay-row .pay-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 132px; padding: 6px 16px 0; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.chart .bar .v { font-size: 10px; color: var(--income); margin-bottom: 3px; white-space: nowrap; transform: scale(.94); font-variant-numeric: tabular-nums; }
.chart .bar .b { width: 78%; max-width: 30px; background: color-mix(in srgb, var(--primary) 26%, transparent); border-radius: 4px 4px 0 0; }
.chart .bar.now .b { background: var(--primary); }
.chart .bar.now .m { color: var(--primary); font-weight: 500; }
.chart .bar .m { font-size: 10px; color: var(--text-2); margin-top: 5px; white-space: nowrap; transform: scale(.94); }

.rank-item { display: flex; align-items: center; gap: 12px; padding: var(--row-y) 0; border-bottom: 0.5px solid var(--sep); cursor: pointer; }
.rank-item:last-child { border-bottom: none; }
.rank-item:active { background: var(--fill); }
.rank-item .rk { width: 20px; font-size: 15px; color: var(--text-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rank-item .rk.top { color: var(--text); font-weight: 500; }
.rank-item .grow { flex: 1; min-width: 0; font-size: 17px; }
.rank-item .money { color: var(--income); font-weight: 400; }

/* ============ 本周课程 ============ */
.week-day { padding: 14px 0; border-bottom: 0.5px solid var(--sep); }
.week-day:last-child { border-bottom: none; }
.week-day-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.week-day-head .wd-date { margin-left: auto; color: var(--text-2); font-weight: 400; font-size: 13px; font-variant-numeric: tabular-nums; }
/* 「今天」比星期几更重一档：它不是日期，是「这一行就是现在」的标记 */
.week-day-head .wd-today { color: var(--primary); font-size: 12px; font-weight: 700; }
.week-day.today .wd-name { color: var(--primary); }

/* 课表一行，照 iOS 日程的排法：左边两行时间，右边课程名 + 副信息。
   课程名永远完整显示，宽度不够就自己折行，不压缩、不拆字。 */
.week-lesson { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0 1px; }
.wl-when { flex: 0 0 44px; text-align: right; font-variant-numeric: tabular-nums; }
.wl-when .wl-t1 { display: block; font-size: 15px; line-height: 1.25; color: var(--text); }
.wl-when .wl-t2 { display: block; font-size: 13px; line-height: 1.3; color: var(--text-2); }
.wl-main { flex: 1 1 auto; min-width: 0; }
.wl-course { font-size: 15px; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.wl-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.wl-sub .wl-kind { padding: 1px 7px; border-radius: 999px; background: var(--field); font-size: 11px; line-height: 1.5; }
.wl-sub .wl-miss { padding: 1px 7px; border-radius: 999px; background: var(--danger-weak); color: var(--danger); font-size: 11px; line-height: 1.5; }
/* 同一节课的几个学生并排：名字之间留 6px，不加顿号，读起来像一串人名 */
.wl-names { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.wl-name { display: inline-flex; align-items: center; gap: 3px; }
/* 「缺」跟在某个名字后面，比整行一个「缺」更准：同一节课可能只缺一个人 */
.wl-name .wl-miss { padding: 0 5px; font-style: normal; }
/* 右边写这节课的状态（正常 / 请假 / 调课…），跟上课记录同一个样式；没记就空着 */
.wl-marks { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 1px; }
.wl-marks .tag { font-size: 11px; line-height: 1.5; padding: 1px 7px; }
/* 无课那行原来用「—」打头，紧跟在「周一」下面会被读成「周一 一」；
   换成空心圆当占位符，一眼就是「空的」 */
.week-nolesson { padding: 6px 0 2px; font-size: 13px; color: var(--text-2); }
.week-nolesson .wnl-dot { margin-right: 7px; color: var(--text-3); font-size: 14px; }
/* 过去的日期整体压暗会让「缺」这种提醒也看不清，所以只淡掉文字，不整块透明 */
.week-day.past .wd-name,
.week-day.past .wd-date,
.week-day.past .wl-course,
.week-day.past .wl-when .wl-t1 { color: var(--text-2); }

/* ============ 表单 ============ */
/* 记课时的学生搜索：找不着的先藏起来 */
.stu-search { margin-bottom: 8px; }
/* 学生搜索用：任何一组 chip 里加了 .hide 都要真的看不见
   （原来只写在 #recStuChips 上，预约弹窗里搜了没反应） */
.chip-list .chip.hide { display: none; }
.stu-empty { font-size: 13px; color: var(--text-3); padding: 6px 2px 0; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: none; background: var(--field); color: var(--text);
  border-radius: 999px; padding: 8px 15px; font-size: 15px;
  cursor: pointer; font-family: inherit;
}
.chip.on { background: var(--primary); color: #fff; }
.chip.warn-on { background: var(--amber-weak); color: var(--amber); }
.chip .cf-n { font-size: 12px; opacity: .7; font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }
/* 班级 chip：不做整块高亮（两个班成员相同时会一起亮），用「已选/总数」表达 */
.chip.cls-pick.full .cf-n { color: var(--primary); opacity: 1; font-weight: 600; }
.chip.cls-pick.part { background: var(--primary-weak); color: var(--primary); }
.chip.cls-pick.part .cf-n { opacity: 1; }
.chip.chip-manage { background: none; color: var(--primary); }

.subj-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.subj-chip {
  border: none; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 15px; font-weight: 500; line-height: 1; padding: 7px 14px 9px; border-radius: 7px;
  background: var(--field); color: var(--text);
  transition: background .12s, color .12s;
}
.subj-chip:hover { filter: brightness(.96); }
.subj-chip.on { font-weight: 500; }
.subj-chip.subj-add { background: none; color: var(--primary); }
.subj-input-wrap { display: inline-flex; }
.subj-input {
  width: 96px; font-family: inherit; font-size: 15px;
  padding: 8px 12px; border-radius: 999px; border: none;
  box-shadow: inset 0 0 0 1.5px var(--primary);
  outline: none; background: var(--card); color: var(--text);
}

/* 学科徽章：尺寸只在这里定义，其他地方只许调 margin / vertical-align */
.subj-tag {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: .02em;
  vertical-align: 1px; margin-right: 7px;
  flex-shrink: 0; white-space: nowrap;
}

/* 课程选择器 */
.cpick { position: relative; }
.cpick-btn {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: none; border-radius: 10px;
  background: var(--field); font-family: inherit; font-size: 17px; color: var(--text);
  cursor: pointer; text-align: left;
}
.cpick.is-open .cpick-btn { box-shadow: inset 0 0 0 1.5px var(--primary); }
.cpick-cur { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; }
.cpick-ph { color: var(--text-2); }
/* 没有可选课程（没买课时包）：这一格只是说明，不能点 */
.cpick.is-empty .cpick-btn { cursor: default; }
.cpick.is-empty .cpick-ph { color: var(--hint); }
.cpick-arw { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-2); transition: transform .18s; }
.cpick.is-open .cpick-arw { transform: rotate(180deg); }
/* 展开的列表浮在下面几行之上，不占版面高度：
   以前是撑开流内高度，弹层是从底部升起的，一撑高整张卡片就往上跳一下，很晃眼 */
.cpick-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  display: none; margin: 0; padding: 0;
  background: var(--card); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  max-height: 264px; overflow-y: auto;
}
.cpick.is-open .cpick-pop { display: block; }
.cpick-item {
  position: relative; width: 100%; display: flex; align-items: center; gap: 5px;
  padding: 10px 12px; border: none; background: none;
  font-family: inherit; font-size: 17px; color: var(--text);
  cursor: pointer; text-align: left;
}
.cpick-item + .cpick-item::before {
  content: ""; position: absolute; left: 12px; right: 0; top: 0;
  height: 1px; background: var(--sep); transform: scaleY(.5);
}
.cpick-item.on { background: var(--primary-weak); }
.cpick-item.on .cpick-meta { color: var(--primary); font-weight: 400; }
/* 一行到底：名字过长用省略号，不折行、不把列表撑高。
   价格和时长靠右，扫一眼就能比价 */
.cpick-name {
  flex: 1 1 0; min-width: 0; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cpick-meta { flex: 0 0 auto; font-size: 12.5px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 分段控件（iOS 那种） */
.seg { display: flex; gap: 0; background: var(--field); border-radius: 9px; padding: 2px; }
.seg button {
  flex: 1; min-width: 0; border: none; border-radius: 7px; padding: 7px 4px;
  font-size: 15px; cursor: pointer; font-family: inherit;
  background: none; color: var(--text);
}
.seg button.on { background: var(--card); font-weight: 500; box-shadow: 0 1px 3px rgba(0, 0, 0, .10); }
.seg-hint { font-size: 13px; color: var(--text-2); margin-top: 8px; line-height: 1.5; }

.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; padding-left: 2px; }

/* 长表单分区：一组字段一个小标题，眼睛能立刻知道这一段在问什么 */
.form-sec { margin-bottom: 22px; }
.form-sec:last-of-type { margin-bottom: 4px; }
.form-sec-title {
  font-size: 13px; color: var(--text-2); letter-spacing: .01em;
  margin: 0 0 12px 2px;
}
.form-sec .form-row:last-child { margin-bottom: 0; }

/* 编辑页底部的「删除」：独立一行红字，不和主按钮挤在一起 */
.crs-del {
  display: block; width: 100%; margin: 12px 0 4px;
  border: none; background: none; font-family: inherit;
  font-size: 15px; color: var(--danger); padding: 10px;
  -webkit-tap-highlight-color: transparent;
}
/* 两栏表单：短字段并排，别让右边空一大片。
   姓名/性别、年级/学校、省份/家长各占一半，长字段（联系方式、备注）仍独占一行 */
.form-row.two { display: flex; gap: 10px; }
.form-row.two > .fcol { flex: 1 1 0; min-width: 0; }
/* 半栏里的输入框文字小一档：17px 在 150px 宽里容易顶满、显得挤 */
.form-row.two .input, .form-row.two .dtext { font-size: 16px; }
.form-row.two .dfield { padding-left: 12px; padding-right: 10px; }
/* 姓名框末尾嵌一个性别符号：点一下男↔女，不另占一行 */
.name-wrap { position: relative; }
.name-wrap .input { padding-right: 50px; }
.sex-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; background: none; border-radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Symbol", sans-serif;
  font-size: 22px; line-height: 1; color: #007AFF; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sex-btn.is-f { color: #FF2D55; }
.sex-btn:active { background: var(--fill); }
/* 课时包表单：字段两两并排、行距收一档。原来一列七行，
   430 宽的屏上要滚两屏才见到保存按钮，右半边全是空的 */
.pkg-form .form-row { margin-bottom: 14px; }
.pkg-form .form-row label { margin-bottom: 6px; }
/* 所有字段同高同圆角：普通输入框、课程选择、收费方式、收费日期 */
.pkg-form .input,
.pkg-form .cpick-btn {
  height: 50px; padding-top: 0; padding-bottom: 0; border-radius: 14px;
}
.pkg-form .cpick-btn { padding-left: 16px; padding-right: 16px; }
/* ---------- iOS 行式表单（.rf） ----------
   左边标签、右边就是控件本身，行与行之间一条内缩发丝线。
   比「标签在上、控件在下」省一半高度，扫读时眼睛只沿一条竖线走。 */
/* 选中的那一项：右侧一个蓝色对勾 */
.ios-check { flex: 0 0 auto; font-size: 17px; line-height: 1; color: var(--primary); margin-left: 8px; }

.rf { background: var(--card); border-radius: 16px; overflow: hidden; }
.rf > * { position: relative; }
.rf > * + *::before {
  content: ''; position: absolute; left: 16px; right: 0; top: 0;
  height: .5px; background: var(--sep); pointer-events: none;
}
.rf-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; }
.rf-lab { flex: 0 0 auto; font-size: 16px; color: var(--text); letter-spacing: -.01em; }
.rf-lab .req, .rf-lab-top .req { color: var(--danger); margin-left: 2px; }
.rf-input, .rf-select {
  flex: 1 1 auto; min-width: 0; width: 100%;
  border: none; background: none; font-family: inherit; font-size: 16px;
  color: var(--text); text-align: right; padding: 15px 0; letter-spacing: -.01em;
}
/* 文字类输入左对齐（刚打开就接着打字），数字和选择器右对齐（读数时眼睛贴右边） */
.rf-input { outline: none; text-align: left; }
.rf-input.rf-num { text-align: right; }
.rf-input::placeholder { color: var(--text-3); }
.rf-input:focus, .rf-input:focus-visible { outline: none; }
/* 行里的下拉交给全局美化下拉（beautifySelects）：按钮不是输入框，只是「值 + 箭头」 */
.rf .pwrap { flex: 1 1 auto; width: auto; min-width: 0; }
.rf .pwrap .dfield {
  min-height: 52px; padding: 0; background: none; border-radius: 0;
  justify-content: flex-end; gap: 6px;
}
.rf .pwrap .dfield:focus { outline: none; }
.rf .pwrap .dtext { font-size: 16px; letter-spacing: -.01em; }
.rf .pwrap .dicon { width: 11px; height: 11px; color: var(--text-3); margin-left: 1px; }
.rf-unit { flex: 0 0 auto; font-size: 16px; color: var(--text-2); }
/* 整宽控件（学科 chips、分段控件）：标签在上面一行小字，控件撑满 */
.rf-block { padding: 11px 16px 13px; }
.rf-lab-top { font-size: 13px; color: var(--text-2); margin-bottom: 9px; letter-spacing: .01em; }
.rf .seg { margin-bottom: 0; }
.rf .subj-picker { margin-bottom: 0; }
.rf-row .is-invalid, .rf .is-invalid { outline: 2px solid var(--danger); outline-offset: 3px; border-radius: 6px; }

/* 必填标记：一个红星，不写任何提示语 */
/* 单人记课：学生已经定了，只显示名字，不当成可编辑的输入框 */
.solo-stu { font-size: 17px; color: var(--text); padding: 2px 2px 0; letter-spacing: -.01em; }
.form-row label .req, .spop-title .req { color: var(--danger); margin-left: 2px; margin-right: 3px; }
/* 缺哪个字段就描红哪个，配 focus 也不被蓝圈盖住 */
.is-invalid, .is-invalid:focus {
  outline: 2px solid var(--danger); outline-offset: 0;
}
/* 学科是一整片 chips，红框往外让 4px，别贴着第一个 chip */
.subj-picker.is-invalid { outline-offset: 4px; border-radius: 12px; }
/* 夹在两行字段之间的小字提示：上下各留一点，否则会贴着上一行或下一行 */
.seg-hint.tight { margin-top: 7px; margin-bottom: 14px; }
/* 课程管理底部的「新增课程」标题：跟表单项左对齐，不再自带 16px 缩进 */
.crs-new-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  letter-spacing: -.01em; margin: 24px 0 12px 2px;
}
/* 两个日期并排：开始 / 结束各占一半，中间留 8px，跟时间行一个节奏 */
.date-row { display: flex; gap: 8px; }
.date-row > .dcol { flex: 1 1 0; min-width: 0; }
.date-row .dfield { padding-left: 12px; padding-right: 10px; }
.date-row .dtext { font-size: 16px; }
/* 跟在标签后面的补充说明（如「状态」那一行的扣课时规则）：不再单独占一行 */

/* 课程列表第二行：整行一个层级，靠位置和留白区分主次，
   不靠加粗/深色去抢戏——加粗反而显得吵 */
.crs-meta {
  font-size: 13px; line-height: 1.35; color: var(--text-2);
  margin-top: 2px;
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}

/* 上课时间 + 单次价格：并排两栏，像 iOS 把「日期 & 时间」放一起 */
.pair-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; }
.pair-col { min-width: 0; }
.pair-lab { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 7px 2px; }

/* ============ 底栏 ============ */
.tabbar {
  /* 46：要在换页时旧页那层幻灯（45）之上，又在弹层（50）之下 */
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
  padding: 5px 0 max(5px, env(safe-area-inset-bottom));
}
.tabbar button {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 21px; color: var(--text-2); padding: 6px 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  border-radius: 10px; flex: 1;
  transition: color .12s;
}
.tabbar button span { font-size: 10.5px; letter-spacing: .01em; font-weight: 500; }
/* 选中态：图标换成实心剪影，文字转黑加粗（强调色＝黑，跟随主题的黑/白） */
.tabbar button.on { color: var(--text); transform: none; }
.tabbar button.on span { font-weight: 600; }
.tabbar button svg { width: 24px; height: 24px; display: block; }
.tabbar .ic-on { display: none; }
.tabbar button.on .ic-off { display: none; }
.tabbar button.on .ic-on { display: block; }
/* 切换的瞬间轻轻“落”一下，别太跳 */
.tabbar button svg { transition: transform .16s ease; }
.tabbar button:active svg { transform: scale(.92); }
/* 宽屏：底栏收成居中的悬浮胶囊，别横跨整块屏 */
@media (min-width: 700px) {
  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: 16px; width: auto; min-width: 380px; max-width: 440px;
    border: 0.5px solid var(--sep); border-radius: 999px;
    padding: 6px 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .10);
  }
  .tabbar button { padding: 4px 10px; }
}
.quick-btn svg { width: 17px; height: 17px; display: block; color: #fff; }

/* ============ 弹层 ============ */
/* 弹窗滚到底后不许继续把滚动传给背景页面（overscroll-behavior: contain），
   同时打开时锁住 body，避免遮罩上下的手势把后面的页面拖走 */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  /* --kb 是屏幕键盘占掉的高度（由视觉视口算出来，见 bindKeyboard）。
     遮罩底边抬到键盘上面，卡片就不会被键盘顶起来再被截断 */
  bottom: var(--kb, 0px);
  background: rgba(0, 0, 0, .4);
  display: flex; align-items: flex-end; justify-content: center;
  /* 只淡遮罩自己的颜色，不动 opacity：卡片是它的子元素，
     一动 opacity 整张卡片都是半透明的，背后页面透上来糊成一片。
     比卡片快一拍（0.28s vs 0.5s）：背景先暗下去，卡片再从底下升起来 */
  animation: fadeInBg .28s ease-out;
  overscroll-behavior: contain;
}
@keyframes fadeInBg {
  from { background-color: rgba(0, 0, 0, 0); }
  to { background-color: rgba(0, 0, 0, .4); }
}
/* 卡片的位置一律交给 transform + transition，不用 keyframes：
   手指拖动写的是内联 transform，一旦和内联 animation 打架（内联 none 会压住
   样式表里的 animation），关层动画就再也放不出来。用过渡就没有这个坑。 */
.modal-sheet {
  background: var(--bg); width: 100%; max-width: 620px;
  /* 一层很淡的上投影：卡片从底部浮起来，往下拖的时候和下面的页面才分得开 */
  box-shadow: 0 -6px 32px rgba(0, 0, 0, .10);
  border-radius: 24px 24px 0 0;
  padding: 18px 16px max(20px, env(safe-area-inset-bottom));
  max-height: 90vh;
  /* 键盘弹出时按"剩下可视高度"再压一次：90vh 是按整屏算的，
     键盘一占就是三百多像素，卡片会比剩下的空间还高，只能被顶上去 */
  max-height: min(90vh, calc(100dvh - var(--kb, 0px) - 8px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* 起点 100%：整张卡片藏在屏幕下方，升起来的距离正好等于自身高度，
     退场滑出去也是这个距离，一进一出是同一条轨迹 */
  transform: translateY(100%);
  /* 进场用 .48s；手指下拉松手回弹时 JS 会临时改成 .3s 再清掉 */
  transition: transform .48s cubic-bezier(.4, 0, .2, 1);
}
/* 移到位的标记由 JS 在下一帧挂上：不加这个类，卡片就一直停在屏幕下方。
   终点必须是 none 而不是 translateY(0)——只要还留着 transform，
   这层卡片就成了 fixed 子元素（日期面板、时间选择器）的包含块，
   它们会相对卡片定位，跑到屏幕外去 */
.modal-overlay.is-in .modal-sheet { transform: none; }

/* 关层：卡片原路滑回去，遮罩同时淡出。侧滑返回、点 ✕、点「取消」都走这一套。
   这条必须写在 is-in 后面——两条特异性一样，靠顺序决定谁生效 */
.modal-overlay.is-closing {
  /* 只淡掉遮罩本身的颜色：用 opacity 会把整张卡片也一起变透明，背景文字透上来很脏 */
  animation: fadeOutBg .42s cubic-bezier(.4, 0, .2, 1) forwards; pointer-events: none;
}
.modal-overlay.is-closing .modal-sheet { transform: translateY(102%); }
@keyframes fadeOutBg {
  from { background-color: rgba(0, 0, 0, .4); }
  to { background-color: rgba(0, 0, 0, 0); }
}

@media (min-width: 700px) {
  .modal-overlay { align-items: center; }
  /* 桌面端是居中对话框，从底下滑进来会怪，改成缩小淡入 */
  .modal-sheet {
    border-radius: var(--radius-lg); padding: 20px;
    transform: none; transition: none;
    animation: popIn .34s cubic-bezier(.32, .72, 0, 1);
  }
  .modal-overlay.is-closing .modal-sheet { transform: none; animation: popOut .28s ease forwards; }
}
@keyframes popOut { to { transform: scale(.97); opacity: 0; } }
@media (prefers-color-scheme: dark) {
  .modal-sheet { box-shadow: 0 -6px 32px rgba(0, 0, 0, .5); }
}
@keyframes popIn { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px;
  /* 按住标题栏往下拉可以关掉这层：禁掉浏览器自己的滚动，手势交给我们 */
  touch-action: none; cursor: grab;
}
.modal-head:active { cursor: grabbing; }
.modal-head .title { font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
.modal-head .title::before { display: none; }
.modal-close {
  border: none; background: var(--field); color: var(--text-2);
  width: 30px; height: 30px; border-radius: 999px;
  font-size: 14px; cursor: pointer; line-height: 1;
}
.modal-close:hover { background: var(--fill-2); }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }

/* 弹窗里的分组白卡 */
#modalBody .card { padding: 4px 16px; }

/* ============ toast & confirm ============ */
.toast {
  position: fixed; left: 50%; bottom: 128px; transform: translateX(-50%);
  z-index: 90; background: rgba(28, 28, 30, .96); color: #fff;
  border-radius: 14px; padding: 11px 18px; font-size: 15px; font-weight: 600;
  line-height: 1.4; letter-spacing: .005em;
  /* 按内容撑开：短提示一律单行，只有真的超屏宽才折行 */
  width: max-content; max-width: 88vw; text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
  animation: toastIn .2s ease;
}
/* 绿/红保持原来的明亮色，只是不再带透明度：
   半透明叠在白卡上会被「洗淡」一层，加上背景模糊，白字就发虚；
   实色 + 字重 600 之后，同样的绿色看起来就扎实了 */
.toast.err { background: #ff3b30; }
.toast.ok { background: #34c759; }
/* 带「撤销」的提示：一行字 + 一个按钮，按钮半透明白底，压在绿/黑底上都清楚 */
.toast.has-act { display: flex; align-items: center; gap: 14px; padding: 9px 10px 9px 18px; }
.toast.has-act .t-msg { min-width: 0; }
.toast.has-act .t-act {
  flex: 0 0 auto; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .2); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: .01em;
  padding: 7px 13px; border-radius: 10px;
}
.toast.has-act .t-act:active { background: rgba(255, 255, 255, .34); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- 键盘上方的「完成」栏 ----------
   bottom 跟着 --kb 走：iOS 键盘不压缩布局视口，靠变量顶到键盘上面；
   安卓开了 resizes-content 时 --kb 为 0，布局视口本身就已缩到键盘上方 */
#kbBar {
  position: fixed; left: 0; right: 0; bottom: var(--kb, 0px);
  z-index: 260;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 14px 6px 18px;
  background: var(--fill);
  box-shadow: 0 -0.5px 0 var(--sep);
}
#kbBar.is-on { display: flex; }
#kbBar .kb-lab {
  font-size: 13px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#kbBar .kb-done {
  border: none; background: none; font-family: inherit;
  color: var(--primary); font-size: 17px; font-weight: 600;
  padding: 7px 6px; flex-shrink: 0;
}
/* 工具栏叠在弹窗底部时，把卡片的底部留白让出一条，内容不被盖住 */
body.kb-on .modal-sheet { padding-bottom: calc(max(20px, env(safe-area-inset-bottom)) + 44px); }

.confirm-box {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(0, 0, 0, .4);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
.confirm-card {
  background: var(--card); border-radius: 18px; max-width: 300px; width: 100%;
  padding: 22px 20px 18px; text-align: center;
  /* 深色下纯投影压在黑底上看不出来，再加一道发丝边把卡片托出来 */
  box-shadow: 0 18px 46px rgba(0, 0, 0, .16), inset 0 0 0 0.5px var(--card-line);
}
.confirm-card .msg { font-size: 15px; white-space: pre-line; line-height: 1.55; }
.confirm-card .btns { display: flex; gap: 10px; margin-top: 20px; }
.confirm-card .btns .btn { flex: 1; padding: 12px 16px; font-size: 16px; }
/* 对话框里的「删除」是按下就执行的最后一道门，得实心：
   白底红字放在灰底的「取消」旁边，看着比取消还轻，主次正好反了 */
.confirm-card .btn.danger { background: var(--danger-solid); color: #fff; box-shadow: none; }

/* 结构化确认框（结课、删除这类要讲清后果的）：左对齐、分条。
   一段话居中折成四五行，每行都从中间断，读起来像猜句子；
   拆成「对象 + 三条后果」，扫一眼就知道要发生什么。 */
.confirm-card.rich { max-width: 360px; text-align: left; padding: 22px 20px 18px; }
.confirm-card.rich .cf-title {
  font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.35;
}
/* 对象那一行只用一道细线隔开，不再套一层灰块 */
.confirm-card.rich .cf-entity {
  margin-top: 13px; padding-top: 13px; border-top: 0.5px solid var(--sep);
}
.confirm-card.rich .cf-name {
  font-size: 15.5px; font-weight: 600; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.confirm-card.rich .cf-sub {
  margin-top: 3px; font-size: 13px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.confirm-card.rich .cf-points { list-style: none; margin: 14px 0 0; padding: 0; }
.confirm-card.rich .cf-points li {
  position: relative; padding-left: 15px;
  font-size: 13.5px; line-height: 1.55; color: var(--text-2);
}
.confirm-card.rich .cf-points li + li { margin-top: 7px; }
.confirm-card.rich .cf-points li::before {
  content: ''; position: absolute; left: 1px; top: 8.5px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--text-3);
}
.confirm-card.rich .btns { margin-top: 20px; }

.loading-mask {
  position: fixed; inset: 0; z-index: 80;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 15px;
}

/* ============ 姓名联想 ============ */
.ac-wrap { position: relative; }
.ac-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--card); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
  max-height: 224px; overflow-y: auto; z-index: 60;
  animation: ac-in .14s ease;
}
@keyframes ac-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ac-item {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; cursor: pointer; font-size: 17px; line-height: 1.35;
}
.ac-item + .ac-item::before {
  content: ""; position: absolute; left: 14px; right: 0; top: 0;
  height: 1px; background: var(--sep); transform: scaleY(.5);
}
.ac-item.active, .ac-item:hover { background: var(--fill); }
.ac-item .ac-name { flex: 1; min-width: 0; }
.ac-item .ac-name b { color: var(--primary); font-weight: 500; }
.ac-item .ac-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.ac-item.exact .ac-sub { color: var(--amber); }

/* ---------- 自定义学科的管理小浮层 ----------
   不盖掉底下的表单：整块只是叠在课程弹窗上面，取消就回去继续填。 */
.spop-mask {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, .26);
  animation: pageIn .14s ease both;
}
.spop {
  width: 100%; max-width: 300px;
  background: var(--card); border-radius: 16px;
  padding: 18px 16px 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}
.spop-title { font-size: 16px; font-weight: 600; text-align: center; letter-spacing: -.01em; }
.spop-input { margin-top: 14px; text-align: center; }
/* 字体大小：三档竖排，选中反白 */
.fs-opts { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.fs-opt {
  border: none; font-family: inherit; cursor: pointer;
  padding: 11px 12px; border-radius: 11px; background: var(--field);
  color: var(--text); font-size: 16px; text-align: center;
}
.fs-opt.on { background: var(--primary); color: #fff; font-weight: 500; }
@media (prefers-color-scheme: dark) { .fs-opt.on { color: #0b0b0c; } }
.spop-hint { font-size: 12px; color: var(--text-2); line-height: 1.5; margin-top: 10px; text-align: center; }
/* 设不上密码时把服务端的原话露出来，方便查（正常情况是空的） */
.pwd-raw {
  display: none; font-size: 11px; line-height: 1.4; color: var(--text-3);
  text-align: center; margin-top: 6px; word-break: break-all;
}
.pwd-raw:not(:empty) { display: block; }

.spop-link { display: block; margin: 12px auto 0; font-size: 13px; }
/* 一行三个位置：修改密码居卡片正中，「⋯」贴右边 */
.spop-links { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 12px; }
.spop-links .spop-link { grid-column: 2; margin: 0; padding: 4px 2px; justify-self: center; }
.spop-links-sep { color: var(--text-3); font-size: 13px; }
/* 「⋯」：注销这类不可逆的操作藏在它后面，点开小菜单再点「注销账号」 */
.spop-more {
  grid-column: 3; justify-self: end;
  border: 0; background: none; color: var(--text-2); cursor: pointer;
  padding: 4px 6px; border-radius: 8px;
  display: inline-grid; place-items: center;
}
.spop-more:active { background: var(--fill); }
.spop-more .ico-inline { width: 22px; height: 22px; display: block; }
.spop-link.danger { color: var(--danger); }
.spop-link.danger:hover { color: var(--danger); opacity: .8; }

.spop-actions { display: flex; gap: 8px; margin-top: 14px; }
.spop-actions .btn { flex: 1; font-size: 15px; padding: 10px 0; border-radius: 10px; }
/* ---------- 家长月账单 ---------- */
.bill-nav {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 2px 0 12px;
}
.bill-arrow {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: var(--field); color: var(--text); font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0 0 2px; cursor: pointer; font-family: inherit;
}
.bill-arrow:active { background: var(--fill-2); }
.bill-ym {
  min-width: 130px; text-align: center; font-size: 17px; font-weight: 600;
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.bill-preview {
  border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .06);
}
.bill-preview img { display: block; width: 100%; height: auto; }
.bill-hint { font-size: 12.5px; color: var(--text-3); text-align: center; margin: 10px 0 12px; }

/* 倒数弹窗里的日期框，和上面的名字输入框留同样的间距 */
/* 自定义学科右上角一个小点，暗示可以长按管理 */
.subj-chip.is-custom { position: relative; }
.subj-chip.is-custom::after {
  content: ""; position: absolute; top: 5px; right: 5px;
  width: 4px; height: 4px; border-radius: 999px; background: currentColor; opacity: .45;
}

/* ---------- 首页「装到手机桌面」提示条 ---------- */
.install-tip {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius);
  padding: 12px 14px; margin: 12px 0 0;
}
.install-tip .it-ic {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--primary-weak); color: var(--primary);
}
.install-tip .it-ic svg { width: 20px; height: 20px; }
.install-tip .it-main { flex: 1 1 auto; min-width: 0; }
.install-tip .it-t { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.install-tip .it-s { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.install-tip .btn { flex-shrink: 0; }
.install-tip .it-x {
  border: none; background: none; color: var(--text-3); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 6px 2px; flex-shrink: 0;
}
/* 装进安卓 App 后：微信登录走不通（OAuth 会跳到浏览器），直接藏掉 */
.in-app #wechatLoginBtn,
.in-app #loginDivider { display: none !important; }

.admin-sub {
  font-size: 12.5px; color: var(--text-3);
  padding: 14px 0 8px; margin-top: 4px;
  border-top: .5px solid var(--sep);
}
.admin-sub.none { border-top: none; padding: 10px 0 4px; text-align: center; }

.install-link {
  text-align: center; font-size: 13px; color: var(--text-2);
  padding: 22px 0 92px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.install-link:active { opacity: .5; }
.spop-steps { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.spop-steps b { color: var(--primary); font-weight: 600; }

/* ---------- 新手引导：两步走 ---------- */
.start-card { padding: 16px 16px 8px; }
.sc-head { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 4px; }
.sc-head span { display: block; font-size: 13px; font-weight: 400; color: var(--text-2); margin-top: 3px; }
.sc-step { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: .5px solid var(--sep); }
.sc-step:last-child { border-bottom: none; }
.sc-n {
  width: 24px; height: 24px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: var(--field); color: var(--text-2);
}
.sc-txt { flex: 1 1 auto; min-width: 0; }
.sc-txt b { display: block; font-size: 15px; font-weight: 500; }
.sc-txt span { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.sc-step.now .sc-n { background: var(--primary); color: #fff; }
.sc-step.done .sc-n { background: var(--green-weak); color: var(--green); }
.sc-step.wait { opacity: .5; }
.sc-step .btn { flex-shrink: 0; }

/* ---------- 管理页 ---------- */
.admin-view { position: fixed; inset: 0; z-index: 160; background: var(--bg); overflow-y: auto; }
.admin-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep);
}
.admin-back {
  width: 34px; height: 34px; border: none; background: none; cursor: pointer;
  color: var(--primary); display: grid; place-items: center; border-radius: 999px;
}
.admin-back svg { width: 20px; height: 20px; }
.admin-back:active { background: var(--fill); }
.admin-bar-title { flex: 1 1 auto; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.admin-act {
  width: 48px; border: none; background: none; cursor: pointer;
  color: var(--primary); font-family: inherit; font-size: 15px; padding: 6px 2px; border-radius: 8px;
}
.admin-act:active { background: var(--fill); }
.admin-body { padding: 0 16px 48px; }

.admin-sum {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--card); border-radius: var(--radius);
  margin: 14px 0 2px; padding: 14px 0;
}
.admin-sum > div { text-align: center; position: relative; }
.admin-sum > div + div::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: .5px; background: var(--sep);
}
.admin-sum b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.admin-sum span { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 2px; }

.admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: .5px solid var(--sep);
}
.admin-row:last-child { border-bottom: none; }
.admin-phone { font-size: 15px; font-variant-numeric: tabular-nums; }
.admin-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px; letter-spacing: .12em; font-weight: 500;
}
.admin-code.used { color: var(--text-3); text-decoration: line-through; letter-spacing: .08em; font-size: 15px; }
/* 管理页每行的收款：金额比标签重，扫一眼能比出谁用得多 */
.admin-money { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.admin-money b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 复制按钮：一键拿到「链接 + 邀请码」整段话 */
.admin-copy {
  flex-shrink: 0; border: none; cursor: pointer; font-family: inherit;
  font-size: 13px; padding: 6px 13px; border-radius: 999px;
  background: var(--primary-weak); color: var(--primary);
  transition: transform .12s;
}
.admin-copy:active { transform: scale(.96); }
.admin-copy.done { background: var(--green-weak); color: var(--green); }
.spop-choices { display: flex; gap: 8px; margin-top: 14px; }
.spop-choices .btn { flex: 1; padding: 10px 0; font-size: 15px; }

/* ---------- 底部动作面板（记录行的 修改/删除） ---------- */
.spop-mask.is-sheet {
  display: flex; align-items: flex-end; justify-content: center;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .32);
}
.asheet {
  width: 100%; max-width: 420px;
  animation: asheetUp .34s cubic-bezier(.32, .72, 0, 1) both;
}
/* 动作面板是矮卡，只走一小段位移；名字不能和主弹层的 sheetUp 撞——同名后者会覆盖前者 */
@keyframes asheetUp { from { transform: translate3d(0, 40px, 0); opacity: .4; } to { transform: none; opacity: 1; } }
.asheet-group {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}
.asheet-title {
  padding: 13px 16px; font-size: 12.5px; line-height: 1.45; color: var(--text-2);
  text-align: center; border-bottom: 0.5px solid var(--sep);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asheet-item {
  display: block; width: 100%; border: 0; background: none;
  padding: 15px 16px; font-size: 17px; color: var(--primary);
  text-align: center; border-top: 0.5px solid var(--sep);
  -webkit-tap-highlight-color: transparent;
}
.asheet-group > .asheet-item:first-of-type { border-top: 0; }
.asheet-item:active { background: var(--field); }
.asheet-item.danger { color: var(--danger); }
.asheet-cancel {
  margin-top: 8px; background: var(--card); border-top: 0;
  border-radius: 14px; color: var(--text); font-weight: 600;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

/* =========================================================
 * 学生档案：iOS 分组卡片排版
 * ---------------------------------------------------------
 * 头像区只留姓名与信息，锁和编辑收到标题栏右侧；
 * 每个区块一行小标题 + 一张白卡，卡内行与行之间用细线分隔。
 * ======================================================= */
.sheet-detail { padding: 16px 16px max(20px, env(safe-area-inset-bottom)); }

.sheet-detail .modal-head {
  display: flex; align-items: center; gap: 2px;
  margin-bottom: 16px; min-height: 30px;
}
.sheet-detail .modal-head .title {
  flex: 1 1 auto; min-width: 0;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
}
.sheet-detail .head-acts { display: flex; align-items: center; gap: 4px; }
.sheet-detail .head-act {
  border: 0; background: none; color: var(--primary);
  font-size: 15px; padding: 6px 2px;
}
/* ✕ 也别贴着「编辑」，免得想编辑却把档案关掉 */
.sheet-detail .modal-close { flex: 0 0 auto; margin-left: 14px; }

/* 头像 + 姓名 */
.sheet-detail .detail-head { align-items: center; gap: 13px; }
.sheet-detail .detail-name { font-size: 21px; line-height: 1.25; }
.sheet-detail .detail-meta {
  font-size: 13px; color: var(--text-2); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-detail .detail-sub { margin-top: 5px; font-size: 13px; line-height: 1.45; }
.sheet-detail .detail-sub > div + div { margin-top: 2px; }
.sheet-detail .detail-tags { margin-bottom: 4px; }
.sheet-detail .detail-note { color: var(--text-2); }

/* 区块小标题：左标签 + 右计数/链接 */
.sheet-detail .sec-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 18px 4px 7px;
}
.sheet-detail .sec-label { font-size: 13px; color: var(--text-2); letter-spacing: .02em; }
.sheet-detail .sec-count { font-size: 12.5px; color: var(--text-2); opacity: .85; }
/* 区块标题右侧那一组：计数 + ⋯。两者贴在一起，⋯ 比计数低一点，不抢标题 */
.sheet-detail .sec-right { display: flex; align-items: center; gap: 5px; }
.sheet-detail .sec-dots { width: 24px; height: 22px; color: var(--text-2); opacity: .7; }
.sheet-detail .sec-dots svg { width: 15px; height: 15px; }
.sheet-detail .sec-link {
  border: 0; background: none; padding: 0;
  color: var(--primary); font-size: 13px;
}

/* 卡片与卡内元素 */
.sheet-detail .card { border-radius: 12px; padding: 2px 14px; }
.sheet-detail .empty-cell {
  padding: 15px 0; text-align: center;
  font-size: 13px; color: var(--text-2);
}
.sheet-detail .detail-acts { display: flex; gap: 10px; padding: 12px 0; }
.sheet-detail .detail-acts .btn { flex: 1 1 0; }

/* 固定课程行：左两行文字，右侧操作固定不被挤 */
.sheet-detail .sch-item {
  display: flex; align-items: center; gap: 10px;
  /* 这一层是更密的账单单：用上边线，基础样式那条下边线关掉，免得两条线并排 */
  padding: 11px 0; border-top: 0.5px solid var(--sep); border-bottom: 0;
}
.sheet-detail .sch-item:first-child { border-top: 0; }
.sheet-detail .sch-main { flex: 1 1 auto; min-width: 0; }
.sheet-detail .sch-when { font-size: 14.5px; color: var(--text); }
/* 有效期跟在时间后面，小一号灰字：不影响「周几 几点」的主信息 */
.sch-span { font-size: 12px; color: var(--text-2); margin-left: 6px; }
.sheet-detail .sch-course {
  font-size: 13px; color: var(--text-2); margin-top: var(--gap-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-detail .pkg-ops { flex: 0 0 auto; display: flex; gap: 10px; }


/* 档案里的记录行：课名已经提到分组抬头，行里只剩「日期 · 时间」和右侧状态 */
/* 状态标签和 ⋯ 横着排一行：课名不再占位，右边有富余，横排比竖叠更自然 */
.sheet-detail .record-item { padding: 9px 0; align-items: center; }
.sheet-detail .record-item .right {
  flex: 0 0 auto; margin-left: auto;
  display: flex; flex-direction: row; align-items: center; gap: 5px;
}
/* 全局 .rec-meta 是 baseline 对齐 + flex-wrap；纵向排列时这两条会让子项按
   「内容宽度」排（wrap 会按内容分列，stretch 失效），课程名于是不裁切、
   直接压到行尾的标签和按钮下面。这里必须 nowrap + stretch 才吃 text-overflow */
.sheet-detail .rec-meta {
  display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
  gap: 2px; min-width: 0;
}
.sheet-detail .rec-when { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 抬头已经写着课名，记录行只剩日期、时间和右侧状态，三样排成一行。
   中间那列只有 ~150px，所以日期省掉当年的年份、时间用不带空格的短横（见 recDateLabel/recTimeLabel） */
.sheet-detail .rec-group .rec-meta {
  flex-direction: row; align-items: baseline; flex-wrap: nowrap; gap: 4px;
}
.sheet-detail .rec-group .rec-when,
.sheet-detail .rec-group .rec-course { flex: 0 0 auto; font-size: 14.5px; }
.sheet-detail .lesson-badge { font-size: 12px; }
/* 右侧两件套收紧一点，把宽度让给中间的时间 */
.sheet-detail .record-item .right { gap: 3px; }
.sheet-detail .record-item .row-menu { width: 24px; }
.sheet-detail .rec-course {
  font-size: 12.5px; color: var(--text-2); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-detail .record-item .right { flex: 0 0 auto; }
/* 课时包日期行：让日期可以省略，右侧「编辑 删除」不被挤走 */
.sheet-detail .pkg-bot { gap: 10px; }
.sheet-detail .pkg-date {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-detail .pkg-bot .pkg-ops { flex: 0 0 auto; white-space: nowrap; }

/* =========================================================
 * 待上行的「⋯」菜单：贴着按钮弹出的 iOS UIMenu
 * ---------------------------------------------------------
 * 不用遮罩变暗（那样像弹窗），只留一层透明点击区；
 * 卡片右边缘跟按钮对齐，下面放不下时脚本会翻到按钮上方。
 * ======================================================= */
.spop-mask.is-menu {
  display: block; padding: 0; background: transparent; animation: none;
}
.amenu {
  position: fixed; min-width: 128px; padding: 5px;
  background: var(--card);
  border-radius: 13px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .20), 0 0 0 .5px var(--card-line);
  animation: menuIn .16s cubic-bezier(.32, .72, 0, 1) both;
}
@keyframes menuIn {
  from { transform: scale(.9); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.amenu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; border: 0; background: none;
  padding: 10px 11px; border-radius: 9px;
  font-size: 15.5px; color: var(--text); text-align: left;
  font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.amenu-item:active { background: var(--field); }
/* 小圆点用状态色，和标签、日历符号对得上。
   左右各留 3px，让它的占位和 14px 的图标槽一样宽，菜单项文字才不会一段一段缩进 */
.amenu-dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; margin: 0 3px; }
/* 图标槽：目前只有「结课」用（红旗） */
.amenu-ico { width: 14px; height: 14px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.amenu-ico.flag { color: var(--danger); }
.amenu-ico svg { width: 14px; height: 14px; display: block; }
.amenu-dot.st-normal { background: var(--green); }
.amenu-dot.st-makeup { background: var(--green); }
.amenu-dot.st-leave { background: var(--primary); }
.amenu-dot.st-resched { background: var(--purple); }
.amenu-dot.st-trial { background: var(--amber); }
.amenu-dot.st-cancel { background: var(--text-2); }
.amenu-dot.st-note { background: var(--text-3); }
/* 危险项（注销账号）：红点红字，和普通菜单项一眼分开 */
.amenu-dot.st-del { background: var(--danger); }
.amenu-item.danger { color: var(--danger); }
.amenu-item.danger:active { background: var(--danger-weak); }
/* 红字那一项，圆点也变红：灰点配红字看着像没配对 */
.amenu-item.danger .amenu-dot { background: var(--danger); }
/* 「取消」上面一条细线：它不算状态，是另一种动作 */
.amenu-sep { height: 0.5px; margin: 4px 9px; background: var(--sep); }
/* 当前这一项右边打勾（改状态时用），其他项留白占位，文字不左右跳 */
.amenu-check {
  margin-left: auto; display: inline-flex; width: 12px;
  color: var(--primary); opacity: 0;
}
.amenu-item.is-on .amenu-check { opacity: 1; }
.amenu-check svg { width: 12px; height: 12px; display: block; }
.amenu-check svg path {
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ============================================================
   收入的数字：统一健康绿
   ------------------------------------------------------------
   放在文件末尾，是为了压住前面各处写死的 `color: var(--text-2)`
   （比如 .unit-price 的「每次 ¥180」本来是小字灰）。
   只挑真正是钱的：营收、课时包金额、单次价、本节金额、统计卡的本月营收。
   余额（剩几次）和欠费不动——一个是课时、一个是应收未收。
   ============================================================ */
/* 全部用同一个绿（就是营收页「累计总营收」那个），不再分大小字两档 */
.money, .num, .cdp-amt, .pkg-amt, .unit-price, .income-inline,
.stat-cell .n.is-income, .admin-money b, .pm i { color: var(--income); }

/* 学生档案的上课记录：上课内容按行显示，序号不会挤成一段 */
.rec-note { white-space: pre-wrap; line-height: 1.5; }
/* 上课内容有多行时，序号和右侧状态跟着第一行走，不再垂直居中 */
.cdp-item.has-note { align-items: flex-start; }
.cdp-item.has-note .cdp-time { padding-top: 1px; }
.record-item.has-note { align-items: flex-start; }
.record-item.has-note .lesson-badge { margin-top: -1px; }

/* ============================================================
   ColorOS 风格：悬浮胶囊底栏
   贴底整条改成漂浮的一颗胶囊，选中项浅色底 + 品牌色，
   内容区底部留白跟着加高，最后一行不会被 dock 压住
   ============================================================ */
.container { padding-bottom: 112px; }
.tabbar {
  left: 12px; right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 7px 6px;
  border: 0.5px solid var(--sep);
  border-radius: 26px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  box-shadow: 0 8px 28px rgba(16, 24, 40, .10), 0 1px 2px rgba(16, 24, 40, .05);
}
.tabbar button {
  padding: 5px 6px 6px; border-radius: 20px; gap: 2px;
  transition: color .14s, background-color .14s;
}
.tabbar button.on { background: var(--primary-weak); color: var(--primary); }
.tabbar button.on span { color: var(--primary); }
@media (min-width: 700px) {
  .container { padding-bottom: 120px; }
  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: 18px; width: auto; min-width: 400px; max-width: 440px;
    border-radius: 26px; padding: 7px 8px;
  }
}

/* ============================================================
   ColorOS：首页大标题 + 金刚区
   日期降成小字，主标题只讲一件事（今天几节课）；
   四个入口从「带箭头的列表行」变成四块磁贴，手指一次落点就到
   ============================================================ */
.today-head { margin: 18px 0 0; }
.today-head .t-date {
  font-size: 11.5px; color: var(--text-2); letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.today-head .t {
  font-size: 25px; font-weight: 600; letter-spacing: -.02em;
  line-height: 1.22; margin-top: 3px; white-space: nowrap;
}
.today-head .d { font-size: 12.5px; color: var(--text-2); margin-top: 4px; white-space: nowrap; }

.quick-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  background: none; box-shadow: none; overflow: visible; margin-top: 16px;
}
.quick-btn {
  flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 0; min-height: 0; border-radius: 18px;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-align: center;
  color: var(--text);
}
.quick-btn::after { display: none; }
.quick-btn + .quick-btn::before { display: none; }
.quick-btn:active { background: none; }
.quick-btn .ic {
  width: 100%; height: 54px; border-radius: 18px; margin: 0;
  transition: transform .14s ease;
}
.quick-btn:active .ic { transform: scale(.95); }
.quick-btn .ic svg { width: 22px; height: 22px; color: inherit; }
/* 图标底板改成同色系淡底 + 品牌色线条：比整块实心更轻，四个并排也不吵 */
.quick-btn:nth-child(1) .ic { background: color-mix(in srgb, var(--primary) 11%, var(--card)); color: var(--primary); }
.quick-btn:nth-child(2) .ic { background: color-mix(in srgb, var(--green) 14%, var(--card)); color: var(--green); }
.quick-btn:nth-child(3) .ic { background: color-mix(in srgb, var(--amber) 14%, var(--card)); color: var(--amber); }
.quick-btn:nth-child(4) .ic { background: color-mix(in srgb, var(--purple) 12%, var(--card)); color: var(--purple); }

/* 两个数字卡：字号收一档、字重降到 600，和 ColorOS 的克制感一致 */
.hero.two { padding: 16px 0; border-radius: var(--radius); }
.hero.two .h-item b { font-size: 26px; font-weight: 600; }
.hero.two .h-item span { font-size: 11.5px; }

/* 行里放「不是输入框的输入」：课程选择、日期、时间，
   统一收成「值 + 箭头」，不再套一层白框，白卡里也就不会出现白框套白卡 */
.rf .cpick { flex: 1 1 auto; min-width: 0; }
.rf .cpick-btn {
  background: none; padding: 0; min-height: 52px; border-radius: 0;
  justify-content: flex-end; text-align: right; font-size: 15px; gap: 4px;
}
.rf .cpick-cur { justify-content: flex-end; }
.rf .cpick-btn.is-empty .cpick-ph { text-align: right; }
.rf .cpick-arw { width: 11px; height: 11px; color: var(--text-3); }
.rf .cpick-btn .cpick-name {
  flex: 0 1 auto; min-width: 0; text-align: right;
  font-size: 15px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rf .cpick-btn .cpick-meta { font-size: 12px; }
.rf .dwrap { flex: 1 1 auto; min-width: 0; }
.rf .dwrap .dfield {
  background: none; padding: 0; min-height: 52px;
  justify-content: flex-end; gap: 6px; border-radius: 0;
}
.rf .dwrap .dtext { font-size: 15px; }
.rf .dwrap .dicon { width: 13px; height: 13px; color: var(--text-3); }
.rf .dfield:focus { outline: none; }
/* 原生时间框：去掉框，只留右对齐的时间和右侧的钟点图标 */
.rf-input.rf-time {
  flex: 1 1 auto; width: auto; text-align: right; padding: 15px 0;
  font-size: 15px; font-variant-numeric: tabular-nums;
}
.rf-input.rf-time::-webkit-calendar-picker-indicator { opacity: .38; margin-left: 2px; }

/* 学生页右侧的字母索引：从"贴在边上的小字"变成一颗细长悬浮胶囊，
   不再和卡片边缘叠在一起 */
.stu-index {
  right: 3px; padding: 8px 3px; border-radius: 12px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: 0 2px 10px rgba(16, 24, 40, .08), inset 0 0 0 .5px var(--card-line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.stu-index button { font-size: 9.5px; padding: 1px 3px; }
