/* =============================================================
   教研室材料管理系统 · 界面设计系统 (app.css)
   加载顺序：bootstrap.min.css → app.css
   ============================================================= */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --brand-50:  #eef4ff;
  --brand-100: #dde8ff;
  --brand-200: #c2d6ff;
  --brand-300: #98b8ff;
  --brand-400: #6d95fb;
  --brand-500: #3f72f5;
  --brand-600: #2f5ce0;
  --brand-700: #2549b8;
  --brand-800: #1f3c93;

  --ink-900: #0e1729;
  --ink-800: #1c2a44;
  --ink-700: #33415c;
  --ink-600: #4b5a76;
  --ink-500: #64748b;
  --ink-400: #8b98ad;
  --ink-300: #b3bdcd;

  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #e5eaf3;
  --border-strong: #d6ddec;

  --green-600: #16a34a; --green-100: #dcfce7; --green-700: #15803d;
  --amber-600: #d97706; --amber-100: #fef3c7; --amber-700: #b45309;
  --red-600:   #dc2626; --red-100:   #fee2e2; --red-700:   #b91c1c;
  --blue-600:  #0284c7; --blue-100:  #e0f2fe; --blue-700:  #0369a1;
  --violet-600:#7c3aed; --violet-100:#ede9fe;
  --slate-100: #f1f5f9;

  --sidebar-bg: #0f1c33;
  --sidebar-bg-2: #122340;
  --sidebar-text: #a9b7d0;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, .07);
  --sidebar-active: rgba(94, 140, 255, .18);
  --sidebar-w: 268px;
  --topbar-h: 66px;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 13px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(14, 23, 41, .05);
  --shadow-sm: 0 1px 3px rgba(14, 23, 41, .06), 0 4px 16px -12px rgba(14, 23, 41, .22);
  --shadow-md: 0 2px 6px rgba(14, 23, 41, .05), 0 16px 32px -20px rgba(14, 23, 41, .35);
  --shadow-lg: 0 24px 48px -24px rgba(14, 23, 41, .42);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --focus-ring: 0 0 0 3px rgba(63, 114, 245, .22);
}

/* ---------- 2. 基础 ---------- */
* { -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body.app-body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

h1, h2, h3, h4, h5, h6 { color: var(--ink-900); font-weight: 600; }

::selection { background: var(--brand-100); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }

.icon {
  width: 18px; height: 18px;
  flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.18em;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

.text-sub { color: var(--ink-500); }
.text-ink { color: var(--ink-900); }
.text-strong { font-weight: 600; }

/* ---------- 3. 应用框架 ---------- */
.app-shell { min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(178deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  z-index: 1045;
  transition: transform .22s ease;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-mark {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f7df8 0%, #7c5cf4 100%);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(79, 125, 248, .9);
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-text { min-width: 0; }
.brand-name {
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub { font-size: 11.5px; color: #7f8fae; letter-spacing: .06em; }

.sidebar__scroll { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.sidebar__scroll::-webkit-scrollbar { width: 6px; }
.sidebar__scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }

.nav-section { margin-top: 14px; }
.nav-section:first-child { margin-top: 0; }
.nav-section__label {
  padding: 0 12px 8px;
  font-size: 11px; letter-spacing: .14em;
  color: #66779a; text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 500;
  transition: background .14s ease, color .14s ease;
}
.nav-item .icon { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { background: var(--sidebar-hover); color: #e6ecf9; }
.nav-item.is-active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}
.nav-item.is-active::before {
  content: "";
  position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #6d95fb, #7c5cf4);
}
.nav-item.is-active .icon { opacity: 1; }
.nav-item__count {
  margin-left: auto;
  min-width: 22px; padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .12);
  color: #dbe4f6;
  font-size: 11.5px; font-weight: 600; text-align: center;
}
.nav-item.is-active .nav-item__count { background: rgba(255,255,255,.2); color: #fff; }

.sidebar__foot {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex; align-items: center; gap: 11px;
}
.sidebar__foot .avatar { background: rgba(255,255,255,.12); color: #e8eefb; }
.sidebar__foot-name { color: #e8eefb; font-size: 13px; font-weight: 600; line-height: 1.3; }
.sidebar__foot-role { color: #7386a8; font-size: 11.5px; }

/* 主区域 */
.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: 16px;
  min-height: var(--topbar-h);
  padding: 10px 28px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.6) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__burger {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-700);
}
.topbar__title { min-width: 0; flex: 1; }
.topbar__title h1 {
  margin: 0;
  font-size: 18px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.breadcrumbs {
  display: flex; align-items: center; gap: 6px;
  margin-top: 1px;
  font-size: 12px; color: var(--ink-400);
}
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs a:hover { color: var(--brand-600); }
.breadcrumbs .sep { color: var(--ink-300); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar__user { position: relative; }

/* 内容区 */
.content { flex: 1; width: 100%; max-width: 1460px; margin: 0 auto; padding: 26px 28px 56px; }

/* ---------- 4. 头像与用户菜单 ---------- */
.avatar {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-100); color: var(--brand-700);
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase;
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px 5px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  transition: background .14s ease, border-color .14s ease;
}
.user-chip:hover { background: var(--surface-2); border-color: var(--border); }
.user-chip__name { font-size: 13px; font-weight: 600; color: var(--ink-800); line-height: 1.2; }
.user-chip__role { font-size: 11.5px; color: var(--ink-400); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 1200;
}
.menu.is-open { display: block; animation: menu-in .14s ease; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu__item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0; border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-700); font-size: 13.5px; text-align: left;
}
.menu__item:hover { background: var(--surface-2); color: var(--ink-900); }
.menu__item.is-danger { color: var(--red-600); }
.menu__item.is-danger:hover { background: var(--red-100); }
.menu__divider { height: 1px; margin: 6px 4px; background: var(--border); }
.menu__head { padding: 9px 11px 7px; }
.menu__head-name { font-weight: 600; color: var(--ink-900); }
.menu__head-sub { font-size: 12px; color: var(--ink-400); }

/* ---------- 5. 按钮 ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-color: var(--ink-700);
  --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 13.5px; font-weight: 600; line-height: 1.45;
  color: var(--btn-color);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { color: var(--btn-color); border-color: var(--ink-300); background: var(--surface-2); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible { box-shadow: var(--focus-ring); }

.btn-primary {
  --btn-bg: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  --btn-color: #fff; --btn-border: transparent;
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  box-shadow: 0 1px 2px rgba(37, 73, 184, .28), 0 10px 18px -12px rgba(37, 73, 184, .8);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--brand-600), var(--brand-700)); color: #fff; }
.btn-outline-primary { --btn-color: var(--brand-600); --btn-border: var(--brand-200); background: #fff; }
.btn-outline-primary:hover { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-300); }
.btn-success { --btn-color: #fff; --btn-border: transparent; background: linear-gradient(180deg, #22b357, var(--green-600)); }
.btn-success:hover { background: linear-gradient(180deg, var(--green-600), var(--green-700)); color: #fff; }
.btn-danger { --btn-color: #fff; --btn-border: transparent; background: linear-gradient(180deg, #e64545, var(--red-600)); }
.btn-danger:hover { background: linear-gradient(180deg, var(--red-600), var(--red-700)); color: #fff; }
.btn-outline-danger { --btn-color: var(--red-600); --btn-border: #f3c6c6; background: #fff; }
.btn-outline-danger:hover { background: var(--red-100); color: var(--red-700); border-color: #eeb4b4; }
.btn-outline-secondary { --btn-color: var(--ink-600); --btn-border: var(--border-strong); background: #fff; }
.btn-outline-secondary:hover { background: var(--surface-2); color: var(--ink-800); }
.btn-secondary { --btn-color: var(--ink-700); --btn-border: var(--border-strong); background: var(--surface-2); }
.btn-ghost { --btn-border: transparent; box-shadow: none; background: transparent; color: var(--ink-600); }
.btn-ghost:hover { background: var(--slate-100); color: var(--ink-900); border-color: transparent; }
.btn-light { --btn-color: var(--ink-700); background: var(--slate-100); --btn-border: transparent; }
.btn-light:hover { background: #e6ebf3; color: var(--ink-900); }

.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--radius-xs); gap: 5px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { padding: 11px 20px; font-size: 14.5px; border-radius: var(--radius); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-block { width: 100%; }

/* ---------- 6. 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 15px; font-weight: 600; color: var(--ink-900);
}
.card-header .sub { font-size: 12.5px; font-weight: 400; color: var(--ink-400); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.p-4 { padding: 24px; }
.card-footer {
  padding: 14px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card-title-sm { font-size: 14px; font-weight: 600; color: var(--ink-900); }

.section-title {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 14px;
  font-size: 15px; font-weight: 600; color: var(--ink-900);
}
.section-title .icon { color: var(--brand-500); width: 17px; height: 17px; }

.panel-soft { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

/* 栅格辅助 */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-top { align-items: start; }
.col-span-2 { grid-column: 1 / -1; }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* ---------- 7. 统计卡片 ---------- */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-card__icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
}
.stat-card__icon .icon { width: 20px; height: 20px; }
.stat-card__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--ink-900); line-height: 1.15; }
.stat-card__label { font-size: 12.5px; color: var(--ink-500); margin-top: 3px; }
.stat-card__hint { font-size: 11.5px; color: var(--ink-400); margin-top: 6px; }

.tint-brand { background: var(--brand-100); color: var(--brand-600); }
.tint-green { background: var(--green-100); color: var(--green-600); }
.tint-amber { background: var(--amber-100); color: var(--amber-600); }
.tint-red   { background: var(--red-100);   color: var(--red-600); }
.tint-blue  { background: var(--blue-100);  color: var(--blue-600); }
.tint-violet{ background: var(--violet-100);color: var(--violet-600); }

.value-green { color: var(--green-600); }
.value-amber { color: var(--amber-600); }
.value-red { color: var(--red-600); }
.value-brand { color: var(--brand-600); }

/* ---------- 8. 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card > .table-wrap:first-child { border-radius: var(--radius-lg); }

.table {
  width: 100%;
  margin: 0;
  border-collapse: separate; border-spacing: 0;
  font-size: 13.5px;
  color: var(--ink-800);
  --bs-table-bg: transparent;
}
.table thead th {
  padding: 11px 16px;
  background: var(--surface-2);
  border-top: 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; letter-spacing: .03em;
  color: var(--ink-500);
  text-transform: none;
  white-space: nowrap;
  text-align: left;
  vertical-align: middle;
}
.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #f7f9fe; }
.table .cell-main { font-weight: 600; color: var(--ink-900); }
.table .cell-sub { font-size: 12px; color: var(--ink-400); margin-top: 1px; }
.table .num { font-variant-numeric: tabular-nums; }
.table .row-actions { display: flex; justify-content: flex-end; gap: 6px; opacity: .55; transition: opacity .12s ease; }
.table tbody tr:hover .row-actions { opacity: 1; }

/* 绩效考核规则核对：固定列宽并压缩表单控件，保证 12 列在桌面端完整可见 */
.performance-rule-form { table-layout: fixed; min-width: 1060px; font-size: 12.5px; }
.performance-rule-form .form-control,
.performance-rule-form .form-select { padding: 6px 8px; font-size: 12px; }
.performance-rule-form .form-select { padding-right: 24px; background-position: right 7px center; }
.performance-rule-form textarea.form-control { min-height: 48px; }
.performance-rule-form input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.performance-rule-form input[type="number"]::-webkit-outer-spin-button,
.performance-rule-form input[type="number"]::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }

/* 安卓安装包分发 */
.app-release-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f7f9ff 0%, var(--surface) 58%, #f5f1ff 100%);
  box-shadow: var(--shadow-sm);
}
.app-release-hero__icon {
  width: 62px; height: 62px; display: grid; place-items: center;
  border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--brand-500), #7c5cf0);
  box-shadow: 0 14px 30px -16px rgba(63, 114, 245, .72);
}
.app-release-hero__icon .icon { width: 28px; height: 28px; }
.app-release-kicker { color: var(--brand-600); font-size: 10.5px; font-weight: 800; letter-spacing: .14em; }
.app-release-hero h2 { margin: 5px 0 7px; color: var(--ink-900); font-size: clamp(20px, 3vw, 27px); font-weight: 750; }
.app-release-hero p { margin: 0 0 8px; color: var(--ink-500); font-size: 13px; line-height: 1.75; }
.app-release-meta { display: flex; flex-wrap: wrap; gap: 5px 16px; color: var(--ink-400); font-size: 12px; }
.app-release-hero__actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 238px; }
.app-release-hero__actions .btn { justify-content: center; }
.app-release-url { display: flex; flex-direction: column; gap: 5px; }
.app-release-url span { color: var(--ink-400); font-size: 11.5px; }
.app-release-url .form-control { font-size: 11.5px; color: var(--ink-500); background: rgba(255, 255, 255, .72); }
.table-sm thead th { padding: 9px 14px; }
.table-sm tbody td { padding: 9px 14px; }

.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- 9. 徽章与状态 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-soft { background: var(--slate-100); color: var(--ink-600); }
.badge-brand { background: var(--brand-100); color: var(--brand-700); }
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-amber { background: var(--amber-100); color: var(--amber-700); }
.badge-red   { background: var(--red-100);   color: var(--red-700); }
.badge-blue  { background: var(--blue-100);  color: var(--blue-700); }
.badge-violet{ background: var(--violet-100);color: var(--violet-600); }
.badge-outline { background: #fff; border: 1px solid var(--border-strong); color: var(--ink-600); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  background: var(--slate-100);
  color: var(--ink-600);
  font-size: 12.5px;
}
.chip .icon { width: 13px; height: 13px; color: var(--ink-400); }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 10. 表单 ---------- */
.form-label, label.form-label {
  margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-700);
}
.form-control, .form-select {
  display: block; width: 100%;
  padding: 8.5px 12px;
  font-family: inherit; font-size: 13.5px; line-height: 1.5;
  color: var(--ink-900);
  background-color: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.form-control::placeholder { color: var(--ink-300); }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-400);
  box-shadow: var(--focus-ring);
  outline: none;
}
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 13px 10px;
  padding-right: 34px;
  appearance: none;
}
.form-control-sm, .form-select-sm { padding: 6px 10px; font-size: 12.5px; border-radius: var(--radius-xs); }
textarea.form-control { min-height: 88px; }
.form-text { margin-top: 5px; font-size: 12px; color: var(--ink-400); }
.field-error { margin-top: 5px; font-size: 12.5px; color: var(--red-600); display: flex; align-items: center; gap: 5px; }
.form-check-input {
  width: 16px; height: 16px; margin-top: .2em;
  border: 1.5px solid var(--ink-300);
  border-radius: 5px;
  box-shadow: none;
}
.form-check-input:checked { background-color: var(--brand-500); border-color: var(--brand-500); }
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input:focus { box-shadow: var(--focus-ring); border-color: var(--brand-400); }
.form-check-label { font-size: 13.5px; color: var(--ink-700); }

/* 多选标签（适用范围等） */
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-grid__item label {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 0; padding: 6px 12px 6px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 13.5px; color: var(--ink-700);
  cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.check-grid__item label:hover { border-color: var(--brand-300, #a9c4ff); }
.check-grid__item label:has(input:checked) {
  border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-700); font-weight: 600;
}
.check-grid__item input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--brand-500); }

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.field { margin-bottom: 16px; }

/* 筛选条 */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 160px; }
.filter-bar .filter-grow { flex: 1; min-width: 200px; }
.filter-bar .form-control.filter-grow { width: 100%; }
.search-field { position: relative; }
.search-field .icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-400); width: 15px; height: 15px; pointer-events: none;
}
.search-field .form-control { padding-left: 34px; }

/* ---------- 11. 提醒 / 提示 ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 13.5px;
}
.alert .icon { margin-top: 2px; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--green-700); }
.alert-danger, .alert-error { background: #fef2f2; border-color: #fecaca; color: var(--red-700); }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: var(--amber-700); }
.alert-info { background: #f0f9ff; border-color: #bae6fd; color: var(--blue-700); }

.toast-stack {
  position: fixed; top: 78px; right: 22px; z-index: 1300;
  display: flex; flex-direction: column; gap: 10px;
  width: min(380px, calc(100vw - 44px));
}
.toast-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ink-300);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 13.5px; color: var(--ink-700);
  animation: toast-in .24s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.toast-item.is-hiding { opacity: 0; transform: translateY(-6px); transition: all .25s ease; }
.toast-item .icon { margin-top: 1px; }
.toast-item.t-success { border-left-color: var(--green-600); }
.toast-item.t-success .icon { color: var(--green-600); }
.toast-item.t-error, .toast-item.t-danger { border-left-color: var(--red-600); }
.toast-item.t-error .icon, .toast-item.t-danger .icon { color: var(--red-600); }
.toast-item.t-warning { border-left-color: var(--amber-600); }
.toast-item.t-warning .icon { color: var(--amber-600); }
.toast-item.t-info { border-left-color: var(--blue-600); }
.toast-item.t-info .icon { color: var(--blue-600); }
.toast-item__close { margin-left: auto; border: 0; background: none; color: var(--ink-300); padding: 0 2px; }
.toast-item__close:hover { color: var(--ink-600); }

/* ---------- 12. 空状态 ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 52px 24px;
  text-align: center;
}
.empty-state__icon {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  margin-bottom: 6px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-300);
}
.empty-state__icon .icon { width: 24px; height: 24px; }
.empty-state__title { font-size: 14.5px; font-weight: 600; color: var(--ink-700); }
.empty-state__desc { font-size: 13px; color: var(--ink-400); max-width: 380px; }

/* ---------- 13. 键值列表 / 详情 ---------- */
.kv { display: grid; gap: 0; }
.kv-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-key { color: var(--ink-500); }
.kv-value { color: var(--ink-900); min-width: 0; overflow-wrap: anywhere; }

/* ---------- 14. 文件行 ---------- */
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .14s ease, background .14s ease;
}
.file-row + .file-row { margin-top: 8px; }
.file-row:hover { border-color: var(--brand-200); background: #fbfcff; }
.file-row__icon {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--brand-50); color: var(--brand-600);
}
.file-row__icon .icon { width: 17px; height: 17px; }
.file-row__name { font-size: 13.5px; font-weight: 600; color: var(--ink-800); overflow-wrap: anywhere; }
.file-row__meta { font-size: 12px; color: var(--ink-400); }

/* ---------- 15. 分页 ---------- */
.pagination {
  display: flex; align-items: center; gap: 6px;
  margin: 18px 0 0;
  padding: 0; list-style: none;
}
.page-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink-600);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.page-link:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); }
.page-item.disabled .page-link { color: var(--ink-300); background: var(--surface-2); pointer-events: none; box-shadow: none; }
.page-item.active .page-link { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.page-ellipsis { color: var(--ink-300); padding: 0 4px; }

/* ---------- 16. 进度条 ---------- */
.progress { height: 8px; background: var(--slate-100); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); border-radius: 99px; }

/* ---------- 17. 标签页 ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); width: fit-content; }
.tabs a {
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  color: var(--ink-500); font-size: 13px; font-weight: 600;
}
.tabs a:hover { color: var(--ink-800); }
.tabs a.is-active { background: #fff; color: var(--brand-600); box-shadow: var(--shadow-xs); }

/* ---------- 18. 时间线 ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
  border-radius: 2px;
}
.timeline-item { position: relative; padding: 0 0 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -22px; top: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--brand-300);
}
.timeline-item.is-success::before { border-color: var(--green-600); }
.timeline-item.is-danger::before { border-color: var(--red-600); }
.timeline-item.is-muted::before { border-color: var(--ink-300); }
.timeline-item__time { font-size: 12px; color: var(--ink-400); }
.timeline-item__title { font-size: 13.5px; font-weight: 600; color: var(--ink-800); }
.timeline-item__desc { font-size: 13px; color: var(--ink-500); }

/* ---------- 19. 登录页 ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--bg);
}
.auth-brand {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px;
  color: #e8eefb;
  background:
    radial-gradient(1000px 520px at 85% -10%, rgba(124, 92, 244, .55), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(63, 114, 245, .5), transparent 55%),
    linear-gradient(160deg, #0d1a30 0%, #12233f 55%, #16294a 100%);
  overflow: hidden;
}
.auth-brand::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 75%);
  pointer-events: none;
}
.auth-brand__top { position: relative; display: flex; align-items: center; gap: 13px; }
.auth-brand__body { position: relative; max-width: 430px; }
.auth-brand__body h2 { color: #fff; font-size: 27px; font-weight: 700; letter-spacing: -.01em; line-height: 1.4; margin: 0 0 12px; }
.auth-brand__body p { color: #93a6c9; font-size: 14px; margin: 0 0 26px; }
.auth-feature { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13.5px; color: #c3d0e8; }
.auth-feature .icon { color: #7fa3ff; width: 16px; height: 16px; }
.auth-brand__foot { position: relative; font-size: 12px; color: #64779c; }

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card__head { margin-bottom: 26px; }
.auth-card__head h1 { font-size: 23px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.auth-card__head p { color: var(--ink-500); font-size: 13.5px; margin: 0; }
.auth-foot-note { margin-top: 26px; font-size: 12px; color: var(--ink-400); text-align: center; }
.auth-consent { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 2px; }
.auth-consent .form-check-input { flex: 0 0 auto; margin-top: 3px; }
.auth-consent .form-check-label { line-height: 1.55; }
.auth-consent a { color: var(--brand-600); text-decoration: none; }
.auth-consent a:hover { text-decoration: underline; }

/* 公开法律文件页面 */
.legal-page {
  min-height: 100vh;
  margin: 0;
  padding: 34px 20px 42px;
  background:
    radial-gradient(circle at 8% 0%, rgba(63, 114, 245, .16), transparent 34%),
    linear-gradient(180deg, #eef3fb 0%, #f8fafc 42%, #f2f5fa 100%);
  color: var(--ink-700);
}
.legal-shell { width: min(900px, 100%); margin: 0 auto; }
.legal-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.legal-brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; }
.legal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.legal-nav a {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-500);
  font-size: 12.5px;
  font-weight: 600;
}
.legal-nav a:hover, .legal-nav a[aria-current="page"] { background: #fff; color: var(--brand-700); }
.legal-card {
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid rgba(214, 223, 238, .95);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 60px -38px rgba(31, 57, 105, .42);
}
.legal-card__head { padding-bottom: 22px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.legal-kicker { color: var(--brand-600); font-size: 10.5px; font-weight: 800; letter-spacing: .16em; }
.legal-card h1 { margin: 7px 0 8px; color: var(--ink-900); font-size: clamp(24px, 4vw, 34px); font-weight: 750; letter-spacing: -.025em; }
.legal-meta { margin: 0; color: var(--ink-400); font-size: 12px; }
.legal-section { margin: 0 0 27px; }
.legal-section:last-child { margin-bottom: 0; }
.legal-section h2 { margin: 0 0 9px; color: var(--ink-900); font-size: 16px; font-weight: 700; }
.legal-section p, .legal-section li { color: var(--ink-600); font-size: 13.5px; line-height: 1.9; }
.legal-section p { margin: 0 0 9px; }
.legal-section ul { margin: 0; padding-left: 19px; }
.legal-section li + li { margin-top: 4px; }
.legal-section strong { color: var(--ink-800); font-weight: 650; }
.filing-footer {
  width: 100%;
  padding: 14px 28px 18px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .62);
  color: var(--ink-400);
  font-size: 11.5px;
}
.filing-footer__inner {
  width: 100%; max-width: 1460px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 7px 20px;
}
.filing-footer__links { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; }
.filing-footer a {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink-500); text-decoration: none;
}
.filing-footer a:hover { color: var(--brand-600); }
.filing-footer .icon { width: 13px; height: 13px; stroke-width: 1.8; }
.auth-body { min-height: 100vh; display: flex; flex-direction: column; }
.auth-body .auth-page { flex: 1; min-height: 0; }
.auth-body .filing-footer { background: var(--bg); }
.legal-page .filing-footer { padding: 20px 6px 0; border-top: 0; background: transparent; }

@media (max-width: 767.98px) {
  .legal-page { padding: 20px 12px 30px; }
  .legal-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .legal-nav { width: 100%; }
  .legal-nav a { padding-left: 0; padding-right: 12px; }
  .legal-card { border-radius: 17px; }
  .filing-footer { padding: 13px 16px 16px; }
  .filing-footer__inner { flex-direction: column; align-items: flex-start; gap: 7px; }
  .filing-footer__links { gap: 6px 12px; }
  .legal-page .filing-footer { padding: 18px 2px 0; }
}

/* ---------- 20. 杂项 ---------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.stack-sm > * + * { margin-top: 10px; }
.stack > * + * { margin-top: 16px; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.muted { color: var(--ink-500); }
.muted-sm { font-size: 12.5px; color: var(--ink-400); }
.nowrap { white-space: nowrap; }
.text-end { text-align: right; }
.strong-lg { font-size: 16px; font-weight: 650; color: var(--ink-900); }
.list-clean { list-style: none; margin: 0; padding: 0; }
.soft-panel { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px 16px; }

.notice-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  font-size: 13px;
}

.bar-list { display: grid; gap: 12px; }
.bar-list__row { display: grid; gap: 6px; }
.bar-list__head { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-600); }
.bar-list__head b { color: var(--ink-900); font-weight: 650; }

/* ---------- 21. Bootstrap 兼容微调 ---------- */
.row { --bs-gutter-x: 18px; --bs-gutter-y: 18px; }
.table-responsive { border-radius: inherit; }
.list-group-item { padding: 12px 16px; border-color: var(--border); font-size: 13.5px; }
.display-6 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.form-check { display: flex; align-items: center; gap: 8px; min-height: auto; margin: 0; padding-left: 0; }
.form-check .form-check-input { margin: 0; float: none; }
input[type="file"].form-control { padding: 7px 10px; }
input[type="file"].form-control::file-selector-button {
  margin: -7px 10px -7px -10px;
  padding: 7px 12px;
  border: 0; border-right: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-600); font-weight: 600; font-size: 12.5px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* ---------- 22. 响应式 ---------- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(14, 23, 41, .45);
  backdrop-filter: blur(2px);
  z-index: 1040;
}
body.nav-open .sidebar-overlay { display: block; }

@media (max-width: 1279.98px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-102%); box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app-main { margin-left: 0; }
  .topbar { padding: 10px 16px; }
  .topbar__burger { display: inline-flex; }
  .content { padding: 18px 16px 48px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .auth-panel { min-width: 0; padding: 32px 20px; }
  .auth-brand { display: none; }
}

@media (max-width: 767.98px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 14px; }
  .stat-card__value { font-size: 22px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .kv-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .topbar__title h1 { font-size: 16px; }
  .filter-bar { padding: 10px; }
  .filter-bar .form-control, .filter-bar .form-select { min-width: 0; flex: 1; }
  .toast-stack { top: 70px; right: 12px; left: 12px; width: auto; }
  .card-body { padding: 16px; }
  .card-body.p-4 { padding: 18px; }
  .card-header { padding: 14px 16px; }
  .filter-bar .search-field { width: 100%; }
  .auth-panel { min-height: 0; padding: 28px 18px; }
  .auth-card { max-width: 100%; }
  .auth-card__head { margin-bottom: 22px; }
  .auth-foot-note { margin-top: 20px; }
}

/* ---------- 22b. 窄屏表格：不逐字折行，改为横向滚动 ---------- */
@media (max-width: 767.98px) {
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table thead th, .table tbody td { word-break: keep-all; }
  .table thead th { padding: 10px 12px; }
  .table tbody td { padding: 11px 12px; }
  .table .cell-sub { white-space: nowrap; }
  .table-wrap.is-scrollable { box-shadow: inset -14px 0 12px -12px rgba(15, 23, 42, .16); }
}

/* ---------- 23. 补充工具类 ---------- */
.min-w-0 { min-width: 0; }
.narrow { max-width: 760px; margin: 0 auto; }
.narrow-sm { max-width: 520px; margin: 0 auto; }
.req { color: var(--red-600); margin-left: 2px; }
.danger-badge {
  width: 56px; height: 56px; margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 18px;
  background: var(--red-100); color: var(--red-600);
}
.danger-badge .icon { width: 26px; height: 26px; }
.icon-tint {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--brand-50); color: var(--brand-600);
}
.icon-tint .icon { width: 19px; height: 19px; }

/* ---------- 24. 追加组件 ---------- */
.stat-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.steps.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-link.disabled { color: var(--ink-300); background: var(--surface-2); pointer-events: none; box-shadow: none; }
.steps { counter-reset: step; display: grid; gap: 4px; }
.step-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radius-sm);
}
a.step-item:hover { background: var(--surface-2); }
.step-item__no {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-50); color: var(--brand-600);
  font-size: 12px; font-weight: 700;
}
.step-item__title { font-size: 13.5px; font-weight: 600; color: var(--ink-800); }
.step-item__desc { font-size: 12.5px; color: var(--ink-400); }
@media (max-width: 1279.98px) { .stat-grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1279.98px) { .stat-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1279.98px) { .steps.cols-3, .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .stat-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .stat-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .steps.cols-3, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 25. 细节修正 ---------- */
.filter-bar .search-field { flex: 1; min-width: 220px; display: block; }
.filter-bar .search-field .form-control { width: 100%; }
.table .row-actions { opacity: .8; }
.table tbody tr:hover .row-actions { opacity: 1; }

/* ---------- 26. 审核与提交块 ---------- */
.review-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.review-option:hover { border-color: var(--brand-300); background: var(--brand-50); }
.review-option input[type="radio"] { margin-top: 3px; accent-color: var(--brand-500); width: 16px; height: 16px; }
.review-option__title { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-800); }
.review-option__desc { display: block; font-size: 12.5px; color: var(--ink-400); }
.review-option:has(input:checked) { border-color: var(--brand-400); background: var(--brand-50); box-shadow: var(--focus-ring); }

.submission-block {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.submission-block + .submission-block { margin-top: 14px; }
.review-note {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.review-note.is-approved { background: #f0fdf4; color: var(--green-700); }
.review-note.is-approved .icon { color: var(--green-600); }
.review-note.is-returned { background: #fef2f2; color: var(--red-700); }
.review-note.is-returned .icon { color: var(--red-600); }

/* ---------- 27. 政策文件列表 ---------- */
.chip.is-active { background: var(--brand-100); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-200); }
a.chip { transition: background .14s ease, color .14s ease; }
a.chip:hover { background: var(--brand-50); color: var(--brand-600); }

.doc-list { display: grid; }
.doc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .12s ease;
}
.doc-item:last-child { border-bottom: 0; }
.doc-item:hover { background: #f7f9fe; }
.doc-item__icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--brand-50); color: var(--brand-600);
}
.doc-item__body { flex: 1; }
.doc-item__title { font-size: 14.5px; font-weight: 600; }
.doc-item__title a { color: var(--ink-900); }
.doc-item__title a:hover { color: var(--brand-600); }
.doc-item__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; font-size: 12.5px; color: var(--ink-500); }
.doc-item__side { display: flex; align-items: center; gap: 8px; flex: none; }
.log-content {
  max-width: 460px; max-height: 96px; overflow: auto;
  font-size: 12.5px; color: var(--ink-600); white-space: pre-wrap;
}
@media (max-width: 767.98px) {
  .doc-item { flex-wrap: wrap; }
  .doc-item__side { width: 100%; justify-content: flex-end; }
}

/* ---------- 26. 错误页 ---------- */
.soft-badge {
  width: 64px; height: 64px; margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 20px;
  background: var(--brand-50); color: var(--brand-600);
  font-size: 19px; font-weight: 700; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.error-page {
  min-height: 100vh; margin: 0;
  display: grid; place-items: center;
  background: var(--surface-2);
  padding: 24px;
}
.error-page__inner {
  max-width: 420px; text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
}

/* ---------- 27. 窄屏顶栏与筛选栏 ---------- */
@media (max-width: 767.98px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar__title { flex: 1 1 40%; }
  .topbar__actions {
    order: 9; width: 100%; flex-wrap: wrap;
    justify-content: flex-end; gap: 8px;
  }
  .topbar__actions:empty { display: none; }
  .topbar__actions .btn { padding: 7px 12px; font-size: 13px; }

  .filter-bar { gap: 8px; }
  .filter-bar .search-field { flex: 1 1 100%; width: 100%; min-width: 0; }
  .filter-bar .form-control, .filter-bar .form-select { flex: 1 1 42%; min-width: 0; }
  .filter-bar .btn { flex: 0 0 auto; }
}

/* ---------- 28. 成果档案 ---------- */
.picker-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
}
.picker-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.picker-card:hover { transform: translateY(-2px); border-color: var(--brand-300); box-shadow: var(--shadow-md); }
.picker-card__icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--brand-50); color: var(--brand-600);
}
.picker-card__icon .icon { width: 19px; height: 19px; }
.picker-card__title { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink-900); }
.picker-card__desc { display: block; font-size: 12.5px; color: var(--ink-500); margin-top: 3px; }
.picker-card__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }

.formset-row { padding: 16px 0; border-top: 1px dashed var(--border-strong); }
.formset-row:first-child { border-top: 0; padding-top: 0; }
.formset-row.is-deleted { opacity: .45; }
.formset-row__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.formset-row__no { font-size: 12.5px; font-weight: 600; color: var(--ink-500); }
.formset-row .form-grid { gap: 12px; }
.formset-row .field { margin-bottom: 0; }

.check-inline {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-600); cursor: pointer;
}
.check-inline input { accent-color: var(--brand-500); width: 15px; height: 15px; margin: 0; }

.stat-mini-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); }
.stat-mini {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.stat-mini__value { font-size: 20px; font-weight: 700; color: var(--ink-900); line-height: 1.2; }
.stat-mini__label { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

.matrix-wrap { overflow-x: auto; }
.matrix th, .matrix td { white-space: nowrap; }
.matrix th.is-sticky, .matrix td.is-sticky {
  position: sticky; left: 0; z-index: 1;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}
.matrix tbody tr:hover td.is-sticky { background: var(--surface-2); }

.attach-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.type-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-50); color: var(--brand-700);
  font-size: 12.5px; font-weight: 500;
}
.score-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.score-line__value { font-size: 22px; font-weight: 700; color: var(--ink-900); font-variant-numeric: tabular-nums; }

@media (max-width: 767.98px) {
  .formset-row .form-grid { grid-template-columns: 1fr; }
  .picker-grid { grid-template-columns: 1fr; }
}

.table tbody tr.is-selected { background: var(--brand-50); }
.table tbody tr.is-selected td { background: transparent; }

.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1199.98px) { .form-grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .form-grid.cols-4 { grid-template-columns: 1fr; } }

.mapping-rule {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--surface-2);
}
.mapping-rule + .mapping-rule { margin-top: 12px; }
.mapping-rule__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.mapping-rule [data-source-block][hidden] { display: none; }

/* ---------- 29. 教师个人主页 ---------- */
.profile-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.profile-hero__avatar {
  width: 76px; height: 76px; flex: none;
  display: grid; place-items: center;
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  color: var(--brand-700);
  font-size: 24px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(63, 114, 245, .14);
}
.profile-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero__name { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 700; color: var(--ink-900); }
.profile-hero__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: 13px; color: var(--ink-500); }
.profile-hero__aside {
  min-width: 240px; max-width: 340px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.profile-hero__aside-label { font-size: 12px; color: var(--ink-400); }
.profile-hero__aside-value { margin-top: 2px; font-size: 13px; color: var(--ink-700); }

.directory-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.teacher-card {
  display: flex; flex-direction: column;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.teacher-card.is-locked {
  background: #eef1f6;
  border-style: dashed;
  box-shadow: none;
  filter: grayscale(.45);
  opacity: .78;
}
.teacher-card.is-locked .teacher-card__avatar { background: #e2e7ef; color: var(--ink-400); }
.teacher-card.is-overview { background: var(--surface-2); box-shadow: none; }
.teacher-card__head { display: flex; align-items: center; gap: 12px; }
.teacher-card__avatar {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center;
  border-radius: 15px; overflow: hidden;
  background: var(--brand-50); color: var(--brand-700);
  font-size: 16px; font-weight: 700;
}
.teacher-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.teacher-card__name { display: flex; align-items: center; gap: 6px; font-size: 15.5px; font-weight: 650; color: var(--ink-900); }
.teacher-card__name a { color: var(--ink-900); }
.teacher-card__name a:hover { color: var(--brand-600); }
.teacher-card__meta { font-size: 12.5px; color: var(--ink-400); }
.teacher-card__body { display: grid; gap: 7px; flex: 1; margin-top: 14px; }
.teacher-card__line { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-700); }
.teacher-card__line .icon { color: var(--ink-400); }
.teacher-card__line.is-muted { color: var(--ink-400); }
.teacher-card__foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.list-group-block + .list-group-block { border-top: 1px solid var(--border); }
.list-group-block__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
  background: var(--surface-2);
  font-size: 13px; font-weight: 600; color: var(--ink-700);
}
.list-group-block .doc-item { padding: 13px 20px; }

@media (max-width: 767.98px) {
  .profile-hero__aside { width: 100%; max-width: none; }
  .directory-grid { grid-template-columns: 1fr; }
}

.menu-wrap { position: relative; display: inline-block; }
.menu-wrap .menu { min-width: 250px; }

/* ---------- 30. 移动端：表格卡片化与上传反馈 ---------- */
.upload-hint { margin-top: 6px; font-size: 12.5px; color: var(--brand-600); }
.upload-hint:empty { display: none; }
.upload-hint.is-warn { color: var(--amber-700); }

@media (max-width: 767.98px) {
  .table-wrap.is-cards { overflow: visible; border-radius: 0; box-shadow: none; }

  .table-cards { display: block; }
  .table-cards thead { display: none; }
  .table-cards tbody { display: block; }
  .table-cards tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
  }
  .table-cards tbody tr:last-child { margin-bottom: 0; }
  .table-cards tbody tr:hover td { background: transparent; }

  .table-cards tbody td {
    display: flex; align-items: baseline; gap: 12px;
    padding: 9px 14px;
    border: 0; border-bottom: 1px dashed var(--border);
    white-space: normal; word-break: normal; overflow-wrap: anywhere;
  }
  .table-cards tbody td:last-child { border-bottom: 0; }
  .table-cards tbody td::before {
    content: attr(data-label);
    flex: 0 0 76px;
    color: var(--ink-400);
    font-size: 12.5px; font-weight: 500;
  }
  .table-cards tbody td:not([data-label])::before { content: none; }
  /* 卡片模式下，桌面上"隐藏窄屏列"的单元格要全部显示出来 */
  .table-cards tbody td.d-none,
  .table-cards tbody td.d-md-table-cell,
  .table-cards tbody td.d-lg-table-cell { display: flex !important; }
  .table-cards tbody td.is-card-primary.d-none,
  .table-cards tbody td.is-card-primary.d-md-table-cell { display: block !important; }
  .table-cards tbody tr { position: relative; }
  .table-cards tbody td.is-card-check {
    position: absolute; top: 13px; right: 14px;
    display: block; padding: 0; border: 0;
  }
  .table-cards tbody td.is-card-check::before { content: none; }
  .table-cards tbody td.is-card-check .form-check-input {
    width: 21px; height: 21px; margin: 0; float: none;
  }
  .table-cards tbody td[colspan] { display: block; border-bottom: 0; padding: 10px 14px; }
  .table-cards tbody td[colspan]::before { content: none; }

  .table-cards tbody td.is-card-primary {
    display: block;
    padding: 13px 14px 11px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fbfcff, var(--surface));
    padding-right: 48px;
  }
  .table-cards tbody td.is-card-primary::before { content: none; }
  .table-cards tbody td.is-card-primary .cell-main { font-size: 14.5px; }
  .table-cards tbody td.is-card-primary .cell-sub { white-space: normal; }

  .table-cards tbody td .row-actions { flex-wrap: wrap; }
  .table-cards tbody td.text-end { justify-content: flex-start; }
  .table-cards tbody td.text-end > * { text-align: left; }
  .app-release-hero { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .app-release-hero__actions { grid-column: 1 / -1; min-width: 0; }
}

/* ---------- 31. AI 助手 ---------- */
.ai-page {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - var(--topbar-h) - 96px);
  min-height: 520px;
}

.ai-side {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ai-side__head { padding: 12px 12px 8px; }
.ai-side__list { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.ai-side__foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-500);
  display: grid; gap: 3px;
}
.ai-side__foot b { color: var(--ink-800); font-weight: 600; }
.ai-side__label {
  padding: 8px 8px 4px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-400);
}
.ai-conv {
  display: block; padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-700);
  border: 1px solid transparent;
  margin-bottom: 2px;
}
.ai-conv-item { position: relative; }
.ai-conv-item .ai-conv { padding-right: 34px; }
.ai-conv__del {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--ink-400); opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.ai-conv-item:hover .ai-conv__del,
.ai-conv__del:focus-visible { opacity: 1; }
.ai-conv__del:hover { background: var(--red-100); color: var(--red-600); }
.ai-conv:hover { background: var(--surface-2); color: var(--ink-900); }
.ai-conv.is-active {
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
}
.ai-conv__title {
  display: block;
  font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-conv__time { display: block; font-size: 11.5px; color: var(--ink-400); margin-top: 2px; }

.ai-chat {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ai-chat__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfcff, var(--surface));
}
.ai-chat__brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--ink-900);
}
.ai-chat__brand .ai-orb {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--violet-600));
  box-shadow: 0 6px 14px -8px rgba(63, 114, 245, .9);
}
.ai-chat__brand small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-500); }
.ai-chat__meta { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-chat__quota { display: none; font-size: 12.5px; color: var(--ink-500); }
.ai-chat__quota b { color: var(--ink-800); font-weight: 600; }

.ai-chat__stream {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 8px;
  background:
    radial-gradient(1200px 300px at 15% -10%, rgba(63, 114, 245, .05), transparent 60%),
    var(--surface);
  scroll-behavior: smooth;
}
.ai-empty { max-width: 620px; margin: 18px auto 0; text-align: center; }
.ai-empty__orb {
  width: 62px; height: 62px; margin: 0 auto 14px;
  border-radius: 20px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--violet-600));
  box-shadow: 0 18px 34px -18px rgba(63, 114, 245, .85);
}
.ai-empty__orb .icon { width: 28px; height: 28px; }
.ai-empty__title { font-size: 19px; font-weight: 650; color: var(--ink-900); }
.ai-empty__desc { color: var(--ink-500); margin: 6px 0 18px; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ai-suggest button {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-700);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: .15s ease;
}
.ai-suggest button:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); }

.ai-msg { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; }
.ai-msg__avatar {
  width: 32px; height: 32px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: var(--brand-50); color: var(--brand-700);
}
.ai-msg--assistant .ai-msg__avatar {
  background: linear-gradient(135deg, var(--brand-500), var(--violet-600));
  color: #fff;
}
.ai-msg__body { min-width: 0; max-width: min(760px, 86%); }
.ai-msg__bubble {
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-800);
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg--user { flex-direction: row-reverse; }
.ai-msg--user .ai-msg__body { max-width: min(640px, 82%); }
.ai-msg--user .ai-msg__bubble {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  border-color: transparent;
  color: #fff;
}
.ai-msg__time { font-size: 11.5px; color: var(--ink-400); margin-top: 5px; }
.ai-msg--user .ai-msg__time { text-align: right; }
.ai-msg__tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.ai-tool-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  font-size: 12.5px;
}
.ai-tool-chip .icon { width: 13px; height: 13px; }
.ai-tool-chip.is-error { background: var(--red-100); border-color: #fecaca; color: var(--red-700); }
.ai-file-chip {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  border: 1px solid var(--brand-600);
  box-shadow: var(--shadow-xs);
  color: #fff;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.ai-file-chip:hover { color: #fff; filter: brightness(1.06); }
.ai-file-chip .icon { color: #fff; }
.ai-file-chip::after {
  content: "下载";
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .24);
  font-size: 12px; font-weight: 600;
}

.ai-action {
  border: 1px solid var(--amber-100);
  background: #fffdf5;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  max-width: min(760px, 90%);
  margin: 0 0 16px 42px;
}
.ai-action__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--amber-700);
  margin-bottom: 6px;
}
.ai-action__summary { color: var(--ink-800); font-weight: 600; }
.ai-action__hint { font-size: 12.5px; color: var(--ink-500); margin-top: 4px; }
.ai-action__actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; align-items: center; }
.ai-action.is-done { border-color: #bbe7c9; background: #f6fef9; }
.ai-action.is-done .ai-action__head { color: var(--green-700); }
.ai-action.is-cancelled { border-color: var(--border); background: var(--surface-2); }
.ai-action.is-cancelled .ai-action__head { color: var(--ink-500); }
.ai-action.is-failed { border-color: #fecaca; background: #fff6f6; }
.ai-action.is-failed .ai-action__head { color: var(--red-700); }

.ai-typing { display: inline-flex; gap: 5px; align-items: center; padding: 13px 16px; }
.ai-typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-300);
  animation: ai-blink 1.05s infinite ease-in-out;
}
.ai-typing i:nth-child(2) { animation-delay: .16s; }
.ai-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ai-composer { border-top: 1px solid var(--border); padding: 12px 14px 10px; background: var(--surface); }
.ai-composer__box {
  display: flex; align-items: flex-end; gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 8px 8px 8px 14px;
  background: var(--surface);
  transition: .16s ease;
}
.ai-composer__box:focus-within { border-color: var(--brand-400); box-shadow: var(--focus-ring); }
.ai-composer.has-voice .ai-composer__box { border-color: var(--brand-400); box-shadow: var(--focus-ring); }
.ai-composer.is-busy .ai-composer__box { opacity: .72; }
.ai-composer__box textarea {
  flex: 1; border: 0; outline: none; resize: none;
  font-family: inherit; font-size: 14px; line-height: 1.6;
  color: var(--ink-900); background: transparent;
  max-height: 156px; min-height: 24px;
  padding: 4px 0;
}
.ai-composer__btns { display: flex; align-items: center; gap: 6px; }
.ai-mic {
  width: 38px; height: 38px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink-600); display: grid; place-items: center;
  cursor: pointer; transition: .15s ease;
}
.ai-mic:hover { border-color: var(--brand-300); color: var(--brand-600); }
.ai-mic.is-recording {
  background: var(--red-600); border-color: var(--red-600); color: #fff;
  animation: ai-pulse 1.4s infinite;
}
.ai-mic:disabled { opacity: .5; cursor: not-allowed; }
@keyframes ai-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  70% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.ai-composer__hint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-400); margin-top: 7px; padding: 0 4px;
}
.ai-recorder {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 9px; padding: 9px 13px;
  border-radius: var(--radius); background: #fff6f6;
  border: 1px solid #fecaca; color: var(--red-700); font-size: 13px;
}
.ai-recorder__dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--red-600);
  animation: ai-blink 1.1s infinite;
}
.ai-recorder__timer { font-variant-numeric: tabular-nums; font-weight: 650; }
.ai-recorder__hint { color: var(--ink-500); margin-left: auto; }
.ai-voice-hint {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px; padding: 8px 12px;
  border-radius: var(--radius); background: var(--brand-50, #eff6ff);
  border: 1px solid var(--brand-200, #bfdbfe); color: var(--brand-700, #1d4ed8);
  font-size: 13px; overflow-wrap: anywhere;
}
.ai-voice-hint .muted-sm { margin-left: auto; white-space: nowrap; }

.ai-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius);
  font-size: 13.5px; margin-bottom: 14px;
}
.ai-banner.is-warn { background: var(--amber-100); color: var(--amber-700); }
.ai-banner.is-info { background: var(--brand-50); color: var(--brand-700); }
.ai-banner.is-error { background: var(--red-100); color: var(--red-700); }
.ai-banner a { font-weight: 600; text-decoration: underline; color: inherit; }

/* AI 设置页 */
.ai-provider-table td { vertical-align: middle; }
.ai-provider-name { font-weight: 600; color: var(--ink-900); }
.ai-provider-sub { font-size: 12.5px; color: var(--ink-500); }
.ai-status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
}
.ai-status-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300);
}
.ai-status-dot.is-ok::before { background: var(--green-600); }
.ai-status-dot.is-bad::before { background: var(--red-600); }
.ai-steps { counter-reset: ai-step; display: grid; gap: 12px; }
.ai-steps li {
  list-style: none; position: relative; padding-left: 38px;
  color: var(--ink-600); font-size: 13.5px;
}
.ai-steps li::before {
  counter-increment: ai-step; content: counter(ai-step);
  position: absolute; left: 0; top: -1px;
  width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-700);
  font-size: 12.5px; font-weight: 700;
}
.ai-steps code {
  background: var(--slate-100); border-radius: 6px; padding: 1px 6px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-800);
}

@media (max-width: 991.98px) {
  .ai-page { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; min-width: 0; }
  .ai-side { display: none; }
  .ai-chat { height: calc(100vh - var(--topbar-h) - 120px); min-height: 460px; min-width: 0; }
  .ai-chat__head { min-width: 0; }
  .ai-chat__meta { min-width: 0; max-width: 100%; }
  .ai-chat__mobile { display: flex; width: 100%; max-width: 100%; min-width: 0; }
  .ai-chat__meta .badge { display: none; }
  .ai-chat__quota { display: block; width: 100%; }
  .ai-msg__body, .ai-msg--user .ai-msg__body { max-width: 100%; }
  .ai-action { margin-left: 0; max-width: 100%; }
  .ai-file-chip, .ai-tool-chip { max-width: 100%; overflow-wrap: anywhere; }
}
@media (min-width: 992px) { .ai-chat__mobile { display: none; } }
@media (max-width: 575.98px) {
  .ai-composer__box { padding-left: 12px; gap: 6px; }
  .ai-composer__box [data-ai-send] .btn-text { display: none; }
  .ai-composer__hint { font-size: 11.5px; gap: 8px; }
  .ai-chat__stream { padding: 14px 12px 6px; }
  .ai-composer__box textarea { font-size: 16px; }
}
@media (max-width: 767.98px) {
  .form-control, .form-select { font-size: 16px; }
}

/* ---------- 28. 首页工作台 ---------- */
.dashboard-page { display: grid; gap: 18px; }

.dash-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 166px;
  padding: 26px 30px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, .16), transparent 24%),
    linear-gradient(118deg, #142b56 0%, #2452b8 58%, #3f72f5 100%);
  box-shadow: 0 24px 42px -30px rgba(30, 64, 175, .8);
  color: #fff;
}
.dash-hero::before {
  content: "";
  position: absolute;
  right: -84px;
  bottom: -124px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(255, 255, 255, .035), 0 0 0 92px rgba(255, 255, 255, .025);
  z-index: -1;
}
.dash-hero--teacher {
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, .14), transparent 24%),
    linear-gradient(118deg, #17324d 0%, #1f5d77 56%, #2b7f91 100%);
  box-shadow: 0 24px 42px -30px rgba(15, 76, 98, .8);
}
.dash-hero__copy { position: relative; z-index: 1; max-width: 760px; }
.dash-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .82);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
}
.dash-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 2.4vw, 29px);
  font-weight: 700;
  letter-spacing: -.025em;
}
.dash-hero p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
}
.dash-hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dash-hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .88);
  font-size: 12px;
  white-space: nowrap;
}
.dash-hero__mark {
  position: relative;
  z-index: 0;
  width: 104px;
  height: 104px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 30px;
  background: rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .9);
  transform: rotate(-6deg);
}
.dash-hero__mark .icon { width: 48px; height: 48px; stroke-width: 1.45; }

.dash-setup {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 18px;
  border: 1px solid #f2d58d;
  border-left: 4px solid var(--amber-500, #f59e0b);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, #fffbeb, #fff 70%);
}
.dash-setup__intro { min-width: 230px; display: grid; gap: 2px; }
.dash-setup__eyebrow { color: var(--amber-700); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.dash-setup__intro strong { color: var(--ink-800); font-size: 13.5px; }
.dash-setup__intro > span:last-child { color: var(--ink-500); font-size: 12px; }
.dash-setup__steps { display: flex; flex: 1; flex-wrap: wrap; gap: 8px; }
.dash-setup__step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-700);
}
.dash-setup__step:hover { border-color: var(--brand-300); color: var(--ink-900); }
.dash-setup__step strong { display: block; font-size: 12.5px; }
.dash-setup__step small { display: block; color: var(--ink-400); font-size: 11.5px; line-height: 1.35; }
.dash-setup__check { flex: none; color: var(--ink-300); }
.dash-setup__step.is-done .dash-setup__check { color: var(--green-600); }
.dash-setup__dot {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber-500, #f59e0b);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .12);
}
.dash-setup__action { flex: none; }

.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dash-kpi {
  --kpi-accent: var(--brand-500);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-height: 132px;
  padding: 18px 17px 17px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.dash-kpi::after {
  content: "";
  position: absolute;
  left: 17px; right: 17px; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--kpi-accent);
  opacity: .5;
}
a.dash-kpi:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  color: inherit;
}
.dash-kpi--brand { --kpi-accent: var(--brand-500); }
.dash-kpi--red { --kpi-accent: var(--red-600); }
.dash-kpi--amber { --kpi-accent: var(--amber-600); }
.dash-kpi--violet { --kpi-accent: var(--violet-600); }
.dash-kpi--green { --kpi-accent: var(--green-600); }
.dash-kpi__icon {
  width: 40px; height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
}
.dash-kpi__icon .icon { width: 19px; height: 19px; }
.dash-kpi__body { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.dash-kpi__label { color: var(--ink-500); font-size: 12.5px; font-weight: 550; }
.dash-kpi__value {
  margin-top: 2px;
  color: var(--ink-900);
  font-size: 29px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.dash-kpi__value small { margin-left: 3px; color: var(--ink-500); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.dash-kpi__meta { margin-top: 7px; color: var(--ink-400); font-size: 11.5px; line-height: 1.4; }
.dash-kpi__arrow { margin-left: auto; margin-top: 2px; color: var(--ink-300); flex: none; }

.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr);
  gap: 18px;
  align-items: start;
}
.dash-stack { display: grid; gap: 18px; min-width: 0; }
.dash-stack > .card + .card { margin-top: 0; }
.dash-card { overflow: hidden; border-radius: var(--radius-lg); }
.dash-card .card-header { padding: 16px 18px; }
.dash-card .card-body { padding: 18px; }
.dash-card .card-header .sub { line-height: 1.35; }

.dash-task-list { display: grid; gap: 12px; }
.dash-task {
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dash-task:hover { border-color: var(--brand-200); box-shadow: 0 12px 24px -22px rgba(37, 73, 184, .5); }
.dash-task__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dash-task__name { display: block; color: var(--ink-900); font-size: 14.5px; font-weight: 650; line-height: 1.35; }
.dash-task__name:hover { color: var(--brand-600); }
.dash-task__sub { margin-top: 3px; color: var(--ink-400); font-size: 11.5px; }
.dash-task__progress-line {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 6px;
  color: var(--ink-500); font-size: 11.5px;
}
.dash-task__progress-line strong { color: var(--ink-700); font-weight: 650; }
.dash-task__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.dash-task__metrics { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dash-task__metric { padding: 3px 7px; border-radius: 7px; background: var(--slate-100); color: var(--ink-500); font-size: 11.5px; }
.dash-task__metric b { margin-left: 2px; color: var(--ink-700); font-weight: 650; }
.dash-task__metric.is-danger { background: var(--red-100); color: var(--red-700); }
.dash-task__metric.is-danger b { color: var(--red-700); }
.dash-task__actions { display: flex; align-items: center; gap: 10px; flex: none; }
.dash-task__due { color: var(--ink-400); font-size: 11.5px; white-space: nowrap; }

.dash-todo-card { align-self: stretch; }
.dash-todo-list { display: grid; gap: 5px; }
.dash-todo__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 9px;
  border-radius: 11px;
  color: var(--ink-700);
  transition: background .14s ease, color .14s ease;
}
.dash-todo__item:hover { background: var(--brand-50); color: var(--ink-900); }
.dash-todo__icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; }
.dash-todo__icon .icon { width: 16px; height: 16px; }
.dash-todo__copy { min-width: 0; flex: 1; display: grid; gap: 1px; }
.dash-todo__copy strong { font-size: 13px; font-weight: 600; }
.dash-todo__copy small { color: var(--ink-400); font-size: 11.5px; line-height: 1.35; }
.dash-todo__count {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--slate-100);
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.dash-todo__arrow { color: var(--ink-300); flex: none; }
.dash-todo__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  color: var(--ink-400);
  font-size: 11px;
}
.dash-todo__foot span { display: inline-flex; align-items: center; gap: 5px; }
.dash-todo__foot a { font-size: 11.5px; font-weight: 600; }

.dash-lower { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.dash-lower > .card + .card { margin-top: 0; }
.dash-metric-line { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.dash-metric-line__value { color: var(--ink-900); font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.dash-metric-line__label { color: var(--ink-500); font-size: 12.5px; }
.dash-metric-line__score { margin-left: auto; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--brand-50); color: var(--brand-700); font-size: 11.5px; font-weight: 650; }
.dash-mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.dash-mini-stats a {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-500);
  font-size: 11px;
}
.dash-mini-stats a:hover { background: var(--brand-50); color: var(--brand-700); }
.dash-mini-stats strong { color: var(--ink-900); font-size: 16px; line-height: 1.2; }
.dash-bar-list { margin-top: 16px; gap: 10px; }
.dash-bar-list .progress { height: 6px; }
.dash-inline-empty { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--ink-400); font-size: 12px; }
.dash-progress-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--ink-400);
  font-size: 11.5px;
}
.dash-progress-note a { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; white-space: nowrap; }

.dash-shortcut-list { display: grid; gap: 5px; }
.dash-shortcut-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 10px;
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 550;
}
.dash-shortcut-list a:hover { background: var(--surface-2); color: var(--ink-900); }
.dash-shortcut-list a > .icon { margin-left: auto; color: var(--ink-300); }
.dash-shortcut-list__icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; }
.dash-shortcut-list__icon .icon { width: 15px; height: 15px; }

.dash-empty { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 6px 2px; }
.dash-empty__icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; }
.dash-empty__icon .icon { width: 19px; height: 19px; }
.dash-empty > div { min-width: 0; flex: 1; }
.dash-empty strong { display: block; color: var(--ink-800); font-size: 13.5px; }
.dash-empty p { margin: 3px 0 0; color: var(--ink-400); font-size: 12px; }
.dash-empty--vertical { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 190px; padding: 18px; text-align: center; }
.dash-empty--vertical p { max-width: 250px; }
.dash-empty--compact { min-height: 138px; align-items: flex-start; }

.dash-activity { display: flex; align-items: flex-end; gap: 9px; height: 132px; padding: 8px 4px 0; }
.dash-activity__day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; height: 100%; }
.dash-activity__track { width: 100%; height: 96px; display: flex; align-items: flex-end; justify-content: center; }
.dash-activity__bar {
  display: block;
  width: min(24px, 68%);
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  box-shadow: 0 6px 12px -8px rgba(47, 92, 224, .8);
  transition: height .2s ease;
}
.dash-activity__bar.is-zero { height: 4px !important; background: var(--slate-100); box-shadow: none; }
.dash-activity__label { color: var(--ink-400); font-size: 10.5px; white-space: nowrap; }
.dash-activity__empty { margin: -3px 0 0; color: var(--ink-400); font-size: 11.5px; text-align: center; }

.dash-material-list { display: grid; gap: 10px; }
.dash-material {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(180deg, #fff, #fbfcff);
}
.dash-material__icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; }
.dash-material__icon .icon { width: 18px; height: 18px; }
.dash-material__main { min-width: 0; flex: 1; }
.dash-material__title { color: var(--ink-900); font-size: 13.5px; font-weight: 600; }
.dash-material__sub { margin-top: 2px; color: var(--ink-400); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-material__badges { display: flex; gap: 5px; margin-top: 6px; }
.dash-material__side { display: flex; align-items: center; gap: 10px; flex: none; }
.dash-material__due { color: var(--ink-400); font-size: 11px; white-space: nowrap; }

.dash-status-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dash-status-strip a {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--ink-500);
  font-size: 11.5px;
}
.dash-status-strip a:hover { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-700); }
.dash-status-strip strong { color: var(--ink-900); font-size: 19px; line-height: 1.2; }

.dash-teaching-list { display: grid; gap: 10px; }
.dash-teaching-row { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.dash-teaching-row:last-child { padding-bottom: 0; border-bottom: 0; }
.dash-teaching-row__dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-50); }
.dash-teaching-row > div { flex: 1; min-width: 0; }
.dash-teaching-row strong { display: block; color: var(--ink-800); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-teaching-row small { display: block; margin-top: 1px; color: var(--ink-400); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-workload-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.dash-workload-summary > div { display: grid; gap: 3px; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); }
.dash-workload-summary span { color: var(--ink-400); font-size: 10.5px; }
.dash-workload-summary strong { color: var(--ink-800); font-size: 13px; }

.dash-quick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.dash-quick {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.dash-quick:hover { transform: translateY(-1px); border-color: var(--brand-200); box-shadow: var(--shadow-sm); color: var(--ink-900); }
.dash-quick > span { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; }
.dash-quick > span .icon { width: 15px; height: 15px; }

.dash-help { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.dash-help summary { display: flex; align-items: center; gap: 7px; padding: 11px 15px; color: var(--ink-500); font-size: 12px; font-weight: 550; cursor: pointer; list-style: none; }
.dash-help summary::-webkit-details-marker { display: none; }
.dash-help summary::after { content: "展开"; margin-left: auto; color: var(--ink-400); font-size: 11px; }
.dash-help[open] summary::after { content: "收起"; }
.dash-help__body { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 15px 14px; }
.dash-help__body span { padding: 6px 9px; border-radius: 8px; background: var(--surface-2); color: var(--ink-500); font-size: 11.5px; }

@media (max-width: 1279.98px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-layout { grid-template-columns: minmax(0, 1fr); }
  .dash-lower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-shortcut-card { grid-column: 1 / -1; }
  .dash-shortcut-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-setup { flex-wrap: wrap; }
  .dash-setup__steps { order: 3; flex-basis: 100%; }
}

@media (max-width: 991.98px) {
  .dash-hero { padding: 22px; }
  .dash-hero__mark { width: 82px; height: 82px; border-radius: 24px; }
  .dash-hero__mark .icon { width: 38px; height: 38px; }
  .dash-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .dashboard-page { gap: 14px; }
  .dash-hero { min-height: 0; padding: 20px 18px; border-radius: 17px; }
  .dash-hero__mark { display: none; }
  .dash-hero__meta { gap: 6px; margin-top: 14px; }
  .dash-hero__pill { font-size: 11px; padding: 5px 8px; }
  .dash-setup { padding: 13px 14px; }
  .dash-setup__intro { min-width: 0; }
  .dash-setup__action { margin-left: auto; }
  .dash-kpis { gap: 10px; }
  .dash-kpi { min-height: 124px; padding: 14px; gap: 10px; border-radius: 14px; }
  .dash-kpi__icon { width: 34px; height: 34px; border-radius: 10px; }
  .dash-kpi__value { font-size: 25px; }
  .dash-kpi__meta { font-size: 10.5px; }
  .dash-kpi__arrow { display: none; }
  .dash-layout, .dash-stack, .dash-lower { gap: 14px; }
  .dash-lower { grid-template-columns: minmax(0, 1fr); }
  .dash-shortcut-card { grid-column: auto; }
  .dash-task__top { align-items: flex-start; }
  .dash-task__foot { align-items: flex-start; flex-direction: column; gap: 10px; }
  .dash-task__actions { width: 100%; justify-content: space-between; }
  .dash-task__due { white-space: normal; }
  .dash-activity { height: 120px; gap: 5px; }
  .dash-activity__track { height: 86px; }
  .dash-material { align-items: flex-start; flex-wrap: wrap; }
  .dash-material__main { flex-basis: calc(100% - 54px); }
  .dash-material__side { width: 100%; justify-content: space-between; padding-left: 51px; }
  .dash-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-workload-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-shortcut-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-quick { font-size: 12px; }
}

@media (max-width: 359.98px) {
  .dash-kpis { grid-template-columns: minmax(0, 1fr); }
  .dash-kpi { min-height: 0; }
  .dash-quick-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-shortcut-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 证明材料在线预览 ---------- */
body.attachment-preview-open { overflow: hidden; }

.attachment-preview {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.attachment-preview[hidden], .attachment-preview [hidden] { display: none !important; }
.attachment-preview__scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 17, 31, .78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.attachment-preview__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  height: calc(100vh - 48px);
  height: min(880px, calc(100dvh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 32px 80px rgba(2, 10, 23, .42);
}
.attachment-preview__header {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.attachment-preview__heading { min-width: 0; flex: 1; }
.attachment-preview__eyebrow {
  display: block;
  margin-bottom: 1px;
  color: var(--ink-400);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .13em;
}
.attachment-preview__heading h2 {
  margin: 0;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 14.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-preview__close {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-500);
  cursor: pointer;
}
.attachment-preview__close:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--ink-900); }
.attachment-preview__close .icon { width: 17px; height: 17px; }
.attachment-preview__stage {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  overscroll-behavior: contain;
  background: #1b2433;
}
.attachment-preview__stage iframe {
  width: 100%;
  height: 100%;
  flex: none;
  border: 0;
  background: #fff;
}
.attachment-preview__stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform .16s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.attachment-preview__status {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(10, 19, 33, .78);
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.attachment-preview__status.is-error { color: #ffe4e6; background: rgba(127, 29, 29, .86); }
.attachment-preview__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.attachment-preview__tools { display: flex; align-items: center; gap: 5px; }
.preview-tool {
  min-width: 31px;
  height: 31px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-600);
  font-size: 12px;
  cursor: pointer;
}
.preview-tool:hover { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-700); }
.preview-tool__scale { width: 48px; color: var(--ink-400); font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: center; }
.attachment-preview__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.file-row__actions { display: flex; align-items: center; gap: 6px; flex: none; }

.score-match {
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.score-match__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.score-match__title { color: var(--ink-500); font-size: 11.5px; font-weight: 650; letter-spacing: .06em; }
.score-match__rule { margin-top: 3px; color: var(--ink-900); font-size: 13.5px; font-weight: 650; }
.score-match__meta { margin-top: 2px; color: var(--ink-500); font-size: 12px; }
.score-match__detail { margin-top: 7px; color: var(--ink-500); font-size: 11.5px; line-height: 1.6; overflow-wrap: anywhere; }
.score-match__link { display: inline-block; margin-top: 7px; font-size: 11.5px; }
.score-match__warning { margin-top: 8px; padding: 7px 9px; border-radius: 7px; background: var(--amber-100); color: var(--amber-700); font-size: 11.5px; }
.score-admin-panel { display: grid; gap: 10px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--border); }

@media (max-width: 767.98px) {
  .attachment-preview { padding: 0; }
  .attachment-preview__dialog {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .attachment-preview__header { padding: 11px 13px; }
  .attachment-preview__heading h2 { font-size: 13.5px; }
  .attachment-preview__footer { flex-wrap: wrap; padding: 9px 11px; }
  .attachment-preview__tools { order: 2; width: 100%; justify-content: center; }
  .attachment-preview__actions { margin-left: 0; width: 100%; justify-content: flex-end; }
  .file-row { flex-wrap: wrap; }
  .file-row__actions { width: 100%; justify-content: flex-end; padding-left: 48px; }
}
