/* ============================================================
   ClassBegin · 浅色工作台（Sky Workspace）
   参考：Linear / Stripe / Tabler / shadcn Modern Minimal / Graphy
   浅灰蓝画布 + 白卡片 + 单一蓝色强调；选中用浅色底，避免大块实心黑
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Consolas, monospace;
  --bg: #f4faff;
  --card: #ffffff;
  --fill: #eef6fc;
  --fill-2: #e2f0fa;
  --line: #d7eaf6;
  --line-2: #eaf4fb;
  --fg: #1e293b;
  --fg-2: #5b6b7c;
  --fg-3: #8aa0b3;
  --blue: #42a5f5;
  --blue-h: #2b98ef;
  --blue-soft: #e8f5fe;
  --blue-fill: #c5e8fb;
  --blue-fill-h: #b3e0f8;
  --blue-line: #8ecff0;
  --blue-ring: rgba(66, 165, 245, .28);
  --green: #059669;
  --green-bg: #ecfdf5;
  --red: #ff5c5c;
  --red-bg: #ffe8e8;
  --red-fill: #ff5c5c;
  --red-fill-h: #f04e4e;
  --red-line: #ff5c5c;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --gold-bg: #fff7ed;
  --bar-bg: #ffffff;
  --mask: rgba(15, 23, 42, .32);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .03);
  --r: 10px;
  --r-lg: 14px;
  --pill: 999px;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --sidebar-w: 232px;
  --topbar-h: 48px;
  --tabbar-h: 56px;
  --panel-top: 10vh;
  color-scheme: light only;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  isolation: isolate;
}
body::before {
  content: '';
  position: fixed;
  width: 160%;
  height: 160%;
  top: -30%;
  left: -30%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 42% at 18% 28%, rgba(186, 231, 255, .85) 0%, transparent 62%),
    radial-gradient(ellipse 42% 38% at 82% 18%, rgba(255, 255, 255, .7) 0%, transparent 58%),
    radial-gradient(ellipse 48% 44% at 78% 78%, rgba(125, 196, 245, .5) 0%, transparent 60%),
    radial-gradient(ellipse 40% 36% at 22% 82%, rgba(66, 165, 245, .22) 0%, transparent 58%),
    linear-gradient(160deg, #e8f6fd 0%, #c5e8fb 48%, #b7e8eb 100%);
  animation: flow-drift 26s var(--ease) infinite alternate;
  will-change: transform;
}
@keyframes flow-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.06); }
}
.water-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
html.water-on body::before { display: none; }
button, input, select, textarea { font: inherit; color: inherit; border: none; background: none; outline: none; }
button { cursor: pointer; }
a { text-decoration: none; color: var(--blue); }
a:hover { text-decoration: underline; }
img { display: block; }
kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--fill);
  color: var(--fg-2);
  border: 1px solid var(--line);
}
::selection { background: var(--blue-soft); color: var(--fg); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d3e3; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--blue-ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  body::before { animation: none !important; }
}

.muted { color: var(--fg-3); font-size: 12px; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }
.inline-form { display: inline-flex; }
.btn-block { width: 100%; }
.m-only { display: none !important; }
.theme-ico-sun, .theme-ico-moon { width: 16px; height: 16px; display: none; }

.toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  max-width: min(92vw, 480px);
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(15, 40, 63, .24);
  animation: toast-in .3s cubic-bezier(.32, .72, 0, 1) both;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(.95); } }
.toast.hide { animation: toast-out .25s cubic-bezier(.32, .72, 0, 1) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(.95); } }
.toast.error { background: var(--red); }
/* 表单字段没填对：红框标出来，配合提示条，避免「点了没反应」的错觉 */
.field-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .16) !important;
  animation: field-shake .3s ease;
}
@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: transparent; }
.auth-wrap { width: min(100%, 380px); }
.auth-card { padding: 32px 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: auth-in .5s cubic-bezier(.32, .72, 0, 1) both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.auth-logo { width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 8px; animation: logo-in .6s cubic-bezier(.32, .72, 0, 1) .1s both; }
@keyframes logo-in { from { opacity: 0; transform: scale(.5) rotate(-10deg); } to { opacity: 1; transform: none; } }
.auth-head { margin-bottom: 22px; text-align: center; }
.auth-head h1 { font-size: 22px; font-weight: 600; }
.auth-head p { margin-top: 4px; color: var(--fg-2); font-size: 13px; }
.auth .field { text-align: left; }
.support-text { margin-top: 16px; color: var(--fg-3); font-size: 12px; text-align: center; }
.auth-submit { width: 100%; height: 42px; }

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; background: transparent; }
.main { padding: 24px 28px 48px; min-width: 0; width: 100%; max-width: none; }
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 16px 12px;
  background: #fff;
  border-right: 1px solid var(--line);
  z-index: 100;
  overflow-y: auto;
}
@media (min-width: 769px) {
  html, body { height: 100%; overflow: hidden; }
  .app { height: 100dvh; min-height: 0; overflow: hidden; }
  .sidebar { height: 100%; max-height: 100dvh; }
  .main { height: 100%; overflow-x: hidden; overflow-y: auto; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 14px; }
.logo { width: 32px; height: 32px; border-radius: 6px; }
.brand-text h2 { font-size: 14px; font-weight: 600; }
.brand-text p { font-size: 11px; color: var(--fg-3); }
.class-switch { padding: 0 2px 10px; }
.class-switch label { display: block; font-size: 11px; color: var(--fg-3); margin-bottom: 5px; }
.search-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 34px; margin: 0 0 12px; padding: 0 10px;
  border-radius: var(--r); background: #fff; color: var(--fg-3); font-size: 13px;
  border: 1px solid var(--line);
  transition: background .12s, border-color .12s;
}
.search-btn:hover { background: var(--fill); }
.search-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.search-btn > span:not(.kbds) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-btn .kbds { margin-left: auto; display: flex; gap: 3px; flex-shrink: 0; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r);
  color: var(--fg); font-size: 13px; font-weight: 500;
  transition: background .12s;
}
.nav-item:hover { background: var(--fill); text-decoration: none; }
.nav-item.active { background: var(--blue-soft); color: var(--blue); }
.nav-icon { width: 16px; height: 16px; display: inline-flex; flex-shrink: 0; }
.nav-icon svg { width: 100%; height: 100%; }
/* 「管理」二级菜单（侧边栏可折叠分组） */
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--r);
  background: transparent; color: var(--fg);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: left; transition: background .12s;
}
.nav-group-head:hover { background: var(--fill); }
.nav-caret { margin-left: auto; width: 14px; height: 14px; display: inline-flex; transition: transform .15s; }
.nav-caret svg { width: 100%; height: 100%; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-group-body { display: none; flex-direction: column; gap: 1px; }
.nav-group.open .nav-group-body { display: flex; }
.nav-item.nav-sub { padding-left: 24px; }
/* 移动端「更多」抽屉里的分组小标题 */
.sheet-group-label { padding: 10px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted, #7a90a8); }
.sidebar-footer { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); background: var(--fill); }
.user-pill-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-pill strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 头像 */
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm.avatar-initial { display: flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; }
.avatar-xs { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.m-user-btn .avatar-xs { display: block; }
.m-user-btn:not(:has(.avatar-xs)) { font-size: 14px; font-weight: 600; }
.avatar-settings { display: flex; align-items: flex-start; gap: 32px; padding: 4px 0; }
.avatar-preview-large { flex-shrink: 0; }
.avatar-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); }
.avatar-initial-large { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-size: 36px; font-weight: 600; border: 3px solid var(--line); }
.avatar-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.avatar-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mt-sm { margin-top: 8px; }
.sidebar-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r); background: var(--fill); display: grid; place-items: center; }
.icon-btn:hover { background: var(--fill-2); }
.icon-btn svg { width: 16px; height: 16px; }
.btn-icon { width: 14px; height: 14px; display: inline-flex; margin-right: 2px; }
.btn-icon svg { width: 100%; height: 100%; }

.badge, .tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--fill); color: var(--fg-2); border: 1px solid var(--line);
}
.badge.manager { color: var(--blue); background: var(--blue-soft); border-color: transparent; }
.badge.superadmin { color: var(--blue); background: var(--blue-soft); border-color: transparent; }
.tag.plus { color: var(--green); background: var(--green-bg); border-color: transparent; }
.tag.minus { color: var(--red); background: var(--red-bg); border-color: transparent; }
.score { font-weight: 600; font-variant-numeric: tabular-nums; }
.score.plus { color: var(--green); }
.score.minus { color: var(--red); }
.member-role-chip {
  min-width: 56px; padding: 4px 8px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; background: var(--fill); color: var(--fg-2); flex-shrink: 0;
}
.member-list { display: grid; gap: 6px; }
.member-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r);
  background: #fff; border: 1px solid var(--line);
  animation: member-in .3s cubic-bezier(.32, .72, 0, 1) both;
}
.member-item:nth-child(1) { animation-delay: .05s; }
.member-item:nth-child(2) { animation-delay: .1s; }
.member-item:nth-child(3) { animation-delay: .15s; }
@keyframes member-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.member-item:hover { background: var(--fill); }
.member-info { flex: 1; min-width: 0; }
.member-info strong { font-size: 14px; font-weight: 600; }
.member-item .badge { flex-shrink: 0; }

.top-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.top-hero h1 { font-size: 20px; font-weight: 600; line-height: 1.25; }
.top-hero p { margin-top: 4px; color: var(--fg-2); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips span { padding: 3px 8px; border-radius: 4px; background: var(--fill); font-size: 12px; color: var(--fg-2); border: 1px solid var(--line); }
.chips-select { gap: 8px; }
.chips-select label { cursor: pointer; user-select: none; }

.panel, .stat, .table-card, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  min-width: 0;
  animation: card-in .4s cubic-bezier(.32, .72, 0, 1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.panel:nth-child(2) { animation-delay: .05s; }
.panel:nth-child(3) { animation-delay: .1s; }
.panel:nth-child(4) { animation-delay: .15s; }
.panel, .table-card, .card { padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 600; }
.card-head .sub { color: var(--fg-3); font-size: 12px; margin-top: 2px; }
.card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--fg); }
.card-title svg { width: 14px; height: 14px; }
.card-title .more { margin-left: auto; font-size: 12px; color: var(--blue); font-weight: 500; }
.card-title .more:hover { text-decoration: underline; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.section { min-width: 0; animation: section-in .35s cubic-bezier(.32, .72, 0, 1) both; }
@keyframes section-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.note { padding: 12px 14px; border-radius: var(--r); background: var(--fill); line-height: 1.6; color: var(--fg-2); font-size: 13px; }
.warn-box { background: #fff; }
.lock-box { border-color: #fdba74; background: #fff7ed; }
.lock-box .card-head { margin-bottom: 0; }
.lock-box h3 { color: #c2410c; }
.lock-box .sub { color: #9a3412; }
body.pw-lock .class-switch,
body.pw-lock .search-btn,
body.pw-lock .nav,
body.pw-lock .m-tabbar,
body.pw-lock .m-class-btn,
body.pw-lock .m-icon-btn,
body.pw-lock .top-hero { display: none !important; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { padding: 14px 16px; animation: stat-in .4s cubic-bezier(.32, .72, 0, 1) both; }
.stat:nth-child(1) { animation-delay: .05s; }
.stat:nth-child(2) { animation-delay: .1s; }
.stat:nth-child(3) { animation-delay: .15s; }
.stat:nth-child(4) { animation-delay: .2s; }
@keyframes stat-in { from { opacity: 0; transform: translateY(12px) scale(.95); } to { opacity: 1; transform: none; } }
.stat .head { display: flex; justify-content: space-between; align-items: center; }
.helper { color: var(--fg-2); font-size: 12px; font-weight: 500; }
.icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--fill); color: var(--fg-2); }
.icon svg { width: 14px; height: 14px; }
.icon-blue { background: var(--blue-soft); color: var(--blue); }
.icon-green { background: var(--green-bg); color: var(--green); }
.icon-orange { background: var(--amber-bg); color: var(--amber); }
.icon-pink { background: #fdf2f8; color: #db2777; }
.stat .value { font-size: 26px; font-weight: 600; margin: 8px 0 2px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .helper:last-child { color: var(--fg-3); font-weight: 400; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 500; color: var(--fg-2); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border-radius: var(--r); border: 1px solid var(--line); background: #fff; font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 8px 12px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #ccc; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring); }
.select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.select.multi { height: auto; min-height: 120px; background-image: none; padding: 8px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choice-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-radius: var(--r); background: #fff; border: 1px solid var(--line);
  cursor: pointer; font-size: 13px; user-select: none; transition: background .12s;
}
.choice-item:hover { background: var(--fill); }
.choice-item input { margin: 0; accent-color: var(--blue); }
.search-form { margin-bottom: 12px; }
.json { width: 100%; min-height: 240px; padding: 12px; border-radius: var(--r); background: #f8fafc; color: var(--fg); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; line-height: 1.6; resize: vertical; }
.json-input { min-height: 200px; font-family: var(--mono); font-size: 13px; }
.kv-list { display: grid; gap: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 120px 1fr; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv label { padding: 10px 12px; font-size: 12px; font-weight: 500; color: var(--fg-2); display: flex; align-items: center; margin: 0; background: var(--fill); }
.kv-value { padding: 10px 12px; font-size: 13px; word-break: break-all; }
.pw-wrap { position: relative; width: 100%; }
.pw-wrap .input { padding-right: 42px; }
.pw-toggle {
  position: absolute; top: 1px; right: 1px; bottom: 1px; width: 40px;
  display: grid; place-items: center; color: var(--fg-3);
  -webkit-touch-callout: none; user-select: none; touch-action: none;
}
.pw-toggle:hover, .pw-toggle.on { color: var(--blue); }
.pw-toggle svg { width: 16px; height: 16px; }

.qform { display: grid; gap: 12px; }
.q-panes { display: contents; }
.q-pane { display: contents; }
.q-nav { display: grid; gap: 8px; }
#quickCard [data-q-next] { display: none; }
.qdlg-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-right: 2px;
  border-radius: 6px;
  color: var(--blue);
  flex-shrink: 0;
}
.qdlg-back svg { width: 18px; height: 18px; }
.qdlg-back:hover { background: rgba(66, 165, 245, .12); }
.qdlg.is-step-2 .qdlg-back,
.qdlg.from-cmdk .qdlg-back { display: inline-flex; }
.q-head-picked { margin-left: 4px; font-size: 12px; color: var(--fg-3); }
.qdlg .q-panes { display: grid; }
.qdlg .q-pane {
  grid-area: 1 / 1;
  display: grid;
  gap: 12px;
  align-content: start;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.qdlg .q-pane.on { opacity: 1; visibility: visible; pointer-events: auto; }
.qdlg [data-q-submit] { display: none; }
.qdlg [data-q-next] { display: none; }
.qdlg.is-step-1 [data-q-next] { display: inline-flex; }
.qdlg.is-step-2 [data-q-submit] { display: inline-flex; }
.qdlg.open.from-cmdk { z-index: 2600; }
.cmdk-mask.swap .cmdk { display: none; }
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08); padding: 4px; max-height: min(420px, 55vh); overflow: auto; display: none;
}
.combo-list.open { display: block; }
.combo-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.combo-item:hover, .combo-item.hl { background: var(--blue-soft); color: var(--fg); }
.combo-item .no { font-size: 11px; opacity: .7; min-width: 24px; font-variant-numeric: tabular-nums; }
.combo-item .py { margin-left: auto; font-size: 11px; opacity: .7; text-transform: uppercase; }
.combo-item.empty { color: var(--fg-3); cursor: default; }
.combo-item.empty:hover { background: transparent; color: var(--fg-3); }
.qchips { display: flex; gap: 6px; flex-wrap: wrap; }
.qchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 4px; background: #fff;
  border: 1px solid var(--line); font-size: 12px; font-weight: 500;
  transition: background .12s, color .12s, border-color .12s;
}
.qchip:hover { background: var(--fill); }
.qchip.on { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.qchip .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.qchip .v.p { color: var(--green); } .qchip .v.m { color: var(--red); }
.qchip.on .v { color: inherit; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--fill); border-radius: var(--r); padding: 2px; height: 38px; }
.seg button { border-radius: 4px; font-size: 13px; font-weight: 500; color: var(--fg-2); transition: background .12s, color .12s; }
.seg button.on { background: #fff; color: var(--fg); border: 1px solid var(--line); }
.seg button.on.p { color: var(--green); } .seg button.on.m { color: var(--red); }
.stepper { display: grid; grid-template-columns: 38px 1fr 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.stepper button { font-size: 16px; color: var(--fg-2); transition: background .1s; }
.stepper button:hover { background: var(--fill); }
.stepper input { text-align: center; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; min-width: 0; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.hint { font-size: 12px; color: var(--fg-3); text-align: center; }
.input.shake { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); animation: shake .28s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; white-space: nowrap; user-select: none; position: relative;
  transition: background .15s, color .15s, opacity .15s, border-color .15s, transform .12s;
}
.btn:hover { text-decoration: none; }
.btn:active { opacity: .82; transform: scale(.97); }
.btn-primary { background: var(--blue-fill); color: var(--blue); border: 1px solid var(--blue-line); }
.btn-primary:hover { background: var(--blue-fill-h); }
.btn-outline { background: #fff; color: var(--fg); border: 1px solid var(--line); }
.btn-outline:hover { background: var(--fill); }
.btn-outline.danger { color: var(--red); border-color: var(--red-line); background: #fff; }
.btn-outline.danger:hover { background: var(--red-bg); }
.btn-success { background: #3dbf7a; color: #fff; border: 1px solid #35b571; }
.btn-excel {
  background: #4CAF50; color: #fff; border: none; border-radius: 8px;
  height: 40px; padding: 0 22px; font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(76, 175, 80, .32);
}
.btn-excel:hover { background: #43a047; color: #fff; }
.export-excel-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-danger { background: var(--red-fill); color: #fff; border: 1px solid var(--red-line); }
.btn-danger:hover { background: var(--red-fill-h); }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
  animation: spin .55s linear infinite;
}
.btn-outline.loading::after, .btn-primary.loading::after, .btn-danger.loading::after { border-color: var(--blue-line); border-top-color: var(--blue); }
.btn-danger.loading::after { border-color: var(--red-line); border-top-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.fields > .actions { grid-column: 1 / -1; }
.actions-top { margin: 0 0 6px; grid-column: 1 / -1; }

.table-wrap { overflow-x: auto; border-radius: var(--r); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; background: var(--fill); font-size: 12px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr { animation: row-in .3s cubic-bezier(.32, .72, 0, 1) both; }
tbody tr:nth-child(1) { animation-delay: .02s; }
tbody tr:nth-child(2) { animation-delay: .04s; }
tbody tr:nth-child(3) { animation-delay: .06s; }
tbody tr:nth-child(4) { animation-delay: .08s; }
tbody tr:nth-child(5) { animation-delay: .1s; }
tbody tr:nth-child(n+6) { animation-delay: .12s; }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
tbody tr:hover td { background: var(--fill); }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.ranking-list { display: grid; gap: 6px; }
.ranking-item { border-radius: var(--r); background: #fff; border: 1px solid var(--line); animation: rank-in .35s cubic-bezier(.32, .72, 0, 1) both; }
.ranking-item:nth-child(1) { animation-delay: .05s; }
.ranking-item:nth-child(2) { animation-delay: .1s; }
.ranking-item:nth-child(3) { animation-delay: .15s; }
.ranking-item:nth-child(4) { animation-delay: .2s; }
.ranking-item:nth-child(5) { animation-delay: .25s; }
@keyframes rank-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.ranking-item > summary {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  list-style: none; cursor: pointer; border-radius: var(--r);
}
.ranking-item > summary::-webkit-details-marker { display: none; }
.ranking-item > summary::marker { content: ''; }
.ranking-item:hover > summary, .ranking-item[open] > summary { background: var(--fill); }
.ranking-item.is-self { border-color: var(--blue-line); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-info strong { font-size: 14px; font-weight: 600; }
.me-tag {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px;
  font-size: 11px; font-weight: 600; color: var(--blue); background: var(--blue-soft);
  vertical-align: middle;
}
.ranking-score { text-align: right; }
.ranking-score strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ranking-records { padding: 0 12px 10px 56px; display: grid; gap: 2px; }
.ranking-rec {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line-2);
}
.ranking-rec .t1 { font-size: 13px; }
.ranking-rec .t2 { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.ranking-rec .score { flex-shrink: 0; font-size: 14px; }
.ranking-rec.empty { border-top: none; color: var(--fg-3); font-size: 13px; }
.rank { width: 32px; height: 32px; border-radius: 4px; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; background: var(--fill); color: var(--fg-2); }
.rank.r1 { background: var(--gold-bg); color: var(--amber); }
.rank.r2 { background: var(--fill); color: var(--fg-2); }
.rank.r3 { background: #fff1e8; color: #c2410c; }
.progress-list { display: grid; gap: 12px; }
.progress-row { display: grid; gap: 6px; animation: progress-in .4s cubic-bezier(.32, .72, 0, 1) both; }
.progress-row:nth-child(1) { animation-delay: .05s; }
.progress-row:nth-child(2) { animation-delay: .1s; }
.progress-row:nth-child(3) { animation-delay: .15s; }
.progress-row:nth-child(4) { animation-delay: .2s; }
@keyframes progress-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.progress-head { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.progress-head strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.progress-bar { height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--blue-fill-h); }
.podium-stage { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; height: 132px; margin-top: 4px; animation: podium-in .5s cubic-bezier(.32, .72, 0, 1) .2s both; }
@keyframes podium-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pod .who { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pod .who img { display: block; }
.pod .sc { font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.pod .bar { width: 100%; border-radius: 4px; display: grid; place-items: center; font-weight: 600; font-size: 14px; border: 1px solid var(--line); }
.pod.g .bar { height: 96px; background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.pod.s .bar { height: 74px; background: var(--fill); color: var(--fg); }
.pod.b .bar { height: 58px; background: #fff; color: var(--fg-2); }
.pod.empty .bar { height: 44px; background: var(--fill); color: var(--fg-3); }
.podium-rest { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.feed { display: grid; gap: 0; }
.feed-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: var(--r); }
.feed-item:hover { background: var(--fill); }
.feed-item .av { width: 28px; height: 28px; border-radius: 4px; background: var(--fill); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--fg-2); }
.feed-item .t1 { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .t1 b { font-weight: 600; }
.feed-item .t2 { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .score { padding: 2px 8px; border-radius: 4px; font-size: 13px; }
.feed-item .score.plus { background: var(--green-bg); } .feed-item .score.minus { background: var(--red-bg); }
.feed-empty { padding: 24px 12px; text-align: center; color: var(--fg-3); font-size: 13px; }
.feed-empty .btn { margin-top: 10px; }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.bento > .card { animation: bento-in .4s cubic-bezier(.32, .72, 0, 1) both; }
.bento > .card:nth-child(1) { animation-delay: .05s; }
.bento > .card:nth-child(2) { animation-delay: .1s; }
.bento > .card:nth-child(3) { animation-delay: .15s; }
.bento > .card:nth-child(4) { animation-delay: .2s; }
.bento > .card:nth-child(5) { animation-delay: .25s; }
@keyframes bento-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.b-hero { grid-column: span 8; padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.bento.no-quick .b-hero { grid-column: span 12; }
.b-hero .b-date { color: var(--fg-3); font-size: 12px; }
.b-hero h2 { font-size: 22px; font-weight: 600; line-height: 1.25; margin: 2px 0; }
.b-hero p { color: var(--fg-2); font-size: 13px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 4px; background: var(--fill); font-size: 12px; color: var(--fg-2); border: 1px solid var(--line); }
.pill b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.b-quick { grid-column: span 4; grid-row: span 2; padding: 0; overflow: hidden; }
.quick-head { background: var(--blue-soft); color: var(--blue); padding: 12px 16px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--blue-line); }
.quick-head svg { width: 16px; height: 16px; }
.quick-head strong { font-size: 14px; font-weight: 600; }
.quick-head > span { margin-left: auto; font-size: 12px; color: var(--fg-3); }
.qdlg .quick-head .q-head-picked { margin-left: 4px; margin-right: auto; }
.quick-slot { padding: 14px; }
.b-stat { grid-column: span 2; }
.bento.no-quick .b-stat { grid-column: span 3; }
.b-podium { grid-column: span 5; }
.b-recent { grid-column: span 7; }

.batch-tools { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.batch-tools .input { max-width: 300px; flex: 1; min-width: 160px; }
.batch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; padding: 8px; border-radius: var(--r); background: var(--fill); }
.batch-list .choice-item { padding: 7px 10px; font-size: 13px; background: #fff; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--fg-2); }
.pager-links { display: flex; gap: 6px; }
.restore-form { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.restore-form .select { flex: 1; min-width: 200px; }
.backup-history { margin-top: 12px; }
.backup-list { margin-top: 8px; display: grid; gap: 6px; max-height: 160px; overflow-y: auto; }
.backup-item { padding: 8px 10px; border-radius: var(--r); background: var(--fill); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; word-break: break-all; animation: backup-in .3s cubic-bezier(.32, .72, 0, 1) both; }
.backup-item:nth-child(1) { animation-delay: .05s; }
.backup-item:nth-child(2) { animation-delay: .1s; }
.backup-item:nth-child(3) { animation-delay: .15s; }
@keyframes backup-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.modal-mask { position: fixed; inset: 0; z-index: 1800; background: rgba(15, 23, 42, .32); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: mask-in .3s cubic-bezier(.32, .72, 0, 1) both; }
@keyframes mask-in { from { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); } to { opacity: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } }
.modal-mask.closing { animation: mask-out .25s cubic-bezier(.32, .72, 0, 1) forwards; }
@keyframes mask-out { from { opacity: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } to { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); } }
.modal { width: min(520px, 100%); max-height: 90dvh; overflow-y: auto; padding: 22px; background: #fff; border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow); animation: modal-in .3s cubic-bezier(.32, .72, 0, 1) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-mask.closing .modal { animation: modal-out .2s cubic-bezier(.32, .72, 0, 1) forwards; }
@keyframes modal-out { to { opacity: 0; transform: translateY(16px) scale(.97); } }
.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.qdlg-mask { position: fixed; inset: 0; z-index: 1500; background: rgba(15, 23, 42, .32); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); opacity: 0; pointer-events: none; transition: opacity .3s cubic-bezier(.32, .72, 0, 1), backdrop-filter .3s cubic-bezier(.32, .72, 0, 1), -webkit-backdrop-filter .3s cubic-bezier(.32, .72, 0, 1); }
.qdlg-mask.open { opacity: 1; pointer-events: auto; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.qdlg-mask.closing { opacity: 0; pointer-events: none; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); transition: opacity .25s cubic-bezier(.32, .72, 0, 1), backdrop-filter .25s cubic-bezier(.32, .72, 0, 1), -webkit-backdrop-filter .25s cubic-bezier(.32, .72, 0, 1); }
.qdlg {
  position: fixed; z-index: 1510; left: 50%; top: var(--panel-top);
  width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - var(--panel-top) - 24px); overflow: hidden auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  transform: translateX(-50%) translateY(16px) scale(.97); opacity: 0; visibility: hidden;
  transition: opacity .25s cubic-bezier(.32, .72, 0, 1), transform .3s cubic-bezier(.32, .72, 0, 1), visibility 0s .3s;
}
.qdlg.open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0) scale(1); transition: opacity .25s cubic-bezier(.32, .72, 0, 1), transform .3s cubic-bezier(.32, .72, 0, 1), visibility 0s; }
.qdlg.closing { opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(16px) scale(.97); transition: opacity .2s cubic-bezier(.32, .72, 0, 1), transform .25s cubic-bezier(.32, .72, 0, 1), visibility 0s .25s; }
.qdlg .quick-slot { padding: 14px 14px 18px; }
.qdlg-close { margin-left: auto; width: 24px; height: 24px; border-radius: 4px; display: grid; place-items: center; color: inherit; }
.qdlg-close:hover { background: var(--fill); }
.qdlg-close svg { width: 12px; height: 12px; }
.sheet-handle-q { display: none; }
.cmdk-mask { position: fixed; inset: 0; z-index: 2500; background: rgba(15, 23, 42, .48); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); display: none; align-items: flex-start; justify-content: center; padding: var(--panel-top) 16px 24px; transition: backdrop-filter .3s cubic-bezier(.32, .72, 0, 1), -webkit-backdrop-filter .3s cubic-bezier(.32, .72, 0, 1); }
.cmdk-mask.open { display: flex; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cmdk-mask.closing { display: flex; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); transition: backdrop-filter .25s cubic-bezier(.32, .72, 0, 1), -webkit-backdrop-filter .25s cubic-bezier(.32, .72, 0, 1); }
.cmdk {
  display: flex;
  flex-direction: column;
  width: 480px;
  max-width: calc(100vw - 32px);
  padding-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: cmdk-in .3s cubic-bezier(.32, .72, 0, 1) both;
}
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk-mask.closing .cmdk { animation: cmdk-out .2s cubic-bezier(.32, .72, 0, 1) forwards; }
@keyframes cmdk-out { to { opacity: 0; transform: translateY(-12px) scale(.98); } }
.cmdk-input { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 48px; border-bottom: 1px solid var(--line); }
.cmdk-input svg { width: 16px; height: 16px; color: var(--fg-3); flex-shrink: 0; }
.cmdk-input input { flex: 1; height: 100%; font-size: 15px; min-width: 0; }
.cmdk-input input::placeholder { color: var(--fg-3); white-space: nowrap; }
.cmdk-input kbd { flex-shrink: 0; }
.cmdk-input input:focus, .cmdk-input input:focus-visible { outline: none; box-shadow: none; }
.cmdk-list {
  max-height: min(360px, 46vh);
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 6px 4px 8px 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.cmdk-list::-webkit-scrollbar { width: 10px; }
.cmdk-list::-webkit-scrollbar-thumb { background: #c9d3e3; border-radius: 6px; border: 2px solid #fff; }
.cmdk-list::-webkit-scrollbar-track { background: transparent; }
.cmdk-group { font-size: 11px; font-weight: 600; color: var(--fg-3); padding: 8px 10px 4px; }
.cmdk-item {
  display: grid;
  grid-template-columns: 20px 7em minmax(0, 1fr) 2.5em;
  align-items: center;
  column-gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.cmdk-ico { display: grid; place-items: center; width: 20px; height: 20px; }
.cmdk-ico svg { width: 14px; height: 14px; color: var(--fg-3); }
.cmdk-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cmdk-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-3); font-size: 12px; }
.cmdk-act { text-align: right; font-size: 12px; color: var(--fg-3); }
.cmdk-item.hl { background: var(--blue-soft); color: var(--fg); }
.cmdk-item.hl .cmdk-ico svg, .cmdk-item.hl .cmdk-sub, .cmdk-item.hl .cmdk-act { color: var(--blue); }
.cmdk-empty { padding: 24px; text-align: center; color: var(--fg-3); font-size: 13px; }

.import-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin: -2px 0 12px; font-size: 12px; color: var(--fg-2);
}
.import-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 108px; padding: 16px;
  border: 1px dashed var(--line); border-radius: var(--r);
  background: var(--fill); cursor: pointer; text-align: center;
  transition: border-color .12s, background .12s;
}
.import-drop:hover, .import-drop.on { border-color: var(--blue); background: var(--blue-soft); }
.import-drop input { display: none; }
.import-drop-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.import-drop-sub { font-size: 12px; color: var(--fg-3); }
.import-drop-name:not(:empty) { font-size: 12px; color: var(--blue); margin-top: 2px; }
.import-preview {
  max-height: min(360px, 46vh); overflow: auto;
  border: 1px solid var(--line); margin-bottom: 10px;
  padding-bottom: 8px;
}
.import-st {
  display: inline-flex; padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; background: var(--fill); color: var(--fg-2);
}
.import-st.ok { background: var(--green-bg); color: var(--green); }
.import-st.new { background: var(--blue-soft); color: var(--blue); }
.import-st.skip { background: var(--amber-bg); color: var(--amber); }
.import-st.err { background: var(--red-bg); color: var(--red); }

.m-topbar, .m-tabbar, .sheet, .sheet-backdrop { display: none; }
.global-footer { padding: 16px 0 12px; text-align: center; font-size: 12px; color: var(--fg-3); }

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .main { padding: 20px 18px 40px; }
  .b-hero, .bento.no-quick .b-hero { grid-column: span 12; }
  .b-quick { grid-column: span 5; grid-row: span 2; }
  .b-stat, .bento .b-stat { grid-column: span 7; }
  .bento.no-quick .b-stat { grid-column: span 6; }
  .b-podium, .b-recent { grid-column: span 12; }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .m-only { display: inline-flex !important; }
  .m-topbar {
    display: flex; align-items: center; gap: 8px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 10px 0;
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    animation: topbar-in .3s cubic-bezier(.32, .72, 0, 1) both;
  }
  @keyframes topbar-in { from { transform: translateY(-100%); } to { transform: none; } }
  .m-logo { width: 24px; height: 24px; border-radius: 5px; flex-shrink: 0; }
  .m-class-btn { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 8px 6px; font-size: 15px; font-weight: 600; color: var(--fg); }
  .m-class-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
  .m-chevron { width: 16px; height: 16px; color: var(--fg-3); flex-shrink: 0; display: inline-flex; }
  .m-chevron svg { width: 100%; height: 100%; }
  .m-icon-btn { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--blue); flex-shrink: 0; }
  .m-icon-btn svg { width: 18px; height: 18px; }
  .m-user-btn { width: 32px; height: 32px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; }
  .m-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
    animation: tabbar-in .3s cubic-bezier(.32, .72, 0, 1) both;
  }
  @keyframes tabbar-in { from { transform: translateY(100%); } to { transform: none; } }
  .m-tabbar.has-fab { grid-template-columns: 1fr 1fr 64px 1fr 1fr; }
  .m-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; color: var(--fg-3); font-size: 10px; font-weight: 500; transition: color .15s, transform .15s; }
  .m-tab:active { transform: scale(.9); }
  .m-tab-icon { width: 20px; height: 20px; display: inline-flex; }
  .m-tab-icon svg { width: 100%; height: 100%; }
  .m-tab.active { color: var(--blue); }
  .fab-wrap { display: grid; place-items: center; position: relative; }
  .fab {
    position: absolute; top: -16px; width: 48px; height: 48px; border-radius: 50%;
    background: var(--blue-fill); color: var(--blue); display: grid; place-items: center;
    box-shadow: 0 0 0 4px #fff, 0 6px 14px rgba(66, 165, 245, .18); transition: transform .2s cubic-bezier(.32, .72, 0, 1), background .15s;
    border: 1px solid var(--blue-line);
    animation: fab-in .4s cubic-bezier(.32, .72, 0, 1) .2s both;
  }
  @keyframes fab-in { from { opacity: 0; transform: scale(.5) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
  .fab:active { transform: scale(.9); }
  .fab svg { width: 22px; height: 22px; }
  .fab-lbl { position: absolute; bottom: 4px; font-size: 10px; font-weight: 600; color: var(--blue); }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .32); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); opacity: 0; pointer-events: none; transition: opacity .3s cubic-bezier(.32, .72, 0, 1), backdrop-filter .3s cubic-bezier(.32, .72, 0, 1), -webkit-backdrop-filter .3s cubic-bezier(.32, .72, 0, 1); }
  .sheet-backdrop.open { opacity: 1; pointer-events: auto; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    background: #fff; border-radius: 12px 12px 0 0;
    padding: 6px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    max-height: 82dvh; overflow-y: auto;
    transform: translateY(110%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .35s cubic-bezier(.32, .72, 0, 1), visibility 0s .35s;
  }
  .sheet.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .35s cubic-bezier(.32, .72, 0, 1), visibility 0s;
  }
  .sheet-handle { width: 32px; height: 4px; border-radius: 2px; background: #ddd; margin: 6px auto 12px; }
  .sheet-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; padding: 0 4px; }
  .sheet-list { display: grid; gap: 2px; }
  .sheet-list form { display: contents; }
  .sheet-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border-radius: 10px; min-height: 44px; font-size: 15px; color: var(--fg); text-align: left; transition: background .12s; }
  .sheet-item:active { background: var(--fill); }
  .sheet-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
  .sheet-item-danger { color: var(--red); }
  .sheet-icon { width: 18px; height: 18px; display: inline-flex; flex-shrink: 0; }
  .sheet-icon svg { width: 100%; height: 100%; }
  .sheet-check { width: 16px; height: 16px; margin-left: auto; color: var(--blue); display: inline-flex; }
  .sheet-check svg { width: 100%; height: 100%; }
  .sheet-account-head { display: flex; align-items: center; gap: 10px; padding: 6px 4px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .sheet-avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 16px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; }
  body.sheet-lock { overflow: hidden; }
  .qdlg { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 90dvh; border-radius: 12px 12px 0 0; border-left: 0; border-right: 0; border-bottom: 0; transform: translateY(105%); opacity: 1; transition: transform .3s cubic-bezier(.32, .72, 0, 1), visibility 0s .3s; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .qdlg.open { transform: none; transition: transform .3s cubic-bezier(.32, .72, 0, 1), visibility 0s; }
  .qdlg .quick-head { margin: 8px 12px 0; border: 1px solid var(--line); border-radius: 6px; }
  .sheet-handle-q { display: block; width: 32px; height: 4px; border-radius: 2px; background: #ddd; margin: 8px auto 0; }
  .qdlg .quick-slot { padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .cmdk-mask { padding: 8vh 12px 16px; }
  .main { padding: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 12px) 12px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px); }
  .top-hero { flex-direction: column; align-items: flex-start; margin-bottom: 14px; }
  .chips { display: none; }
  .bento { gap: 8px; }
  .b-hero, .b-quick, .b-podium, .b-recent, .bento.no-quick .b-hero { grid-column: span 12; }
  .b-stat, .bento.no-quick .b-stat { grid-column: span 6; }
  .b-hero { order: 1; padding: 16px; }
  .b-hero h2 { font-size: 20px; }
  .b-quick { display: none; }
  .b-stat { order: 3; } .b-podium { order: 4; } .b-recent { order: 5; }
  .fields { grid-template-columns: 1fr; }
  .input, .select { height: 44px; font-size: 16px; }
  .textarea { font-size: 16px; }
  .btn { height: 44px; font-size: 15px; }
  .btn-xs { height: 34px; font-size: 13px; }
  .actions .btn, .actions a.btn { flex: 1; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .panel, .table-card, .card { padding: 14px; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 22px; }
  .card-head h3 { font-size: 15px; }
  .pw-toggle { width: 44px; }
  .pw-wrap .input { padding-right: 48px; }
  .stepper, .seg { height: 44px; }
  .qchip { padding: 8px 12px; }
  .kv { grid-template-columns: 88px 1fr; }
  .global-footer { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px); }
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; max-height: 92dvh; border-radius: 12px 12px 0 0; padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px)); animation: sheet-in .28s cubic-bezier(.32, .72, 0, 1) both; }
  @keyframes sheet-in { from { transform: translateY(32%); opacity: .7; } to { transform: none; opacity: 1; } }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .avatar-settings { flex-direction: column; align-items: center; text-align: center; }
  .avatar-actions { align-items: center; }
}
@media (max-width: 640px) {
  .table-responsive { border: none; border-radius: 0; overflow: visible; }
  .table-responsive table { min-width: 0; background: transparent; }
  .table-responsive thead { display: none; }
  .table-responsive tbody { display: grid; gap: 8px; }
  .table-responsive tr { display: block; border-radius: 6px; background: #fff; border: 1px solid var(--line); padding: 4px 0; }
  .table-responsive tbody tr:hover td { background: transparent; }
  .table-responsive td { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border: none; padding: 6px 12px; font-size: 14px; }
  .table-responsive td[data-label]::before { content: attr(data-label); color: var(--fg-3); font-size: 12px; font-weight: 500; flex: 0 0 4.5em; padding-top: 2px; }
  .table-responsive td[data-label="头像"] { justify-content: flex-end; }
  .table-responsive td.td-actions { justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
  .table-responsive td.muted { justify-content: center; }
  .table-responsive td.muted { justify-content: center; }
  .table-responsive td.muted { justify-content: center; }
  .batch-list { grid-template-columns: 1fr; }
  .ranking-score strong { font-size: 16px; }
  .restore-form .select { min-width: 0; width: 100%; }
  .restore-form .btn { width: 100%; }
}
@media (max-width: 380px) {
  .stat .value { font-size: 20px; }
  .m-class-name { max-width: 36vw; }
  .podium-stage { height: 118px; }
}
@media print {
  html, body { height: auto; overflow: visible; }
  body::before, .water-fx { display: none !important; }
  .sidebar, .m-topbar, .m-tabbar, .sheet, .sheet-backdrop, .global-footer, .toast, .modal-mask, .actions, .td-actions, .search-form, .b-quick, .qdlg, .qdlg-mask, .cmdk-mask { display: none !important; }
  .app { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .main { padding: 0; height: auto; overflow: visible; }
  .panel, .table-card, .stat, .card { border: 1px solid #ccc; background: #fff; }
}

/* ===== 启动界面（现代化骨架屏）===== */
.splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  transition: opacity .4s ease, visibility .4s ease;
}
.splash-screen.hidden { opacity: 0; visibility: hidden; }

.splash-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  height: 100%;
  overflow: hidden;
}

/* 侧栏骨架 */
.splash-sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
}
.splash-brand { height: 56px; border-radius: 10px; margin-bottom: 16px; }
.splash-class-switch { height: 44px; border-radius: 8px; margin-bottom: 12px; }
.splash-search { height: 40px; border-radius: 8px; margin-bottom: 16px; }
.splash-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.splash-nav-item { height: 40px; border-radius: 8px; }
.splash-user { height: 56px; border-radius: 10px; margin-top: auto; }

/* 主内容骨架 */
.splash-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.splash-topbar {
  display: flex;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.splash-topbar-left { width: 200px; height: 28px; border-radius: 6px; }
.splash-topbar-right { width: 150px; height: 28px; border-radius: 6px; }

.splash-bento {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  padding: 16px 24px 24px;
  overflow-y: auto;
}
.splash-hero { grid-column: span 8; height: 140px; border-radius: 12px; }
.splash-quick { grid-column: span 4; grid-row: span 2; height: 280px; border-radius: 12px; }
.splash-stats { grid-column: span 12; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 8px; }
.splash-stat { height: 80px; border-radius: 12px; }
.splash-podium { grid-column: span 5; grid-row: span 2; height: 200px; border-radius: 12px; }
.splash-recent { grid-column: span 7; grid-row: span 2; height: 320px; border-radius: 12px; }
.splash-recent-item { height: 72px; border-radius: 8px; margin-bottom: 8px; }

/* 移动端顶栏/底栏骨架 */
.splash-m-topbar {
  display: none;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.splash-m-tabbar {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  height: var(--tabbar-h);
  background: #fff;
  border-top: 1px solid var(--line);
}
.splash-m-tab { height: 100%; border-radius: 0; }
.splash-m-tab.fab { border-radius: 50%; margin-top: -16px; }

/* 骨架屏闪烁动画 */
.splash-screen .splash-brand,
.splash-screen .splash-class-switch,
.splash-screen .splash-search,
.splash-screen .splash-nav-item,
.splash-screen .splash-user,
.splash-screen .splash-topbar-left,
.splash-screen .splash-topbar-right,
.splash-screen .splash-hero,
.splash-screen .splash-quick,
.splash-screen .splash-stat,
.splash-screen .splash-podium,
.splash-screen .splash-recent-item,
.splash-screen .splash-m-tab {
  background: linear-gradient(90deg, var(--fill) 25%, var(--line) 50%, var(--fill) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 移动端显示 */
@media (max-width: 768px) {
  .splash-sidebar { display: none; }
  .splash-layout { grid-template-columns: 1fr; }
  .splash-m-topbar { display: block; }
  .splash-m-tabbar { display: grid; }
  .splash-topbar { display: none; }
}

/* 入场/退出动画 */
.splash-screen { animation: splash-in .5s cubic-bezier(.32, .72, 0, 1) both; }
@keyframes splash-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.splash-screen.hidden { animation: splash-out .3s ease both; }
@keyframes splash-out {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}
.splash-spinner {
  width: 40px; height: 40px; margin: 0 auto 16px;
  border: 3px solid var(--blue-fill);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.splash-text { color: var(--fg-3); font-size: 14px; }

/* ===== SPA 导航 Loading ===== */
.spa-loading {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000;
  background: linear-gradient(90deg, var(--blue), var(--blue-h));
  transform-origin: left;
  animation: spa-load 1.2s ease-in-out infinite;
}
@keyframes spa-load {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(1); }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* 主内容进入动画 */
.main { animation: main-in .35s cubic-bezier(.32, .72, 0, 1) both; }
@keyframes main-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 骨架屏组件 ===== */
.skeleton-container { position: relative; }
.skeleton { background: linear-gradient(90deg, var(--fill) 25%, var(--line) 50%, var(--fill) 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; border-radius: inherit; }
.skeleton-container .skeleton { min-height: 100%; }
.pod .skeleton { height: 100%; }
.stat .skeleton { font-size: 26px; font-weight: 600; height: 1.1em; }
.b-stat .skeleton { height: 140px; }
.b-podium .skeleton { height: 132px; }
.b-recent .skeleton { height: 72px; margin-bottom: 8px; }
.batch-skeleton { height: 44px; border-radius: 8px; margin-bottom: 8px; }
.member-skeleton { height: 56px; border-radius: 8px; margin-bottom: 6px; }
.ranking-skeleton { height: 72px; border-radius: 10px; margin-bottom: 6px; }
.table-skeleton { height: 56px; }
.feed-skeleton { height: 64px; border-radius: 8px; margin-bottom: 8px; }
.podium-skeleton { height: 132px; border-radius: 12px; }
.rank .skeleton { width: 32px; height: 32px; border-radius: 50%; }
.avatar-sm.skeleton { width: 32px; height: 32px; border-radius: 50%; }
.avatar-xs.skeleton { width: 28px; height: 28px; border-radius: 50%; }

/* shimmer 动画 */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== 登录页滑动验证码（外置弹窗，内嵌 RaCaptcha iframe） ===== */
.captcha-loading {
  padding: 14px 12px;
  text-align: center;
  color: var(--muted, #7a90a8);
  font-size: 13px;
  background: rgba(255, 255, 255, .6);
  border: 1px dashed var(--line, #e4ecf7);
  border-radius: 14px;
}
.captcha-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #e1584b;
}
.captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: center;
  padding: 16px;
}
.captcha-modal[hidden] { display: none; }
.captcha-dialog {
  width: min(96vw, 560px);
  max-height: 92vh;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .25);
  display: flex;
  flex-direction: column;
}
.captcha-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line, #e4ecf7);
  font-size: 15px;
  color: #1f2d3d;
  flex: none;
}
.captcha-dialog-body {
  flex: none;
  height: 560px;
  max-height: 76vh;
  position: relative;
  background: #f1f1f3;
}
.captcha-dialog-body .captcha-loading { margin: 20px 16px; }
.captcha-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.captcha-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5a6a7e;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.captcha-close:hover { background: rgba(15, 23, 42, .06); }
body.captcha-lock { overflow: hidden; }

/* ===== 班级课程表 ===== */
.tt-grid { overflow-x: auto; }
.tt-header { display: grid; grid-template-columns: 90px repeat(7, 1fr); gap: 1px; min-width: 640px; }
.tt-corner { background: transparent; }
.tt-day-header { text-align: center; padding: 10px 4px; font-weight: 600; font-size: 13px; color: var(--fg-2); background: var(--fill); border-radius: var(--r) var(--r) 0 0; }
.tt-row { display: grid; grid-template-columns: 90px repeat(7, 1fr); gap: 1px; min-width: 640px; }
.tt-period-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px; background: var(--fill); font-size: 12px; gap: 2px; position: relative; }
.tt-period-name { font-weight: 600; color: var(--fg); }
.tt-period-time { color: var(--fg-3); font-size: 11px; }
/* 删除节次按钮常显：以前只在鼠标悬停那一行时出现，手机没有悬停，管理员根本删不掉节次 */
.tt-period-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 4px; background: transparent; color: var(--fg-3); font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: .45; transition: opacity .15s, background .15s, color .15s; }
.tt-row:hover .tt-period-del, .tt-period-del:focus-visible { opacity: 1; }
.tt-period-del:hover { background: var(--red-bg); color: var(--red); opacity: 1; }
.tt-cell { min-height: 52px; padding: 6px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; transition: background .15s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tt-cell:hover { background: var(--fill); }
.tt-cell.filled { cursor: pointer; }
.tt-subject { font-size: 13px; font-weight: 600; line-height: 1.3; }
.tt-detail { font-size: 11px; color: var(--fg-3); }
.tt-mobile { display: none; }
.tt-mobile-tabs { display: flex; gap: 6px; padding: 12px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tt-mobile-tab { flex: none; padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--fg-2); cursor: pointer; white-space: nowrap; }
.tt-mobile-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.tt-mobile-list { padding: 0 16px 16px; }
.tt-mobile-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.tt-mobile-item:last-child { border-bottom: 0; }
.tt-mobile-time { min-width: 70px; text-align: center; font-size: 13px; color: var(--fg-2); line-height: 1.4; }
.tt-mobile-time small { color: var(--fg-3); }
.tt-mobile-content { flex: 1; font-size: 14px; padding-left: 10px; }
.tt-mobile-content strong { font-size: 15px; }
@media (max-width: 768px) {
  .tt-grid { display: none; }
  .tt-mobile { display: block; }
}

/* ===== 量化细则 ===== */
.rules-list { padding: 0; }
.rules-category { margin-bottom: 16px; }
.rules-category-title { font-size: 13px; font-weight: 600; color: var(--fg-2); padding: 8px 0; border-bottom: 1px solid var(--line-2); margin-bottom: 8px; }
.rules-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.rules-item:last-child { border-bottom: 0; }
.rules-score { min-width: 48px; height: 28px; border-radius: var(--pill); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.rules-score.plus { background: var(--green-bg); color: var(--green); }
.rules-score.minus { background: var(--red-bg); color: var(--red); }
.rules-info { flex: 1; min-width: 0; }
.rules-name { font-size: 14px; font-weight: 600; color: var(--fg); }
.rules-desc { font-size: 12px; color: var(--fg-3); margin-top: 2px; line-height: 1.4; }
.rules-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== AI 小助手 ===== */
.ai-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.ai-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 0; scroll-behavior: smooth; }
.ai-msg-list { width: min(860px, calc(100% - 40px)); margin: 0 auto; }
.ai-msg { display: flex; gap: 12px; margin-bottom: 24px; align-items: flex-start; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; flex-shrink: 0; }
.ai-msg.user .ai-msg-avatar { background: var(--card); border: 1px solid var(--line); padding: 2px; }
.ai-msg-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.ai-msg-bubble { max-width: 85%; }
.ai-msg.user .ai-msg-bubble { background: linear-gradient(180deg, #f4f8f8, #eef4f4); border: 1px solid var(--line); padding: 10px 14px; border-radius: 16px 16px 6px 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.ai-msg.assistant .ai-msg-bubble { font-size: 14px; line-height: 1.7; color: var(--fg); }
.ai-msg.assistant .ai-msg-bubble p { margin: 0 0 8px; }
.ai-msg.assistant .ai-msg-bubble p:last-child { margin-bottom: 0; }
.ai-msg.assistant .ai-msg-bubble h1, .ai-msg.assistant .ai-msg-bubble h2, .ai-msg.assistant .ai-msg-bubble h3 { margin: 16px 0 8px; font-weight: 700; }
.ai-msg.assistant .ai-msg-bubble h1 { font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ai-msg.assistant .ai-msg-bubble h2 { font-size: 17px; }
.ai-msg.assistant .ai-msg-bubble h3 { font-size: 15px; }
.ai-msg.assistant .ai-msg-bubble code { background: var(--fill); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 13px; color: var(--blue); }
.ai-msg.assistant .ai-msg-bubble pre { background: #182528; color: #e0e8e6; border-radius: 12px; padding: 14px; overflow-x: auto; margin: 10px 0; font-size: 13px; line-height: 1.5; }
.ai-msg.assistant .ai-msg-bubble pre code { background: none; color: inherit; padding: 0; }
.ai-msg.assistant .ai-msg-bubble table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; display: block; overflow-x: auto; }
.ai-msg.assistant .ai-msg-bubble th, .ai-msg.assistant .ai-msg-bubble td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.ai-msg.assistant .ai-msg-bubble th { background: var(--fill); font-weight: 600; }
.ai-msg.assistant .ai-msg-bubble blockquote { border-left: 3px solid var(--blue); margin: 8px 0; color: var(--fg-2); background: var(--fill); padding: 8px 12px; border-radius: 0 var(--r) var(--r) 0; font-size: 13.5px; }
.ai-msg.assistant .ai-msg-bubble hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.ai-msg.assistant .ai-msg-bubble ol { padding-left: 24px; margin: 8px 0; }
.ai-msg.assistant .ai-msg-bubble ul, .ai-msg.assistant .ai-msg-bubble ol { padding-left: 20px; margin: 8px 0; }
.ai-msg.assistant .ai-msg-bubble li { margin-bottom: 4px; }
.ai-msg.assistant .ai-msg-bubble a { color: var(--blue); text-decoration: underline; }
.ai-action-card { background: var(--fill); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 10px; }
.ai-action-header { font-size: 13px; font-weight: 600; color: var(--fg); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ai-action-body { font-size: 13px; color: var(--fg-2); margin-bottom: 10px; }
.ai-action-actions { display: flex; gap: 8px; }
.ai-typing { display: flex; gap: 4px; padding: 8px 0; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); animation: aiDot 1.2s infinite; }
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.ai-composer { border-top: 1px solid var(--line); padding: 16px; background: var(--card); }
.ai-input-wrap { display: flex; gap: 10px; align-items: flex-end; max-width: 860px; margin: 0 auto; }
.ai-input { flex: 1; min-height: 44px; max-height: 160px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--card); font-size: 14px; line-height: 1.5; resize: none; outline: none; font-family: var(--font); transition: border-color .2s, box-shadow .2s; }
.ai-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(66, 165, 245, .12); }
.ai-send-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .2s, transform .1s; }
.ai-send-btn:hover { background: var(--blue-h); }
.ai-send-btn:active { transform: scale(.95); }
.ai-send-btn:disabled { opacity: .4; cursor: not-allowed; }
.ai-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--fg-3); }
.ai-empty h2 { font-size: 22px; color: var(--fg-2); margin-bottom: 8px; }
.ai-empty p { font-size: 14px; }
.ai-file-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--fg-2); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-file-btn:hover { background: var(--fill); }

/* ---- AI 工具栏 / 模型选择 / 图片 / 提问卡片 ---- */
.ai-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--card); flex-wrap: wrap; }
.ai-toolbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.ai-toolbar-title { font-weight: 700; font-size: 15px; white-space: nowrap; }
.ai-model-select { max-width: 260px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg); font-size: 13px; font-family: var(--mono); outline: none; cursor: pointer; }
.ai-model-select:focus { border-color: var(--blue); }
.ai-newchat-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--blue); border-radius: 10px; background: var(--card); color: var(--blue); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s; }
.ai-newchat-btn:hover { background: rgba(66, 165, 245, .1); }
.ai-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-session-select { max-width: 240px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg); font-size: 12.5px; outline: none; cursor: pointer; }
.ai-session-select:focus { border-color: var(--blue); }
.ai-session-select:disabled { opacity: .55; cursor: not-allowed; }
.ai-del-session-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-del-session-btn:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.ai-del-session-btn:disabled { opacity: .4; cursor: not-allowed; }
.ai-stream-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-2); cursor: pointer; user-select: none; white-space: nowrap; }
.ai-stream-toggle input { accent-color: var(--blue); cursor: pointer; }
.ai-attach-preview { display: flex; align-items: center; gap: 10px; max-width: 860px; margin: 0 auto 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--fill); }
.ai-attach-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.ai-attach-remove { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--fill-2, #eee); color: var(--fg-2); font-size: 11px; cursor: pointer; flex-shrink: 0; }
.ai-attach-remove:hover { background: var(--red); color: #fff; }
.ai-attach-name { font-size: 12px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-file-icon { font-size: 22px; line-height: 44px; text-align: center; width: 44px; height: 44px; flex-shrink: 0; }
.ai-user-image { max-width: 260px; max-height: 200px; border-radius: 10px; display: block; margin-bottom: 6px; border: 1px solid var(--line); }
.ai-msg.user .ai-msg-bubble .ai-user-text { white-space: pre-wrap; }
.ai-tool-status { font-size: 12.5px; color: var(--fg-2); background: var(--fill); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.ai-question-card { background: var(--fill); border: 1px solid var(--blue); border-radius: var(--r); padding: 14px; margin-top: 10px; }
.ai-question-header { font-size: 13px; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.ai-question-context { font-size: 12.5px; color: var(--fg-3); margin-bottom: 6px; }
.ai-question-text { font-size: 14px; color: var(--fg); margin-bottom: 10px; line-height: 1.6; }
.ai-question-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ai-question-hint { font-size: 11.5px; }
.ai-usage { font-size: 11px; color: var(--fg-3); margin-top: 8px; font-family: var(--mono); }
.ai-attach-previews { display: none; flex-wrap: wrap; gap: 8px; max-width: 860px; margin: 0 auto 10px; }
.ai-attach-previews .ai-attach-preview { margin: 0; }

/* ===== AI 小助手 v2：左侧会话栏 + 固定外框（只有消息区和会话列表可滚动） ===== */
.ai-section { height: calc(100dvh - 76px); min-height: 440px; overflow: hidden; }
.ai-panel { height: 100%; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ai-shell { flex: 1 1 auto; display: flex; align-items: stretch; min-width: 0; min-height: 0; overflow: hidden; }
.ai-sessions { width: 236px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--fill-2, var(--fill)); min-height: 0; }
.ai-sessions-head { padding: 12px; border-bottom: 1px solid var(--line); }
.ai-sessions-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; }
.ai-sessions-empty { font-size: 12.5px; color: var(--fg-3); text-align: center; padding: 24px 8px; }
.ai-session-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer; margin-bottom: 2px; }
.ai-session-item:hover { background: var(--fill); }
.ai-session-item.active { background: var(--blue-fill, rgba(66, 165, 245, .14)); }
.ai-session-info { flex: 1 1 auto; min-width: 0; }
.ai-session-title { font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-session-meta { font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.ai-session-del { width: 24px; height: 24px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-3); cursor: pointer; display: none; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-session-item:hover .ai-session-del { display: inline-flex; }
.ai-session-del:hover { color: var(--red); background: rgba(229, 57, 53, .1); }
.ai-session-del svg { width: 13px; height: 13px; }
.ai-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ai-shell .ai-toolbar { flex-shrink: 0; position: relative; z-index: 20; }
.ai-shell .ai-messages { flex: 1 1 0; min-height: 0; }
.ai-shell .ai-composer { position: relative; z-index: 30; flex-shrink: 0; padding: 14px 16px 10px; }
.ai-shell svg { flex-shrink: 0; }
.ai-toolbar-brand { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; background: var(--blue); color: #fff; flex-shrink: 0; }
.ai-toolbar-brand svg { width: 16px; height: 16px; }
.ai-ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; }
.ai-newchat-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.ai-newchat-btn:hover { background: var(--blue-h); }
.ai-newchat-btn svg { width: 14px; height: 14px; }
.ai-msg-avatar svg { width: 17px; height: 17px; }
.ai-tool-status svg { width: 13px; height: 13px; vertical-align: -2px; }
.ai-tool-status.fail { color: var(--red); }
.ai-action-header svg, .ai-question-header svg { width: 14px; height: 14px; vertical-align: -2px; }
.ai-empty-logo { display: inline-flex; width: 52px; height: 52px; border-radius: 16px; background: var(--blue); color: #fff; align-items: center; justify-content: center; margin-bottom: 12px; }
.ai-empty-logo svg { width: 26px; height: 26px; }
.ai-file-btn svg { width: 19px; height: 19px; }
.ai-send-btn svg { width: 18px; height: 18px; }
.ai-attach-remove svg { width: 11px; height: 11px; }
.ai-file-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--fill); border-radius: 8px; color: var(--blue); }
.ai-file-icon svg { width: 20px; height: 20px; }
.ai-composer-hint { text-align: center; font-size: 11px; color: var(--fg-3); margin: 6px 0 0; }
@media (max-width: 900px) {
  .ai-sessions { display: none; }
  .ai-session-select { display: inline-block !important; max-width: 190px; }
}
.ai-session-select { display: none; }

/* ===== 快速记分对话框：关闭态强制失效（防御 .q-pane.on 残留形成的隐形点击拦截层） ===== */
.qdlg:not(.open):not(.closing),
.qdlg:not(.open):not(.closing) * {
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ==========================================================================
   考勤（点名册）
   行 = 一次点名（日期+节次），列 = 学生，格子 = 迟到/旷课/请假；空格子 = 正常。
   ========================================================================== */
.att-addbar { align-items: flex-end; }
.att-addbar .att-addbar-btn { display: flex; align-items: flex-end; }
.att-legend {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
  margin: 10px 0 14px;
}
.att-legend-items { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.att-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 2px 10px; border-radius: var(--pill);
  font-size: 12px; line-height: 1.7; border: 1px solid transparent;
}
.att-chip-late { color: var(--amber); background: var(--amber-bg); border-color: var(--amber); }
.att-chip-absent { color: var(--red); background: var(--red-bg); border-color: var(--red); }
.att-chip-leave { color: var(--blue-h); background: var(--blue-soft); border-color: var(--blue-line); }
.att-chip-none { color: var(--fg-3); background: var(--fill); border-color: var(--line); }

.att-scroll { overflow-x: auto; padding-bottom: 4px; }
.att-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 520px; }
.att-table th, .att-table td { padding: 0; border-bottom: 1px solid var(--line-2); }
.att-corner {
  position: sticky; left: 0; z-index: 2; background: var(--card);
  padding: 10px 12px !important; text-align: left; font-size: 12px; color: var(--fg-2);
  border-right: 1px solid var(--line);
}
.att-month-nav { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--fg); }
.att-month-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  color: var(--fg-2); text-decoration: none; line-height: 1;
}
.att-month-btn:hover { background: var(--fill); color: var(--fg); }
.att-stu {
  padding: 10px 8px !important; font-size: 12px; font-weight: 600; color: var(--fg-2);
  text-align: center; min-width: 56px; max-width: 84px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.att-stu-no { display: block; font-weight: 400; font-size: 10px; color: var(--fg-3); }
.att-rowhead {
  position: sticky; left: 0; z-index: 1; background: var(--card);
  padding: 6px 10px !important; text-align: left; font-weight: 600;
  border-right: 1px solid var(--line); white-space: nowrap;
}
.att-date { display: block; font-size: 13px; color: var(--fg); }
.att-period { display: block; font-size: 11px; color: var(--fg-3); font-weight: 400; }
.att-row-del {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  border: none; background: none; cursor: pointer; color: var(--fg-3);
  font-size: 14px; line-height: 1; padding: 0 2px;
}
.att-row-del:hover { color: var(--red); }
.att-cell {
  display: block; width: 100%; min-height: 34px;
  border: 1px solid transparent; background: none; cursor: pointer;
  font-size: 13px; color: var(--fg-3); border-radius: 6px;
}
.att-cell:hover { background: var(--fill); border-color: var(--line); }
.att-cell-late { color: var(--amber); background: var(--amber-bg); border-color: var(--amber); font-weight: 600; }
.att-cell-absent { color: var(--red); background: var(--red-bg); border-color: var(--red); font-weight: 600; }
.att-cell-leave { color: var(--blue-h); background: var(--blue-soft); border-color: var(--blue-line); font-weight: 600; }

.att-menu { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.att-menu-btn {
  padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--card); color: var(--fg); cursor: pointer; text-align: left; font-size: 14px;
}
.att-menu-btn:hover:not(:disabled) { background: var(--fill); }
.att-menu-btn:disabled { opacity: .5; cursor: not-allowed; }
.att-menu-late:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }
.att-menu-absent:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.att-menu-leave:hover:not(:disabled) { border-color: var(--blue-line); color: var(--blue-h); }
.att-menu-clear:hover:not(:disabled) { border-color: var(--fg-3); }
.att-bind-row { align-items: center; }
.att-bind-label { align-self: flex-start; }
