/* ============================================================
   数智心理生态服务平台 · 共享设计系统 (theme.css)
   - 浅色 / 深色 双主题，基于 CSS 变量（rgb 通道，供 Tailwind alpha 使用）
   - 纯 CSS 组件，零构建，直接 <link> 引用
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 表面与文本（rgb 通道） */
  --bg: 239 243 250;
  --surface: 255 255 255;
  --surface-2: 246 249 253;
  --elev: 240 245 251;
  --line: 226 232 244;
  --line-strong: 203 213 231;
  --ink: 15 23 42;
  --body: 51 65 85;
  --muted: 71 85 105;
  --faint: 100 116 139;

  /* 品牌与语义色 */
  --primary: 37 99 235;
  --primary-strong: 29 78 216;
  --success: 22 163 74;
  --warning: 202 106 8;
  --danger: 220 38 38;
  --ai: 124 58 237;
  --info: 13 148 136;

  /* 圆角 */
  --r-xs: 7px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px -4px rgba(15, 23, 42, .10);
  --shadow: 0 2px 4px -2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .16);
  --shadow-lg: 0 12px 40px -16px rgba(15, 23, 42, .28);
  --ring: 0 0 0 3px rgb(var(--primary) / .28);

  /* 布局尺寸 */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;

  /* 缓动（指数 ease-out，无回弹） */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-quart: cubic-bezier(.25, 1, .5, 1);
}

.dark {
  --bg: 8 12 22;
  --surface: 17 24 39;
  --surface-2: 22 30 48;
  --elev: 30 41 63;
  --line: 33 44 66;
  --line-strong: 48 63 92;
  --ink: 233 239 248;
  --body: 202 213 231;
  --muted: 148 163 190;
  --faint: 113 128 156;

  --primary: 96 165 250;
  --primary-strong: 129 184 255;
  --success: 45 200 110;
  --warning: 245 165 36;
  --danger: 248 113 113;
  --ai: 167 139 250;
  --info: 45 212 191;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 10px -4px rgba(0, 0, 0, .5);
  --shadow: 0 2px 6px -2px rgba(0, 0, 0, .45), 0 12px 30px -14px rgba(0, 0, 0, .65);
  --shadow-lg: 0 18px 50px -18px rgba(0, 0, 0, .75);
  --ring: 0 0 0 3px rgb(var(--primary) / .35);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: rgb(var(--bg));
  color: rgb(var(--body));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Noto Sans SC", sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

h1, h2, h3, h4, h5 { color: rgb(var(--ink)); margin: 0; font-weight: 700; line-height: 1.25; }
h1 { letter-spacing: -0.02em; text-wrap: balance; }
h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgb(var(--primary) / .22); }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: rgb(var(--line-strong)) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgb(var(--line-strong)); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--muted)); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 隐藏滚动条但保留滚动（用于固定高度的应用式内滚动面板，如列表 / 详情区） */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* 焦点可见性（仅对交互控件，表单/搜索自行处理，避免叠加多重高亮） */
:focus-visible { outline: none; box-shadow: var(--ring); }
input:focus-visible, textarea:focus-visible, select:focus-visible, .search:focus-within input { box-shadow: none; }

/* 主色调文本 */
.text-ink { color: rgb(var(--ink)); }
.text-body { color: rgb(var(--body)); }
.text-muted { color: rgb(var(--muted)); }
.text-faint { color: rgb(var(--faint)); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- 应用外壳（后台三端） ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  transition: grid-template-columns .32s var(--ease);
}
.app-shell.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

/* 侧边栏 */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgb(var(--surface));
  border-right: 1px solid rgb(var(--line));
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.sidebar__brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgb(var(--line));
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}
.brand-mark {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(145deg, rgb(var(--primary)), rgb(var(--ai)));
  font-size: 18px;
}
.brand-text { min-width: 0; }
.brand-text b { display: block; color: rgb(var(--ink)); font-size: 15px; letter-spacing: -0.01em; line-height: 1.2; }
.brand-text span { font-size: 11.5px; color: rgb(var(--faint)); }

.sidebar__nav { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 20px; }
.nav-group { margin-top: 18px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group__label {
  padding: 0 12px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgb(var(--faint));
  letter-spacing: .02em;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: var(--r-sm);
  color: rgb(var(--muted));
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.nav-item i:first-child { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }
.nav-item .nav-item__chev { margin-left: auto; font-size: 11px; opacity: .6; transition: transform .2s var(--ease); }
.nav-item:hover { background: rgb(var(--elev)); color: rgb(var(--ink)); }
.nav-item.active { background: rgb(var(--primary) / .12); color: rgb(var(--primary-strong)); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; border-radius: 0 4px 4px 0; background: rgb(var(--primary));
  animation: pill .34s var(--ease);
}
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 99px;
  background: rgb(var(--danger) / .14); color: rgb(var(--danger));
}
.nav-item.active .nav-badge { background: rgb(var(--primary) / .16); color: rgb(var(--primary-strong)); }

/* 折叠态 */
.app-shell.is-collapsed .brand-text,
.app-shell.is-collapsed .nav-group__label,
.app-shell.is-collapsed .nav-item span,
.app-shell.is-collapsed .nav-item .nav-item__chev,
.app-shell.is-collapsed .nav-badge,
.app-shell.is-collapsed .sidebar__foot .u-meta { display: none; }
.app-shell.is-collapsed .nav-item { justify-content: center; padding: 11px; }
.app-shell.is-collapsed .sidebar__brand { justify-content: center; padding: 0; }

.sidebar__foot { border-top: 1px solid rgb(var(--line)); padding: 12px; flex-shrink: 0; }
.u-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); cursor: pointer; }
.u-card:hover { background: rgb(var(--elev)); }
.u-meta { min-width: 0; }
.u-meta b { display: block; font-size: 13.5px; color: rgb(var(--ink)); line-height: 1.2; }
.u-meta span { font-size: 11.5px; color: rgb(var(--faint)); }

/* 主区 */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgb(var(--surface) / .82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgb(var(--line));
  position: sticky; top: 0; z-index: 30;
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.content-narrow { max-width: none; margin: 0; }

/* 图标按钮 */
.icon-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: rgb(var(--muted));
  background: transparent; border: 1px solid transparent;
  cursor: pointer; font-size: 16px;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s;
}
.icon-btn:hover { background: rgb(var(--elev)); color: rgb(var(--ink)); }
.icon-btn.has-dot { position: relative; }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
  border-radius: 99px; background: rgb(var(--danger)); border: 2px solid rgb(var(--surface));
}

/* ---------- 通用组件 ---------- */
.card {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--line));
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: background-color .4s var(--ease), border-color .24s var(--ease), box-shadow .24s var(--ease), transform .24s var(--ease-quart);
}
.card-hover { cursor: pointer; }
.card-hover:hover { box-shadow: var(--shadow); border-color: rgb(var(--primary) / .38); }
.card-hover:active { box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }

.section-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: rgb(var(--ink)); }
.section-title .st-bar { width: 4px; height: 16px; border-radius: 99px; background: rgb(var(--primary)); }

.divider { height: 1px; background: rgb(var(--line)); border: 0; margin: 0; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: 1px solid rgb(var(--line-strong));
  background: rgb(var(--surface)); color: rgb(var(--body));
  white-space: nowrap;
  transition: transform .12s var(--ease), background-color .18s, border-color .18s, color .18s, box-shadow .18s;
}
.btn i { font-size: 13px; }
.btn:hover { border-color: rgb(var(--primary) / .5); color: rgb(var(--primary-strong)); background: rgb(var(--primary) / .06); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: rgb(var(--primary)); border-color: rgb(var(--primary)); color: #fff; }
.btn-primary:hover { background: rgb(var(--primary-strong)); border-color: rgb(var(--primary-strong)); color: #fff; }
.dark .btn-primary { background: rgb(37 99 235); border-color: rgb(37 99 235); color: #fff; }
.dark .btn-primary:hover { background: rgb(29 78 216); border-color: rgb(29 78 216); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: rgb(var(--muted)); }
.btn-ghost:hover { background: rgb(var(--elev)); color: rgb(var(--ink)); }
.btn-danger { background: rgb(var(--danger)); border-color: rgb(var(--danger)); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

/* 标签 / 徽章 */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.tag i { font-size: 10px; }
.tag-primary { background: rgb(var(--primary) / .12); color: rgb(var(--primary-strong)); }
.tag-success { background: rgb(var(--success) / .14); color: rgb(var(--success)); }
.tag-warning { background: rgb(var(--warning) / .15); color: rgb(var(--warning)); }
.tag-danger { background: rgb(var(--danger) / .14); color: rgb(var(--danger)); }
.tag-ai { background: rgb(var(--ai) / .14); color: rgb(var(--ai)); }
.tag-info { background: rgb(var(--info) / .15); color: rgb(var(--info)); }
.tag-muted { background: rgb(var(--muted) / .14); color: rgb(var(--muted)); }
.dark .tag-primary { color: rgb(var(--primary)); }

/* 状态圆点 */
.dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.dot-live { position: relative; }

/* 图标底座 */
.medallion { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; transition: transform .24s var(--ease-quart); }
.card-hover:hover .medallion { transform: scale(1.08) rotate(-3deg); }
.medallion-primary { background: rgb(var(--primary) / .12); color: rgb(var(--primary)); }
.medallion-success { background: rgb(var(--success) / .14); color: rgb(var(--success)); }
.medallion-warning { background: rgb(var(--warning) / .15); color: rgb(var(--warning)); }
.medallion-danger { background: rgb(var(--danger) / .14); color: rgb(var(--danger)); }
.medallion-ai { background: rgb(var(--ai) / .14); color: rgb(var(--ai)); }
.medallion-info { background: rgb(var(--info) / .15); color: rgb(var(--info)); }

/* KPI 统计块 */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__val { font-size: 26px; font-weight: 800; color: rgb(var(--ink)); letter-spacing: -0.02em; line-height: 1.1; }
.stat__label { font-size: 13px; color: rgb(var(--muted)); }
.stat__delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.delta-up { color: rgb(var(--success)); }
.delta-down { color: rgb(var(--danger)); }

/* 表单控件 */
.field { display: block; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: rgb(var(--body)); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit;
  color: rgb(var(--ink)); background: rgb(var(--surface));
  border: 1px solid rgb(var(--line-strong)); border-radius: var(--r-sm);
  transition: border-color .18s, box-shadow .18s, background-color .4s;
}
.input::placeholder, .textarea::placeholder { color: rgb(var(--faint)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: rgb(var(--primary)); box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 92px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
.search {
  display: flex; align-items: center; gap: 9px;
  padding: 0 12px; height: 40px; border-radius: var(--r-sm);
  background: rgb(var(--surface-2)); border: 1px solid rgb(var(--line));
  color: rgb(var(--faint)); transition: border-color .18s, box-shadow .18s;
}
.search:focus-within { border-color: rgb(var(--primary)); box-shadow: var(--ring); background: rgb(var(--surface)); }
.search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 13.5px; color: rgb(var(--ink)); font-family: inherit; }
.search input:focus, .search input:focus-visible { box-shadow: none; outline: none; }

/* 分段控件 / 标签页 */
.segmented { display: inline-flex; gap: 3px; padding: 4px; background: rgb(var(--surface-2)); border: 1px solid rgb(var(--line)); border-radius: 11px; }
.segmented button {
  padding: 6px 14px; border: 0; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: rgb(var(--muted)); border-radius: 8px; font-family: inherit;
  transition: background-color .18s var(--ease), color .18s;
}
.segmented button:hover { color: rgb(var(--ink)); }
.segmented button.active { background: rgb(var(--surface)); color: rgb(var(--primary-strong)); box-shadow: var(--shadow-xs); }
.dark .segmented button.active { background: rgb(var(--elev)); color: rgb(var(--primary)); }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { width: 0; height: 0; display: none; }
.tab {
  position: relative; padding: 11px 14px; border: 0; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; color: rgb(var(--muted)); white-space: nowrap; font-family: inherit;
  transition: color .18s;
}
.tab:hover { color: rgb(var(--ink)); }
.tab.active { color: rgb(var(--primary-strong)); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: rgb(var(--primary)); }
.dark .tab.active { color: rgb(var(--primary)); }

/* 进度条 */
.progress { height: 8px; border-radius: 99px; background: rgb(var(--line)); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: rgb(var(--primary)); transition: width .6s var(--ease); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th { text-align: left; font-weight: 600; color: rgb(var(--faint)); font-size: 12.5px; padding: 11px 14px; border-bottom: 1px solid rgb(var(--line)); white-space: nowrap; }
.table tbody td { padding: 13px 14px; border-bottom: 1px solid rgb(var(--line)); color: rgb(var(--body)); }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: rgb(var(--surface-2)); }
.table tbody tr:last-child td { border-bottom: 0; }
/* 日期与数值列不折行：列窄时 2026-07-16 会被断成两行，读起来像两个日期 */
.table tbody td.tnum { white-space: nowrap; }

/* 列表项 */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); cursor: pointer; transition: background-color .15s; }
.list-row:hover { background: rgb(var(--surface-2)); }
.list-row.active { background: rgb(var(--primary) / .1); }

/* 时间线 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: rgb(var(--line)); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -26px; top: 3px; width: 16px; height: 16px; border-radius: 99px; background: rgb(var(--surface)); border: 3px solid rgb(var(--primary)); }
.tl-item.is-danger::before { border-color: rgb(var(--danger)); }
.tl-item.is-warning::before { border-color: rgb(var(--warning)); }
.tl-item.is-success::before { border-color: rgb(var(--success)); }
.tl-item.is-ai::before { border-color: rgb(var(--ai)); }

/* 软提示条（替代侧边竖条 accent，使用整体底纹 + 图标） */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid rgb(var(--line)); background: rgb(var(--surface-2)); }
.callout-ai { background: rgb(var(--ai) / .07); border-color: rgb(var(--ai) / .22); }
.callout-danger { background: rgb(var(--danger) / .06); border-color: rgb(var(--danger) / .22); }
.callout-warning { background: rgb(var(--warning) / .07); border-color: rgb(var(--warning) / .24); }
.callout-success { background: rgb(var(--success) / .07); border-color: rgb(var(--success) / .22); }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgb(2 6 23 / .55); backdrop-filter: blur(2px); animation: fade .25s var(--ease); }
.modal__panel { position: relative; width: 100%; background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); max-height: 90vh; display: flex; flex-direction: column; animation: pop .28s var(--ease); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid rgb(var(--line)); }
.modal__body { padding: 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid rgb(var(--line)); }

/* 移动端侧栏抽屉遮罩 */
.scrim { position: fixed; inset: 0; background: rgb(2 6 23 / .5); z-index: 39; display: none; }
.scrim.show { display: block; }

/* 右侧详情抽屉 */
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; width: min(560px, 100vw); z-index: 62;
  background: rgb(var(--surface)); border-left: 1px solid rgb(var(--line)); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(101%); transition: transform .36s var(--ease);
}
.drawer.open { transform: none; }
.drawer__head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid rgb(var(--line)); }
.drawer__body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid rgb(var(--line)); }
.drawer-scrim { position: fixed; inset: 0; background: rgb(2 6 23 / .5); z-index: 61; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.drawer-scrim.show { opacity: 1; pointer-events: auto; }

/* 抽屉内小节 */
.d-sec { margin-bottom: 20px; }
.d-sec:last-child { margin-bottom: 0; }
.d-sec__t { font-size: 13px; font-weight: 700; color: rgb(var(--ink)); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed rgb(var(--line)); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: rgb(var(--muted)); }
.kv span:last-child { color: rgb(var(--ink)); font-weight: 500; }

/* 轻提示 Toast */
.toast-wrap { position: fixed; top: 74px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); box-shadow: var(--shadow-lg); color: rgb(var(--ink)); font-size: 14px; font-weight: 500; animation: toastIn .34s var(--ease); }
.toast i { font-size: 16px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
.row-flash { animation: rowFlash 1.6s var(--ease); }
@keyframes rowFlash { 0% { background: rgb(var(--success) / .18); } 100% { background: transparent; } }

/* ---------- 动效 ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { transform: scale(1); opacity: .5; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pill { from { transform: translateY(-50%) scaleY(.15); opacity: 0; } to { transform: translateY(-50%) scaleY(1); opacity: 1; } }

.reveal { opacity: 0; animation: rise .5s var(--ease) forwards; }
.reveal-1 { animation-delay: .04s; }
.reveal-2 { animation-delay: .10s; }
.reveal-3 { animation-delay: .16s; }
.reveal-4 { animation-delay: .22s; }
.reveal-5 { animation-delay: .28s; }
.reveal-6 { animation-delay: .34s; }

.view { display: none; }
.view.active { display: block; animation: viewIn .36s var(--ease) both; }
.tabpane { display: none; }
.tabpane.active { display: block; animation: paneIn .32s var(--ease); }

/* 抽屉内容分段渐入 */
.drawer.open .drawer__body > .d-sec { opacity: 0; animation: rise .44s var(--ease) forwards; }
.drawer.open .drawer__body > .d-sec:nth-child(1) { animation-delay: .06s; }
.drawer.open .drawer__body > .d-sec:nth-child(2) { animation-delay: .12s; }
.drawer.open .drawer__body > .d-sec:nth-child(3) { animation-delay: .18s; }
.drawer.open .drawer__body > .d-sec:nth-child(4) { animation-delay: .24s; }

/* ---------- 响应式：侧栏抽屉化 ---------- */
@media (max-width: 1024px) {
  .app-shell, .app-shell.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); z-index: 41;
    transform: translateX(-100%); transition: transform .32s var(--ease);
  }
  .app-shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 14px; }
  .hide-sm { display: none !important; }
}
@media (min-width: 1025px) { .only-sm { display: none !important; } }

/* ---------- 头像 ----------
   原型没有真实照片，用「圆形底色 + 默认人像剪影」表达头像语义，比首字方块更像档案头像。
   接真实数据时把内部 svg 换成 <img> 即可，外层样式不用动。 */
.avatar {
  display: grid; place-items: center; overflow: hidden;
  border-radius: 50%;
  background: rgb(var(--surface-2));
  color: #fff;
}
.avatar > svg { width: 100%; height: 100%; fill: currentColor; fill-opacity: .9; }
.avatar > img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg {
  width: 64px; height: 64px;
  box-shadow: 0 0 0 3px rgb(var(--surface)), 0 0 0 4px rgb(var(--line));
}

/* ---------- 分页（列表底部标准分页条） ---------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.pager__info { font-size: 12.5px; color: rgb(var(--faint)); }
.pager__info b { color: rgb(var(--ink)); font-weight: 700; }
.pager__ctrl { display: inline-flex; align-items: center; gap: 6px; }
.pager__btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgb(var(--line-strong)); border-radius: var(--r-sm);
  background: rgb(var(--surface)); color: rgb(var(--body));
  font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s;
}
.pager__btn i { font-size: 11px; }
.pager__btn:hover:not(:disabled):not(.is-active) { border-color: rgb(var(--primary) / .5); color: rgb(var(--primary-strong)); background: rgb(var(--primary) / .06); }
.pager__btn.is-active { background: rgb(var(--primary)); border-color: rgb(var(--primary)); color: #fff; cursor: default; }
.pager__btn:disabled { color: rgb(var(--faint)); background: rgb(var(--surface-2)); cursor: not-allowed; }

/* 无障碍：尊重减弱动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; }
}


/* 全端列表操作列统一为文字操作：保留 button 语义与原事件，仅移除按钮视觉。
   产品标注 2026-08-10：操作列链接不再单独给颜色，与表格正文字体保持一致（悬停下划线保留可点击感）。
   产品标注 2026-08-11：操作列文字不再加粗，字重与表格正文一致。
   产品标注 2026-08-12：全端操作列统一对齐「机构管理 · 学校」页的 .org-link 样式——
   主色文字、13px、项间距 12px；停用等破坏性操作用危险色，提醒类用警告色，禁用态用弱化色。 */
.tbl-act,
.table td:last-child .btn,
.table td:last-child button.btn {
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: rgb(var(--primary)) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  white-space: nowrap;
}
.tbl-act:hover,
.table td:last-child .btn:hover,
.table td:last-child button.btn:hover { text-decoration: underline; transform: none !important; }
/* 多个操作之间的间距对齐 .org-link-group 的 12px（操作单元格内均为 flex 容器） */
.table td:last-child > .flex { gap: 12px; }
.tbl-act.is-danger,
.table td:last-child .btn-danger { color: rgb(var(--danger)) !important; }
.tbl-act.is-warning { color: rgb(var(--warning)) !important; }
.tbl-act.is-muted { color: rgb(var(--muted)) !important; }
.tbl-act:disabled,
.table td:last-child .btn:disabled { color: rgb(var(--faint)) !important; cursor: not-allowed; }
.tbl-act:disabled:hover,
.table td:last-child .btn:disabled:hover { text-decoration: none; }
