/* =====================================================================
   Demo测试医院 · 诊后随访系统 — 组件层 components.css
   ---------------------------------------------------------------------
   职责：spec 6.2 组件清单的全部类名与静态状态（尺寸/颜色/边框/排版/
        hover/focus-visible/disabled/选中态）。动效（角标展开、扫光、
        涟漪、滑入、生长、抖动等）统一在 fx.css。
   视觉：深墨侧栏 + 羊皮纸内容区；莱茵几何语言用于框架与交互，
        正文阅读区保持干净。
   --------------------------------------------------------------------- */
@import url('base.css');

/* =====================================================================
   1. 按钮 .btn
   ===================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 15px;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--ink);
  background-color: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--t) var(--fx-ease), background-color var(--t) var(--fx-ease),
    border-color var(--t) var(--fx-ease), box-shadow var(--t) var(--fx-ease);
}

.btn:hover:not(:disabled) {
  color: var(--ink);
  background-color: var(--paper-3);
  border-color: var(--ink-4);
}

.btn:active:not(:disabled) {
  background-color: var(--paper-4);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px rgba(193, 82, 45, 0.5);
}

.btn:disabled,
.btn[disabled],
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn .ico {
  opacity: 0.9;
}

.btn-primary {
  color: #fff8f3;
  background-color: var(--accent);
  border-color: var(--accent-2);
  box-shadow: 0 6px 18px -10px rgba(193, 82, 45, 0.8), inset 0 1px 0 rgba(255, 248, 242, 0.16);
}

.btn-primary:hover:not(:disabled) {
  color: #fff8f3;
  background-color: var(--accent-2);
  border-color: var(--accent-2);
}

.btn-primary:active:not(:disabled) {
  background-color: #8c3920;
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px rgba(193, 82, 45, 0.55),
    0 6px 18px -10px rgba(193, 82, 45, 0.8);
}

.btn-ghost {
  color: var(--ink-2);
  background-color: transparent;
  border-color: var(--line-2);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background-color: var(--paper-3);
  border-color: var(--ink-4);
}

.btn-danger {
  color: var(--red);
  background-color: transparent;
  border-color: #d8b3ac;
  box-shadow: none;
}

.btn-danger:hover:not(:disabled) {
  color: var(--red-ink);
  background-color: var(--red-soft);
  border-color: var(--red);
}

.btn-sm {
  gap: 5px;
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: 6px;
}

.btn-lg {
  gap: 9px;
  min-height: 44px;
  padding: 11px 24px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  color: var(--ink-2);
  background-color: transparent;
  border-color: transparent;
  border-radius: 7px;
  box-shadow: none;
}

.btn-icon:hover:not(:disabled) {
  color: var(--ink);
  background-color: var(--paper-3);
  border-color: var(--line);
}

.btn-loading {
  cursor: progress;
  pointer-events: none;
}

/* 按钮内的等宽编号（可选结构） */
.btn .btn-num {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  opacity: 0.6;
}

/* =====================================================================
   2. 图标按钮 / 通知铃铛 / 账号 / 浮层菜单
   ===================================================================== */
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--ink-2);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: color var(--t-fast) var(--fx-ease), background-color var(--t-fast) var(--fx-ease),
    border-color var(--t-fast) var(--fx-ease);
}

.icon-btn:hover:not(:disabled) {
  color: var(--ink);
  background-color: var(--paper-3);
  border-color: var(--line);
}

.icon-btn:active:not(:disabled) {
  background-color: var(--paper-4);
}

.icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px rgba(193, 82, 45, 0.45);
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-btn .ico {
  color: currentColor;
}

.notif-btn {
  position: relative;
}

.notif-btn.loading .ico {
  opacity: 0.28;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--paper-2);
  pointer-events: none;
}

.notif-dot.show {
  display: block;
}

/* 账号按钮 */
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 3px 11px 3px 4px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: border-color var(--t) var(--fx-ease), background-color var(--t) var(--fx-ease);
}

.account-btn:hover {
  background: var(--paper-3);
  border-color: var(--ink-4);
}

.account-btn:active {
  background: var(--paper-4);
}

.account-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px rgba(193, 82, 45, 0.42);
}

.account-btn .avatar {
  width: 28px;
  height: 28px;
}

.account-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.account-role {
  padding-left: 8px;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  white-space: nowrap;
  border-left: 1px solid var(--line);
}

.account-caret {
  color: var(--ink-4);
}

/* 通用浮层 + 菜单 */
.popover {
  position: absolute;
  z-index: var(--z-popover);
  min-width: 190px;
  padding: 7px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
}

.popover.open {
  opacity: 1;
  pointer-events: auto;
}

.menu {
  display: grid;
  gap: 1px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--fx-ease), color var(--t-fast) var(--fx-ease);
}

.menu-item:hover:not(:disabled) {
  color: var(--ink);
  background: var(--paper-3);
}

.menu-item:active:not(:disabled) {
  background: var(--paper-4);
}

.menu-item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

.menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.menu-item.menu-danger {
  color: var(--red);
}

.menu-item.menu-danger:hover {
  color: var(--red-ink);
  background: var(--red-soft);
}

.menu-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--ink-3);
}

.menu-item:hover .menu-ico {
  color: var(--accent-2);
}

.menu-item.menu-danger:hover .menu-ico {
  color: var(--red-ink);
}

.menu-sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--line);
}

/* =====================================================================
   3. 卡片 / KPI
   ===================================================================== */
.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 20px 22px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.card-title::before {
  content: '';
  flex: none;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

.card-title .spacer {
  flex: 1;
}

.card-hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink-4);
}

.card-link,
.pressable {
  cursor: pointer;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.kpi-label .ico {
  color: var(--ink-4);
}

.kpi-num {
  margin: 9px 0 7px;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi-num small {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-3);
}

.kpi-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 18px;
  font-size: 12px;
  color: var(--ink-3);
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  border-radius: var(--r-xs);
  color: var(--ink-2);
  background: var(--paper-3);
}

.kpi-trend.up {
  color: var(--sage-ink);
  background: var(--sage-soft);
}

.kpi-trend.down {
  color: var(--red-ink);
  background: var(--red-soft);
}

.kpi-trend.flat {
  color: var(--ink-3);
  background: var(--paper-3);
}

.kpi-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--line);
}

.kpi-bar i {
  display: block;
  width: var(--kpi, 38%);
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left center;
}

.kpi[data-tone='sage'] .kpi-bar i {
  background: linear-gradient(90deg, #4c6d55, var(--sage));
}

.kpi[data-tone='amber'] .kpi-bar i {
  background: linear-gradient(90deg, #96700f, var(--amber));
}

.kpi[data-tone='red'] .kpi-bar i {
  background: linear-gradient(90deg, #862f27, var(--red));
}

.kpi[data-tone='blue'] .kpi-bar i {
  background: linear-gradient(90deg, #2f4a6e, var(--blue));
}

/* =====================================================================
   4. 数据表 .dt / 表格 / 分页 / 筛选 / 搜索
   ===================================================================== */
.dt {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.dt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dt-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dt-search {
  position: relative;
  display: flex;
  align-items: center;
}

.dt-search > .ico {
  position: absolute;
  left: 10px;
  z-index: 1;
  color: var(--ink-4);
  pointer-events: none;
}

.dt-search .input,
.dt-search > input {
  min-width: 220px;
  height: 34px;
  padding: 0 12px 0 32px;
  font-size: 13px;
}

.dt-table {
  width: 100%;
}

table.dt-table {
  border-collapse: collapse;
  font-size: 13.5px;
}

table.dt-table th {
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
  color: var(--ink-3);
  background: transparent;
  border-bottom: 1px solid var(--line-2);
}

table.dt-table td {
  padding: 12px 14px;
  vertical-align: middle;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}

table.dt-table tbody tr {
  transition: background-color var(--t-fast) var(--fx-ease), box-shadow var(--t-fast) var(--fx-ease);
}

table.dt-table tbody tr:hover {
  background: #fffdf8;
  box-shadow: inset 2px 0 0 var(--accent);
}

table.dt-table tbody tr.selected {
  background: var(--accent-tint);
  box-shadow: inset 2px 0 0 var(--accent);
}

table.dt-table tbody tr:last-child td {
  border-bottom: 0;
}

table.dt-table .cell-strong {
  font-weight: 600;
  color: var(--ink);
}

table.dt-table .cell-mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

/* 网格行（div 版表格 / 列表行） */
.dt-row {
  position: relative;
  display: grid;
  grid-template-columns: var(
    --dt-cols,
    minmax(160px, 1.5fr) minmax(110px, 1fr) minmax(100px, 0.9fr) auto
  );
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: transparent;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--t-fast) var(--fx-ease), box-shadow var(--t-fast) var(--fx-ease);
}

.dt-row:last-child {
  border-bottom: 0;
}

.dt-row:hover {
  background: #fffdf8;
  box-shadow: inset 2px 0 0 var(--accent);
}

.dt-row.selected {
  background: var(--accent-tint);
  box-shadow: inset 2px 0 0 var(--accent);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.dt-empty {
  padding: 38px 20px;
  font-size: 13px;
  text-align: center;
  color: var(--ink-3);
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pager-info {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.pager-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pager-btn {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}

.pager-btn:hover:not(:disabled) {
  color: var(--ink);
  background: var(--paper-3);
  border-color: var(--ink-4);
}

.pager-btn.active {
  color: var(--paper-2);
  background: var(--ink);
  border-color: var(--ink);
}

.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pager-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px rgba(193, 82, 45, 0.4);
}

/* 胶囊筛选按钮（.filter 为旧类名兼容别名） */
.chip-btn,
.filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 12px;
  overflow: hidden;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t-fast) var(--fx-ease), background-color var(--t-fast) var(--fx-ease),
    border-color var(--t-fast) var(--fx-ease);
}

.chip-btn:hover,
.filter:hover {
  color: var(--accent-2);
  background: var(--accent-tint);
  border-color: var(--accent-soft);
}

.chip-btn.active,
.filter.active {
  color: var(--paper-2);
  background: var(--ink);
  border-color: var(--ink);
}

.chip-btn:focus-visible,
.filter:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px rgba(193, 82, 45, 0.35);
}

.chip-btn .count {
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.65;
}

/* =====================================================================
   5. 徽标 / 状态 / 风险 / 标签
   ===================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
}

.chip-dot,
.chip > i {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.chip-ok {
  color: var(--sage-ink);
  background: var(--sage-soft);
  border-color: #c6d5c7;
}

.chip-warn {
  color: var(--amber-ink);
  background: var(--amber-soft);
  border-color: #e4d3a2;
}

.chip-danger {
  color: var(--red-ink);
  background: var(--red-soft);
  border-color: #e2bdb6;
}

.chip-info {
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-color: #c9d4e4;
}

.chip-muted {
  color: var(--ink-3);
  background: var(--paper-3);
  border-color: var(--line);
}

/* 风险等级 */
.risk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 5px;
}

.risk i {
  flex: none;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
}

.risk-low {
  color: var(--sage-ink);
  background: var(--sage-soft);
  border-color: #c6d5c7;
}

.risk-medium {
  color: var(--amber-ink);
  background: var(--amber-soft);
  border-color: #e4d3a2;
}

.risk-high {
  color: var(--red-ink);
  background: var(--red-soft);
  border-color: #e2bdb6;
}

.risk-unknown {
  color: var(--ink-3);
  background: var(--paper-3);
  border-color: var(--line);
}

/* 普通标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 8px;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
}

.tag-accent {
  color: var(--accent-2);
  background: var(--accent-tint);
  border-color: var(--accent-soft);
}

/* 业务状态（ui.statusChip / reportChip 生成 .status-<status>） */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
}

.status::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.status-pending {
  color: var(--amber-ink);
  background: var(--amber-soft);
  border-color: #e4d3a2;
}

.status-accepted {
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-color: #c9d4e4;
}

.status-snoozed {
  color: var(--ink-2);
  background: var(--paper-3);
  border-color: var(--line-2);
}

.status-in_progress,
.status-in-progress {
  color: var(--accent-2);
  background: var(--accent-tint);
  border-color: var(--accent-soft);
}

.status-completed {
  color: var(--sage-ink);
  background: var(--sage-soft);
  border-color: #c6d5c7;
}

.status-overdue {
  color: var(--red-ink);
  background: var(--red-soft);
  border-color: #e2bdb6;
}

.status-cancelled {
  color: var(--ink-3);
  background: transparent;
  border-color: var(--line-2);
}

.status-active {
  color: var(--sage-ink);
  background: var(--sage-soft);
  border-color: #c6d5c7;
}

.status-archived {
  color: var(--ink-3);
  background: var(--paper-3);
  border-color: var(--line);
}

.status-disabled {
  color: var(--ink-4);
  background: transparent;
  border-color: var(--line);
}

.status-open {
  color: var(--red-ink);
  background: var(--red-soft);
  border-color: #e2bdb6;
}

.status-acknowledged {
  color: var(--amber-ink);
  background: var(--amber-soft);
  border-color: #e4d3a2;
}

.status-resolved {
  color: var(--sage-ink);
  background: var(--sage-soft);
  border-color: #c6d5c7;
}

.status-unknown {
  color: var(--ink-3);
  background: var(--paper-3);
  border-color: var(--line);
}

/* 报告状态：ui.reportChip 生成 .status-report-<status> */
.status-report-pending_review,
.status-report-pending-review {
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-color: #c9d4e4;
}

.status-report-approved {
  color: var(--sage-ink);
  background: var(--sage-soft);
  border-color: #c6d5c7;
}

.status-report-rejected {
  color: var(--red-ink);
  background: var(--red-soft);
  border-color: #e2bdb6;
}

/* 预警级别：ui.alertTag 生成 .alert-tag.alert-high / .alert-medium */
.alert-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
}

.alert-tag::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
}

.alert-high,
.alert-tag-high {
  color: var(--red-ink);
  background: var(--red-soft);
  border-color: #e2bdb6;
}

.alert-medium,
.alert-tag-medium {
  color: var(--amber-ink);
  background: var(--amber-soft);
  border-color: #e4d3a2;
}

.alert-low,
.alert-tag-low {
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-color: #c9d4e4;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* =====================================================================
   6. 标签页 .tabs / .tab
   ===================================================================== */
.tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px 12px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color var(--t-fast) var(--fx-ease);
}

.tab:hover {
  color: var(--ink-2);
}

.tab.active {
  color: var(--ink);
}

.tab::after {
  content: '';
  position: absolute;
  right: 50%;
  bottom: -1px;
  left: 50%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.tab.active::after {
  right: 14%;
  left: 14%;
}

.tab:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-soft);
}

.tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  color: var(--ink-3);
  background: var(--paper-3);
  border-radius: 9px;
}

.tab.active .tab-count {
  color: var(--accent-2);
  background: var(--accent-soft);
}

/* =====================================================================
   7. 表单 .form
   ===================================================================== */
.form {
  display: grid;
  gap: 15px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  transition: color var(--t-fast) var(--fx-ease);
}

.field:focus-within .field-label {
  color: var(--accent-2);
}

.field-label .req {
  color: var(--accent-2);
  font-size: 12px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color var(--t-fast) var(--fx-ease), box-shadow var(--t) var(--fx-ease),
    background-color var(--t-fast) var(--fx-ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-4);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-4);
}

.input:focus,
.select:focus,
.textarea:focus {
  background-color: #fffdf8;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.55;
  background-color: var(--paper-3);
  cursor: not-allowed;
}

.select {
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%237f7466' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

.textarea {
  min-height: 92px;
  line-height: 1.65;
  resize: vertical;
}

.hint {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

/* 校验错误：ui.setFieldError 会加 .has-error + .shake + 插入 .field-error */
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.field.has-error .field-label {
  color: var(--red-ink);
}

.field-error {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--red);
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch > span,
.switch .switch-track {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  background: var(--paper-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  transition: background-color var(--t) var(--fx-ease), border-color var(--t) var(--fx-ease);
}

.switch > span::after,
.switch .switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(35, 30, 25, 0.25);
}

.switch input:checked + span,
.switch input:checked + .switch-track {
  background: var(--accent);
  border-color: var(--accent-2);
}

.switch input:focus-visible + span,
.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px rgba(193, 82, 45, 0.45);
}

.switch input:disabled + span,
.switch input:disabled + .switch-track {
  opacity: 0.5;
}

.switch.is-disabled {
  cursor: not-allowed;
}

/* 复选 */
.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.check input {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--paper-2);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--fx-ease), border-color var(--t-fast) var(--fx-ease);
}

.check input:hover {
  border-color: var(--ink-4);
}

.check input:checked {
  background: var(--accent);
  border-color: var(--accent-2);
}

.check input:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4.5px;
  width: 4px;
  height: 8px;
  border: solid #fff8f3;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

.check input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.check input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 表单底部操作区（可选内层） */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

/* =====================================================================
   8. 遮罩 / 抽屉 / 弹层
   ===================================================================== */
.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: rgba(32, 27, 22, 0.34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
}

.scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  width: min(520px, 94vw);
  background: var(--paper-2);
  border-left: 1px solid var(--line-2);
  box-shadow: -24px 0 60px -30px rgba(35, 30, 25, 0.5);
  transform: translateX(102%);
  visibility: hidden;
}

.drawer.open {
  transform: none;
  visibility: visible;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex: none;
  padding: 17px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.drawer-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.drawer-close {
  flex: none;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px 26px;
  overflow-y: auto;
}

.drawer-foot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 20px;
  background: var(--paper-3);
  border-top: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 27, 22, 0.42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  max-height: min(84dvh, 860px);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.985);
}

.modal.open .modal-card {
  transform: none;
}

.modal-card.modal-sm {
  width: min(380px, 100%);
}

.modal-card.modal-lg {
  width: min(760px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: none;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.modal-body {
  display: grid;
  flex: 1 1 auto;
  gap: 14px;
  min-height: 0;
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-body > p,
.modal-body > .confirm-text {
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--ink-2);
}

.modal-foot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
}

/* =====================================================================
   9. 反馈：toast / alert-banner / legal-note
   ===================================================================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, 86vw);
  padding: 11px 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--paper-2);
  background: var(--ink);
  border-left: 3px solid var(--accent);
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-ok {
  border-left-color: var(--sage);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-info {
  border-left-color: var(--blue);
}

/* 兼容旧 data-kind 写法 */
.toast[data-kind='ok'] {
  border-left-color: var(--sage);
}

.toast[data-kind='error'] {
  border-left-color: var(--red);
}

.toast[data-kind='info'] {
  border-left-color: var(--blue);
}

.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 15px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--amber-ink);
  background: var(--amber-soft);
  border: 1px solid #e4d3a2;
  border-radius: var(--r-sm);
}

.alert-banner .ico {
  margin-top: 1px;
  flex: none;
}

.alert-banner > div {
  min-width: 0;
}

.alert-banner b {
  font-weight: 600;
}

.alert-banner-danger {
  color: var(--red-ink);
  background: var(--red-soft);
  border-color: #e2bdb6;
}

.alert-banner-info {
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-color: #c9d4e4;
}

.alert-banner-ok {
  color: var(--sage-ink);
  background: var(--sage-soft);
  border-color: #c6d5c7;
}

.legal-note {
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-3);
  background: rgba(251, 248, 241, 0.65);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-xs);
}

.legal-note b {
  color: var(--ink-2);
  font-weight: 600;
}

/* =====================================================================
   10. 空态 / 骨架屏
   ===================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 46px 24px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 2px;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink-4);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 50%;
}

.empty-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.empty-desc {
  max-width: 340px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.empty-state .btn {
  margin-top: 8px;
}

.skeleton {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, var(--paper-3) 25%, var(--paper-4) 37%, var(--paper-3) 63%);
  background-size: 400% 100%;
  border-radius: 4px;
}

.skeleton-line:last-child {
  width: 62%;
}

/* =====================================================================
   11. 时间轴
   ===================================================================== */
.timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 18px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--line-2);
}

.tl-item:last-child::before {
  display: none;
}

.tl-dot {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  background: var(--paper-2);
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
}

.tl-item.done .tl-dot {
  background: var(--sage);
  border-color: var(--sage);
}

.tl-item.active .tl-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tl-item.alert .tl-dot {
  background: var(--red);
  border-color: var(--red);
}

.tl-time {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}

.tl-main {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
}

.tl-main b {
  margin-right: 6px;
  font-weight: 600;
  color: var(--ink);
}

.tl-main p {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* =====================================================================
   12. 图表（CSS 柱状/环形/迷你趋势 + ui.js 的纯 SVG 图表容器）
   ===================================================================== */
.chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 180px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
}

.chart-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  min-width: 0;
}

.chart-bar > i {
  display: block;
  width: 100%;
  max-width: 34px;
  height: var(--h, 50%);
  background: var(--bar-color, var(--accent));
  border-radius: 3px 3px 0 0;
  opacity: 0.9;
  transform-origin: bottom center;
}

.chart-bar > i.bar-sage {
  --bar-color: var(--sage);
}
.chart-bar > i.bar-amber {
  --bar-color: var(--amber);
}
.chart-bar > i.bar-red {
  --bar-color: var(--red);
}
.chart-bar > i.bar-blue {
  --bar-color: var(--blue);
}

.chart-bar-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  color: var(--ink-2);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-item i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-item b {
  margin-left: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
}

/* ui.js：SVG 柱状图 / 环形图 */
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 22px;
}

.chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.chart-xlabels {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 18px;
}

.chart-xlabels span {
  position: absolute;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
  transform: translateX(-50%);
}

.chart-donut-wrap {
  position: relative;
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
}

.chart-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  pointer-events: none;
}

.chart-donut-center b {
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chart-donut-center span {
  font-size: 11px;
  color: var(--ink-3);
}

.chart-arc {
  transition: stroke-dasharray var(--t-slow) var(--fx-out);
}

/* 纯 CSS 环形图（静态数据用） */
.chart-donut {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(
    var(--sage) 0 var(--p1, 40%),
    var(--amber) var(--p1, 40%) var(--p2, 72%),
    var(--red) var(--p2, 72%) 100%
  );
}

.chart-donut::after {
  content: '';
  position: absolute;
  inset: 22px;
  background: var(--paper-2);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* 迷你趋势条 */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 38px;
  width: 100%;
}

.sparkline i {
  flex: 1;
  min-width: 2px;
  height: var(--h, 40%);
  background: var(--line-2);
  border-radius: 1px;
  transform-origin: bottom center;
}

.sparkline i.on {
  background: var(--accent);
}

/* =====================================================================
   13. KV 网格 / 分隔线 / 几何装饰
   ===================================================================== */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 28px;
  margin: 0;
}

.kv-grid > div,
.kv-item {
  min-width: 0;
}

.kv-grid dt,
.kv-grid .kv-key {
  margin-bottom: 2px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.kv-grid dd,
.kv-grid .kv-val {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  word-break: break-word;
}

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

.divider-strong {
  background: var(--line-2);
}

.divider-v {
  width: 1px;
  height: auto;
  align-self: stretch;
  margin: 0 12px;
  background: var(--line);
}

/* 六边形装饰：莱茵几何语言 */
.hex {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 38px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  background: var(--accent-soft);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.hex-ink {
  color: var(--paper-2);
  background: var(--ink-2);
}

.hex-lg {
  width: 46px;
  height: 52px;
  font-size: 13px;
}

/* 斜线纹理 */
.hatch {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(35, 30, 25, 0.07) 0 1px,
    transparent 1px 6px
  );
}

/* 十字准星 */
.cross {
  position: relative;
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.cross::before,
.cross::after {
  content: '';
  position: absolute;
  background: currentColor;
  opacity: 0.75;
}

.cross::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}

.cross::after {
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  transform: translateY(-50%);
}

/* 分段进度条 */
.seg-bar {
  display: flex;
  gap: 3px;
  width: 100%;
  height: 4px;
}

.seg-bar i {
  flex: 1;
  min-width: 2px;
  background: var(--paper-4);
  border-radius: 1px;
}

.seg-bar i.on {
  background: var(--accent);
}

.seg-bar i.done {
  background: var(--ink-2);
}

/* =====================================================================
   14. 通知列表（抽屉内）
   ===================================================================== */
.notif-list {
  display: grid;
  gap: 2px;
  margin: 0 -6px;
}

.notif-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 8px;
  align-items: start;
  gap: 11px;
  width: 100%;
  padding: 11px 10px;
  overflow: hidden;
  font-size: 13px;
  text-align: left;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--fx-ease), border-color var(--t-fast) var(--fx-ease);
}

.notif-item:hover {
  background: var(--paper-3);
  border-color: var(--line);
}

.notif-item:focus-visible,
.dt-row:focus-visible,
.card-link:focus-visible,
.pressable:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-soft), inset 2px 0 0 var(--accent);
}

.notif-item.unread {
  background: var(--accent-tint);
}

.notif-item.unread:hover {
  background: var(--accent-soft);
}

.notif-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--ink-2);
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.notif-item.unread .notif-ico {
  color: var(--accent-2);
  background: var(--paper-2);
  border-color: var(--accent-soft);
}

.notif-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}

.notif-body {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notif-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

.notif-unread-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* =====================================================================
   15. 头像
   ===================================================================== */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-2);
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: 50%;
  user-select: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

/* =====================================================================
   16. 响应式
   ===================================================================== */
@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
  }

  .kpi {
    padding: 15px 16px 13px;
  }

  .kpi-num {
    font-size: 28px;
  }

  .drawer {
    width: 100%;
    max-width: 560px;
  }

  .modal {
    padding: 16px;
  }

  .dt-search .input,
  .dt-search > input {
    min-width: 160px;
  }
}

@media (max-width: 620px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dt {
    overflow-x: auto;
  }

  table.dt-table {
    min-width: 560px;
  }

  .dt-toolbar {
    align-items: stretch;
  }

  .dt-search {
    width: 100%;
  }

  .dt-search .input,
  .dt-search > input {
    width: 100%;
    min-width: 0;
  }

  .tabs .tab {
    padding: 10px 13px 11px;
    font-size: 13.5px;
  }

  .modal-card {
    width: 100%;
  }

  .account-name {
    display: none;
  }
}
