/* ============================================================
   启明实验学校 · 教务管理后台
   设计基线：深墨蓝侧栏 / 米白内容 / 暖金强调
   ============================================================ */

:root {
  --ink: #132238;
  --ink-2: #1d304a;
  --ink-3: #2b405c;
  --sidebar: #0d1b2c;
  --sidebar-2: #122742;
  --gold: #c99a4b;
  --gold-2: #b3843a;
  --gold-soft: #f6ecd9;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e5eaf1;
  --line-2: #eef1f6;
  --text: #182436;
  --muted: #6b7b8e;
  --muted-2: #94a1b1;
  --green: #1f8a70;
  --green-soft: #e3f3ee;
  --amber: #b97d18;
  --amber-soft: #fbf1dc;
  --red: #bf483e;
  --red-soft: #fbeae8;
  --blue: #2f6fd0;
  --blue-soft: #e8f0fc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 35, 55, .04), 0 10px 28px -22px rgba(20, 35, 55, .35);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", system-ui, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.icon { flex: 0 0 auto; vertical-align: -3px; }
::selection { background: var(--gold-soft); }

/* ---------------------------------------------------------- 登录 */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.login-brand {
  position: relative; overflow: hidden; padding: 64px 68px;
  color: #f5efe3; display: flex; flex-direction: column; justify-content: space-between;
  background:
    linear-gradient(140deg, rgba(9, 21, 36, .94) 0%, rgba(13, 35, 58, .82) 55%, rgba(20, 48, 74, .78) 100%),
    url("https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=majestic%20modern%20chinese%20school%20campus%20at%20dusk%2C%20warm%20windows%20light%2C%20tall%20trees%2C%20architectural%20photography%2C%20elegant%20and%20calm&image_size=landscape_16_9") center/cover no-repeat;
}
.login-brand::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .5; pointer-events: none;
}
.login-brand > * { position: relative; z-index: 1; }
.brand-mark { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #d8ad63, #b3843a); color: #16263c;
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  box-shadow: 0 8px 24px -10px rgba(201, 154, 75, .8);
}
.brand-text strong { display: block; font-family: var(--serif); font-size: 20px; letter-spacing: .08em; }
.brand-text span { font-size: 11px; letter-spacing: .22em; opacity: .62; text-transform: uppercase; }
.login-brand h1 {
  font-family: var(--serif); font-size: clamp(32px, 3.4vw, 48px); line-height: 1.32;
  font-weight: 600; letter-spacing: .04em; margin: 0 0 22px; max-width: 16em;
}
.login-brand h1 em { font-style: normal; color: #e4bb79; }
.login-brand p { max-width: 34em; color: rgba(245, 239, 227, .68); font-size: 14.5px; line-height: 1.9; }
.login-facts { display: flex; gap: 34px; margin-top: 40px; }
.login-facts b { display: block; font-family: var(--serif); font-size: 26px; color: #f1d8ae; font-weight: 600; }
.login-facts span { font-size: 12px; color: rgba(245, 239, 227, .55); letter-spacing: .06em; }
.login-foot { font-size: 12px; color: rgba(245, 239, 227, .38); letter-spacing: .08em; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: #fbfaf7; }
.login-form-wrap { width: 100%; max-width: 380px; }
.login-form-wrap > .eyebrow { font-size: 11px; letter-spacing: .22em; color: var(--gold-2); text-transform: uppercase; margin-bottom: 14px; }
.login-form-wrap h2 { font-family: var(--serif); font-size: 28px; letter-spacing: .04em; margin-bottom: 8px; }
.login-form-wrap .login-desc { color: var(--muted); font-size: 13px; margin-bottom: 30px; }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; letter-spacing: .04em; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  outline: none; transition: border-color .18s, box-shadow .18s;
}
textarea.input { height: auto; padding: 10px 13px; resize: vertical; min-height: 92px; line-height: 1.7; }
.input:hover { border-color: #cfd8e3; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 154, 75, .16); }
.input::placeholder { color: var(--muted-2); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.input-icon .input { padding-left: 39px; }
.login-submit { width: 100%; margin-top: 6px; }
.login-error { min-height: 20px; color: var(--red); font-size: 12.5px; margin: -4px 0 8px; }
.demo-block { margin-top: 30px; padding-top: 22px; border-top: 1px dashed var(--line); }
.demo-block > span { display: block; font-size: 12px; color: var(--muted-2); margin-bottom: 10px; }
.demo-accounts { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-account {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px;
  font-size: 12px; color: var(--muted); cursor: pointer; transition: all .16s;
}
.demo-account:hover { border-color: var(--gold); color: var(--ink); background: var(--gold-soft); }
.login-help { margin-top: 18px; font-size: 11.5px; color: var(--muted-2); line-height: 1.8; }

/* ---------------------------------------------------------- 框架 */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 250px; flex: 0 0 250px; background: linear-gradient(180deg, var(--sidebar) 0%, #0b1727 100%);
  color: #c3cedd; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 40;
}
.sidebar-head { padding: 22px 22px 18px; display: flex; align-items: center; gap: 12px; }
.sidebar-head .brand-logo { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }
.sidebar-head strong { display: block; color: #f2ede3; font-family: var(--serif); font-size: 16px; letter-spacing: .06em; }
.sidebar-head span { font-size: 10.5px; color: rgba(195, 206, 221, .45); letter-spacing: .16em; }
.sidebar-term {
  margin: 2px 18px 14px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .06);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: rgba(195, 206, 221, .7);
}
.sidebar-term b { color: #e8d3ae; font-weight: 500; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 20px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.nav-group { margin-top: 16px; }
.nav-group:first-child { margin-top: 2px; }
.nav-group > span {
  display: block; padding: 0 12px 7px; font-size: 10.5px; letter-spacing: .18em;
  color: rgba(195, 206, 221, .38);
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 2px; border-radius: 9px;
  color: rgba(195, 206, 221, .76); font-size: 13.5px; transition: background .16s, color .16s;
}
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-item.active { background: rgba(201, 154, 75, .14); color: #f0d9b1; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 3px; background: var(--gold);
}
.nav-item .icon { color: rgba(195, 206, 221, .55); }
.nav-item.active .icon { color: var(--gold); }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--gold); color: #17263b; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center;
}
.sidebar-foot { padding: 14px 20px 18px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 11px; color: rgba(195, 206, 221, .38); display: flex; justify-content: space-between; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; padding: 0 28px;
  display: flex; align-items: center; gap: 18px;
  background: rgba(243, 245, 249, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 234, 241, .8);
}
.menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted-2); white-space: nowrap; }
.crumbs strong { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.crumbs .sep { opacity: .45; }
.topbar-search { margin-left: auto; width: min(320px, 32vw); }
.topbar-search .input { height: 38px; background: #fff; }
.topbar-action { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  color: var(--muted); cursor: pointer; transition: all .16s; position: relative;
}
.icon-btn:hover { color: var(--ink); border-color: #cfd8e3; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.ghost-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
  padding: 8px 12px; border-radius: 8px; transition: all .16s; white-space: nowrap;
}
.ghost-link:hover { background: #fff; color: var(--ink); }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer;
}
.user-chip:hover { border-color: #cfd8e3; }
.user-chip .avatar { width: 30px; height: 30px; font-size: 13px; }
.user-chip b { font-size: 12.5px; font-weight: 600; }
.user-chip small { display: block; font-size: 10.5px; color: var(--muted-2); line-height: 1.2; }
.user-drop {
  position: absolute; right: 28px; top: 58px; width: 190px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px -20px rgba(20, 35, 55, .4);
  padding: 6px; z-index: 50;
}
.user-drop a, .user-drop button {
  width: 100%; text-align: left; background: none; border: 0; padding: 9px 11px;
  border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer;
  display: flex; align-items: center; gap: 9px;
}
.user-drop a:hover, .user-drop button:hover { background: var(--bg); }
.user-drop .danger { color: var(--red); }
.user-drop hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 4px; }

.content { flex: 1; padding: 26px 30px 48px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page { animation: fade-up .32s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-family: var(--serif); font-size: 26px; letter-spacing: .03em; font-weight: 600; }
.page-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------- 基础组件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent;
  background: #fff; color: var(--text); font-size: 13px; cursor: pointer;
  transition: transform .12s, box-shadow .16s, background .16s, border-color .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); box-shadow: 0 8px 20px -12px rgba(19, 34, 56, .8); }
.btn-gold { background: var(--gold); color: #182436; font-weight: 600; }
.btn-gold:hover { background: #d3a75c; }
.btn-outline { border-color: var(--line); color: var(--muted); }
.btn-outline:hover { border-color: #cfd8e3; color: var(--ink); background: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #f7dbd8; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #eef1f5; color: #758396; }
.badge.gold { background: var(--gold-soft); color: var(--gold-2); }
.badge.plain::before { display: none; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 20px 0;
}
.card-title { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card-body { padding: 16px 20px 20px; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.card.flush .card-body { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }

.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 18px 15px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.kpi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--bg); color: var(--ink-3); }
.kpi-icon.gold { background: var(--gold-soft); color: var(--gold-2); }
.kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-icon.red { background: var(--red-soft); color: var(--red); }
.kpi-value { font-family: var(--serif); font-size: 29px; font-weight: 600; letter-spacing: .01em; margin-top: 10px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value small { font-family: var(--font); font-size: 12px; color: var(--muted-2); font-weight: 400; margin-left: 3px; }
.kpi-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted-2); margin-top: 7px; }
.kpi-meta .up { color: var(--green); }
.kpi-meta .down { color: var(--red); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input, .toolbar select.input { height: 38px; }
.toolbar-search { width: 260px; }
.toolbar .spacer { flex: 1; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  flex: 0 0 auto; white-space: nowrap;
  height: 34px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: .16s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip .chip-count {
  font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums;
}
.filter-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-chip.active .chip-count { color: rgba(255, 255, 255, .68); }

/* ---------------------------------------------------------- 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th {
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted-2);
  letter-spacing: .04em; padding: 11px 14px; background: #fafbfd;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
table.data tbody tr { transition: background .14s; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .actions { display: flex; gap: 2px; justify-content: flex-end; }
table.data th.num { text-align: right; }
.row-link { cursor: pointer; }
.tlink { color: var(--blue); cursor: pointer; }
.tlink:hover { text-decoration: underline; }

.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-main b { font-weight: 600; }
.cell-main small { display: block; font-size: 11px; color: var(--muted-2); line-height: 1.35; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 14px; font-weight: 600;
  background: var(--gold-soft); color: var(--gold-2); font-family: var(--serif);
}
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.avatar.lg { width: 54px; height: 54px; border-radius: 14px; font-size: 21px; }
.avatar.green { background: var(--green-soft); color: var(--green); }
.avatar.blue { background: var(--blue-soft); color: var(--blue); }
.avatar.red { background: var(--red-soft); color: var(--red); }
.avatar.gray { background: #eef1f5; color: #758396; }

.progress { height: 6px; border-radius: 999px; background: #edf0f5; overflow: hidden; min-width: 64px; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.progress.amber > i { background: var(--amber); }
.progress.red > i { background: var(--red); }
.progress.blue > i { background: var(--blue); }
.rate-cell { display: flex; align-items: center; gap: 9px; min-width: 116px; }
.rate-cell span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 38px; text-align: right; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.pagination .muted { font-size: 12px; color: var(--muted-2); }
.pager { display: flex; gap: 4px; }
.pager button {
  min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 12px; cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: #cfd8e3; color: var(--ink); }
.pager button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------------------------------------------------- 图表 */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-empty { height: 180px; display: grid; place-items: center; color: var(--muted-2); font-size: 12.5px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.legend i { width: 8px; height: 8px; border-radius: 3px; }
.bar-list { display: flex; flex-direction: column; gap: 13px; }
.bar-item { display: grid; grid-template-columns: 92px 1fr 48px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-item .label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-item .val { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar-item .track { height: 7px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.bar-item .track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2e8f77, #1f8a70); }
.bar-item.amber .track i { background: linear-gradient(90deg, #d3a75c, #b97d18); }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-center { text-align: center; }
.donut-center b { display: block; font-family: var(--serif); font-size: 25px; font-weight: 600; }
.donut-center span { font-size: 11px; color: var(--muted-2); }
.dist-list { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dist-row b { width: 16px; color: var(--muted); font-weight: 600; }
.dist-row .track { flex: 1; height: 6px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.dist-row .track i { display: block; height: 100%; border-radius: 999px; background: var(--gold); }
.dist-row span { width: 24px; text-align: right; color: var(--muted-2); }

/* ---------------------------------------------------------- 列表 / 时间线 */
.activity { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line-2); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 30px; height: 30px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; }
.activity-body { flex: 1; min-width: 0; }
.activity-body p { font-size: 12.5px; color: var(--text); }
.activity-body p b { font-weight: 600; }
.activity-body small { display: block; font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.schedule { display: flex; flex-direction: column; gap: 8px; }
.schedule-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fcfdff; }
.schedule-time { font-size: 11.5px; color: var(--gold-2); background: var(--gold-soft); border-radius: 7px; padding: 4px 8px; min-width: 46px; text-align: center; }
.schedule-main { flex: 1; min-width: 0; }
.schedule-main b { font-size: 13px; font-weight: 600; }
.schedule-main small { display: block; font-size: 11px; color: var(--muted-2); }
.schedule-class { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.todo-list { display: flex; flex-direction: column; gap: 9px; }
.todo-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: #fcfdff;
}
.todo-item .icon-box { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); flex: 0 0 auto; }
.todo-main { flex: 1; }
.todo-main b { display: block; font-size: 12.5px; font-weight: 600; }
.todo-main small { font-size: 11px; color: var(--muted-2); }
.todo-item .btn { flex: 0 0 auto; }

/* ---------------------------------------------------------- 考勤点名 */
.att-course { margin-bottom: 16px; }
.att-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.att-title { display: flex; align-items: center; gap: 10px; }
.att-title b { font-size: 14.5px; }
.att-meta { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.att-actions { display: flex; gap: 8px; align-items: center; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 8px; padding: 14px 20px 18px; }
.roster-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 9px; background: #fff;
}
.roster-row.dirty { border-color: var(--gold); background: #fffdf8; }
.roster-name { flex: 1; min-width: 0; font-size: 12.5px; }
.roster-name b { display: block; font-weight: 600; }
.roster-name small { font-size: 10.5px; color: var(--muted-2); }
.seg { display: inline-flex; gap: 2px; background: #f1f4f8; border-radius: 7px; padding: 2px; }
.seg button {
  border: 0; background: none; width: 25px; height: 23px; border-radius: 5px;
  font-size: 10.5px; color: var(--muted); cursor: pointer; line-height: 1;
}
.seg button:hover { background: #fff; color: var(--ink); }
.seg button.on[data-v="present"] { background: var(--green); color: #fff; }
.seg button.on[data-v="late"] { background: var(--amber); color: #fff; }
.seg button.on[data-v="leave"] { background: var(--blue); color: #fff; }
.seg button.on[data-v="absent"] { background: var(--red); color: #fff; }
.seg button.on[data-v="none"] { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.att-summary { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 20px 14px; font-size: 11.5px; color: var(--muted); }
.att-summary b { color: var(--ink); }

/* ---------------------------------------------------------- 详情 / 表单 */
.detail-head { display: flex; gap: 16px; align-items: center; padding: 18px 22px; background: linear-gradient(120deg, #fbf8f2, #f7fafd); border-bottom: 1px solid var(--line-2); }
.detail-head h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.detail-head .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.detail-head .badges { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.detail-body { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-box { background: #fafbfd; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; }
.stat-box span { display: block; font-size: 11px; color: var(--muted-2); }
.stat-box b { display: block; font-size: 19px; font-family: var(--serif); font-weight: 600; margin-top: 3px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.section-title h4 { font-size: 13.5px; font-weight: 600; }
.section-title span { font-size: 11.5px; color: var(--muted-2); }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.info-row span { color: var(--muted-2); }
.info-row b { font-weight: 500; text-align: right; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-note { font-size: 11.5px; color: var(--muted-2); margin-top: -8px; margin-bottom: 14px; }
.form-error { color: var(--red); font-size: 12px; margin-bottom: 8px; min-height: 16px; }

/* ---------------------------------------------------------- 弹窗 */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(12, 23, 38, .45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px); animation: fade-in .16s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  box-shadow: 0 30px 80px -30px rgba(10, 20, 35, .55);
  animation: pop .18s ease both; overflow: hidden;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal.wide { max-width: 760px; }
.modal.drawer { max-width: 620px; margin-left: auto; margin-right: 0; height: 100%; max-height: 100%; border-radius: 16px 0 0 16px; }
.modal.xwide { max-width: 980px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-close { border: 0; background: none; color: var(--muted-2); cursor: pointer; padding: 4px; border-radius: 7px; }
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #fcfdff; }
.modal-foot .left { margin-right: auto; }

/* ---------------------------------------------------------- 提示 */
#toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 12.5px; box-shadow: 0 14px 40px -18px rgba(10, 20, 35, .6);
  animation: toast-in .22s ease both;
}
.toast.success .icon { color: #7fd4b8; }
.toast.error { background: #942f28; }
.toast.info { background: var(--ink-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--bg); display: grid; place-items: center; margin: 0 auto 14px; color: var(--muted-2); }
.empty b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; margin-bottom: 5px; }
.empty p { font-size: 12.5px; color: var(--muted-2); margin-bottom: 14px; }
.loading-block { padding: 60px; display: grid; place-items: center; color: var(--muted-2); font-size: 12.5px; }
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fb 50%, #eef1f5 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------- 班级卡片 / 公告 */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.class-card { padding: 20px; }
.class-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.class-card h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.class-card .grade { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.class-stats { display: flex; gap: 22px; margin: 18px 0 14px; }
.class-stats div b { display: block; font-size: 18px; font-family: var(--serif); font-weight: 600; }
.class-stats div span { font-size: 11px; color: var(--muted-2); }
.class-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 13px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--muted); }

.ann-list { display: flex; flex-direction: column; }
.ann-item { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line-2); }
.ann-item:last-child { border-bottom: 0; }
.ann-cover { width: 92px; height: 68px; border-radius: 9px; object-fit: cover; background: var(--bg); flex: 0 0 auto; }
.ann-main { flex: 1; min-width: 0; }
.ann-main h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.ann-main p { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ann-meta { display: flex; align-items: center; gap: 10px; margin-top: 7px; font-size: 11px; color: var(--muted-2); flex-wrap: wrap; }
.ann-actions { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; flex: 0 0 auto; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  border: 0; background: none; padding: 9px 13px; font-size: 13px; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--gold); font-weight: 600; }

/* ---------------------------------------------------------- 权限矩阵 */
.matrix-wrap { overflow-x: auto; }
table.matrix { border-collapse: collapse; min-width: 720px; width: 100%; font-size: 12px; }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--line-2); padding: 9px 12px; text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }
table.matrix thead th { background: #fafbfd; font-weight: 500; color: var(--muted); font-size: 11.5px; }
table.matrix td.yes { color: var(--green); }
table.matrix td.no { color: #d9dfe8; }
.matrix-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11.5px; color: var(--muted-2); }

/* ---------------------------------------------------------- 个人中心 */
.profile-hero {
  display: flex; align-items: center; gap: 20px; padding: 24px;
  background: linear-gradient(120deg, #101f34, #1d3552); color: #f4efe4;
  border-radius: var(--radius); margin-bottom: 18px;
}
.profile-hero .avatar { width: 62px; height: 62px; border-radius: 16px; font-size: 24px; background: rgba(255, 255, 255, .1); color: #f0d9b1; }
.profile-hero h2 { font-family: var(--serif); font-size: 24px; letter-spacing: .03em; }
.profile-hero p { font-size: 12.5px; color: rgba(244, 239, 228, .6); margin-top: 3px; }
.profile-hero .grow { flex: 1; }
.profile-hero .badge { background: rgba(255, 255, 255, .1); color: #f0d9b1; }

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 1280px) {
  .grid-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .24s ease; box-shadow: 0 0 60px rgba(0, 0, 0, .3); }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(10, 20, 35, .4); z-index: 35; }
  body.sidebar-open .sidebar-mask { display: block; }
  .menu-btn { display: inline-grid; }
  .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 22px 20px 40px; }
}
@media (max-width: 860px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-list { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-search { display: none; }
  .crumbs .root { display: none; }
  .user-chip b, .user-chip small { display: none; }
  .user-chip { padding: 4px; }
  .ghost-link { display: none; }
}
@media (max-width: 640px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 18px 14px 36px; }
  .content, .page, .card, .card-body { min-width: 0; max-width: 100%; }
  .page-title { font-size: 22px; }
  .page-head { margin-bottom: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .modal { max-width: 100%; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal.drawer { border-radius: 16px 16px 0 0; margin: 0; }
  .roster { grid-template-columns: 1fr; }
  .class-grid { grid-template-columns: 1fr; }
  .toolbar-search { width: 100%; }
  .toolbar { gap: 8px; }
  .att-head { padding: 14px; }
  .roster { padding: 12px 14px 16px; }
  .detail-body { padding: 16px; }
}

/* ============================================================
   角色权限配置
   ============================================================ */
.perm-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.role-list { display: flex; flex-direction: column; gap: 8px; }
.role-card {
  width: 100%; text-align: left; padding: 14px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; transition: border-color .16s, box-shadow .16s, background .16s;
}
.role-card:hover { border-color: #d3dde9; }
.role-card.active { border-color: var(--ink-3); background: #fbfcfe; box-shadow: 0 0 0 3px rgba(29, 48, 74, .06); }
.role-card .role-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-card b { font-size: 14px; }
.role-card small { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 4px; line-height: 1.5; }
.role-card .badge { transform: scale(.92); transform-origin: right center; }
.perm-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.perm-panel-head h3 { font-family: var(--serif); font-size: 19px; letter-spacing: .03em; }
.perm-panel-head p { color: var(--muted); font-size: 12.5px; margin-top: 5px; max-width: 46em; }
.perm-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
table.perm-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.perm-table th, table.perm-table td { border-bottom: 1px solid var(--line-2); padding: 10px 12px; text-align: center; }
table.perm-table th:first-child, table.perm-table td:first-child { text-align: left; color: var(--text); }
table.perm-table thead th { background: #fafbfd; color: var(--muted); font-weight: 500; font-size: 11.5px; }
table.perm-table td.read { color: var(--green); font-weight: 600; }
table.perm-table td.lock { color: var(--muted-2); font-size: 11px; }
.perm-toggle { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.perm-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.perm-toggle span {
  width: 20px; height: 20px; border-radius: 6px; border: 1px solid #d5dde8; background: #fff;
  display: grid; place-items: center; color: transparent; font-size: 12px; transition: all .14s;
}
.perm-toggle input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.perm-toggle input:disabled + span { background: #f0f3f7; border-color: #e2e8f0; color: #a9b4c2; }
.perm-toggle input:focus-visible + span { box-shadow: 0 0 0 3px rgba(47, 111, 208, .18); }
.perm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.perm-hint { color: var(--muted-2); font-size: 11.5px; line-height: 1.6; }

/* ============================================================
   线索跟进时间线
   ============================================================ */
.lead-steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.lead-step { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted-2); }
.lead-step i {
  display: block; height: 4px; border-radius: 4px; background: #e8ecf3; margin-bottom: 7px;
}
.lead-step.done i { background: var(--green); }
.lead-step.current i { background: var(--gold); }
.lead-step.current { color: var(--gold-2); font-weight: 600; }
.lead-step.done { color: var(--green); }
.timeline { position: relative; padding-left: 20px; margin-top: 6px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -19px; top: 5px; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; border: 2px solid var(--gold);
}
.tl-item .tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.tl-item .tl-head b { font-weight: 600; }
.tl-item .tl-head span { color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.tl-item p { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.6; }
.lead-contact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.lead-contact a {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px;
  background: #f5f7fb; color: var(--ink-3); border: 1px solid var(--line); font-size: 12.5px;
}
.lead-contact a:hover { border-color: var(--ink-3); }

/* ============================================================
   考勤统计
   ============================================================ */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-strip .kpi { padding: 16px 18px; }
.anomaly-list { display: flex; flex-direction: column; }
.anomaly-row { display: grid; grid-template-columns: 1.4fr repeat(3, .7fr) 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.anomaly-row:last-child { border-bottom: 0; }
.anomaly-row .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.anomaly-row .who b { font-weight: 600; }
.anomaly-row .who small { display: block; color: var(--muted-2); font-size: 11px; }
.anomaly-row .cnt { text-align: center; font-variant-numeric: tabular-nums; }
.anomaly-row .cnt b { font-size: 14px; }
.anomaly-row .cnt.risk b { color: var(--red); }
.anomaly-row .cnt.warn b { color: var(--amber); }
.anomaly-row .cnt small { display: block; color: var(--muted-2); font-size: 10.5px; }
.anomaly-row .bar-cell { display: flex; align-items: center; gap: 8px; }
.anomaly-row .bar-cell .progress { flex: 1; }
.weekday-row { display: flex; flex-direction: column; gap: 10px; }
.weekday-item { display: grid; grid-template-columns: 46px 1fr 54px; gap: 10px; align-items: center; font-size: 12.5px; }
.weekday-item .progress { height: 7px; }
.tab-note { color: var(--muted-2); font-size: 11.5px; margin-top: 10px; line-height: 1.6; }
.scope-banner {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 14px;
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--muted);
}
.scope-banner b { color: var(--ink-3); }

@media (max-width: 900px) {
  .perm-layout { grid-template-columns: 1fr; }
  .role-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .role-card { min-width: 190px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .anomaly-row { grid-template-columns: 1.3fr repeat(3, .6fr); }
  .anomaly-row .bar-cell { grid-column: span 4; }
}
@media (max-width: 640px) {
  .lead-steps { flex-wrap: wrap; }
  .lead-step { flex: 1 0 40%; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   通知中心（铃铛弹窗）
   ============================================================ */
.notif-list { display: flex; flex-direction: column; }
.notif-item { padding: 13px 14px; border-radius: 10px; border: 1px solid transparent; transition: background .14s, border-color .14s; }
.notif-item:hover { background: #f7f9fc; }
.notif-item.unread { background: #f5f8fd; border-color: #e3ecf8; }
.notif-item.unread:hover { background: #edf3fc; }
.notif-item + .notif-item { margin-top: 4px; }
.notif-main h4 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.notif-main p { color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.6; }
.notif-main .ann-meta { margin-top: 5px; }

/* ============================================================
   食安溯源：链路详情
   ============================================================ */
.food-thumb { position: relative; width: 86px; height: 60px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); display: block; }
.food-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.food-thumb button { position: absolute; top: 2px; right: 2px; width: 17px; height: 17px; border: 0; border-radius: 50%; background: rgba(15, 22, 33, .66); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }

.trace-sheet { font-size: 13px; }
.trace-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.trace-facts > div { display: flex; gap: 10px; padding: 9px 12px; background: #fff; font-size: 12.5px; }
.trace-facts span { color: var(--muted-2); flex: 0 0 82px; }
.trace-facts b { font-weight: 600; color: var(--text); }

.trace-flow { display: flex; align-items: flex-start; margin: 8px 0 18px; }
.trace-node { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 54px; }
.trace-node .dot { width: 27px; height: 27px; border-radius: 50%; background: #eef1f6; color: var(--muted-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.trace-node.done .dot { background: var(--green-soft); color: var(--green); border-color: #bfe3d8; }
.trace-node.current .dot { background: var(--gold); color: #fff; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 154, 75, .16); }
.trace-node .label { font-size: 11.5px; color: var(--muted); }
.trace-node.current .label { color: var(--gold-2); font-weight: 600; }
.trace-bar { flex: 1 1 auto; height: 2px; background: var(--line); margin-top: 14px; min-width: 12px; }

.trace-section-title { font-size: 12.5px; font-weight: 600; color: var(--text); margin: 4px 0 10px; display: flex; align-items: center; gap: 8px; }
.trace-timeline { list-style: none; margin: 0 0 18px; padding: 0 0 0 6px; }
.trace-step { position: relative; padding: 0 0 16px 24px; border-left: 1px solid var(--line); }
.trace-step:last-child { border-left-color: transparent; padding-bottom: 2px; }
.trace-step .marker { position: absolute; left: -11px; top: 0; width: 21px; height: 21px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.trace-step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trace-step-head b { font-size: 13px; }
.trace-step-body p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.trace-step-meta { margin-top: 5px; font-size: 11.5px; color: var(--muted-2); }
.trace-shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.trace-shots img { width: 104px; height: 70px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }

.trace-advance { border-top: 1px dashed var(--line); padding-top: 14px; }

@media (max-width: 860px) {
  .trace-facts { grid-template-columns: 1fr; }
  .trace-node { min-width: 44px; }
  .trace-node .label { font-size: 10.5px; }
}

/* ============================================================
   小屏适配（≤480px）：表格已由 .table-wrap 横滚，这里处理布局堆叠
   ============================================================ */
@media (max-width: 480px) {
  body { overflow-x: hidden; }
  .grid-kpi { grid-template-columns: 1fr 1fr; }
  .crumbs .sep, #crumb { font-size: 12px; }
  .filter-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-chip { white-space: nowrap; }
  .toolbar { flex-wrap: wrap; }
  .ann-item { flex-direction: column; }
  .ann-cover { width: 100%; height: 150px; }
  .ann-actions { flex-wrap: wrap; }
  .ann-actions .btn { flex: 1 0 30%; justify-content: center; }
  .modal-body { padding: 18px 16px; }
  .notif-main h4 { font-size: 13px; }
  .user-drop { right: 10px; }
  table.perm-table th, table.perm-table td { padding: 8px 6px; font-size: 11.5px; }
  .page-head .btn { width: 100%; }
}
