/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 15px 18px;
  border-bottom: 1px solid var(--border-light); min-height: 52px;
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-body.pad0 { padding: 0; }
.card-foot { padding: 14px 18px; border-top: 1px solid var(--border-light); }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title-row h4 { font-size: 14px; font-weight: 600; }
.card-desc { font-size: 12px; color: var(--text-3); line-height: 1.7; }

/* ============ 指标卡 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.stat-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 16px 16px 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat-label svg { width: 14px; height: 14px; color: var(--text-3); }
.stat-value {
  font-size: 25px; font-weight: 600; letter-spacing: 0.2px; margin-top: 10px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-value small { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 3px; }
.stat-foot { margin-top: 9px; font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.stat-foot .up { color: var(--success); display: inline-flex; align-items: center; gap: 2px; }
.stat-foot .down { color: var(--danger); display: inline-flex; align-items: center; gap: 2px; }
.stat-foot svg { width: 11px; height: 11px; }
.stat.alert { border-color: #f3d8d8; background: linear-gradient(180deg, #fffafa, var(--card)); }
[data-theme="dark"] .stat.alert { border-color: #4a2a2a; background: linear-gradient(180deg, #241a1a, var(--card)); }
.stat-ico {
  position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border-radius: 7px;
  background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.stat-ico svg { width: 16px; height: 16px; }
@media (max-width: 1560px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ============ 按钮 ============ */
.btn {
  height: 32px; padding: 0 13px; border-radius: var(--radius-btn); border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13px; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; cursor: pointer; white-space: nowrap;
  transition: all 0.14s; user-select: none; line-height: 1;
}
.btn:hover { border-color: #c9d3e2; background: var(--bg); }
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.93); }
.btn-danger-ghost { color: var(--danger); border-color: #f0cfcf; background: #fff7f7; }
.btn-danger-ghost:hover { background: #fdeeee; border-color: var(--danger); }
[data-theme="dark"] .btn-danger-ghost { background: rgba(214, 69, 69, 0.1); border-color: #4a2a2a; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--border-light); }
.btn-text { border-color: transparent; background: transparent; color: var(--primary); padding: 0 4px; height: auto; }
.btn-text:hover { background: transparent; text-decoration: underline; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 4px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn-icon { width: 32px; padding: 0; }

/* ============ 表单 ============ */
.input, .select, .textarea {
  height: 32px; border: 1px solid var(--border); border-radius: var(--radius-btn);
  background: var(--card); padding: 0 10px; font-size: 13px; outline: none; width: 100%;
  transition: border 0.14s, box-shadow 0.14s; color: var(--text);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input:disabled, .select:disabled { background: var(--bg); color: var(--text-3); cursor: not-allowed; }
.select { appearance: none; padding-right: 26px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A93A0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.7; }
.input-sm { height: 28px; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.field > label .req { color: var(--danger); }
.field .hint { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.cols1 { grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.check input { display: none; }
.check .box {
  width: 15px; height: 15px; border: 1px solid #c8d0db; border-radius: 3px; background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; transition: all 0.12s; flex: none;
}
.check .box svg { width: 10px; height: 10px; color: #fff; opacity: 0; }
.check input:checked + .box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .box svg { opacity: 1; }
.check .box.radio { border-radius: 50%; }
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; color: var(--text-2); }
.switch input { display: none; }
.switch .track {
  width: 36px; height: 20px; border-radius: 12px; background: #cfd6e0; position: relative;
  transition: background 0.16s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  top: 2px; left: 2px; transition: transform 0.16s; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch.sm .track { width: 30px; height: 17px; }
.switch.sm .track::after { width: 13px; height: 13px; }
.switch.sm input:checked + .track::after { transform: translateX(13px); }
.segmented { display: inline-flex; background: var(--bg); border-radius: 6px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; height: 26px; padding: 0 12px; font-size: 12.5px;
  border-radius: 4px; color: var(--text-2); cursor: pointer;
}
.segmented button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 500; }
.quick-range { display: inline-flex; gap: 4px; border: 1px solid var(--border); border-radius: 6px; padding: 2px; }
.quick-range button { border: 0; background: transparent; font-size: 12px; padding: 4px 9px; border-radius: 4px; color: var(--text-2); cursor: pointer; }
.quick-range button.on { background: var(--primary-50); color: var(--primary); font-weight: 500; }

/* ============ 筛选栏 ============ */
.filterbar {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 14px 16px 2px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 12px; }
.filter-item { display: flex; flex-direction: column; gap: 6px; }
.filter-item > span { font-size: 11.5px; color: var(--text-3); }
.filter-item .input, .filter-item .select { width: 160px; }
.filter-item.wide .input { width: 220px; }
.filter-item.date .input { width: 132px; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }
.filter-toggle { font-size: 12px; color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.filter-toggle svg { width: 12px; height: 12px; }

/* ============ 页签 ============ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs::-webkit-scrollbar { height: 0; }
.tabs .tab {
  padding: 10px 14px; font-size: 13px; color: var(--text-2); cursor: pointer;
  position: relative; white-space: nowrap; display: flex; align-items: center; gap: 6px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tabs .tab .cnt {
  font-size: 11px; background: var(--bg); border-radius: 9px; padding: 1px 6px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tabs .tab.on .cnt { background: var(--primary-50); color: var(--primary); }
.tabs.card-tabs { padding: 0 16px; margin: 0; border-bottom-color: var(--border-light); }
.subtabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border-light); margin-bottom: 14px; }
.subtabs .tab { padding: 8px 2px; font-size: 13px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs .tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ============ 表格 ============ */
.table-wrap { width: 100%; overflow: auto; position: relative; }
.table { width: 100%; font-size: 13px; min-width: 100%; }
.table th {
  text-align: left; font-weight: 500; color: var(--text-2); background: #fafbfc;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  font-size: 12.5px; position: sticky; top: 0; z-index: 3;
}
[data-theme="dark"] .table th { background: #1d222a; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.table tbody tr:hover td { background: #f9fbfd; }
[data-theme="dark"] .table tbody tr:hover td { background: #1e242c; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .col-actions { text-align: right; white-space: nowrap; position: sticky; right: 0; background: var(--card); box-shadow: -6px 0 10px -8px rgba(16,24,40,.18); }
.table th.col-actions { background: #fafbfc; z-index: 4; }
[data-theme="dark"] .table th.col-actions { background: #1d222a; }
.table tbody tr:hover .col-actions { background: #f9fbfd; }
[data-theme="dark"] .table tbody tr:hover .col-actions { background: #1e242c; }
.table .cell-main { font-weight: 500; color: var(--text); }
.table .cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.table .thumb { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; background: var(--bg); }
.table .tr-warn td { background: #fffbf4; }
[data-theme="dark"] .table .tr-warn td { background: #241f16; }
.table .num, .table .money { text-align: right; font-variant-numeric: tabular-nums; }
.table .money { font-weight: 500; }
.table-compact td { padding: 8px 12px; }
.table-plain th { background: transparent; }
.col-actions .btn-group { justify-content: flex-end; }
.check-col { width: 36px; }
.tbl-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.tbl-toolbar .spacer { flex: 1; }
.batch-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--primary-50);
  border-bottom: 1px solid var(--border-light); font-size: 12.5px; color: var(--primary);
}
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 14px 16px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.pager .total { margin-right: auto; color: var(--text-3); }
.pager button {
  min-width: 28px; height: 28px; border: 1px solid var(--border); background: var(--card);
  border-radius: 4px; cursor: pointer; font-size: 12.5px; color: var(--text-2); padding: 0 7px;
}
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager .select { width: 78px; height: 28px; font-size: 12px; }
.column-toggle { position: relative; }

/* ============ 标签 ============ */
.tag {
  display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: var(--radius-tag);
  font-size: 11.5px; line-height: 1; white-space: nowrap; font-weight: 500;
}
.tag-primary { color: var(--primary); background: var(--primary-50); }
.tag-success { color: #2e9e5b; background: #eaf6ef; }
.tag-warning { color: #b57012; background: #fdf3e3; }
.tag-danger { color: #c53c3c; background: #fdeeee; }
.tag-info { color: #2b5aa7; background: #eef3fb; }
.tag-neutral { color: #6b7481; background: #f1f3f6; }
.tag-purple { color: #6b5bd2; background: #f1effc; }
[data-theme="dark"] .tag-success { color: #62cf90; background: rgba(46, 158, 91, 0.16); }
[data-theme="dark"] .tag-warning { color: #eab05a; background: rgba(224, 138, 30, 0.16); }
[data-theme="dark"] .tag-danger { color: #ee8a8a; background: rgba(214, 69, 69, 0.16); }
[data-theme="dark"] .tag-info, [data-theme="dark"] .tag-primary { color: #8fb4ea; background: rgba(95, 143, 216, 0.16); }
[data-theme="dark"] .tag-neutral { color: #9aa4b2; background: rgba(255, 255, 255, 0.07); }
[data-theme="dark"] .tag-purple { color: #a79df0; background: rgba(107, 91, 210, 0.18); }
.tag-outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.star { color: #e0982a; letter-spacing: 1px; font-size: 12px; }
.star .off { color: #d8dde5; }

/* ============ 弹窗 / 抽屉 ============ */
.mask {
  position: fixed; inset: 0; background: rgba(17, 24, 34, 0.42); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 20px 40px;
  overflow-y: auto; animation: fadein 0.16s ease; backdrop-filter: blur(1px);
}
.mask.center { align-items: center; padding: 30px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes popin { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal {
  background: var(--card); border-radius: 10px; width: 560px; max-width: 100%;
  box-shadow: var(--shadow-lg); animation: popin 0.18s ease; display: flex; flex-direction: column;
  max-height: 86vh;
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { font-size: 15.5px; font-weight: 600; flex: 1; }
.modal-head .x { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; color: var(--text-3); display: flex; align-items: center; justify-content: center; }
.modal-head .x:hover { background: var(--border-light); color: var(--text); }
.modal-head .x svg { width: 14px; height: 14px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body.flush { padding: 0; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }
.modal-foot .left { margin-right: auto; }
.modal.sm { width: 420px; }
.modal.lg { width: 760px; }
.modal.xl { width: 980px; }
.drawer-mask { position: fixed; inset: 0; background: rgba(17, 24, 34, 0.38); z-index: 100; animation: fadein 0.16s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 640px; max-width: 94vw; background: var(--card);
  z-index: 101; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slidein 0.2s ease;
}
.drawer.wide { width: 780px; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 10px; }
.drawer-head h3 { font-size: 15.5px; font-weight: 600; flex: 1; }
.drawer-head .x { border: 0; background: transparent; cursor: pointer; color: var(--text-3); width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 5px; }
.drawer-head .x:hover { background: var(--border-light); }
.drawer-head .x svg { width: 14px; height: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { padding: 13px 20px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; justify-content: flex-end; }

/* ============ Toast / 确认 ============ */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  border-radius: 7px; padding: 9px 14px; font-size: 13px; display: flex; align-items: center;
  gap: 8px; animation: popin 0.18s ease; max-width: 520px;
}
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.warn svg { color: var(--warning); }
.toast .t-x { margin-left: 6px; cursor: pointer; color: var(--text-3); pointer-events: auto; font-size: 12px; }
.confirm-msg { font-size: 13.5px; line-height: 1.8; color: var(--text-2); }
.confirm-msg b { color: var(--text); }
.warn-box {
  margin-top: 14px; background: #fff8ec; border: 1px solid #f6e2bd; color: #9a6412;
  border-radius: 6px; padding: 10px 12px; font-size: 12.5px; line-height: 1.75;
}
[data-theme="dark"] .warn-box { background: rgba(224, 138, 30, 0.1); border-color: #4a3a20; color: #e0b06a; }

/* ============ 空状态 / 骨架 ============ */
.empty { padding: 56px 20px; text-align: center; color: var(--text-3); }
.empty .empty-art { width: 120px; height: 88px; margin: 0 auto 14px; }
.empty h4 { font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.empty p { font-size: 12px; margin-top: 6px; }
.empty .btn { margin-top: 14px; }
.empty.sm { padding: 30px 16px; }
.empty.sm .empty-art { width: 84px; height: 62px; margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 37%, #eef1f5 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 4px; }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #232932 25%, #2b323d 37%, #232932 63%); background-size: 400% 100%; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-row { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border-light); }
.sk-row .skeleton { height: 14px; }

/* ============ 时间轴 / 步骤 ============ */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px 0; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -18px; top: 3px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--card); border: 2px solid #c3cbd6;
}
.tl-item.done::before { border-color: var(--primary); background: var(--primary); }
.tl-item.act::before { border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 3px var(--primary-50); }
.tl-title { font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.7; }
.steps { display: flex; align-items: flex-start; overflow-x: auto; padding: 4px 0 2px; }
.step { flex: 1; min-width: 84px; text-align: center; position: relative; }
.step::before { content: ""; position: absolute; top: 10px; left: -50%; right: 50%; height: 1px; background: var(--border); }
.step:first-child::before { display: none; }
.step .dot { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text-3); display: flex; align-items: center; justify-content: center; margin: 0 auto 7px; font-size: 10px; position: relative; z-index: 2; }
.step .dot svg { width: 11px; height: 11px; }
.step .s-label { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.step .s-time { font-size: 10.5px; color: var(--text-3); margin-top: 3px; white-space: nowrap; }
.step.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done::before { background: var(--primary); }
.step.done .s-label { color: var(--text); }
.step.cur .dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.step.cur .s-label { color: var(--primary); font-weight: 500; }
.step.cur::before { background: var(--primary); }

/* ============ 描述列表 ============ */
.desc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.desc.cols1 { grid-template-columns: 1fr; }
.desc.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.desc-item { display: flex; gap: 10px; font-size: 13px; line-height: 1.6; min-width: 0; }
.desc-item dt { color: var(--text-3); flex: none; min-width: 72px; font-size: 12.5px; }
.desc-item dd { color: var(--text); flex: 1; min-width: 0; word-break: break-all; }
.desc-item.full { grid-column: 1 / -1; }
.kv-box { background: var(--bg); border-radius: 6px; padding: 12px 14px; font-size: 12.5px; color: var(--text-2); line-height: 1.9; }
.money-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: var(--text-2); }
.money-line b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.money-line.total { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 11px; font-size: 14px; }
.money-line.total b { font-size: 18px; color: var(--danger); font-weight: 600; }
.money-line.minus b { color: var(--success); }
.formula { font-size: 11.5px; color: var(--text-3); background: var(--bg); border-radius: 5px; padding: 8px 10px; line-height: 1.8; font-family: Consolas, "SF Mono", monospace; }

/* ============ 图表 ============ */
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; overflow: visible; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); border-radius: 6px; padding: 8px 10px; font-size: 12px;
  line-height: 1.8; z-index: 5; display: none; min-width: 120px; white-space: nowrap;
}
.chart-tip .ct-title { font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; }
.chart-tip .ct-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.chart-tip .ct-row i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.chart-legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.chart-axis { font-size: 10.5px; fill: #98a1ad; font-variant-numeric: tabular-nums; }
.chart-empty { height: 200px; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12.5px; }

.bar-list { display: flex; flex-direction: column; gap: 14px; }
.bar-item { display: flex; flex-direction: column; gap: 6px; }
.bar-item .bi-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.bar-item .bi-rank { width: 17px; height: 17px; border-radius: 4px; background: var(--bg); color: var(--text-3); font-size: 10.5px; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.bar-item:nth-child(1) .bi-rank { background: #fdf0dc; color: #b8801e; }
.bar-item:nth-child(2) .bi-rank { background: #eef1f5; color: #6f7b8a; }
.bar-item:nth-child(3) .bi-rank { background: #fbeee5; color: #b4744a; }
.bar-item .bi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item .bi-val { color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar-track { height: 6px; border-radius: 4px; background: var(--border-light); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7ba3dc, var(--primary)); transition: width 0.4s ease; }
.heat-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; padding: 7px 0; }
.heat-row .h-name { width: 72px; color: var(--text-2); flex: none; }
.heat-row .h-track { flex: 1; height: 16px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.heat-row .h-fill { height: 100%; background: linear-gradient(90deg, #cfe0f5, var(--primary)); border-radius: 3px; }
.heat-row .h-val { width: 76px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.spark { width: 90px; height: 26px; }

/* ============ 列表小组件 ============ */
.notice-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--border-light); font-size: 12.5px; }
.notice-item:last-child { border-bottom: 0; }
.notice-ico { width: 26px; height: 26px; border-radius: 6px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.notice-ico svg { width: 13px; height: 13px; }
.notice-item .n-body { flex: 1; min-width: 0; }
.notice-item .n-title { color: var(--text); line-height: 1.6; }
.notice-item .n-meta { color: var(--text-3); font-size: 11px; margin-top: 3px; display: flex; gap: 8px; }
.quick-actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.quick-btn {
  border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 9px; cursor: pointer; transition: all 0.15s;
  font-size: 12.5px; color: var(--text-2);
}
.quick-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); transform: translateY(-1px); }
.quick-btn .q-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.quick-btn .q-ico svg { width: 17px; height: 17px; }
.quick-btn:hover .q-ico { background: var(--primary); color: #fff; }
.quick-btn small { font-size: 11px; color: var(--text-3); }
.quick-btn:hover small { color: var(--primary); }

.mini-list .mi { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 12.5px; }
.mini-list .mi:last-child { border-bottom: 0; }
.mini-list .mi .spacer { flex: 1; }

.goods-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.goods-cell img { width: 40px; height: 40px; border-radius: 6px; flex: none; }
.goods-cell .g-info { min-width: 0; }
.goods-cell .g-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.goods-cell .g-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.image-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.image-cell { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; position: relative; aspect-ratio: 1; }
.image-cell img { width: 100%; height: 100%; object-fit: cover; }
.image-cell .del { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border-radius: 4px; background: rgba(0,0,0,0.45); color: #fff; border: 0; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.image-add { border: 1px dashed var(--border); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--text-3); font-size: 11.5px; cursor: pointer; aspect-ratio: 1; background: var(--bg); }
.image-add:hover { border-color: var(--primary); color: var(--primary); }
.image-add svg { width: 18px; height: 18px; }

/* ============ 权限树 ============ */
.perm-tree { border: 1px solid var(--border); border-radius: 6px; max-height: 380px; overflow-y: auto; }
.perm-node { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.perm-node:last-child { border-bottom: 0; }
.perm-node.lv2 { padding-left: 40px; background: #fcfcfd; }
[data-theme="dark"] .perm-node.lv2 { background: #1c2129; }
.perm-node .pn-name { min-width: 110px; }
.perm-node .pn-btns { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.perm-node .check { font-size: 12px; }

/* ============ 小票 / 地图 ============ */
.receipt { background: #fff; color: #222; width: 302px; margin: 0 auto; padding: 18px 16px; font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.7; border: 1px solid #e3e6eb; }
.receipt h4 { text-align: center; font-size: 15px; letter-spacing: 2px; margin-bottom: 4px; }
.receipt .r-sub { text-align: center; font-size: 10.5px; color: #666; }
.receipt .r-line { border-top: 1px dashed #999; margin: 9px 0; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 10px; }
.receipt .r-item { margin-bottom: 2px; }
.receipt .r-total { font-size: 14px; font-weight: bold; }
.map-box { position: relative; background: linear-gradient(160deg, #eef4fb, #e6eef8); border-radius: 8px; overflow: hidden; height: 260px; border: 1px solid var(--border); }
[data-theme="dark"] .map-box { background: linear-gradient(160deg, #1b2330, #172030); }
.map-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(43,90,167,0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(43,90,167,0.07) 1px, transparent 1px); background-size: 36px 36px; }
.map-road { position: absolute; background: rgba(255,255,255,0.85); border-radius: 2px; }
[data-theme="dark"] .map-road { background: rgba(255,255,255,0.08); }
.map-pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-2); }
.map-pin .pin { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; box-shadow: 0 2px 8px rgba(43,90,167,0.4); border: 2px solid #fff; }
.map-pin.rider .pin { background: var(--success); box-shadow: 0 2px 8px rgba(46,158,91,0.4); }
.map-pin.shop .pin { background: var(--warning); box-shadow: 0 2px 8px rgba(224,138,30,0.4); }
.map-path { position: absolute; inset: 0; }
.map-legend { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,0.9); border-radius: 5px; padding: 6px 9px; font-size: 11px; display: flex; gap: 12px; color: #555; }
[data-theme="dark"] .map-legend { background: rgba(25,29,36,0.9); color: var(--text-2); }

/* ============ 其他 ============ */
.banner-cell { display: flex; gap: 10px; align-items: center; }
.banner-cell img { width: 86px; height: 44px; border-radius: 5px; object-fit: cover; }
.rule-list { display: flex; flex-direction: column; gap: 8px; }
.rule-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 8px 10px; background: var(--bg); border-radius: 5px; }
.rule-row .r-idx { width: 18px; height: 18px; border-radius: 4px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 10.5px; }
.tip-strip { display: flex; align-items: flex-start; gap: 8px; background: var(--primary-50); color: var(--primary); border-radius: 6px; padding: 9px 12px; font-size: 12px; line-height: 1.7; }
.tip-strip svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.tip-strip.warn { background: #fff8ec; color: #9a6412; }
[data-theme="dark"] .tip-strip.warn { background: rgba(224, 138, 30, 0.1); color: #dfae66; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--bg); border-radius: 4px; padding: 2px 7px; font-size: 11.5px; color: var(--text-2); }
.masked { letter-spacing: 0.5px; color: var(--text-2); }
.pointer { cursor: pointer; }
.divider-v { width: 1px; align-self: stretch; background: var(--border-light); margin: 0 4px; }
.kbd { font-family: Consolas, monospace; font-size: 11px; border: 1px solid var(--border); border-bottom-width: 2px; padding: 1px 5px; border-radius: 3px; color: var(--text-3); background: var(--bg); }
.scroll-y { overflow-y: auto; }
.two-col-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.row-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border-light); font-size: 12.5px; }
.row-line:last-child { border-bottom: 0; }
.row-line .spacer { flex: 1; }
.badge-soft { background: var(--primary-50); color: var(--primary); border-radius: 4px; padding: 2px 7px; font-size: 11.5px; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); display: inline-block; vertical-align: 3px; margin: 0 6px; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs15 { font-size: 15px; } .fs18 { font-size: 18px; } .fs22 { font-size: 22px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.w100 { width: 100%; } .w120 { width: 120px; } .w160 { width: 160px; } .w200 { width: 200px; } .w240 { width: 240px; }

/* ============ 表格工具条 / 列设置 ============ */
.tbl-tools { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border-light); font-size: 12.5px; color: var(--text-2); }
.tbl-tools .batch-info b { color: var(--primary); }
.col-pop-wrap { position: relative; }
.col-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--card);
  border: 1px solid var(--border); border-radius: 7px; box-shadow: var(--shadow-md); padding: 10px 12px;
  z-index: 30; min-width: 150px; flex-direction: column; gap: 9px;
}
.col-pop.show { display: flex; }
.col-pop-title { font-size: 11.5px; color: var(--text-3); border-bottom: 1px solid var(--border-light); padding-bottom: 6px; }
.col-pop .check { font-size: 12.5px; }
.sk-table { padding: 6px 0; }

/* ============ 行内紧凑组件 ============ */
.inline-flex { display: inline-flex; align-items: center; gap: 6px; }
.thumb-sm { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; background: var(--bg); }
.thumb-lg { width: 56px; height: 56px; border-radius: 7px; object-fit: cover; background: var(--bg); }
.panel-title { font-size: 13.5px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel-title .line { width: 3px; height: 13px; border-radius: 2px; background: var(--primary); }
.stat-mini { font-size: 12px; color: var(--text-3); }
.stat-mini b { font-size: 16px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 3px; }
.order-num { font-family: Consolas, "SF Mono", monospace; font-size: 12px; letter-spacing: 0.2px; }
.tl-note { font-size: 11.5px; color: var(--text-3); }
.fee-panel { background: var(--bg); border-radius: 8px; padding: 14px 16px; }
.fee-panel .money-line { padding: 5px 0; }
.receipt-wrap { background: var(--bg); padding: 16px; border-radius: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.section-head h4 { font-size: 13.5px; font-weight: 600; }
.section-head:first-child { margin-top: 0; }
.drawer-section { border-bottom: 1px solid var(--border-light); padding-bottom: 16px; margin-bottom: 16px; }
.drawer-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.step-dot-sm { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.copy-ico { cursor: pointer; color: var(--text-3); display: inline-flex; }
.copy-ico:hover { color: var(--primary); }
.copy-ico svg { width: 12px; height: 12px; }
.filter-collapsed .filter-extra { display: none; }
.tab-page-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab-page-actions .spacer { flex: 1; }
.order-goods-list { display: flex; flex-direction: column; }
.order-goods-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border-light); }
.order-goods-item:last-child { border-bottom: 0; }
.order-goods-item img { width: 44px; height: 44px; border-radius: 6px; flex: none; }
.order-goods-item .og-name { font-size: 13px; }
.order-goods-item .og-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.order-goods-item .og-qty { margin-left: auto; color: var(--text-2); font-size: 12px; text-align: right; }
.order-goods-item .og-amount { width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.permission-matrix td, .permission-matrix th { text-align: center; }
.permission-matrix td:first-child, .permission-matrix th:first-child { text-align: left; }
.mini-chart { height: 60px; }
.notice-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, var(--primary-50), transparent); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }
.notice-banner svg { width: 15px; height: 15px; color: var(--primary); flex: none; }
.notice-banner .spacer { flex: 1; }
.review-item { padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.review-item:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-content { margin-top: 8px; font-size: 13px; line-height: 1.8; color: var(--text); }
.review-reply { margin-top: 10px; background: var(--bg); border-radius: 6px; padding: 9px 12px; font-size: 12.5px; line-height: 1.8; color: var(--text-2); }
.review-imgs { display: flex; gap: 8px; margin-top: 9px; }
.review-imgs img { width: 66px; height: 66px; border-radius: 6px; object-fit: cover; cursor: zoom-in; }
.avatar-cell { display: flex; align-items: center; gap: 9px; }
.avatar-cell .ac-name { font-weight: 500; }
.avatar-cell .ac-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.badge-num { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 500; }
.subaccount-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border-light); }
.subaccount-row:last-child { border-bottom: 0; }
.hours-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.hours-row .day { width: 96px; font-size: 12.5px; color: var(--text-2); }
.hours-row .input { width: 96px; }
.biz-hour-range { display: flex; align-items: center; gap: 6px; }
.matrix-note { font-size: 11.5px; color: var(--text-3); margin-top: 8px; line-height: 1.8; }

/* ============ 顶栏用户菜单 / 账号切换 ============ */
.header { position: relative; }
.user-pop {
  display: none; position: absolute; right: 14px; top: 50px; width: 240px; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md); z-index: 60;
  padding: 8px; animation: popin 0.14s ease;
}
.user-pop.show { display: block; }
.up-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--border-light); margin-bottom: 6px; }
.up-name { font-size: 13px; font-weight: 600; }
.up-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.up-item { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 5px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.up-item:hover { background: var(--bg); color: var(--text); }
.up-item.danger { color: var(--danger); }
.up-item.danger:hover { background: #fdeeee; }
[data-theme="dark"] .up-item.danger:hover { background: rgba(214, 69, 69, 0.14); }
.up-sep { height: 1px; background: var(--border-light); margin: 5px 0; }
.switch-wrap { display: flex; flex-direction: column; gap: 16px; }
.switch-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 7px; letter-spacing: 0.5px; }
.switch-acc {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--border);
  background: var(--card); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; font-size: 12.5px;
}
.switch-acc:hover { border-color: var(--primary); background: var(--primary-50); }
.switch-acc > span:nth-child(2) { flex: 1; min-width: 0; }
.switch-acc small { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.todo-row:hover { background: var(--bg); border-radius: 5px; }
.mt4 { margin-top: 4px; }

/* ============ 响应式补充（目标宽度 ≥1280，兼容窄屏） ============ */
@media (max-width: 1180px) {
  .main-side, .main-side.wide { grid-template-columns: 1fr; }
  .cols-2, .cols-3, .cols-4, .cols-5, .cols-6 { grid-template-columns: 1fr; }
  .desc.cols3 { grid-template-columns: 1fr 1fr; }
  .header-search { display: none; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .stat-grid, .stat-grid.g4, .stat-grid.g3 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(4, 1fr) !important; }
  .permission-matrix { font-size: 12px; }
  .header { gap: 8px; padding: 0 12px; }
  .user-chip .u-name, .user-chip .u-role { display: none; }
}
