/* 班务大屏 2.0 · 通用设计系统（Fluent 风格浅色主题） */
:root {
  --bg: #eef2f9;
  --bg-grad-1: #e8effc;
  --bg-grad-2: #f6f8fd;
  --card: #ffffff;
  --card-2: #f7f9fe;
  --line: #e3e9f3;
  --line-2: #d3dced;
  --ink: #101c30;
  --ink-2: #46586f;
  --ink-3: #7c8da4;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #e8f0ff;
  --ok: #059669;
  --ok-soft: #e6f7f0;
  --warn: #c2760a;
  --warn-soft: #fff4e3;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 30, 54, .05), 0 8px 24px -12px rgba(16, 30, 54, .16);
  --shadow-lg: 0 24px 60px -20px rgba(16, 30, 54, .28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
.hidden { display: none !important; }

/* ---------- 布局 ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 18px 16px 90px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title { font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.card-sub { font-size: 12.5px; color: var(--ink-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: #fff; color: var(--ink);
  font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--card-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-danger { background: var(--danger-soft); border-color: #f6c9c9; color: var(--danger); }
.btn-danger:hover { background: #fbe0e0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; color: #fff;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.input::placeholder, .textarea::placeholder { color: #a8b5c6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237c8da4' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.help { font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }
.counter { font-size: 12px; color: var(--ink-3); text-align: right; }
.counter.over { color: var(--danger); font-weight: 700; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: #cfd8e6; position: relative; transition: background .18s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* 复选 / 单选 */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff;
  font-size: 13.5px; cursor: pointer; user-select: none;
}
.chip input { display: none; }
.chip.on, .chip input:checked ~ span { color: var(--brand); border-color: var(--brand); }
.chip:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }

/* ---------- 徽标 ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-info { background: var(--brand-soft); color: var(--brand); }
.pill-muted { background: #eef2f8; color: var(--ink-3); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.bad { background: var(--danger); }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 4px; background: #e6ecf7; padding: 4px; border-radius: 12px; overflow-x: auto; }
.tab { flex: 1; min-width: 84px; height: 36px; border: none; background: transparent; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(16,30,54,.12); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- 空状态 ---------- */
.empty { padding: 36px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }
.empty-icon { font-size: 30px; margin-bottom: 8px; opacity: .7; }

/* ---------- toast ---------- */
.bw-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: #101c30; color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; max-width: min(90vw, 420px);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 9999; box-shadow: var(--shadow-lg); text-align: center;
}
.bw-toast.show { opacity: 1; transform: translate(-50%, 0); }
.bw-toast.ok { background: #0d7f5f; }
.bw-toast.err { background: #b91c1c; }

/* ---------- 对话框 ---------- */
.bw-mask {
  position: fixed; inset: 0; background: rgba(10, 20, 36, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 9000; backdrop-filter: blur(3px);
}
.bw-dialog {
  width: min(440px, 100%); background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 20px; animation: pop .16s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.bw-dialog-title { font-size: 16.5px; font-weight: 800; margin-bottom: 10px; }
.bw-dialog-body { font-size: 14px; color: var(--ink-2); line-height: 1.65; }
.bw-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.bw-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.bw-input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c8d3e3; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 640px) {
  .page { padding: 12px 12px 88px; }
  .card { padding: 14px; border-radius: 12px; }
}
