/* ==================================================================
   活动运营管理系统 —— 样式表（浅色主题）
   设计要点：
   · PC 端：左侧固定侧边栏 + 顶部栏 + 内容区
   · 手机端：顶部栏 + 底部标签栏（拇指可达），列表转卡片，表单全屏抽屉
   · 所有颜色走 CSS 变量，便于整体换色
   ================================================================== */

:root {
  /* 主色 */
  --primary: #1e6fdc;
  --primary-hover: #1a5fc0;
  --primary-soft: #eaf2fd;
  --primary-line: #c7dcf8;

  /* 语义色（中国习惯：涨红跌绿，此处用于状态语义，不用于股价） */
  --success: #17a673;
  --success-soft: #e6f7f1;
  --warning: #e0a020;
  --warning-soft: #fdf4e3;
  --danger: #d94b3e;
  --danger-soft: #fdeceb;
  --info: #4b7bd9;
  --info-soft: #eef3fd;

  /* 中性色 */
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e3e8f0;
  --border-strong: #cfd7e3;
  --text: #1c2433;
  --text-2: #5a6579;
  --text-3: #8b95a7;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 56, .06);
  --shadow: 0 2px 10px rgba(20, 32, 56, .08);
  --shadow-lg: 0 12px 40px rgba(20, 32, 56, .16);

  --topbar-h: 56px;
  --tabbar-h: 58px;
  --sidebar-w: 216px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
a { color: var(--primary); text-decoration: none; }
code { font-family: var(--mono); font-size: .92em; background: #eef1f6; padding: 1px 5px; border-radius: 4px; color: #3b4a63; }
[hidden] { display: none !important; }

/* ============================ 登录 ============================ */

.login-wrap {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: 20px; overflow: auto;
}
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 12% 8%, #dbe9fd 0%, transparent 60%),
    radial-gradient(800px 520px at 88% 92%, #e2f3ec 0%, transparent 58%),
    linear-gradient(160deg, #f7f9fc 0%, #eef2f8 100%);
}
.login-card {
  position: relative; width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 30px 28px 24px;
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.login-logo { flex: none; line-height: 0; }
.login-brand h1 { font-size: 19px; letter-spacing: -.2px; }
.login-brand p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

.login-tabs {
  display: flex; gap: 4px; background: #f1f4f9; padding: 4px;
  border-radius: var(--radius-sm); margin-bottom: 18px;
}
.login-tab {
  flex: 1; border: 0; background: transparent; padding: 8px 10px;
  font: inherit; font-size: 13.5px; color: var(--text-2);
  border-radius: 5px; cursor: pointer; transition: all .15s;
}
.login-tab.active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }

.login-pane { display: block; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.login-error {
  background: var(--danger-soft); color: var(--danger); border: 1px solid #f6cfcb;
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px;
}
.login-hint { margin: 14px 0 0; font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.7; }

.dd-users { display: grid; gap: 8px; max-height: 300px; overflow: auto; margin-bottom: 4px; }
.dd-user {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); cursor: pointer; font: inherit; transition: all .15s;
}
.dd-user:hover { border-color: var(--primary-line); background: var(--primary-soft); }
.dd-user .avatar { width: 34px; height: 34px; font-size: 14px; }
.dd-user-name { font-weight: 600; font-size: 13.5px; }
.dd-user-sub { font-size: 12px; color: var(--text-3); }
.loading-inline { color: var(--text-3); font-size: 13px; padding: 16px; text-align: center; }

/* ============================ 骨架 ============================ */

.app-shell { min-height: 100%; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 60;
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.menu-toggle { display: none; }

.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); cursor: pointer; transition: all .15s;
}
.icon-btn:hover { background: #f0f3f8; color: var(--text); }
.bell-badge {
  position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px;
  border-radius: 8px; text-align: center;
}

.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  border-radius: 999px; cursor: pointer; transition: background .15s;
}
.user-chip:hover { background: #f0f3f8; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--primary), #3f8ae8);
  color: #fff; font-size: 13px; font-weight: 600;
  display: grid; place-items: center;
}
.user-meta { line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-3); }

.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 55;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.side-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.side-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; margin-bottom: 2px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 13.5px;
  cursor: pointer; text-align: left; transition: all .14s;
}
.side-item:hover { background: #f2f5fa; color: var(--text); }
.side-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side-item svg { flex: none; opacity: .9; }
.side-group-label {
  font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .4px;
  padding: 14px 11px 6px;
}
.sidebar-foot { padding: 10px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.dd-badge {
  font-size: 11.5px; padding: 6px 9px; border-radius: 6px; line-height: 1.5;
  background: var(--warning-soft); color: #8a6414; border: 1px solid #f0dcae;
}
.dd-badge.real { background: var(--success-soft); color: #0f7a55; border-color: #b9e6d6; }
.sidebar-mask { position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(18,26,42,.4); z-index: 54; }

.content {
  margin-left: var(--sidebar-w); padding: 18px 20px 40px;
  padding-top: calc(var(--topbar-h) + 18px);
  min-height: 100vh;
}
.loading-page {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 70px 0; color: var(--text-3); font-size: 13.5px;
}

.tabbar { display: none; }

/* ============================ 通用组件 ============================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px;
  cursor: pointer; transition: all .15s; white-space: nowrap; line-height: 1.3;
}
.btn:hover { border-color: var(--primary-line); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c33f33; border-color: #c33f33; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f0f3f8; color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { padding: 11px 18px; font-size: 15px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14.5px; flex: 1; min-width: 0; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 25px; font-weight: 700; margin-top: 6px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.stat.warn .stat-value { color: var(--warning); }
.stat.danger .stat-value { color: var(--danger); }
.stat.ok .stat-value { color: var(--success); }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 5px; font-size: 12px; font-weight: 500; line-height: 1.6;
  background: #eef1f6; color: var(--text-2); white-space: nowrap;
}
.tag.blue { background: var(--primary-soft); color: #1553a8; }
.tag.green { background: var(--success-soft); color: #0f7a55; }
.tag.orange { background: var(--warning-soft); color: #8a6414; }
.tag.red { background: var(--danger-soft); color: #a83226; }
.tag.gray { background: #eef1f6; color: var(--text-2); }
.tag.purple { background: #f1eefd; color: #5a45b8; }

.notice {
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid; line-height: 1.6; margin-bottom: 12px;
}
.notice-info { background: var(--info-soft); border-color: #cfdcf7; color: #2b5599; }
.notice-warn { background: var(--warning-soft); border-color: #f0dcae; color: #8a6414; }
.notice-danger { background: var(--danger-soft); border-color: #f6cfcb; color: #a83226; }
.notice-ok { background: var(--success-soft); border-color: #b9e6d6; color: #0f7a55; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl th {
  background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12.5px;
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tbl tbody tr:hover { background: #f8fafd; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
table.tbl td.actions { white-space: nowrap; text-align: right; }
.empty { padding: 44px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty svg { opacity: .35; margin-bottom: 8px; }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.pager-info { font-size: 12.5px; color: var(--text-3); }
.pager-btns { display: flex; gap: 6px; align-items: center; }

.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.toolbar .spacer { flex: 1; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month],
input[type=datetime-local], input[type=search], input[type=tel], input[type=email], select, textarea {
  font: inherit; font-size: 13.5px; padding: 7px 10px; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface);
  width: 100%; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,111,220,.12);
}
input:disabled, select:disabled, textarea:disabled { background: #f4f6fa; color: var(--text-3); cursor: not-allowed; }
input[readonly] { background: #f7f9fc; color: var(--text-2); }
textarea { resize: vertical; min-height: 68px; }
select { background-image: none; }
.search-box { position: relative; min-width: 190px; }
.search-box input { padding-left: 30px; }
.search-box svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.filter-select { min-width: 118px; width: auto; }
.toolbar-label { font-size: 12.5px; color: var(--text-3); margin-right: -3px; }

/* 表单栅格 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.req::after { content: " *"; color: var(--danger); font-weight: 700; }
.field-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.field-error { font-size: 11.5px; color: var(--danger); margin-top: 4px; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217,75,62,.1); }

/* 弹窗 */
.modal-host { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; background: rgba(18,26,42,.42); }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column;
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal.wide { max-width: 940px; }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15.5px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); }

/* 抽屉 */
.drawer-host { position: fixed; inset: 0; z-index: 200; background: rgba(18,26,42,.42); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 100%; max-width: 620px;
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slideIn .2s ease-out;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 15.5px; flex: 1; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); }

/* 底部动作面板（手机） */
.sheet-host { position: fixed; inset: 0; z-index: 210; background: rgba(18,26,42,.42); display: flex; align-items: flex-end; }
.sheet {
  width: 100%; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 82vh; overflow-y: auto; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  animation: sheetUp .2s ease-out;
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-title { padding: 12px 18px 8px; font-size: 13px; color: var(--text-3); font-weight: 600; }
.sheet-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 14px 18px;
  border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text);
  cursor: pointer; text-align: left;
}
.sheet-item:hover { background: var(--surface-2); }
.sheet-item.danger { color: var(--danger); }
.sheet-cancel { margin: 8px 14px 0; padding: 13px; text-align: center; border-top: 1px solid var(--border); color: var(--text-2); }

/* Toast */
.toast-host {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 300;
  display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  background: #22304a; color: #fff; padding: 10px 16px; border-radius: 9px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease-out;
  max-width: 92vw; line-height: 1.5;
}
.toast.ok { background: #12805a; }
.toast.err { background: #c33f33; white-space: pre-wrap; }
.toast.warn { background: #a8791a; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

.spinner {
  width: 18px; height: 18px; border: 2px solid var(--primary-line);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 详情描述列表 */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 13.5px; align-items: baseline; }
.dl dt { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.dl dd { margin: 0; word-break: break-all; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 13px 20px; }
.kv-item .k { font-size: 12px; color: var(--text-3); }
.kv-item .v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kv-item .v.money { color: var(--primary); }

/* 进度条 */
.bar { height: 6px; background: #eef1f6; border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.bar.ok > i { background: var(--success); }
.bar.warn > i { background: var(--warning); }
.bar.danger > i { background: var(--danger); }

/* 看板分栏 */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.board-col-head { padding: 10px 13px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.board-col-body { padding: 8px; display: grid; gap: 7px; max-height: 460px; overflow-y: auto; }
.board-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; font-size: 12.5px; cursor: pointer; transition: all .14s; }
.board-item:hover { border-color: var(--primary-line); box-shadow: var(--shadow-sm); }
.board-item .t { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.board-item .m { color: var(--text-3); font-size: 11.5px; }
.board-empty { padding: 22px 10px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 0 16px; background: var(--surface); }
.tab {
  padding: 11px 14px; border: 0; background: transparent; font: inherit; font-size: 13.5px;
  color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 步骤条 */
.steps { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; font-size: 13px; background: #eef1f6; color: var(--text-3); }
.step.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.step.done { background: var(--success-soft); color: #0f7a55; }
.step-n { width: 18px; height: 18px; border-radius: 50%; background: currentColor; color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 700; }

/* 财务结果面板 */
.fin-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fin-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; }
.fin-cell .k { font-size: 12px; color: var(--text-3); }
.fin-cell .v { font-size: 20px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.fin-cell .x { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.fin-cell.hl { background: var(--primary-soft); border-color: var(--primary-line); }
.fin-cell.hl .v { color: var(--primary); }
.fin-cell.good .v { color: var(--success); }
.fin-cell.bad .v { color: var(--danger); }

/* 成本明细小表 */
.tbl-sm { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl-sm th, .tbl-sm td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.tbl-sm th { font-size: 12px; color: var(--text-3); font-weight: 600; background: var(--surface-2); }
.tbl-sm td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 预警条目 */
.alert-item {
  display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .13s;
}
.alert-item:hover { background: var(--surface-2); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 7px; }
.alert-dot.SEVERE { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.alert-dot.URGENT { background: #e8734a; box-shadow: 0 0 0 3px #fdede6; }
.alert-dot.ATTENTION { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.alert-dot.INFO { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.alert-main { flex: 1; min-width: 0; }
.alert-title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.alert-content { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.alert-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 条码/二维码 */
.barcode-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.barcode-label {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px;
  text-align: center; background: #fff;
}
.barcode-label .nm { font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.barcode-label .cd { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); margin-top: 4px; word-break: break-all; }
.barcode-label svg { max-width: 100%; height: auto; }

/* 扫码页 */
.scan-stage {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 26px 16px; text-align: center; background: var(--surface-2);
}
.scan-stage video { width: 100%; max-height: 300px; border-radius: var(--radius-sm); background: #000; }

/* 进度圈 */
.ring { --p: 0; width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), #eef1f6 0); }
.ring > div { width: 78px; height: 78px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 17px; font-weight: 700; }

/* 分隔 */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs15 { font-size: 15px; } .fs16 { font-size: 16px; }
.bold { font-weight: 600; }
.flex { display: flex; } .flex-col { flex-direction: column; } .aic { align-items: center; } .jcb { justify-content: space-between; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.hidden-lg { display: none; }

/* ============================ 响应式 ============================ */

@media (max-width: 1080px) {
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; padding: 14px 12px calc(var(--tabbar-h) + 22px); padding-top: calc(var(--topbar-h) + 14px); }
  .user-meta { display: none; }
  .user-chip svg { display: none; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .stat-value { font-size: 22px; }
  .modal { max-height: 92vh; border-radius: var(--radius); }
  .drawer { max-width: 100%; }
  .modal-host { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-width: 100%; }

  /* 手机底部标签栏 */
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 58;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -1px 8px rgba(20,32,56,.05);
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: transparent; color: var(--text-3); font: inherit;
    font-size: 10.5px; cursor: pointer; padding: 0; position: relative;
  }
  .tabbar-item.active { color: var(--primary); font-weight: 600; }
  .tabbar-item svg { width: 21px; height: 21px; }
  .tabbar-item .dot {
    position: absolute; top: 5px; left: 50%; margin-left: 5px;
    min-width: 15px; height: 15px; padding: 0 4px; background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700; border-radius: 8px; line-height: 15px; text-align: center;
  }

  /* 列表转卡片 */
  table.tbl.responsive thead { display: none; }
  table.tbl.responsive tbody tr {
    display: block; margin-bottom: 9px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface); padding: 4px 0; box-shadow: var(--shadow-sm);
  }
  table.tbl.responsive tbody td {
    display: flex; justify-content: space-between; gap: 12px; padding: 6px 13px;
    border-bottom: 0; text-align: right; align-items: baseline;
  }
  table.tbl.responsive tbody td::before {
    content: attr(data-label); color: var(--text-3); font-size: 12px; font-weight: 500;
    text-align: left; flex: none; max-width: 45%;
  }
  table.tbl.responsive tbody td.cell-primary {
    font-weight: 600; font-size: 14.5px; padding-top: 9px; padding-bottom: 7px;
    border-bottom: 1px solid var(--border); margin-bottom: 3px;
  }
  table.tbl.responsive tbody td.cell-primary::before { color: var(--text-3); }
  table.tbl.responsive tbody td.actions { justify-content: flex-end; padding-bottom: 9px; }
  table.tbl.responsive tbody td.actions::before { content: ""; display: none; }
  .table-wrap { overflow-x: visible; }
  .pager { justify-content: center; }
  .toolbar { padding: 10px 12px; }
  .toolbar .search-box { flex: 1; min-width: 130px; }
  .board { grid-template-columns: 1fr; }
  .board-col-body { max-height: none; }
  .tabs { padding: 0 12px; }
  .modal-foot .btn, .drawer-foot .btn { flex: 1; }
}

@media (max-width: 420px) {
  .card-body { padding: 13px; }
  .card-head { padding: 11px 13px; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
}

@media print {
  .topbar, .sidebar, .tabbar, .toolbar, .pager, .btn, .sidebar-mask { display: none !important; }
  .content { margin: 0; padding: 0; }
  .card { box-shadow: none; border-color: #ccc; }
  .barcode-label { break-inside: avoid; }
}
