:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --sidebar: #101c2c;
  --sidebar-hover: #1b2c44;
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --text: #1a2332;
  --muted: #6b7686;
  --border: #e6e9ef;
  --green: #16a34a;
  --orange: #ea7b12;
  --red: #dc2626;
  --shadow: 0 1px 3px rgba(16, 28, 44, 0.06), 0 4px 16px rgba(16, 28, 44, 0.07);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.55;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ---- 登录 ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% 10%, #123a6b 0%, #0d2237 45%, #0a1626 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 40px 36px; width: 400px; max-width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,0.35); }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.logo { width: 48px; height: 48px; border-radius: 13px; background: linear-gradient(135deg, #0d6efd, #4aa8ff); color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.login-card h1 { font-size: 20px; font-weight: 700; }
.login-card p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.login-card form label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.login-card input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.12); }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
.btn-primary { width: 100%; margin-top: 8px; padding: 12px; background: linear-gradient(135deg, #0d6efd, #2f8bfd); color: #fff; font-size: 15px; font-weight: 600; border-radius: 9px; }
.btn-primary:hover { filter: brightness(1.05); }
.login-tip { margin-top: 18px; text-align: center; color: #9aa6b5; font-size: 12px; }

/* ---- 应用布局 ---- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 216px; background: var(--sidebar); color: #d8e0ee; display: flex; flex-direction: column; flex: none; }
.brand-side { padding: 18px 18px 14px; margin-bottom: 0; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt strong { color: #fff; font-size: 16px; }
.brand-txt span { color: #8fa0b8; font-size: 12px; }
.nav { flex: 1; padding: 8px 10px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 9px; color: #b9c5d6; text-decoration: none; font-size: 14px; margin-bottom: 3px; transition: all .15s; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: linear-gradient(135deg, #0d6efd, #2f8bfd); color: #fff; font-weight: 600; }
.nav .ico { width: 18px; text-align: center; font-size: 16px; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid #223247; }
.user-info { display: flex; flex-direction: column; margin-bottom: 10px; }
.user-info .name { color: #fff; font-weight: 600; font-size: 14px; }
.user-info .role { color: #8fa0b8; font-size: 12px; }
.btn-ghost { width: 100%; padding: 8px; background: transparent; color: #b9c5d6; border: 1px solid #33455f; border-radius: 8px; font-size: 13px; }
.btn-ghost:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-foot .btn-ghost + .btn-ghost { margin-top: 8px; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 58px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex: none; }
.page-title { font-size: 17px; font-weight: 700; }
.today-date { color: var(--muted); font-size: 13px; }
.content { flex: 1; overflow: auto; padding: 22px 24px; }

/* ---- 模块化：子功能切换器（topbar 与 content 之间） ---- */
.subnav {
  flex: none; display: flex; gap: 2px; background: #fff;
  border-bottom: 1px solid var(--border); padding: 0 16px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav button {
  flex: none; padding: 11px 14px; font-size: 13.5px; color: var(--muted);
  background: none; border: none; border-bottom: 2px solid transparent; white-space: nowrap;
}
.subnav button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 桌面端侧边栏子项 */
.nav a.nav-sub {
  padding: 8px 13px 8px 26px; font-size: 13px; margin: 1px 0 1px 10px;
  border-left: 2px solid #24354f; border-radius: 0 8px 8px 0;
}
.nav a.nav-sub .ico.dot { width: auto; font-size: 12px; color: #5a6b85; }
.nav a.nav-sub.active { background: linear-gradient(135deg, #0d6efd, #2f8bfd); border-left-color: transparent; color: #fff; }

/* 占位页（规划中功能） */
.ph-card { text-align: center; padding: 52px 20px; }
.ph-ico { font-size: 46px; margin-bottom: 12px; }
.ph-card h3 { font-size: 17px; margin-bottom: 6px; }
.ph-card p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.ph-card .btn { width: auto; padding: 10px 28px; }

/* ---- 卡片与通用 ---- */
.grid { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h2 .tag { font-size: 12px; font-weight: 500; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.kpi .value.money::before { content: "¥"; font-size: 15px; margin-right: 2px; font-weight: 600; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.accent-blue { color: var(--primary); }
.accent-green { color: var(--green); }
.accent-orange { color: var(--orange); }
.accent-red { color: var(--red); }

/* ---- 课表 ---- */
.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-item { display: flex; gap: 14px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; align-items: center; }
.schedule-item .time { flex: none; width: 74px; text-align: center; }
.schedule-item .time .t { font-size: 17px; font-weight: 700; color: var(--primary); }
.schedule-item .time .d { font-size: 11px; color: var(--muted); }
.schedule-item .body { flex: 1; min-width: 0; }
.schedule-item .title { font-weight: 600; font-size: 15px; }
.schedule-item .meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: #eef3ff; color: var(--primary); }
.chip.orange { background: #fff3e6; color: var(--orange); }
.chip.green { background: #e9f9ef; color: var(--green); }
.chip.gray { background: #f0f2f5; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---- 导航卡片 ---- */
.nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.nav-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; box-shadow: var(--shadow); transition: all .15s; }
.nav-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,28,44,0.12); border-color: #c9d9f5; }
.nav-card .big { font-size: 26px; }
.nav-card .tt { font-weight: 700; margin-top: 10px; }
.nav-card .ds { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---- 表单 ---- */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.10); }
.field textarea { resize: vertical; min-height: 60px; }
.fl { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
.ck-group { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 7px 0; }
.ck { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); cursor: pointer; }
.ck input { accent-color: var(--primary); width: 15px; height: 15px; }
.detail-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
/* ---- 报销凭证附件 ---- */
.ex-upload { display: flex; align-items: center; gap: 8px; }
.ex-file { display: inline-flex; align-items: center; gap: 6px; background: #f0f7ff; border: 1px solid #d6e6fb; border-radius: 8px; padding: 5px 10px; font-size: 12px; max-width: 100%; }
.ex-file-mini { background: #f7f9fc; border-color: var(--border); padding: 2px 8px; font-size: 12px; margin: 0 4px 4px 0; }
.ex-file .link { word-break: break-all; }
.ex-fsize { color: var(--muted); font-size: 11px; white-space: nowrap; }
.ex-del { border: none; background: none; color: var(--red); cursor: pointer; font-size: 12px; padding: 0 2px; }
.btn { padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.btn-primary { background: linear-gradient(135deg, #0d6efd, #2f8bfd); color: #fff; }
.btn-secondary { background: #f0f2f5; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #fdeaec; color: var(--red); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.warn-box { background: #fff7e8; border: 1px solid #f7dfa8; color: #8a5a00; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.warn-box ul { margin: 4px 0 0 18px; }
.edit-banner { background: #eef5ff; border: 1px solid #cfe0ff; color: #1d4ed8; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.edit-banner b { font-size: 14px; }

/* ---- 智能录入 ---- */
.smart-box textarea { width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.smart-box textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.10); }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; padding: 10px 16px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---- 搜索列表 ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.toolbar input { min-width: 220px; }
table.courses { width: 100%; border-collapse: collapse; font-size: 13px; }
table.courses th, table.courses td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.courses th { background: #f7f8fa; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.courses tr:hover td { background: #fafbfc; }
.link { color: var(--primary); cursor: pointer; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: 13px; }

/* ---- 图表 ---- */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart { height: 300px; }
@media (max-width: 640px) {
  .sidebar { width: 64px; }
  .brand-txt, .nav a span, .sidebar-foot .user-info, .sidebar-foot .btn-ghost { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .nav-cards { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .chart-row { grid-template-columns: 1fr; }
}

/* ---- toast ---- */
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #1a2332; color: #fff; padding: 11px 20px; border-radius: 9px; font-size: 13px; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

/* ---- 课表可点击 ---- */
.schedule-item.clickable { cursor: pointer; transition: all .15s; }
.schedule-item.clickable:hover { border-color: #c9d9f5; box-shadow: 0 4px 14px rgba(16,28,44,0.08); transform: translateY(-1px); }
.home-tabs .tag { margin-left: 4px; }

/* ---- 今周课表 ---- */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: start; }
.week-col { min-width: 0; }
.week-day { font-weight: 700; font-size: 14px; margin-bottom: 8px; display: flex; flex-direction: column; }
.week-date { font-size: 11px; font-weight: 400; color: var(--muted); }
.week-col.today .week-day { color: var(--primary); }
.week-col .schedule-item { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 12px; margin-bottom: 8px; }
.week-col .schedule-item .time { width: auto; text-align: left; display: flex; align-items: baseline; gap: 8px; }
.week-col .schedule-item .time .t { font-size: 14px; }
.week-col .schedule-item .meta { flex-direction: column; gap: 2px; }
.week-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 8px 0; }
@media (max-width: 1000px) {
  .week-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 资金管理 ---- */
.fin-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.fin-tabs { margin-bottom: 0; border-bottom: none; }
.fin-tabs button { padding: 6px 14px; font-size: 13px; border-bottom: none; border-radius: 8px; }
.fin-tabs button.active { background: var(--primary); color: #fff; font-weight: 600; }
.fin-nav { display: flex; align-items: center; gap: 8px; }
.fin-period { font-weight: 700; font-size: 15px; min-width: 118px; text-align: center; color: var(--text); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child, .tbl .tl { text-align: left; }
.tbl thead th { color: var(--muted); font-weight: 600; font-size: 12px; background: #f8fafc; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl .neg { color: var(--red); font-weight: 600; }
.tbl .more { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0; }
.aging-total { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.aging-total b { color: var(--red); font-size: 16px; }
.fin-reconcile { font-size: 13px; line-height: 1.7; margin-bottom: 14px; background: #eef4ff; border: 1px solid #cddcfc; border-radius: 8px; padding: 10px 14px; color: #3a4a66; }
.fin-reconcile b { font-weight: 700; }
.flow-pos { color: var(--green); font-weight: 700; }
.flow-neg { color: var(--red); font-weight: 700; }

/* ---- 资金流水登记向导（基于课程） ---- */
.flow-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.flow-tabs button { padding: 7px 14px; border-radius: 8px; background: #f0f2f5; color: var(--text); font-size: 13px; }
.flow-tabs button.active { background: var(--primary); color: #fff; }
.flow-search { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.flow-search input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.flow-search input:focus { border-color: var(--primary); }
.hint { color: var(--muted); font-size: 12px; }
.flow-results { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; background: #fafbfc; }
.flow-pick { display: flex; align-items: stretch; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fff; transition: background .15s; cursor: pointer; }
.flow-pick:last-child { border-bottom: none; }
.flow-pick:hover { background: #f7f9fc; }
.flow-pick.added { background: #eff6ff; border-left: 3px solid var(--primary); padding-left: 11px; }
.flow-pick.added:hover { background: #e6f0ff; }
.fp-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; justify-content: center; }
.fp-code { display: inline-block; background: linear-gradient(135deg, #eef5ff, #e0edff); color: #1d4ed8; border: 1px solid #cfe0ff; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .3px; width: fit-content; }
.fp-title { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.4; }
.fp-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.fp-meta span { white-space: nowrap; }
.fp-right { flex: none; display: flex; align-items: center; gap: 14px; }
.fp-amounts { display: flex; flex-direction: column; gap: 3px; text-align: right; min-width: 110px; }
.fp-amt-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 1.4; }
.fp-amt-label { color: var(--muted); }
.fp-amt-val { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.fp-amt-val.fp-got { color: var(--green); }
.fp-bal-row .fp-amt-label { font-weight: 600; color: var(--text); }
.fp-bal-row .fp-amt-val { font-weight: 700; font-size: 13px; }
.fp-bal-neg { color: var(--red) !important; }
.fp-bal-ok { color: var(--green) !important; }
.btn-ghost-success { background: #e8f5ee; color: #15803d; border: 1px solid #bbf0d0; }
.btn-ghost-success:hover { background: #d7f0e2; }
.flow-group { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.flow-group select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 240px; font-size: 13px; }
.flow-check-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.flow-amt, .flow-amt-sel { width: 108px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.flow-amt:focus, .flow-amt-sel:focus { outline: none; border-color: var(--primary); }
.flow-in-sel td { background: #f0f7ff; }
.aging-sel td { background: #f0f7ff; }
.aging-row { cursor: pointer; }
.fin-recv-pick { color: var(--muted); font-size: 13px; margin-right: 10px; }
.fin-recv-pick b { color: var(--primary); }
.code-cell { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }
.flow-sel-title { font-weight: 700; font-size: 14px; margin: 16px 0 8px; color: var(--text); }
.flow-info { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.flow-info input, .flow-info select { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; box-sizing: border-box; outline: none; }
.flow-info input:focus { border-color: var(--primary); }
.flow-total { margin-right: auto; font-size: 14px; color: var(--text); }
.flow-total b { color: var(--primary); font-size: 17px; }
.btn-link { background: none; color: var(--primary); font-size: 13px; padding: 0 2px; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

/* ---- 课程详情 · 资金流水区块 ---- */
.detail-flows-head { font-weight: 700; font-size: 14px; margin: 18px 0 10px; }
.detail-flow-block { margin-bottom: 14px; }
.detail-flow-block b { color: var(--text); }
.detail-flow-block > span { color: var(--muted); font-size: 12px; margin-left: 8px; }
.fin-note { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.8; background: #f8fafc; border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; }

/* ---- 弹窗 ---- */
.modal-mask { position: fixed; inset: 0; background: rgba(10, 22, 38, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 720px; max-width: 100%; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,0.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; font-size: 18px; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: #f0f2f5; color: var(--text); }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.modal-foot .btn { min-width: 88px; }

/* 课程编辑弹窗 */
.ce-modal-body { min-width: 720px; max-width: 860px; max-height: 72vh; }
.modal-head h3 .ce-code {
  display: inline-block; background: linear-gradient(135deg, #eef5ff, #e0edff);
  color: #1d4ed8; border: 1px solid #cfe0ff; border-radius: 6px;
  padding: 2px 10px; font-size: 12px; font-weight: 700; margin-left: 6px;
  vertical-align: 1px; letter-spacing: .3px;
}

/* ---- 详情 ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.detail-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.detail-row.full { grid-column: 1 / -1; }
.detail-row .k { flex: none; width: 96px; color: var(--muted); font-size: 13px; }
.detail-row .v { flex: 1; font-size: 13px; word-break: break-word; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }

/* ---- topbar 右侧（移动端用户菜单容器） ---- */
.topbar-right { display: flex; align-items: center; gap: 12px; }
#mobile-user { display: none; }
#mobile-nav { display: none; }

/* ================= 移动端适配（≤768px） ================= */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .app { height: 100dvh; }
  .topbar { height: 52px; padding: 0 14px; }
  .page-title { font-size: 15px; }
  .today-date { font-size: 12px; }
  .content { padding: 14px 14px 78px; }

  /* 底部固定导航 */
  #mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    display: flex; background: #fff; border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 16px rgba(16, 28, 44, 0.08);
  }
  #mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 2px 6px; font-size: 10.5px; color: var(--muted); text-decoration: none;
    min-height: 52px; justify-content: center;
  }
  #mobile-nav a .ico { font-size: 19px; line-height: 1; }
  #mobile-nav a.active { color: var(--primary); font-weight: 700; }

  /* 移动端用户菜单 */
  #mobile-user { display: block; position: relative; }
  #mobile-user .mu-btn {
    width: 34px; height: 34px; border-radius: 50%; background: #f0f2f5;
    display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--text);
  }
  #mobile-user .mu-btn:active { background: #e2e6ec; }
  #mobile-user .mu-menu {
    position: fixed; right: 12px; top: 56px; width: 168px; background: #fff;
    border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgba(16, 28, 44, 0.18);
    overflow: hidden; z-index: 950;
  }
  #mobile-user .mu-menu button { display: block; width: 100%; text-align: left; padding: 13px 14px; font-size: 13.5px; background: #fff; color: var(--text); }
  #mobile-user .mu-menu button + button { border-top: 1px solid var(--border); }
  #mobile-user .mu-menu button:active { background: #f5f7fa; }
  #mobile-user .mu-menu .mu-name { font-size: 13px; font-weight: 700; color: var(--text); background: #f7f8fa; }
  #mobile-user .mu-menu .mu-role { font-size: 11px; color: var(--muted); font-weight: 400; }

  /* 登录 */
  .login-wrap { padding: 16px; }
  .login-card { padding: 28px 22px; border-radius: 14px; }

  /* 单列化 */
  .form-grid { grid-template-columns: 1fr; }
  .flow-info { grid-template-columns: 1fr; gap: 8px 12px; }
  .week-grid { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .chart { height: 220px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .value { font-size: 20px; }

  /* 表格横向滚动 */
  table.courses { display: block; overflow-x: auto; white-space: nowrap; }
  .tbl th, .tbl td { padding: 7px 9px; font-size: 12px; }

  /* 模态框：底部抽屉式全屏 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-width: 100%; height: 92vh; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-head { padding: 14px 16px; }
  .modal-head h3 { font-size: 15px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: #fff; }

  /* 工具栏 */
  .toolbar { gap: 8px; }
  .toolbar input { min-width: 0; flex: 1; }
  .toolbar input, .toolbar select { font-size: 14px; padding: 10px 12px; }
  .fin-toolbar { gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
  .fin-period { min-width: 92px; font-size: 14px; }
  .fin-nav .btn { padding: 7px 12px; }

  /* tabs 横向滚动 */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs button { flex: none; padding: 10px 12px; font-size: 13px; }

  /* 子功能切换器 */
  .subnav { padding: 0 6px; }
  .subnav button { padding: 10px 12px; font-size: 13px; min-height: 40px; }

  /* 课表 */
  .schedule-item { padding: 12px; gap: 10px; }
  .schedule-item .time { width: 62px; }
  .schedule-item .title { font-size: 14px; }

  /* 隐藏首页快捷卡（底部导航已覆盖全部入口） */
  .nav-cards { display: none; }

  /* 流水登记向导 */
  .flow-results { max-height: 36vh; }
  .flow-pick { padding: 7px 10px; gap: 8px; }
  .flow-search { flex-wrap: wrap; }
  .flow-search input { font-size: 14px; }
  .flow-group select { min-width: 0; flex: 1; }
  .flow-amt, .flow-amt-sel { width: 88px; }

  /* toast 横贯 */
  .toast { top: 12px; left: 12px; right: 12px; transform: none; text-align: center; }

  /* 详情 */
  .detail-row .k { width: 84px; }

  /* 触控目标 */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .tabs button { min-height: 38px; }
  .flow-tabs button { min-height: 34px; }
}