/* ============================================================
   金猪内部管理系统 Pro — 设计系统
   ============================================================ */
:root {
  /* 品牌 / 强调色 */
  --brand:        #6366f1;
  --brand-2:      #8b5cf6;
  --brand-grad:   linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --brand-soft:   rgba(99, 102, 241, .12);

  /* 中性 / 表面（浅色）*/
  --bg:           #f4f5fa;
  --surface:      #ffffff;
  --surface-2:    #fafbfe;
  --border:       #e7e9f2;
  --border-strong:#d7dae8;
  --ink:          #1f2430;
  --ink-2:        #5b6474;
  --ink-3:        #98a1b3;
  --shadow-sm:    0 1px 2px rgba(20,24,40,.05), 0 1px 3px rgba(20,24,40,.06);
  --shadow:       0 4px 14px rgba(24,28,48,.08);
  --shadow-lg:    0 12px 40px rgba(24,28,48,.14);

  /* 侧边栏 */
  --side-bg:      linear-gradient(185deg, #1b2138 0%, #131829 60%, #10152340 100%);
  --side-solid:   #141a2e;
  --side-ink:     #c4cbe0;
  --side-ink-2:   #8a93b0;
  --side-active:  rgba(129,140,248,.16);

  /* 状态色 */
  --ok:      #16a34a;   --ok-soft:   rgba(22,163,74,.12);
  --warn:    #d97706;   --warn-soft: rgba(217,119,6,.12);
  --danger:  #dc2626;   --danger-soft: rgba(220,38,38,.12);
  --info:    #2563eb;   --info-soft: rgba(37,99,235,.12);

  /* 图表分类色（经 validate_palette 校验：light）*/
  --series-1: #2a78d6; --series-2: #008300; --series-3: #e87ba4; --series-4: #eda100;
  --series-5: #1baf7a; --series-6: #eb6834; --series-7: #4a3aa7; --series-8: #e34948;
  --chart-surface: #ffffff;
  --grid: #eef0f6;

  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg:           #0d111c;
  --surface:      #161c2b;
  --surface-2:    #1b2233;
  --border:       #263048;
  --border-strong:#33405e;
  --ink:          #e8ecf6;
  --ink-2:        #a4adc4;
  --ink-3:        #6d7897;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.3);
  --shadow:       0 6px 22px rgba(0,0,0,.35);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.5);
  --side-bg:      linear-gradient(185deg, #10152a 0%, #0b0f1d 100%);
  --side-solid:   #0d1120;
  --brand-soft:   rgba(99,102,241,.2);
  --series-1: #3987e5; --series-2: #008300; --series-3: #d55181; --series-4: #c98500;
  --series-5: #199e70; --series-6: #d95926; --series-7: #9085e9; --series-8: #e66767;
  --chart-surface: #161c2b;
  --grid: #232c42;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14px; -webkit-font-smoothing: antialiased; line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--side-bg); background-color: var(--side-solid);
  color: var(--side-ink); position: fixed; inset: 0 auto 0 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 40; transition: width .22s ease;
  border-right: 1px solid rgba(255,255,255,.04);
}
.brand {
  display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; color: #fff;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px; background: var(--brand-grad);
  display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff;
  box-shadow: 0 6px 16px rgba(99,102,241,.45); flex-shrink: 0;
}
.brand .name { font-weight: 700; font-size: 16px; letter-spacing: .3px; white-space: nowrap; }
.brand .name small { display: block; font-size: 10.5px; font-weight: 500; color: var(--side-ink-2); letter-spacing: 2px; }

.menu { flex: 1; overflow-y: auto; padding: 6px 12px 24px; }
.menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
.menu-group-title { font-size: 11px; color: var(--side-ink-2); padding: 16px 12px 7px; letter-spacing: 1px; font-weight: 600; }
.menu-item {
  display: flex; align-items: center; gap: 11px; padding: 9.5px 12px; border-radius: 10px;
  color: var(--side-ink); cursor: pointer; font-size: 13.5px; margin-bottom: 2px;
  transition: background .16s, color .16s; position: relative; white-space: nowrap;
}
.menu-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-item.active { background: var(--side-active); color: #fff; font-weight: 600; }
.menu-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--brand-2); border-radius: 0 3px 3px 0;
}
.menu-item .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }

.main { flex: 1; margin-left: 236px; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 62px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px;
  padding: 0 22px; position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .crumb { color: var(--ink-3); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center;
  cursor: pointer; transition: all .15s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.icon-btn svg { width: 18px; height: 18px; }

.userchip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 40px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); }
.userchip:hover { border-color: var(--brand); }
.userchip .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.userchip .uname { font-size: 13px; font-weight: 600; line-height: 1.1; }
.userchip .urole { font-size: 11px; color: var(--ink-3); }

.content { padding: 22px; flex: 1; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head .sub { color: var(--ink-3); font-size: 12px; }
.card-body { padding: 18px; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .cols-4 { grid-template-columns: repeat(2,1fr); } .cols-3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 820px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* KPI 卡 */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::after { content:''; position:absolute; right:-30px; top:-30px; width:110px; height:110px; border-radius:50%; background: var(--brand-soft); opacity:.5; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.kpi .kpi-icon svg { width: 22px; height: 22px; }
.kpi .kpi-label { color: var(--ink-2); font-size: 13px; margin-top: 14px; }
.kpi .kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .kpi-foot { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.kpi .kpi-foot .up { color: var(--ok); font-weight: 600; }
.kpi .kpi-foot .down { color: var(--danger); font-weight: 600; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap; font-family: inherit;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.btn-primary:hover { color: #fff; filter: brightness(1.06); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field > label .req { color: var(--danger); }
.input, .select, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-family: inherit; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.select { appearance: none; 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='%2398a1b3' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-row-3.wide-last { grid-template-columns: 1fr 1fr 3fr; }
/* 在 3 列栅格里横跨前两列，并把内部再切成 2 列：
   用于把说明文字塞进旁边高单元格（如退款那格占 3 行）留下的空白，
   而不是在栅格下面单开一整行——那样只会把表单撑更高。
   align-content:start 保证内部两个 field 顶对齐，不被拉伸去填满整格高度。 */
.form-row-3 > .fr3-span2 {
  grid-column: span 2; min-width: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; align-content: start;
}
/* 子格内部横跨两列（放提示条） */
.form-row-3 > .fr3-span2 > .fr3-full { grid-column: 1 / -1; }
/* 窄屏整体塌成 1 列时，跨列声明要撤掉，否则会凭空造出第二列 */
@media (max-width: 720px) {
  .form-row-3 > .fr3-span2 { grid-column: auto; grid-template-columns: 1fr; }
}
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.grid-asym { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 720px){ .form-row, .form-row-3, .form-row-3.wide-last, .form-row-4, .grid-asym { grid-template-columns: 1fr; } }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.search-box input { padding-left: 32px; width: 210px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center;}
table.tbl th { padding: 10px 8px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--brand); }
table.tbl th.sortable .sort-ind { display: inline-block; width: 0; height: 0; margin-left: 5px; vertical-align: middle; opacity: .25; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
table.tbl th.sortable[data-sort-dir="asc"] .sort-ind { opacity: 1; border-top: none; border-bottom: 5px solid currentColor; }
table.tbl th.sortable[data-sort-dir="desc"] .sort-ind { opacity: 1; border-bottom: none; border-top: 5px solid currentColor; }
table.tbl th.sortable[data-sort-dir] { color: var(--brand); }
table.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: normal; }
table.tbl td .cell-wrap { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
table.tbl td .cell-wrap.lines-1 { -webkit-line-clamp: 1; }
table.tbl td .cell-wrap.lines-2 { -webkit-line-clamp: 2; }
table.tbl td .cell-wrap.lines-3 { -webkit-line-clamp: 3; }
table.tbl td .cell-wrap.lines-4 { -webkit-line-clamp: 4; }
table.tbl td .cell-wrap.lines-5 { -webkit-line-clamp: 5; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td.num, table.tbl th.num {font-variant-numeric: tabular-nums; }
table.tbl .muted { color: var(--ink-3); }
.tbl-empty { text-align: center; color: var(--ink-3); padding: 46px 0; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-info { background: var(--info-soft); color: var(--info); }
.tag-muted { background: var(--border); color: var(--ink-2); }
.chip { display:inline-block; padding: 1px 8px; margin: 1px; background: var(--brand-soft); color: var(--brand); border-radius: 6px; font-size: 11.5px; font-weight:600; }
/* .rank-badge / .rank-1~3 已删除：唯一使用方「业绩排名」页已下线，排名改看数据看板的嵌入卡（横向条形图，无名次徽章） */

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 14px 4px 2px; font-size: 13px; color: var(--ink-2); }
.pager button { min-width: 32px; height: 32px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager-dots { padding: 0 4px; color: var(--ink-3); }

/* ---------------- 弹窗 ---------------- */
.mask { position: fixed; inset: 0; background: rgba(15,20,35,.5); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .18s; }
/* 弹窗打开时锁住页面滚动：滚轮落在遮罩留白、弹窗标题栏/按钮栏这些不可滚区域时，
   事件会直接穿到背后的页面上去（.modal-body 内部的滚动链另由 overscroll-behavior 断开）。
   锁的是 html+body 两层：本项目 html,body 都是 height:100%，实际滚动容器随浏览器而异。
   用 overflow:hidden 而不是 position:fixed，浏览器会自动保住滚动位置，关窗后不会跳回顶部。 */
html.modal-open, html.modal-open body { overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; animation: pop .2s cubic-bezier(.2,.9,.3,1.2); }
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1040px; }
/* xxl：按父窗口百分比取宽（宽表格/多字段表单用），超宽屏封顶 1800px，小屏自动退化。 */
.modal.xxl { max-width: min(1800px, 94vw); max-height: 94vh; }
/* 可拖拽调整大小：右下角手柄。resize 需要 overflow 非 visible，故手柄独立绝对定位实现。 */
.modal.resizable { position: relative; }
/* 手柄浮在右下角。无 footer 的弹窗(hideFoot)里它会盖在滚动内容上，故加半透明底避免看不清 */
/* 手柄样式不限定在 .modal 下：整页卡片(.resizable-card)复用同一个类，
   若只写 .modal .modal-grip，卡片上的手柄会没有定位与尺寸（0×0 不可见、拖不动）。 */
.modal-grip { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 46%, var(--ink-3) 46%, var(--ink-3) 54%, transparent 54%, transparent 70%, var(--ink-3) 70%, var(--ink-3) 78%, transparent 78%);
  opacity: .5; border-bottom-right-radius: 16px; z-index: 3; }
.modal-grip:hover { opacity: 1; }
/* 拖拽中：关掉动画与文本选中，避免抖动 */
.modal.resizing { animation: none; user-select: none; }
/* 整页卡片(订单登记等)也可拖宽：手柄复用 .modal-grip 样式，但只横向、且底部留空间不压住按钮 */
.card.resizable-card { position: relative; }
.card.resizable-card .modal-grip { cursor: ew-resize; border-bottom-right-radius: var(--radius); }
.card.resizable-card.resizing { user-select: none; }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.modal-head .x { cursor: pointer; color: var(--ink-3); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; }
.modal-head .x:hover { background: var(--danger-soft); color: var(--danger); }
/* min-height:0 让 body 在被指定固定高度的弹窗里正确收缩并内部滚动（flex 子项默认不缩） */
/* overscroll-behavior:contain 断开滚动链：body 滚到顶/底后，多余的滚轮增量不再传给背后的页面 */
.modal-body { padding: 20px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
/* 可调整大小且有底部按钮时，手柄与「保存」按钮都在右下角，会互相遮挡：给 footer 留出手柄宽度 */
.modal.resizable .modal-foot { padding-right: 26px; }

/* Toast */
#toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; font-weight: 500; min-width: 220px; animation: slidein .25s; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.ok svg { color: var(--ok); } .toast.err svg { color: var(--danger); }

/* misc */
.chart { width: 100%; height: 300px; }
.chart.sm { height: 240px; }
.chart.lg { height: 360px; }
.flex { display: flex; } .items-center { align-items: center; } .gap { gap: 10px; }
/* 操作列：按钮多时自动换行，控制最小宽度避免撑满 */
.cell-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 120px; max-width: 200px; }
.cell-actions .btn-sm { flex: 0 0 auto; }
.muted { color: var(--ink-3); } .mono { font-variant-numeric: tabular-nums; }
.money::before { content: '¥'; opacity: .55; margin-right: 1px; font-size: .85em; }
.text-ok { color: var(--ok); } .text-danger { color: var(--danger); } .text-brand { color: var(--brand); }
.text-warn { color: var(--warn); }
.fw7 { font-weight: 700; } .center { text-align: center; } .right { text-align: right; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.hint { font-size: 12px; color: var(--ink-3); background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px 12px; }

/* 算法说明徽标：ⓘ 悬停/聚焦弹出公式框。挂在图表标题旁，说明数据口径与计算方式 */
.algo-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; font-style: normal; cursor: help; flex-shrink: 0; user-select: none; vertical-align: middle; }
.algo-tip:hover, .algo-tip:focus { background: var(--brand); color: #fff; outline: none; }
.algo-tip .algo-pop {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%) translateY(-4px);
  width: 260px; max-width: 76vw; padding: 10px 12px; z-index: 60;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 12px; font-weight: 400; line-height: 1.6; text-align: left;
  white-space: normal; opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s;
}
.algo-tip:hover .algo-pop, .algo-tip:focus .algo-pop { opacity: 1; transform: translateX(-50%) translateY(0); }
.algo-tip .algo-pop b { color: var(--ink); font-weight: 700; }
.algo-tip .algo-pop .f { display: block; margin-top: 4px; padding: 4px 7px; background: var(--surface-2); border-radius: 6px; color: var(--brand); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; }
/* 靠右卡片的说明框防溢出：右对齐 */
.card-head .algo-tip .algo-pop { left: auto; right: -4px; transform: translateY(-4px); }
.card-head .algo-tip:hover .algo-pop, .card-head .algo-tip:focus .algo-pop { transform: translateY(0); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
/* 默认(未选中)态：白底 + 边框，平时也像实体按钮，不再是纯文字 */
.seg button { border: 1px solid var(--border); background: var(--surface); padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 600; font-family: inherit; transition: background .15s, color .15s, box-shadow .15s, border-color .15s; }
/* hover：淡品牌底 + 品牌字 + 品牌边，明确"可点" */
.seg button:hover:not(.active) { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
/* 选中态：品牌渐变填充 + 白字 + 投影，一眼可辨 */
.seg button.active { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(99,102,241,.35); }
.checkline { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.checkline input { width: 16px; height: 16px; accent-color: var(--brand); }
/* overscroll-behavior:contain：选人框滚到底后别把滚轮增量甩给外层 .modal-body，否则整张表单会跟着跳 */
.people-pick { border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface-2); display: flex; flex-wrap: wrap; gap: 6px; }
.people-pick .grp { font-size: 11px; color: var(--ink-3); margin: 6px 4px 3px; font-weight: 600; width: 100%; }
.people-pick label { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; margin: 3px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 12.5px; background: var(--surface); }
.people-pick label:hover { border-color: var(--brand); }
.people-pick input:checked + span { color: var(--brand); font-weight: 700; }
.spin { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: rot .7s linear infinite; margin: 40px auto; }
@keyframes rot { to { transform: rotate(360deg); } }

.sidebar-collapsed .sidebar { width: 70px; }
.sidebar-collapsed .brand .name, .sidebar-collapsed .menu-item span, .sidebar-collapsed .menu-group-title { display: none; }
.sidebar-collapsed .main { margin-left: 70px; }
.sidebar-collapsed .menu-item { justify-content: center; }

/* 消息通知中心 */
.bell-wrap { position: relative; padding: 8px; border-radius: 10px; transition: background .2s; display: flex; align-items: center; justify-content: center; }
.bell-wrap:hover { background: var(--surface-2); }
.bell-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 1px solid var(--surface); }
.bell-dropdown { position: absolute; top: 48px; right: -8px; width: 340px; max-height: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 999; overflow: hidden; display: flex; flex-direction: column; }
.bell-dropdown .bell-head { padding: 12px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
/* 通知面板不在弹窗里（页面没被锁滚），滚到底后的滚轮增量会直接甩到页面上，这里也要断开 */
.bell-dropdown .bell-body { overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.bell-dropdown .bell-item { padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.bell-dropdown .bell-item:hover { background: var(--surface-2); }
.bell-dropdown .bell-item.unread { border-left: 3px solid var(--brand); }
.bell-dropdown .bell-item .bell-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.bell-dropdown .bell-item .bell-content { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.bell-dropdown .bell-item .bell-time { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.bell-dropdown .bell-empty { padding: 24px; text-align: center; color: var(--ink-3); font-size: 13px; }
.bell-dropdown .bell-foot { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-3); cursor: pointer; }
.bell-dropdown .bell-foot:hover { color: var(--brand); }

/* ============================================================
   laydate 箭头修复：字体文件缺失时 fallback 为文本箭头
   ============================================================ */
.layui-laydate-header i.laydate-icon.laydate-prev-y::before { content: '«'; }
.layui-laydate-header i.laydate-icon.laydate-prev-m::before { content: '‹'; }
.layui-laydate-header i.laydate-icon.laydate-next-m::before { content: '›'; }
.layui-laydate-header i.laydate-icon.laydate-next-y::before { content: '»'; }
.layui-laydate-header i.laydate-icon { font-family: inherit !important; font-style: normal; font-size: 14px; color: inherit; text-align: center; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.layui-laydate-header i.laydate-icon:hover { color: var(--brand); }

/* 深色主题适配 */
[data-theme="dark"] .layui-laydate,
[data-theme="dark"] .layui-laydate .layui-laydate-content,
[data-theme="dark"] .layui-laydate .layui-laydate-header,
[data-theme="dark"] .layui-laydate .layui-laydate-footer { background-color: var(--surface); border-color: var(--border); color: var(--ink); }
[data-theme="dark"] .layui-laydate .layui-laydate-header { border-bottom-color: var(--border); }
[data-theme="dark"] .layui-laydate-content th { color: var(--ink-2); }
[data-theme="dark"] .layui-laydate-content td { color: var(--ink-2); }
[data-theme="dark"] .layui-laydate-content td:hover { background: var(--surface-2); }
[data-theme="dark"] .layui-laydate .layui-this { background-color: var(--brand) !important; color: #fff !important; }
[data-theme="dark"] .layui-laydate-footer { border-top-color: var(--border); }
[data-theme="dark"] .layui-laydate-hint { color: var(--danger); }
[data-theme="dark"] .layui-laydate .laydate-day-next,
[data-theme="dark"] .layui-laydate .laydate-day-prev { color: var(--ink-3); }

/* ---- 区间选择：起止两端 + 区间内着色 ----
   vendor 的 laydate.css，以及 laydate.js 运行时往 <head> 注入的 theme/default/laydate.css，
   都排在 app.css 之后且自带 !important（区间内 #00F7DE 亮青、两端 #009688 墨绿），同权重
   压不住，所以这里一律 !important 拉回品牌色。 */
/* 起止两端。只限定在区间面板内 —— 不加 .layui-laydate-range 前缀会把全站单日选择器的选中色
   也从墨绿改成品牌紫，那是本次需求外的全局视觉变更，线上不顺手改。
   （注：暗色下单日选择器早已是品牌紫，见上面 [data-theme=dark] 那条；浅色仍是墨绿。若哪天想统一，
   把这行的 .layui-laydate-range 前缀去掉即可。） */
.layui-laydate-range .layui-this { background-color: var(--brand) !important; color: #fff !important; }
/* 区间内的日子：品牌淡底 + 品牌字。grid 是暗色下用的主题，它那份规则底色是浅灰，必须一起覆盖 */
.layui-laydate-content td.laydate-selected,
.laydate-selected:hover,
.laydate-theme-grid .laydate-selected,
.laydate-theme-grid .laydate-selected:hover { background-color: var(--brand-soft) !important; color: var(--brand) !important; }
/* 区间内属于上/下月的补位日：压淡，跟本月的日子区分开 */
.laydate-selected.laydate-day-next,
.laydate-selected.laydate-day-prev { background-color: var(--surface-2) !important; color: var(--ink-3) !important; }
/* 区间面板宽 546px（两月并排），窄屏溢出视口 → 改上下堆叠。
   不动 vendor 对翻页箭头的隐藏：range 模式下两个面板的月份是联动锁定的（右=左+1），
   放开被隐藏的那半边箭头会让面板进入不一致状态。 */
@media (max-width: 600px) {
  .layui-laydate-range { width: 274px !important; }
  .layui-laydate-range .layui-laydate-main { display: block; }
  .layui-laydate-range .laydate-main-list-1 .layui-laydate-content { border-left: 0 !important; }
}

/* ============================================================
   移动端抽屉：≤720px 侧边栏移出屏幕，汉堡按钮滑出 + 遮罩
   ============================================================ */
.nav-overlay { display: none; }
@media (max-width: 720px) {
  /* 侧边栏默认移出屏幕左侧，加过渡 */
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--shadow-lg); }
  /* 内容区不再给侧边栏让位，占满整宽 */
  .main { margin-left: 0; }
  /* 桌面折叠态在移动端无意义，强制归零 */
  .sidebar-collapsed .sidebar { width: 236px; }
  .sidebar-collapsed .main { margin-left: 0; }
  .sidebar-collapsed .brand .name,
  .sidebar-collapsed .menu-item span,
  .sidebar-collapsed .menu-group-title { display: revert; }
  .sidebar-collapsed .menu-item { justify-content: flex-start; }
  /* 抽屉打开：侧边栏滑入 + 遮罩淡入 */
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-overlay {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(15,20,35,.5); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .24s ease;
  }
  body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
  /* 顶栏内边距收窄，给小屏更多空间 */
  .topbar { padding: 0 14px; gap: 10px; }
  .content { padding: 16px 14px; }
  /* 用户名在极窄屏隐藏，只留头像 */
  .userchip > div { display: none; }
  .userchip { padding: 5px; }
}

/* ============================================================
   体验增强：骨架屏 · 入场动画 · 微交互
   ============================================================ */
/* —— 骨架屏 —— */
.skel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; box-sizing: border-box; }
.skel { background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 37%, var(--border) 63%); background-size: 400% 100%; border-radius: 8px; animation: skel-shine 1.3s ease infinite; }
.skel-line { height: 13px; margin: 8px 0; }
@keyframes skel-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* —— 卡片/行入场：淡入 + 轻微上浮 —— */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise-in { animation: rise .42s cubic-bezier(.2,.7,.3,1) both; }

/* —— 微交互：看板卡悬停抬起、按钮点击回弹 —— */
.dash-card .card, .dash-card .kpi { transition: transform .18s ease, box-shadow .18s ease; }
.dash-card:hover .card, .dash-card:hover .kpi { transform: translateY(-3px); box-shadow: var(--shadow); }
.btn:active { transform: scale(.96); }
.btn-primary:active { transform: scale(.96); }
.menu-item { transition: background .16s, color .16s, transform .12s; }
.menu-item:active { transform: scale(.97); }

/* 尊重系统「减弱动态效果」：关掉全部装饰动画 */
@media (prefers-reduced-motion: reduce) {
  .rise-in { animation: none; }
  .skel { animation: none; }
  .dash-card:hover .card, .dash-card:hover .kpi { transform: none; }
}

/* ============================================================
   Markdown 文档渲染（使用手册 / 产品资料 共用）
   原为 help.js 内联注入，两页共用后搬到此处统一维护。
   ============================================================ */
.md-wrap { display: flex; gap: 16px; align-items: flex-start; }
.md-toc { width: 230px; flex: 0 0 230px; position: sticky; top: 16px; padding: 14px 12px; max-height: calc(100vh - 100px); overflow: auto; }
.md-toc-title { font-weight: 700; color: var(--ink); margin-bottom: 8px; font-size: 13px; }
.md-toc-item { display: block; padding: 5px 8px; border-radius: 6px; color: var(--ink-2); font-size: 13px; cursor: pointer; text-decoration: none; line-height: 1.4; }
.md-toc-item:hover { background: var(--brand-soft); color: var(--brand); }
.md-toc-item.lv2 { padding-left: 20px; font-size: 12px; color: var(--ink-3); }
.md-body { flex: 1; min-width: 0; padding: 24px 30px; line-height: 1.75; color: var(--ink-2); }
.md-body .md-h { color: var(--ink); font-weight: 700; line-height: 1.35; scroll-margin-top: 16px; }
.md-body .md-h1 { font-size: 24px; margin: 8px 0 16px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }
.md-body .md-h2 { font-size: 19px; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.md-body .md-h3 { font-size: 16px; margin: 20px 0 8px; }
.md-body .md-h4 { font-size: 14px; margin: 16px 0 6px; color: var(--ink-2); }
.md-body .md-p { margin: 8px 0; }
.md-body .md-ul, .md-body .md-ol { margin: 8px 0; padding-left: 24px; }
.md-body .md-ul li, .md-body .md-ol li { margin: 4px 0; }
.md-body code { background: var(--brand-soft); color: var(--brand); padding: 1px 6px; border-radius: 5px; font-family: var(--mono, monospace); font-size: .9em; }
.md-body pre { background: var(--surface-2, rgba(127,127,127,.08)); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow: auto; margin: 12px 0; }
.md-body pre code { background: none; color: var(--ink-2); padding: 0; font-size: 12.5px; line-height: 1.6; }
.md-body strong { color: var(--ink); font-weight: 700; }
.md-body a { color: var(--brand); text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body .md-hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.md-body .md-quote { margin: 12px 0; padding: 10px 14px; background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 6px; color: var(--ink-2); }
.md-body .md-table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.md-body .md-table th, .md-body .md-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.md-body .md-table th { background: var(--brand-soft); color: var(--ink); font-weight: 700; }
.md-body .md-table tbody tr:nth-child(even) { background: var(--surface-2, transparent); }
/* 正文图片：自适应宽度、点击可看大图（产品资料页绑定放大） */
.md-body .md-img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); margin: 10px 0; cursor: zoom-in; display: block; }
@media (max-width: 820px) {
  .md-wrap { flex-direction: column; }
  .md-toc { width: 100%; flex: none; position: static; max-height: none; }
}

/* ============================================================
   产品资料页（左侧文档列表 + 右侧阅读/编辑）
   ============================================================ */
.doc-side { width: 260px; flex: 0 0 260px; }
.doc-side-hd { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.doc-search { width: 100%; }
.doc-new { width: 100%; }
.doc-list { display: flex; flex-direction: column; }
.doc-cat { margin-top: 10px; }
.doc-cat:first-child { margin-top: 0; }
.doc-item { display: flex; align-items: center; gap: 6px; }
.doc-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.doc-draft { flex: 0 0 auto; transform: scale(.85); }
.doc-empty { padding: 24px 8px; }
.doc-main { flex: 1; min-width: 0; }

/* 阅读态头部：分类/更新人 + 编辑删除按钮 */
.doc-read-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.doc-read-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-read-time { color: var(--ink-3); font-size: 12px; }
.doc-read-ops { display: flex; gap: 8px; }
.doc-zoom { text-align: center; }
.doc-zoom img { max-width: 100%; max-height: 76vh; border-radius: 8px; }

/* 编辑态 */
.doc-edit { padding: 14px 16px 16px; }
.doc-edit-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-f-title { flex: 1 1 260px; min-width: 200px; font-weight: 600; }
.doc-f-cat { flex: 0 0 150px; }
.doc-f-sort { flex: 0 0 86px; }
.doc-f-pub { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.doc-edit-ops { display: flex; gap: 8px; margin-left: auto; }
.doc-kbd { font-size: 11px; opacity: .75; font-family: var(--mono, monospace); }
.doc-edit-tip { font-size: 12px; color: var(--ink-3); background: var(--brand-soft); border-radius: 6px; padding: 7px 10px; margin-bottom: 10px; line-height: 1.6; }
.doc-edit-tip b { color: var(--brand); }

/* EasyMDE 深浅色适配：库自带样式是浅色硬编码，这里改为跟随系统 CSS 变量 */
.doc-edit .EasyMDEContainer .CodeMirror { background: var(--surface, transparent); color: var(--ink); border-color: var(--border); border-radius: 0 0 8px 8px; min-height: 420px; }
.doc-edit .EasyMDEContainer .CodeMirror-cursor { border-left-color: var(--ink); }
.doc-edit .EasyMDEContainer .CodeMirror-selected { background: var(--brand-soft) !important; }
.doc-edit .editor-toolbar { background: var(--surface-2, transparent); border-color: var(--border); border-radius: 8px 8px 0 0; }
.doc-edit .editor-toolbar button { color: var(--ink-2) !important; }
.doc-edit .editor-toolbar button:hover, .doc-edit .editor-toolbar button.active { background: var(--brand-soft); border-color: var(--border); color: var(--brand) !important; }
.doc-edit .editor-toolbar i.separator { border-left-color: var(--border); border-right-color: transparent; }
.doc-edit .editor-statusbar { color: var(--ink-3); }
.doc-edit .CodeMirror-fullscreen, .doc-edit .editor-toolbar.fullscreen { z-index: 60; background: var(--surface, #fff); }
/* 分屏预览 & 全屏预览：正文样式复用 .md-body 的一套（类名由 previewRender 输出的原生标签承接） */
.doc-edit .editor-preview, .doc-edit .editor-preview-side { background: var(--surface, #fff); color: var(--ink-2); border-color: var(--border); padding: 16px 20px; line-height: 1.75; }
.doc-edit .editor-preview img, .doc-edit .editor-preview-side img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.doc-edit .editor-preview table, .doc-edit .editor-preview-side table { border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.doc-edit .editor-preview th, .doc-edit .editor-preview td,
.doc-edit .editor-preview-side th, .doc-edit .editor-preview-side td { border: 1px solid var(--border); padding: 8px 12px; }
.doc-edit .editor-preview th, .doc-edit .editor-preview-side th { background: var(--brand-soft); color: var(--ink); }
.doc-edit .editor-preview h1, .doc-edit .editor-preview h2, .doc-edit .editor-preview h3,
.doc-edit .editor-preview-side h1, .doc-edit .editor-preview-side h2, .doc-edit .editor-preview-side h3 { color: var(--ink); }
.doc-edit .editor-preview blockquote, .doc-edit .editor-preview-side blockquote { margin: 12px 0; padding: 10px 14px; background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 6px; }
.doc-edit .editor-preview pre, .doc-edit .editor-preview-side pre { background: var(--surface-2, rgba(127,127,127,.08)); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow: auto; }

@media (max-width: 820px) {
  .doc-side { width: 100%; flex: none; }
  .doc-edit-ops { margin-left: 0; width: 100%; }
}

/* ============ 订单详情弹窗 ============ */
/* 顶部状态条：审核 / 完工 / 结算 / 交付 四个状态各带日期，横排一眼扫完 */
.od-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.od-stat { flex: 1; min-width: 132px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.od-stat .k { font-size: 11.5px; color: var(--ink-3); margin-bottom: 4px; }
.od-stat .v { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.od-stat .d { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.od-stat.on  { border-color: rgba(22,163,74,.35);  background: var(--ok-soft); }
.od-stat.off { border-color: var(--border); }
.od-stat.warn{ border-color: rgba(217,119,6,.35);  background: var(--warn-soft); }
.od-stat.bad { border-color: rgba(220,38,38,.35);  background: var(--danger-soft); }
/* 分节标题：比 .field>label 更醒目，用于「款项 / 参与人 / 备注」等段落分区 */
.od-sec { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin: 0 0 10px; }
.od-sec::after { content: ''; flex: 1; height: 1px; background: var(--border); }
/* 收款进度条：已收 / 合同额 */
.od-bar { height: 7px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 6px; }
.od-bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), #8b5cf6); }
/* 进度款分期表：紧凑单行，避免用大表格挤走上下文 */
.od-prog { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.od-prog th, .od-prog td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.od-prog th { color: var(--ink-3); font-weight: 600; background: var(--surface-2); }
.od-prog td.num, .od-prog th.num { text-align: right; }
.od-prog tr:last-child td { border-bottom: 0; }
@media (max-width: 820px) { .od-stat { min-width: 100%; } }

/* ============ 凭证上传区（虚线可粘贴区） ============ */
/* 虚线框 + 框内明写 Ctrl+V：粘贴能力得让员工不悬停就看见，原先只写在 button title 里基本发现不了 */
.proof-zone {
  display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 10px;
  border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.proof-zone:hover, .proof-zone:focus-visible { border-color: var(--brand); background: var(--surface); }
.proof-zone:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* 退款金额为 0 时禁用：pointer-events 不能全关，否则「查看」旧凭证也点不动，只压交互态 */
.proof-zone.disabled { opacity: .55; cursor: not-allowed; border-style: dashed; }
.proof-zone.disabled:hover { border-color: var(--border-strong); background: var(--surface-2); }
/* 已暂存：实线 + 品牌色，和「还没选图」在余光里就能区分 */
.proof-zone.staged { border-style: solid; border-color: var(--brand); background: var(--surface); }
/* 粘贴命中瞬间闪一下，给个明确的“收到了”反馈 */
.proof-zone.flash { animation: proof-flash .5s ease; }
/* 色值跟 --brand(#6366f1) 对齐；keyframes 里没法对变量做 alpha，只能写死 RGB */
@keyframes proof-flash {
  0%   { box-shadow: 0 0 0 0 rgba(99,102,241,.45); }
  100% { box-shadow: 0 0 0 10px rgba(99,102,241,0); }
}
.proof-zone .pz-thumb {
  flex: none; width: 46px; height: 46px; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border);
}
.proof-zone .pz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proof-zone .pz-ph { font-size: 11px; color: var(--ink-3); }
.proof-zone .pz-main { flex: 1; min-width: 0; }
.proof-zone .pz-title { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.proof-zone .pz-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; word-break: break-all; }
.proof-zone.staged .pz-sub { color: var(--brand); font-weight: 600; }
.proof-zone kbd {
  display: inline-block; padding: 0 4px; font-family: var(--font); font-size: 11px; line-height: 16px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 4px;
}
/* 查看 / 撤销：待上传的新截图也要能当场看和撤回，不必先提交 */
.proof-zone .pz-acts { flex: none; display: flex; gap: 4px; white-space: nowrap; }

/* 凭证管理区（编辑订单表单内）：逐版列出，当前版可移除。
   移除只解除关联，文件与 order_attachments 行永久保留 —— 详情页「凭证留痕」仍查得到。 */
.proof-hist { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.proof-hist .ph-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 5px 9px; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.proof-hist .ph-head .muted { font-weight: 400; }
.proof-hist .ph-row {
  display: flex; align-items: center; gap: 7px; padding: 5px 9px; font-size: 11.5px;
  border-bottom: 1px solid var(--border);
}
.proof-hist .ph-row:last-child { border-bottom: 0; }
.proof-hist .ph-thumb {
  flex: none; width: 30px; height: 30px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in; display: block;
}
.proof-hist .ph-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* 退款凭证多图暂存列表 */
.pz-staged-list { margin-top: 4px; }
.pz-staged-list-inner { display: flex; flex-direction: column; gap: 4px; }
.pz-staged-item {
  display: flex; align-items: center; gap: 7px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 12px;
}
.pz-staged-thumb {
  flex: none; width: 32px; height: 32px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border); cursor: zoom-in; display: block;
}
.pz-staged-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }

/* ============ 订单修改记录（详情弹窗底部） ============ */
/* 每次修改一张卡：原先只有一条左竖线 + 12px 间距，多次修改连成一片分不清边界。
   注意「一次修改」可能对应多条 order_revisions（订单字段走 /save、凭证走 /refund-proof/upload），
   已在 revisionsHtml 里按「同人 + 5 秒内」合并，这里只负责把一组画成一张卡。 */
.rev-item {
  border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: 8px; background: var(--surface-2); padding: 7px 10px 8px; margin-bottom: 8px;
}
.rev-item:last-child { margin-bottom: 0; }
/* 最近一次高亮：翻记录时第一眼要落在「最后被改成什么样」 */
.rev-item.is-latest { border-left-color: var(--brand); background: var(--brand-soft); }
.rev-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3); margin-bottom: 5px;
  padding-bottom: 5px; border-bottom: 1px dashed var(--border);
}
.rev-no { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rev-time { font-variant-numeric: tabular-nums; }
.rev-who { font-weight: 600; color: var(--ink-2); }
/* 变更行之间给一点呼吸，字段名与新旧值的对照才扫得清 */
.rev-body > div { line-height: 1.65; }
