:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  --line: #e8ecea;
  --line-2: #d9dfdc;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: #e8f6f4;
  --ok: #16a34a;
  --ok-soft: #e9f7ef;
  --warn: #d97706;
  --warn-soft: #fdf1e3;
  --danger: #dc2626;
  --danger-soft: #fdeceb;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 12px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-2: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -18px rgba(15, 23, 42, 0.22);
  --ease: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
code, pre { font-family: ui-monospace, "SF Mono", Consolas, "Cascadia Mono", monospace; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================= 基础控件 ================= */
.btn-primary {
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-sm);
  color: #ffffff;
  background: var(--accent);
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-primary.block { width: 100%; display: block; }
.btn-ghost {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  background: var(--surface);
  font-size: 14px;
  transition: background-color var(--ease), border-color var(--ease);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn-ghost-sm {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--ink-3);
  background: var(--surface);
  font-size: 12px;
  transition: background-color var(--ease), color var(--ease);
}
.btn-ghost-sm:hover { color: var(--ink); background: var(--surface-2); }
.btn-danger {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  color: #ffffff;
  background: var(--danger);
  font-size: 14px;
  font-weight: 650;
}
.btn-danger.block { width: 100%; display: block; }
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }
.link {
  padding: 4px 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}
.link:hover { color: var(--accent-strong); }

/* 兼容 JS 动态生成的按钮类 */
.primary-button { height: 46px; padding: 0 20px; border: 0; border-radius: var(--r-sm); color: #fff; background: var(--accent); font-size: 14px; font-weight: 650; white-space: nowrap; }
.primary-button:hover { background: var(--accent-strong); }
.primary-button:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost-button { height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--ink-2); background: var(--surface); font-size: 13px; }
.ghost-button:hover { background: var(--surface-2); }
.danger-ghost { padding: 4px 0; border: 0; color: var(--danger); background: transparent; font-size: 12px; }
.text-button { padding: 4px 0; border: 0; color: var(--accent); background: transparent; font-size: 13px; font-weight: 600; }
.subline { color: var(--ink-3); font-size: 13px; }

.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg.sm { border-radius: 10px; }
.seg-item {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: var(--ink-3);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  transition: background-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.seg.sm .seg-item { height: 26px; padding: 0 10px; font-size: 12px; }
.seg-item.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.tag.running, .tag.completed { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tag.failed { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.tag.stopping { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.chip-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--ok);
  background: var(--ok-soft);
  font-size: 11px;
  font-weight: 600;
}
.chip-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* JS 动态状态徽章 */
.status-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.status-badge.running, .status-badge.completed { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.status-badge.failed { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.status-badge.stopping { color: var(--warn); background: var(--warn-soft); border-color: transparent; }

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 700;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.form-error {
  margin: 0;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
  line-height: 1.5;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  outline: none;
  color: var(--ink);
  background: var(--surface);
  font-size: 15px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field textarea { height: auto; padding: 11px 14px; resize: vertical; min-height: 74px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }

/* ================= 登录 / 注册 ================= */
.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(32px + env(safe-area-inset-bottom));
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 18px -10px rgba(13, 148, 136, 0.55);
}
.logo svg { width: 24px; height: 24px; stroke-width: 2.2; }
.auth-brand strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.auth-brand small { display: block; margin-top: 2px; color: var(--ink-4); font-size: 12px; }
.auth-wrap .seg { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.auth-wrap .seg-item { height: 40px; font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.captcha-row { display: flex; gap: 10px; align-items: flex-end; }
.captcha-field { flex: 1; }
.captcha-box {
  flex: 0 0 128px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 6px 0 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--surface-2);
}
.captcha-box button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-3);
  background: var(--surface);
}
.captcha-box svg { width: 15px; height: 15px; }
.privacy-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.privacy-list li { position: relative; padding-left: 20px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.privacy-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.auth-footnote { margin: 18px 0 0; color: var(--ink-4); font-size: 12px; text-align: center; line-height: 1.6; }

/* ================= 应用骨架 ================= */
.app-shell { display: flex; min-height: 100vh; }
.rail {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  flex: 0 0 84px;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.rail-logo { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; background: transparent; margin-bottom: 16px; }
.rail-logo .logo { width: 40px; height: 40px; border-radius: 12px; }
.rail-nav { display: none; flex-direction: column; gap: 6px; width: 100%; align-items: center; }
.rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 64px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  color: var(--ink-3);
  background: transparent;
  font-size: 10px;
  transition: background-color var(--ease), color var(--ease);
}
.rail-item svg { width: 21px; height: 21px; }
.rail-item:hover { color: var(--ink); background: var(--surface-2); }
.rail-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.rail-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 1px;
}
.rail-foot { margin-top: auto; }

.app { flex: 1; min-width: 0; }
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
.appbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.appbar-brand .logo { width: 34px; height: 34px; border-radius: 10px; }
.appbar-brand .logo svg { width: 20px; height: 20px; }
.wordmark { display: flex; flex-direction: column; gap: 0; min-width: 0; text-align: left; }
.wordmark strong { font-size: 15px; font-weight: 750; letter-spacing: -0.01em; }
.wordmark small { color: var(--ink-4); font-size: 11px; }
.appbar-right { display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-3);
  background: var(--surface);
  font-size: 12px;
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.status-pill.connected i { background: var(--ok); }
.who {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  transition: background-color var(--ease);
}
.who:hover { background: var(--surface-2); }
.who-name { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 13px; }
.who > svg { width: 16px; height: 16px; color: var(--ink-4); }

.screen { max-width: 960px; margin: 0 auto; padding: 20px 16px calc(110px + env(safe-area-inset-bottom)); }
.page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.page-sub { margin: 5px 0 0; color: var(--ink-3); font-size: 14px; line-height: 1.55; }
.page-head .btn-primary { align-self: stretch; }
.view { display: none; }
.view.active { display: block; animation: page-in 220ms var(--ease); }

/* ================= 概览 ================= */
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.hero h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.hero-sub { margin: 6px 0 0; color: var(--ink-3); font-size: 15px; }
.hero .btn-primary { align-self: stretch; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
}
.stat-label { color: var(--ink-4); font-size: 12px; }
.stat strong { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat strong b { font-weight: 800; }
.stat .unit { font-size: 12px; color: var(--ink-4); font-weight: 500; }
.stat small { color: var(--ink-3); font-size: 12px; }

.group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
  margin-bottom: 12px;
  overflow: hidden;
}
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 0;
}
.group-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.group-body { padding: 10px 16px 14px; }

.entry {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.entry:last-child { border-bottom: 0; }
.entry:active { opacity: 0.7; }
.entry-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
}
.entry-icon svg { width: 19px; height: 19px; }
.entry > span:nth-child(2) { flex: 1; min-width: 0; }
.entry strong { display: block; font-size: 14px; font-weight: 650; }
.entry small { display: block; margin-top: 2px; color: var(--ink-4); font-size: 12px; }
.entry .chev { width: 16px; height: 16px; color: var(--ink-4); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface-2);
  font-size: 12px;
}
.account-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.note-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
}
.note-icon svg { width: 14px; height: 14px; }
.note p { margin: 0; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.note strong { color: var(--ink-2); font-size: 13px; }

.live-task-head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.live-task-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.live-task-meta { margin: 0 0 8px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.bar { margin: 12px 0; }
.bar:last-child { margin-bottom: 0; }
.bar-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; color: var(--ink-3); font-size: 12px; }
.bar-head strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.bar-track { height: 7px; overflow: hidden; border-radius: 4px; background: #edf1f0; }
.bar-track.lg { height: 9px; border-radius: 5px; }
.bar-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 240ms var(--ease); }

.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  min-height: 132px;
  padding: 24px 16px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--ink-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.empty-icon svg { width: 20px; height: 20px; }
.empty strong { display: block; color: var(--ink-2); font-size: 14px; font-weight: 650; }
.empty small { display: block; margin-top: 3px; color: var(--ink-4); font-size: 12px; line-height: 1.5; }

/* JS 动态空状态 */
.empty-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  min-height: 120px;
  padding: 20px 14px;
  text-align: center;
}
.empty-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.empty-mark svg { width: 19px; height: 19px; }
.empty-card strong { display: block; color: var(--ink-2); font-size: 14px; font-weight: 650; }
.empty-card small { display: block; margin-top: 3px; color: var(--ink-4); font-size: 12px; }

/* ================= 账号列表 ================= */
.account-list { display: flex; flex-direction: column; gap: 10px; }
.account-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
}
.account-item-copy { min-width: 0; }
.account-item-copy strong { display: block; font-size: 15px; font-weight: 700; }
.account-item-copy small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.account-item-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 2px; }
.account-item-actions .primary-button, .account-item-actions .ghost-button { flex: 1; }

/* ================= 选课流程 ================= */
.flow { display: flex; flex-direction: column; gap: 12px; }
.account-chip-select {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 116px;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--ink-2);
  background: var(--surface);
  text-align: left;
  transition: border-color var(--ease), background-color var(--ease), color var(--ease);
}
.account-chip-select:hover { border-color: var(--ink-4); }
.account-chip-select.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.account-chip-select span { font-size: 14px; font-weight: 650; }
.account-chip-select small { color: var(--ink-4); font-size: 11px; }

.list { display: flex; flex-direction: column; }
.homework-item {
  display: block;
  width: 100%;
  padding: 13px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  background: transparent;
  text-align: left;
}
.homework-item:last-child { border-bottom: 0; }
.homework-item:active { opacity: 0.7; }
.homework-item.active { background: var(--accent-soft); border-radius: var(--r-md); border-bottom-color: transparent; padding: 13px 12px; }
.homework-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.homework-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.homework-item small { display: block; margin-top: 5px; color: var(--ink-4); font-size: 12px; }
.status-tag {
  flex: 0 0 auto;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 20px;
}
.status-tag.live { color: var(--ok); background: var(--ok-soft); border-color: transparent; }

.skeleton { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 4px 0; }
.skeleton i {
  position: relative;
  height: 58px;
  overflow: hidden;
  border-radius: var(--r-md);
  background: #eef1f0;
}
.skeleton i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.8) 50%, transparent 80%);
  animation: shimmer 1.3s infinite;
}

.date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.date-item {
  padding: 12px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: inherit;
  background: var(--surface);
  text-align: left;
  transition: border-color var(--ease), background-color var(--ease);
}
.date-item:active { opacity: 0.75; }
.date-item.active { border-color: var(--accent); background: var(--accent-soft); }
.date-item > span { display: flex; justify-content: space-between; color: var(--ink-4); font-size: 11px; }
.date-item strong { display: block; margin: 5px 0 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.date-progress { height: 4px; overflow: hidden; border-radius: 2px; background: #edf1f0; }
.date-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0 10px;
}
.list-toolbar > span { color: var(--ink-4); font-size: 12px; }
.course-list { display: flex; flex-direction: column; }
.course-item {
  display: grid;
  grid-template-columns: 22px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.course-item:last-child { border-bottom: 0; }
.course-item.selected { background: var(--accent-soft); border-radius: var(--r-md); padding-left: 12px; padding-right: 12px; border-bottom-color: transparent; }
.course-item.done { opacity: 0.55; }
.course-check { position: relative; width: 22px; height: 22px; }
.course-check input { position: absolute; opacity: 0; pointer-events: none; }
.course-check > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  transition: background-color var(--ease), border-color var(--ease);
}
.course-check input:checked + span { border-color: var(--accent); background: var(--accent); }
.course-check input:checked + span::after {
  content: "";
  width: 10px;
  height: 5px;
  margin-top: -2px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg);
}
.check-all { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.check-all input { position: absolute; opacity: 0; pointer-events: none; }
.check-all > span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface);
  transition: background-color var(--ease), border-color var(--ease);
}
.check-all input:checked + span { border-color: var(--accent); background: var(--accent); }
.check-all input:checked + span::after {
  content: "";
  width: 9px;
  height: 4px;
  margin-top: -2px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg);
}
.subject-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 750;
}
.course-copy { min-width: 0; }
.course-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.course-copy small { display: block; margin-top: 3px; color: var(--ink-4); font-size: 11px; }
.course-progress { width: 52px; text-align: right; }
.course-progress strong { display: block; color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.course-progress i { display: block; overflow: hidden; height: 4px; margin-top: 5px; border-radius: 2px; background: #edf1f0; }
.course-progress i::after { content: ""; display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--accent); }

.radio-list { display: flex; flex-direction: column; }
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.radio-row:last-child { border-bottom: 0; }
.radio-row:active { opacity: 0.7; }
.radio {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  transition: border-color var(--ease), background-color var(--ease);
}
.radio-row.active .radio { border-color: var(--accent); background: var(--accent); }
.radio-row.active .radio::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: 4px auto;
  border-radius: 50%;
  background: #ffffff;
}
.radio-copy { flex: 1; min-width: 0; }
.radio-copy strong { display: block; font-size: 14px; font-weight: 650; }
.radio-copy small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }

/* ================= 结账面板 ================= */
.checkout { margin-top: 12px; }
.checkout-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-2);
}
.checkout-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.checkout-head strong { color: var(--ink); font-size: 14px; }
.checkout-head b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}
.checkout-row:last-of-type { border-bottom: 0; }
.checkout-row strong { color: var(--ink); font-weight: 650; }
.checkout-row .seg { flex: 1; justify-content: stretch; }
.checkout-row .seg .seg-item { flex: 1; }
.checkout-summary { margin: 12px 0; color: var(--ink-3); font-size: 13px; line-height: 1.6; }
.checkout .btn-primary { margin-top: 4px; }
.checkout-note { margin: 12px 2px 0; color: var(--ink-4); font-size: 12px; line-height: 1.5; }

/* ================= 任务 ================= */
.focus { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; }
.focus-index {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 15px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.focus-copy { min-width: 0; }
.focus-copy small { color: var(--ok); font-size: 11px; font-weight: 600; }
.focus-copy h3 { margin: 5px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 750; letter-spacing: -0.01em; }
.focus-copy p { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 16px 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}
.stat-strip div { display: flex; flex-direction: column; gap: 3px; }
.stat-strip span { color: var(--ink-4); font-size: 11px; }
.stat-strip strong { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }

.log-list { overflow-y: auto; max-height: 430px; padding: 2px 4px 2px 0; }
.log-entry { position: relative; padding: 3px 0 16px 24px; }
.log-entry:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.log-entry > i { position: absolute; left: 1px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-4); border: 2px solid var(--surface); }
.log-entry.success > i { background: var(--ok); }
.log-entry.warning > i { background: var(--warn); }
.log-entry.error > i { background: var(--danger); }
.log-entry strong { display: block; color: var(--ink-2); font-size: 13px; font-weight: 500; line-height: 1.55; }
.log-entry time { display: block; margin-top: 3px; color: var(--ink-4); font-size: 11px; font-variant-numeric: tabular-nums; }

/* ================= 管理 ================= */
.admin-hint { display: block; margin: -8px 0 12px; color: var(--ink-4); font-size: 12px; }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px 14px; text-align: left; white-space: nowrap; }
.table th {
  color: var(--ink-4);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.table td { color: var(--ink-2); border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .role-admin { color: var(--accent); font-weight: 650; }
.table td.status-running, .table td.status-completed { color: var(--ok); }
.table td.status-failed { color: var(--danger); }
.admin-row-actions { display: flex; gap: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.detail-grid h3 { margin: 0 0 8px; font-size: 12px; font-weight: 650; color: var(--ink-4); }
.detail-grid .wide { grid-column: 1 / -1; }
.detail-list { display: flex; flex-direction: column; gap: 8px; }
.admin-detail-item { padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.admin-detail-item strong { display: block; font-size: 13px; font-weight: 650; }
.admin-detail-item small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.events { max-height: 240px; overflow-y: auto; }
.admin-event-line { display: flex; gap: 10px; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.admin-event-line span { flex: none; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.admin-empty { padding: 20px; color: var(--ink-4); font-size: 13px; text-align: center; }

/* ================= 弹窗 ================= */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.45);
  animation: fade-in 180ms ease;
}
.sheet {
  position: relative;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 16px 20px calc(22px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  animation: sheet-in 240ms var(--ease);
}
.sheet .grabber {
  display: block;
  width: 38px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 2px;
  background: var(--line-2);
}
.sheet h2 { margin: 0 0 6px; font-size: 18px; font-weight: 750; letter-spacing: -0.01em; }
.sheet-sub { margin: 0 0 14px; color: var(--ink-3); font-size: 13px; line-height: 1.6; }
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-3);
  background: var(--surface);
}
.sheet-close svg { width: 15px; height: 15px; }
.sheet .seg { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.sheet .seg-item { height: 38px; }
.sheet .field { margin-top: 12px; }
.confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.confirm-actions button { flex: 1; }

/* ================= Toast ================= */
.toast-region {
  position: fixed;
  z-index: 90;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 420px;
  width: fit-content;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-2);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  line-height: 1.5;
  animation: toast-in 220ms var(--ease);
}
.toast::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.toast.error::before { background: var(--danger); }
.toast.success::before { background: var(--ok); }

/* ================= 底部 Dock ================= */
.dock {
  position: fixed;
  z-index: 50;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 32px -14px rgba(15, 23, 42, 0.28);
}
.dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  border: 0;
  border-radius: 12px;
  color: var(--ink-4);
  background: transparent;
  font-size: 10px;
  transition: color var(--ease), background-color var(--ease);
}
.dock button svg { width: 21px; height: 21px; }
.dock button.active { color: var(--accent); background: var(--accent-soft); font-weight: 650; }

/* ================= 动画 ================= */
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: 0.5; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ================= 平板 ================= */
@media (min-width: 720px) {
  .screen { padding: 26px 28px 48px; }
  .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .page-head .btn-primary { align-self: auto; }
  .hero { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .hero .btn-primary { align-self: auto; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .date-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .skeleton { grid-template-columns: repeat(2, 1fr); }
  .account-item { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .account-item-actions { grid-column: auto; margin-top: 0; }
  .account-item-actions .primary-button, .account-item-actions .ghost-button { flex: none; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .backdrop { align-items: center; padding: 20px; }
  .sheet { width: min(100%, 420px); border-radius: var(--r-lg); animation: pop-in 200ms var(--ease); }
  .sheet.small { width: min(100%, 360px); }
  .sheet.wide { width: min(100%, 760px); }
  .sheet .grabber { display: none; }
  .toast-region { left: auto; right: 18px; top: 18px; align-items: flex-end; }
}

/* ================= 桌面 ================= */
@media (min-width: 1100px) {
  .rail { display: flex; }
  .rail-nav { display: flex; }
  .dock { display: none; }
  .appbar-brand { display: none; }
  .appbar { padding: 0 32px; }
  .screen { padding: 34px 36px 64px; }
  #view-courses.active, #view-auto.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
  }
  #view-courses .flow, #view-auto .flow { grid-column: 1; grid-row: 1; }
  #view-courses .checkout, #view-auto .checkout { grid-column: 2; grid-row: 1; position: sticky; top: 88px; }
  .who-name { max-width: 160px; }
}

@keyframes pop-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }

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