/* 电商售后订单登记系统 · 基础样式 */
:root {
  --bg: #F4F5F7;
  --panel: #FFFFFF;
  --side: #FBFBFC;
  --line: #E4E7EC;
  --line-strong: #D0D5DD;
  --text: #101828;
  --muted: #667085;
  --muted-2: #98A2B3;
  --brand: #0A8F52;
  --brand-dark: #067647;
  --brand-soft: #E9F7F0;
  --brand-text: #05603A;
  --danger: #D92D20;
  --danger-soft: #FEF3F2;
  --warn: #B54708;
  --warn-soft: #FFFAEB;
  --ok: #067647;
  --ok-soft: #ECFDF3;
  --info: #175CD3;
  --info-soft: #EFF8FF;
  --radius: 8px;
  --radius-card: 12px;
  --shadow: 0 8px 24px rgba(16, 24, 40, .12);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/22px var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--muted); }

/* ---------- 外壳 ---------- */
.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 16px;
  flex: 0 0 auto;
}
.side-brand .name { font-weight: 600; font-size: 15px; line-height: 20px; }
.side-brand .sub { font-size: 12px; color: var(--muted); line-height: 16px; margin-top: 2px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background .12s, color .12s;
}
.side-nav a:hover { background: #F2F4F7; color: var(--text); }
.side-nav a.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 500; }
.side-nav .ico { width: 18px; text-align: center; font-size: 14px; opacity: .85; }
.nav-group { margin-top: 2px; }
.nav-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; color: var(--muted);
  font-size: 14px; user-select: none;
}
.nav-group-head .ico { width: 18px; text-align: center; font-size: 14px; opacity: .85; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; padding-left: 10px; }
.nav-sub a { padding: 7px 10px 7px 20px; font-size: 13px; color: var(--muted); }
.nav-sub a.active { background: var(--brand-soft); color: var(--brand-text); }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted-2); line-height: 18px; padding: 0 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; }
.topbar .badge-demo { font-size: 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 2px 8px; }
.menu-btn { display: none; }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-text);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.identity-select {
  height: 30px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel); color: var(--text); padding: 0 8px; font-size: 13px;
}

/* ---------- 多标签页工作区 ---------- */
.tabbar {
  display: flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 16px;
  background: #FCFCFD; border-bottom: 1px solid var(--line);
  position: sticky; top: 60px; z-index: 19;
}
.tab-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.tab-scroll::-webkit-scrollbar { height: 4px; }
.tab-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.tab-list { display: flex; align-items: center; gap: 6px; height: 42px; width: max-content; min-width: 100%; }
.tab {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 6px 0 10px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--panel); color: var(--muted);
  font-size: 12px; white-space: nowrap; cursor: pointer; user-select: none;
  flex: 0 0 auto;
}
.tab:hover { border-color: var(--brand); color: var(--text); }
.tab.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); font-weight: 500; }
.tab-dirty { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); display: none; flex: 0 0 auto; }
.tab.is-dirty .tab-dirty { display: inline-block; }
.tab-affix { color: var(--muted-2); font-size: 11px; line-height: 1; }
.tab.active .tab-affix { color: var(--brand-text); }
.tab-close {
  width: 16px; height: 16px; line-height: 15px; text-align: center;
  border-radius: 4px; color: var(--muted-2); font-size: 13px;
}
.tab-close:hover { background: rgba(16, 24, 40, .08); color: var(--text); }
.tab-tools { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.tab-tool {
  width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--panel); color: var(--muted); font-size: 13px; cursor: pointer; line-height: 1;
}
.tab-tool:hover { border-color: var(--brand); color: var(--brand-text); }
.tab-menu {
  position: fixed; z-index: 90;
  min-width: 168px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
}
.tab-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 7px 9px; border: none; background: transparent; border-radius: 6px;
  color: var(--text); font-size: 13px; cursor: pointer;
}
.tab-menu-item:hover:not([disabled]) { background: #F2F4F7; }
.tab-menu-item[disabled] { color: var(--muted-2); cursor: not-allowed; }
.tab-menu-item.danger { color: var(--danger); }
.tab-menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }

.content { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.view { display: flex; flex-direction: column; gap: 16px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.view-head .title { font-size: 18px; font-weight: 600; }
.view-head .desc { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 20px; }

/* ---------- 卡片 / 提示 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 16px; }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warn-soft); border: 1px solid #FEDF89; color: #93370D;
  border-radius: var(--radius); padding: 12px 14px; font-size: 13px; line-height: 20px;
}
.alert.info { background: var(--info-soft); border-color: #B2DDFF; color: #194185; }
.alert-ico {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid currentColor; display: grid; place-items: center;
  font-size: 12px; flex: 0 0 auto; margin-top: 1px;
}

/* ---------- 工具条与控件 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search-box { position: relative; }
.input, .select, .textarea {
  height: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel); color: var(--text);
  padding: 0 10px; font-size: 13px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; line-height: 20px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 143, 82, .12); }
.input::placeholder { color: var(--muted-2); }
.input[disabled], .select[disabled], .textarea[disabled] { background: #F9FAFB; color: var(--muted-2); cursor: not-allowed; }

.btn {
  height: 34px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: #F9FAFB; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #F2F4F7; color: var(--text); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #B42318; border-color: #B42318; }
.btn-danger { border-color: #FDA29B; color: var(--danger); background: var(--panel); }
.btn-danger:hover { background: var(--danger-soft); }

.link-btn { background: none; border: none; padding: 0; color: var(--brand-dark); font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow: auto; max-height: calc(100vh - 372px); }
table.data-table { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; }
.data-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #F9FAFB;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  text-align: left;
  padding: 9px 10px;
  white-space: nowrap;
  user-select: none;
}
.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--text); }
.th-label { vertical-align: middle; }
.sort-mark { display: inline-block; width: 12px; margin-left: 2px; color: var(--muted-2); font-size: 10px; }
.sort-mark.is-asc::after { content: "▲"; }
.sort-mark.is-desc::after { content: "▼"; }
.col-resize {
  position: absolute; right: 0; top: 0; bottom: 0; width: 6px;
  cursor: col-resize;
}
.data-table tbody td {
  border-bottom: 1px solid #F2F4F7;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  vertical-align: middle;
}
.data-table tbody tr:hover td { background: #FCFCFD; }
.data-table tbody tr.row-new td { background: #F6FEF9; }
.data-table tbody tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.align-right { text-align: right; }
.align-center { text-align: center; }
.col-index { color: var(--muted-2); font-family: var(--mono); font-size: 12px; text-align: center; }

/* 固定列（左/右） */
.data-table th.pin-left, .data-table td.pin-left,
.data-table th.pin-right, .data-table td.pin-right {
  position: sticky;
  z-index: 3;
  background: var(--panel);
}
.data-table thead th.pin-left, .data-table thead th.pin-right {
  z-index: 40;
  background: #F9FAFB;
}
.data-table td.pin-left { box-shadow: 1px 0 0 var(--line); }
.data-table td.pin-right { box-shadow: -1px 0 0 var(--line); }
.data-table tbody tr:hover td.pin-left,
.data-table tbody tr:hover td.pin-right { background: #FCFCFD; }
.cell-muted { color: var(--muted); }
.rich-cell { white-space: normal; word-break: break-word; line-height: 18px; }
.rich-cell p, .rich-cell div { margin: 0; }
.rich-cell ul, .rich-cell ol { margin: 0; padding-left: 18px; }
.cell-strong { font-weight: 500; }
.cell-mono { font-family: var(--mono); font-size: 12px; }
.cell-link { color: var(--brand-dark); cursor: pointer; }
.cell-link:hover { text-decoration: underline; }

.editable { cursor: text; border-radius: 6px; }
.editable:hover { background: #F2F4F7; box-shadow: inset 0 0 0 1px var(--line); }
.editing { padding: 0 !important; }
.cell-editor { width: 100%; height: 30px; border: 1px solid var(--brand); border-radius: 6px; padding: 0 6px; font-size: 13px; outline: none; background: #fff; }
td .cell-editor.select { padding: 0 4px; }
.cell-saving { color: var(--muted-2); font-size: 12px; }

.row-actions { display: flex; gap: 4px; flex-wrap: nowrap; }
.btn-mini {
  height: 26px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--panel);
  font-size: 12px; color: var(--brand-dark); cursor: pointer;
}
.btn-mini:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-mini.ghost { color: var(--muted); }
.btn-mini.ghost:hover { background: #F2F4F7; border-color: var(--line-strong); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.pending { color: var(--warn); background: var(--warn-soft); border-color: #FEDF89; }
.badge.processing { color: var(--info); background: var(--info-soft); border-color: #B2DDFF; }
.badge.done { color: var(--ok); background: var(--ok-soft); border-color: #ABEFC6; }
.badge.closed { color: var(--muted); background: #F9FAFB; border-color: var(--line); }
.badge.urgent { color: var(--warn); background: var(--warn-soft); border-color: #FEDF89; }
.badge.critical { color: var(--danger); background: var(--danger-soft); border-color: #FECDCA; }
.badge.plain { color: var(--muted); background: #F9FAFB; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  background: #F2F4F7; color: var(--muted);
  font-size: 12px;
}

/* ---------- 分页器 ---------- */
.pager { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.pager-sum b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.pager-main { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.pager-size { display: flex; align-items: center; gap: 6px; }
.pager-size .select { height: 30px; font-size: 12px; }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pg-btn, .pg-num {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--panel); color: var(--text);
  font-size: 12px; cursor: pointer;
}
.pg-btn:hover:not([disabled]), .pg-num:hover { border-color: var(--brand); color: var(--brand-dark); }
.pg-btn[disabled], .pg-num[disabled] { opacity: .45; cursor: not-allowed; }
.pg-num.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pg-dots { color: var(--muted-2); padding: 0 2px; font-size: 12px; }
.pager-jump { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pager-jump .input { width: 58px; height: 30px; text-align: center; }
.pager-jump .btn { height: 30px; }

/* ---------- 弹层 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 40, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px;
  overflow: auto;
}
.modal {
  width: 520px; max-width: 100%;
  background: var(--panel); border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  animation: modal-in .14s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-close { border: none; background: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.confirm-msg { font-size: 13px; line-height: 22px; color: var(--text); }
.confirm-list { background: #F9FAFB; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 12px; line-height: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; color: var(--muted); }
.field > label b { color: var(--danger); margin-left: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 12px; color: var(--muted-2); line-height: 18px; }

.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- 弹出层 / 提示 ---------- */
.popover {
  position: absolute; z-index: 60;
  width: 236px; max-height: 380px; overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
  padding: 8px;
}
.popover-title { font-size: 12px; color: var(--muted); padding: 4px 8px 8px; }
.popover-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.popover-item:hover { background: #F2F4F7; }
.popover-item input { width: 15px; height: 15px; accent-color: var(--brand); }
.popover-foot { display: flex; gap: 12px; padding: 8px; border-top: 1px solid var(--line); margin-top: 4px; }

.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #101828; color: #fff;
  border-radius: var(--radius); padding: 9px 14px;
  font-size: 13px; box-shadow: var(--shadow);
  animation: toast-in .16s ease-out;
  max-width: 560px;
}
.toast.success { background: #05603A; }
.toast.error { background: #B42318; }
.toast.warn { background: #93370D; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.empty-state { padding: 56px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 16px; cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.stat:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(10, 143, 82, .12); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 600; line-height: 34px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-value.hot { color: var(--danger); }
.stat-sub { font-size: 12px; color: var(--muted-2); margin-top: 4px; }
.stat.is-active { border-color: var(--brand); background: var(--brand-soft); }
@media (min-width: 1101px) { .stat-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; }
.panel-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.bar-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 34px; align-items: center; gap: 10px; margin-top: 10px; }
.bar-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bar-track { height: 8px; background: #F2F4F7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.bar-value { font-family: var(--mono); font-size: 12px; text-align: right; }

/* ---------- 角色 / 权限 ---------- */
.perm-group { border: 1px solid var(--line); border-radius: var(--radius); }
.perm-group + .perm-group { margin-top: 12px; }
.perm-group-head { padding: 9px 12px; background: #F9FAFB; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.perm-group-head .muted { font-weight: 400; font-size: 12px; }
.perm-items { padding: 10px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 2px 0; }
.perm-item input { width: 15px; height: 15px; accent-color: var(--brand); }

/* ---------- 重置 ---------- */
.reset-table { width: 100%; border-collapse: collapse; }
.reset-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  background: #F9FAFB; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.reset-table td { padding: 10px 12px; border-bottom: 1px solid #F2F4F7; font-size: 13px; vertical-align: top; }
.reset-table tr.is-disabled td { color: var(--muted-2); background: #FAFAFB; }
.reset-table tr.is-selected td { background: #F6FEF9; }
.reset-table .impact { font-size: 12px; color: var(--muted); line-height: 19px; max-width: 460px; }
.reset-table .rows-num { font-family: var(--mono); font-size: 12px; }
.reset-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.reset-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reset-summary .picked { font-size: 13px; color: var(--muted); }
.reset-summary .picked b { color: var(--text); font-family: var(--mono); }
.progress-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.progress-track { height: 8px; background: #F2F4F7; border-radius: 999px; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s; }
.reset-progress { display: flex; flex-direction: column; gap: 6px; }
.reset-step { display: grid; grid-template-columns: 18px 140px 1fr; gap: 10px; align-items: center; font-size: 12px; padding: 6px 8px; border-radius: 6px; background: #F9FAFB; }
.reset-step .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); margin: 0 auto; }
.reset-step.running .dot { background: var(--info); animation: pulse 1s infinite; }
.reset-step.success .dot { background: var(--ok); }
.reset-step.failed .dot { background: var(--danger); }
.reset-step.rolledback .dot { background: var(--warn); }
.reset-step.skipped .dot { background: var(--muted-2); }
.reset-step .msg { color: var(--muted); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- 导入 / 批量 ---------- */
.result-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.result-item { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 18px; padding: 6px 8px; border-radius: 6px; background: #F9FAFB; }
.result-item .tag { flex: 0 0 auto; font-weight: 600; }
.result-item.ok .tag { color: var(--ok); }
.result-item.fail .tag { color: var(--danger); }
.result-item.skip .tag { color: var(--warn); }
.file-drop {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 18px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer;
}
.file-drop:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }

/* ---------- 列表设置抽屉 ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(16, 24, 40, .4); }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 400px; max-width: 100%;
  background: var(--panel); box-shadow: -8px 0 28px rgba(16, 24, 40, .18);
  display: flex; flex-direction: column; animation: drawer-in .16s ease-out;
}
@keyframes drawer-in { from { transform: translateX(16px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.drawer-close { border: none; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px; }
.drawer-body { flex: 1; overflow: auto; padding: 12px 0 16px; }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.drawer-foot .select-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.drawer-foot .select-all input { width: 16px; height: 16px; accent-color: var(--brand); }
.drawer-foot .spacer { flex: 1; }
.col-group { background: #F2F4F7; border-radius: var(--radius); padding: 8px 4px; margin: 0 12px 8px; }
.col-group-title { font-size: 12px; color: var(--muted); padding: 0 10px 6px; }
.col-section-title { font-size: 12px; color: var(--muted); padding: 4px 22px 6px; }
.col-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 4px 10px;
  font-size: 13px; color: var(--text);
  background: transparent; cursor: grab;
  border-radius: 6px;
  position: relative;
}
.col-group .col-row { background: #F2F4F7; }
.col-group .col-row:hover { background: #E9ECF0; }
.col-row:hover { background: #F7F8FA; }
.col-row.dragging { opacity: .45; }
.col-row.drop-target { box-shadow: inset 0 2px 0 var(--brand); }
.col-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; cursor: pointer; }
.col-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-actions { display: none; align-items: center; gap: 2px; flex: 0 0 auto; }
.col-row:hover .col-actions { display: flex; }
.icon-btn {
  width: 26px; height: 26px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--brand-dark); cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.icon-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.icon-btn.is-pinned { color: var(--brand-dark); background: var(--brand-soft); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 15px; height: 15px; display: block; }

/* ---------- 富文本编辑 ---------- */
.rich-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; background: #F9FAFB; }
.rich-tool-label { font-size: 12px; color: var(--muted); }
.rich-tools { display: flex; align-items: center; gap: 4px; }
.swatch { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.swatch:hover { box-shadow: 0 0 0 2px var(--brand-soft); }
.rich-clear { margin-left: auto; }
.rich-editor {
  min-height: 140px; max-height: 260px; overflow: auto;
  border: 1px solid var(--line-strong); border-radius: 0 0 var(--radius) var(--radius);
  padding: 10px 12px; font-size: 13px; line-height: 22px; outline: none; background: var(--panel);
}
.rich-editor:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 143, 82, .12); }
.rich-editor:empty::before { content: attr(data-placeholder); color: var(--muted-2); }
.rich-hint { font-size: 12px; color: var(--muted-2); line-height: 18px; }
.rich-preview { border: 1px solid var(--line); border-radius: var(--radius); background: #F9FAFB; padding: 10px 12px; font-size: 13px; line-height: 22px; max-height: 180px; overflow: auto; }

/* ---------- 字段固定下拉 ---------- */
.popover-item select.pin-select {
  height: 24px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; color: var(--muted); background: var(--panel); margin-left: auto;
}

/* ---------- 数据库设置 ---------- */
.db-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.db-item { background: #F9FAFB; border-radius: var(--radius); padding: 10px 12px; }
.db-item label { display: block; font-size: 12px; color: var(--muted); }
.db-item b { display: block; font-size: 15px; font-weight: 600; margin-top: 4px; }
.backup-actions { display: flex; gap: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding: 12px 8px; }
  .side-brand .name, .side-brand .sub, .side-foot, .side-nav a span.nav-text { display: none; }
  .side-brand { justify-content: center; padding: 0; }
  .side-nav a { justify-content: center; padding: 10px 4px; }
  .topbar { padding: 0 12px; }
  .content { padding: 12px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 字段设置弹层 */
.column-tip { font-size: 12px; color: var(--muted); line-height: 18px; }
.column-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.column-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.column-item input { width: 15px; height: 15px; accent-color: var(--brand); }
