/* ============================================================
   百利工程 · 管理端样式（双主题）
   默认：深色科技风（与官网/下载页统一）
   body.theme-light：浅色科技风
   全部颜色走 CSS 变量，切换只需切 body 类。
   ============================================================ */
:root {
  /* 深色（默认） */
  --bg:#081321; --panel:#0D1B2C; --panel2:#0E1E33; --panel3:#16263B;
  --txt:#EDF4FD; --mut:#A9C0DE; --mut2:#7E97BA;
  --line:rgba(120,170,255,.13); --line2:rgba(120,170,255,.26);
  --acc:#3D9BFF; --acc2:#00D9C3; --acc3:#7C6BFF;
  --accSoft:rgba(61,155,255,.15); --hoverRow:rgba(61,155,255,.05);
  --inputBg:#0E1E33;
  --gradMain:linear-gradient(135deg,#3D9BFF,#2E6FFF); --txtOnMain:#fff;
  --gradGreen:linear-gradient(135deg,#22C38E,#00D9C3); --txtOnGreen:#06211A;
  --gradDanger:linear-gradient(135deg,#F05A5C,#E5484D); --txtOnDanger:#fff;
  --btnNeutralBg:#16263B; --btnNeutralText:#CDE4F9;
  --tagGreenBg:rgba(34,195,142,.15); --tagGreen:#3EDCA6;
  --tagBlueBg:rgba(61,155,255,.15); --tagBlue:#6FB6FF;
  --tagOrangeBg:rgba(255,200,87,.15); --tagOrange:#FFD073;
  --tagRedBg:rgba(229,72,77,.15); --tagRed:#FF7A7E;
  --tagGreyBg:rgba(120,170,255,.1); --tagGrey:#97ACCA;
  --shadow:0 10px 30px rgba(0,0,0,.3);
  --topbarBg:rgba(13,27,44,.86);
}
body.theme-light {
  --bg:#f2f5f8; --panel:#ffffff; --panel2:#f6f8fa; --panel3:#e9edf1;
  --txt:#161c26; --mut:#56606c; --mut2:#6b7683;
  --line:#e4e9ee; --line2:#c9d3dc;
  --acc:#1677ff; --acc2:#0aa78f; --acc3:#7c5cff;
  --accSoft:rgba(22,119,255,.12); --hoverRow:#f7fafb;
  --inputBg:#ffffff;
  --gradMain:linear-gradient(135deg,#1677ff,#0e6ad8); --txtOnMain:#fff;
  --gradGreen:linear-gradient(135deg,#22b57d,#0aa78f); --txtOnGreen:#fff;
  --gradDanger:linear-gradient(135deg,#e5484d,#d64545); --txtOnDanger:#fff;
  --btnNeutralBg:#e9edf1; --btnNeutralText:#3a4550;
  --tagGreenBg:#e3f4ec; --tagGreen:#1a8a5c;
  --tagBlueBg:#e5f0f7; --tagBlue:#1a6ea8;
  --tagOrangeBg:#fdf0e0; --tagOrange:#c9771a;
  --tagRedBg:#fdecec; --tagRed:#c0504d;
  --tagGreyBg:#eceff2; --tagGrey:#7a8590;
  --shadow:0 1px 3px rgba(15,40,70,.08);
  --topbarBg:rgba(255,255,255,.9);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size:16px;
  color: var(--txt);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }

a { color: var(--acc); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 820px at 18% -5%, #0C2338 0%, #081321 55%, #0A1B2E 100%);
}
body.theme-light .login-view {
  background: radial-gradient(1200px 820px at 18% -5%, #d9eefc 0%, #f2f5f8 60%, #e8f2f8 100%);
}
.login-card {
  width: 400px;
  background: rgba(13,27,44,.82);
  border: 1px solid rgba(120,170,255,.16);
  border-radius: 16px;
  padding: 38px 36px 30px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 42px rgba(61,155,255,.08);
  backdrop-filter: blur(12px);
}
body.theme-light .login-card {
  background: rgba(255,255,255,.92);
  border: 1px solid #e2eaf2;
  box-shadow: 0 18px 50px rgba(15,40,70,.14);
}
.login-brand {
  font-size:25px; font-weight: 800; color: #fff; text-align: center; letter-spacing: 1.5px;
}
body.theme-light .login-brand { color: var(--txt); }
.login-sub { font-size: 12.5px; color: #97ACCA; text-align: center; margin: 8px 0 28px; letter-spacing: 3px; }
body.theme-light .login-sub { color: var(--mut); }
.login-err {
  background: rgba(229,72,77,.14); color: #FF7A7E; border: 1px solid rgba(255,92,92,.3);
  padding: 8px 12px; border-radius: 8px; font-size:14px; margin-bottom: 14px;
}
body.theme-light .login-err { background:#fdecec; color:#c0392b; border-color:#f5c6c6; }
.login-tip { margin-top: 18px; font-size:13px; color: #6E86A6; text-align: center; }
body.theme-light .login-tip { color: var(--mut2); }

/* ---------- 表单通用 ---------- */
.form-item { display: block; margin-bottom: 16px; }
.form-label { display: block; font-size:15px; color: var(--mut); margin-bottom: 7px; }
.form-item input[type=text],
.form-item input[type=password],
.form-item input[type=number],
.form-item input[type=date],
.form-item input[type=datetime-local],
.form-item select,
.form-item textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  font-size:16px;
  background: var(--inputBg);
  color: var(--txt);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--accSoft);
}
.form-item textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-item { flex: 1; }
.form-required::after { content: " *"; color: #FF5C5C; }

/* 名称「清单选」行：输入框 + 下拉同排 */
.inline-pick { display: flex; gap: 8px; align-items: center; }
.inline-pick input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 8px; font-size:15px; color: var(--txt); background: var(--inputBg); outline: none; }
.inline-pick select { width: auto; min-width: 108px; padding: 10px 10px; border: 1px solid var(--acc); border-radius: 8px; font-size:14px; color: var(--acc); background: var(--inputBg); cursor: pointer; }

/* 文件 URL 输入行（输入框 + 上传按钮） */
.file-url-row { display: flex; gap: 8px; }
.file-url-row input { flex: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 16px;
  font-size:15px;
  cursor: pointer;
  background: var(--btnNeutralBg);
  color: var(--btnNeutralText);
  transition: opacity .15s, background .15s, box-shadow .2s;
}
.btn:hover { opacity: .92; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gradMain); color: var(--txtOnMain); box-shadow: 0 6px 18px var(--accSoft); }
.btn-primary:hover { box-shadow: 0 10px 24px var(--accSoft); }
.btn-success { background: var(--gradGreen); color: var(--txtOnGreen); box-shadow: 0 6px 18px var(--tagGreenBg); }
.btn-danger  { background: var(--gradDanger); color: var(--txtOnDanger); box-shadow: 0 6px 18px var(--tagRedBg); }
.btn-ghost   { background: transparent; border-color: var(--line2); color: var(--mut); }
.btn-ghost:hover { border-color: var(--acc); background: var(--accSoft); }
.btn-sm { padding: 6px 12px; font-size:15px; }
.btn-block { width: 100%; }

/* ---------- 主布局 ---------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 56px;
  background: var(--topbarBg);
  color: var(--txt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size:19px; font-weight: 700; letter-spacing: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size:14px; color: var(--mut); }
.topbar .btn-ghost { color: var(--mut); border-color: var(--line2); }

.body-wrap { flex: 1; display: flex; }
.sidebar {
  width: 210px;
  background: linear-gradient(180deg, var(--panel2), var(--panel3));
  flex-shrink: 0;
  padding: 16px 10px;
  border-right: 1px solid var(--line);
  position: relative;
}
.nav-menu { display: flex; flex-direction: column; }
.nav-item {
  display: block;
  padding: 13px 8px;
  margin: 4px 0;
  color: var(--mut);
  font-size:15px;
  cursor: pointer;
  text-align: center;
  letter-spacing: 1px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
/* 高大上导航特效：悬停滑入光晕 + 文字发光 + 底部流光下划线；选中渐变流光卡片 */
.nav-item:hover {
  background: linear-gradient(135deg, rgba(61,155,255,.22), rgba(0,217,195,.08));
  color: var(--txt);
  transform: translateX(3px);
  border-color: rgba(61,155,255,.28);
  box-shadow: 0 4px 16px rgba(61,155,255,.18);
  text-shadow: 0 0 10px rgba(96,180,255,.7);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(61,155,255,.32), rgba(0,217,195,.16));
  color: var(--txt);
  font-weight: 600;
  border-color: rgba(61,155,255,.38);
  box-shadow: 0 6px 22px rgba(61,155,255,.28), inset 0 0 16px rgba(61,155,255,.12);
  text-shadow: 0 0 12px rgba(109,190,255,.9);
}
.nav-item::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%) scaleX(0);
  bottom: 2px; width: 72%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #3D9BFF, #00D9C3, transparent);
  transition: transform .32s ease;
}
.nav-item:hover::after, .nav-item.active::after { transform: translateX(-50%) scaleX(1); }
/* 侧栏与内容区之间的可拖拽分隔条：按住左右拖动调整侧栏宽度 */
.sb-resize {
  width: 6px; flex-shrink: 0; cursor: col-resize; position: relative; z-index: 3;
  background: transparent;
}
.sb-resize::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 2px;
  background: var(--line2); transition: background .2s, box-shadow .2s;
}
.sb-resize:hover::after, .sb-resize.active::after {
  background: linear-gradient(180deg, #3D9BFF, #00D9C3);
  box-shadow: 0 0 8px rgba(61,155,255,.6);
}

.content { flex: 1; overflow-x: auto; padding: 20px; }
.content-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* ---------- 页面标题 / 工具条 ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-title { font-size:21px; font-weight: 700; color: var(--txt); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select {
  padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; font-size:14px; background: var(--inputBg); color: var(--txt);
}

/* ---------- 卡片 / 统计 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.stat-grid { display: flex; gap: 16px; margin-bottom: 16px; }
.stat-card {
  flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px;
  box-shadow: var(--shadow);
}
.stat-num { font-size:31px; font-weight: 800; color: var(--acc); }
.stat-label { font-size:14px; color: var(--mut); margin-top: 6px; }

/* ---------- 表格 ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
table.grid { width: 100%; border-collapse: collapse; font-size:15px; table-layout: auto; }
table.grid th, table.grid td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}
table.grid th { background: var(--panel2); color: var(--mut); font-weight: 600; white-space: nowrap; }
table.grid tr:hover td { background: var(--hoverRow); }
/* 内容列按文字多少自适应宽度：长文本列自动加宽，短列紧凑 */
table.grid th, table.grid td { max-width: none; }
table.grid td.ellipsis { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-empty { padding: 30px; text-align: center; color: var(--mut2); }

/* 报价构成明细块（报价金额列下方，标签左-金额右对齐） */
.q-amt { position: relative; display: inline-block; cursor: pointer; }
.q-fee {
  position: absolute; top: 100%; right: 0; z-index: 50;
  margin-top: 8px; padding: 14px 18px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel2); box-shadow: 0 12px 36px rgba(0,0,0,.42);
  font-size: 13px; min-width: 300px; text-align: left; white-space: nowrap;
  visibility: hidden; opacity: 0; transform: translateY(10px) scale(.98);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  pointer-events: none;
}
.q-amt:hover .q-fee, .q-amt:focus .q-fee {
  visibility: visible; opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}
.q-fee .q-fee-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--txt); border-bottom: 1px dashed var(--line2); padding-bottom: 6px; }
.q-fee .qf-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; line-height: 1.85; font-size: 13px; }
.q-fee .qf-label { color: var(--mut); white-space: nowrap; }
.q-fee .qf-val { text-align: right; font-weight: 600; white-space: nowrap; }
.q-fee .qf-raw .qf-val { color: var(--primary); font-weight: 800; font-size: 13px; }
.q-fee .qf-tax .qf-val { color: #f59e0b; }

/* 报价详情弹窗：信息区 标签/值 对齐 + 汇总区 */
table.quote-info td { border: 0; background: transparent; padding: 5px 8px; }
.quote-info .qk { width: 92px; color: var(--mut2); font-weight: 600; white-space: nowrap; }
.quote-info .qv { color: var(--txt); font-weight: 700; }
table.quote-sum th { text-align: left; white-space: nowrap; }
table.quote-sum td { text-align: right; }
table.quote-sum tr.total th, table.quote-sum tr.total td { background: rgba(198, 40, 40, 0.14); }
table.quote-sum tr.total td { color: #e53935; font-weight: 800; font-size: 15px; }

/* 清单明细表格内输入框：深色适配主题、全宽、更高 */
table.quote-items td { padding: 6px 6px; }
table.quote-items input { width: 100%; box-sizing: border-box; height: 34px; padding: 6px 10px;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--txt); font-size: 14px; }
body:not(.theme-light) table.quote-items input { background: #0E1E33; }
body:not(.theme-light) table.quote-items input::placeholder { color: #6E86A6; }
table.quote-items input:focus { outline: none; border-color: #3D9BFF; }
table.quote-items td.item-amt { text-align: right; font-weight: 600; white-space: nowrap; }

/* 综合取费输入框：深色适配主题 */
#qf-fee .qf-row input { box-sizing: border-box; height: 34px; padding: 6px 10px;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--txt); font-size: 14px; }
body:not(.theme-light) #qf-fee .qf-row input { background: #0E1E33; }
#qf-fee .qf-row input:focus { outline: none; border-color: #3D9BFF; }

/* 状态标签 */
.tag { display: inline-block; padding: 3px 11px; border-radius: 10px; font-size:14px; }
.tag-green { background: var(--tagGreenBg); color: var(--tagGreen); }
.tag-blue  { background: var(--tagBlueBg); color: var(--tagBlue); }
.tag-orange{ background: var(--tagOrangeBg); color: var(--tagOrange); }

/* ---------- 用户管理：表格 / 角色徽章 / 操作按钮 ---------- */
table.table { width: 100%; border-collapse: collapse; font-size:15px; }
table.table th, table.table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
table.table th { background: var(--panel2); color: var(--mut); font-weight: 600; white-space: nowrap; }
table.table tr:hover td { background: var(--hoverRow); }
.op-cell { white-space: nowrap; }
.op-cell .btn { margin-right: 8px; }
.btn-edit { background: var(--gradMain); color: var(--txtOnMain); }
.role-badge { display: inline-block; padding: 2px 11px; border-radius: 11px; font-size:13px; font-weight: 500; }
.role-super { background: var(--tagRedBg); color: var(--tagRed); }
.role-admin { background: var(--tagBlueBg); color: var(--tagBlue); }
.role-ent   { background: var(--tagGreenBg); color: var(--tagGreen); }
.role-norm  { background: var(--tagGreyBg); color: var(--tagGrey); }
.tag-gray  { background: var(--tagGreyBg); color: var(--tagGrey); }
.tag-red   { background: var(--tagRedBg); color: var(--tagRed); }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px; }
.pagination button {
  min-width: 30px; padding: 5px 9px; border: 1px solid var(--line2); background: var(--panel2); color: var(--mut);
  border-radius: 7px; cursor: pointer; font-size:14px; transition: background .15s;
}
.pagination button:hover { background: var(--accSoft); }
.pagination button.active { background: var(--gradMain); color: var(--txtOnMain); border-color: transparent; font-weight: 600; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
.pagination .page-info { font-size:14px; color: var(--mut2); margin-right: 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4,10,20,.62);
  display: flex; align-items: flex-start; justify-content: center; z-index: 100;
  padding-top: 60px; overflow: auto; backdrop-filter: blur(3px);
}
body.theme-light .modal-mask { background: rgba(20,40,65,.42); }
.modal {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; width: 960px; max-width: 94%;
  box-shadow: var(--shadow); position: relative; min-width: 520px;
  display: flex; flex-direction: column; max-height: 92vh;
}
.modal-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.modal-title { font-size:17px; font-weight: 700; }
.modal-close { cursor: pointer; font-size:21px; color: var(--mut2); line-height: 1; border: none; background: none; }
.modal-close:hover { color: var(--txt); }
.modal-body { padding: 20px 24px; flex: 1; overflow: auto; min-height: 0; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--line); text-align: right; flex-shrink: 0; }
/* 弹窗右下角缩放手柄：按住可自由拉大/拉小弹窗 */
.modal-resize {
  position: absolute; right: 0; bottom: 0; width: 20px; height: 20px; cursor: nwse-resize; z-index: 6;
  background: linear-gradient(135deg, transparent 0 50%, rgba(130,150,180,.6) 50% 58%, transparent 58%);
  border-bottom-right-radius: 14px; opacity: .75;
}
.modal-resize:hover { opacity: 1; }
.modal-foot .btn { margin-left: 8px; }

/* 详情描述列表 */
.desc-list { line-height: 1.9; font-size:15px; }
.desc-list .row { display: flex; border-bottom: 1px dashed var(--line); padding: 7px 0; }
.desc-list .k { width: 140px; color: var(--mut2); flex-shrink: 0; }
.desc-list .v { color: var(--txt); word-break: break-all; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300; }
.toast {
  padding: 11px 20px; border-radius: 9px; color: #fff; font-size:16px; font-weight: 500;
  margin-bottom: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.35);
  animation: toastIn .2s ease;
}
.toast-success { background: var(--gradGreen); color: var(--txtOnGreen); }
.toast-error { background: var(--gradDanger); }
.toast-info { background: var(--gradMain); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px);} to { opacity: 1; transform: none;} }

/* 通用 loading 遮罩 */
.loading-box { padding: 30px; text-align: center; color: var(--mut2); }

/* 照片/附件列表 */
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.photo-list img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); }

.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.muted { color: var(--mut2); font-size:14px; }

/* ============================================================
   色块层次增强：深色/浅色都不是单一色调，科学配色
   - 深色：深蓝底 + 亮一档的次级色块 + 彩条统计卡 + 斑马纹
   - 浅色：深色导航(顶栏/侧栏) + 白卡片 + 彩条统计卡 + 斑马纹
   ============================================================ */
:root { --topbarTxt:#EAF2FC; --zebra:rgba(120,170,255,.05); --panel3b:#16263B; }
body.theme-light { --topbarTxt:#fff; --zebra:#f7fafc; --panel3b:#f7fafc; }

.topbar { color: var(--topbarTxt); }
.topbar-title { color: var(--topbarTxt); }
.topbar-user { color: #97ACCA; }
.topbar .btn-ghost { color: #CDE4F9; border-color: rgba(120,170,255,.3); }

/* 浅色主题：顶栏/侧栏用深色导航，与浅色内容区形成强色差 */
body.theme-light .topbar { background: linear-gradient(135deg, #111F36, #0D1B2C); border-bottom-color: rgba(120,170,255,.15); }
body.theme-light .sidebar { background: #0E1E33; border-right-color: rgba(120,170,255,.12); }
body.theme-light .sidebar .nav-item { color: #97ACCA; }
body.theme-light .sidebar .nav-item:hover { background: rgba(61,155,255,.14); color: #fff; }
body.theme-light .sidebar .nav-item.active { background: linear-gradient(90deg, rgba(61,155,255,.32), rgba(0,217,195,.16)); color: #fff; border-left-color: #3D9BFF; }

/* 统计卡：不同色块 + 顶部彩条 */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradMain); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #00D9C3, #22C38E); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #7C6BFF, #3D9BFF); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #FFC857, #FF9F43); }
.stat-card:nth-child(1) .stat-num { color: var(--acc); }
.stat-card:nth-child(2) .stat-num { color: #00D9C3; }
.stat-card:nth-child(3) .stat-num { color: #7C6BFF; }
.stat-card:nth-child(4) .stat-num { color: #FFC857; }
body.theme-light .stat-card:nth-child(2) .stat-num { color: #0aa78f; }
body.theme-light .stat-card:nth-child(3) .stat-num { color: #7c5cff; }
body.theme-light .stat-card:nth-child(4) .stat-num { color: #d98e12; }

/* 表格斑马纹色差 */
table.grid tr:nth-child(even) td,
table.table tr:nth-child(even) td { background: var(--zebra); }

/* 详情/附件区块次级色块 */
.desc-list { background: var(--panel3b); border: 1px solid var(--line); border-radius: 10px; padding: 8px 16px; }

/* 项目详情分组多列栅格 */
.pg-sec { margin: 14px 0 8px; font-weight: 700; font-size: 13px; color: var(--txt); padding-left: 8px; border-left: 3px solid #2f6fed; }
.pg-sec:first-child { margin-top: 0; }
.pg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.pg-cell { background: var(--panel3b); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 50px; display: flex; flex-direction: column; justify-content: center; }
.pg-k { font-size: 11px; color: var(--mut2); margin-bottom: 4px; }
.pg-v { font-size: 14px; color: var(--txt); font-weight: 600; word-break: break-all; line-height: 1.4; }
.pg-amt .pg-v { color: #2f6fed; }
.pg-cell.pg-full { grid-column: 1 / -1; }

/* 工具条聚焦态 */
.toolbar input:focus, .toolbar select:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--accSoft); }


/* 附件卡片（上传/编辑表单缩略图）：图片卡片 + 文档卡片 + 悬停发光 */
/* 预览区：从左到右横排，多个自动换行 */
.up-preview { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.up-preview .up-file { margin: 0; }
.up-file {
  display: inline-flex; flex-direction: column; align-items: stretch;
  margin: 6px 8px 6px 0; padding: 6px; vertical-align: top; overflow: hidden;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.up-file img { width: 88px; height: 66px; object-fit: cover; display: block; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.up-file:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(61,155,255,.25); border-color: var(--acc); }
.up-file .up-name { font-size:12px; color: var(--mut); max-width: 88px; margin-top: 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-file-doc { flex-direction: row; align-items: center; width: 220px; padding: 8px 10px; }
.up-file-doc .doc-ic { font-size:27px; line-height: 1; margin-right: 8px; color: var(--acc); }
.up-file-doc .up-name { max-width: 120px; margin: 0; text-align: left; }
.up-file-doc .doc-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.up-file-doc .doc-actions a { text-decoration: none; color: var(--acc); font-size:16px; }

/* 编辑表单自适应网格（如材料设备：多字段随窗口宽度自适应并排，宽度不够才换行，缩略图尺寸不变） */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; align-items: start; }
.form-grid .form-item { margin-bottom: 0; min-width: 0; }
.form-grid .up-preview { justify-content: flex-start; }
/* 连续文件/上传字段并排：窗口够宽一行、不够才换行，缩略图尺寸不变 */
.form-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; align-items: start; }
.form-file-grid .form-item { margin-bottom: 0; min-width: 0; }
.form-file-grid .up-preview { justify-content: flex-start; }

/* 状态彩色功能按钮组（编辑表单）：点击选中高亮 */
.status-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.status-btn {
  border: 1px solid var(--line2); background: var(--panel2); color: var(--txt);
  padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .15s ease;
}
.status-btn:hover { border-color: var(--sc, var(--acc)); color: var(--sc, var(--acc)); }
.status-btn.on { background: var(--sc, var(--acc)); border-color: var(--sc, var(--acc)); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.25); }

/* 深色主题下表单控件强制深色，确保中间表单区随主题切换同步（排除浏览器默认白底） */
body:not(.theme-light) .form-item input,
body:not(.theme-light) .form-item select,
body:not(.theme-light) .form-item textarea,
body:not(.theme-light) .inline-pick input,
body:not(.theme-light) .inline-pick select {
  background: #0E1E33; color: #EAF2FC; border-color: rgba(120,170,255,.26);
}
body:not(.theme-light) .form-item input::placeholder,
body:not(.theme-light) .form-item textarea::placeholder { color: #6E86A6; }
body:not(.theme-light) .form-item input:focus,
body:not(.theme-light) .form-item select:focus,
body:not(.theme-light) .form-item textarea:focus { background: #12233A; border-color: #3D9BFF; }

/* 列表附件列紧凑卡片：图片/文件与查看/下载垂直居中并排 */
.up-file.up-mini { display:inline-flex; align-items:center; vertical-align:middle; padding:3px; margin:3px 6px 3px 0; border-radius:6px; }
.up-file.up-mini img { width:70px; height:54px; object-fit:cover; border-radius:4px; cursor:zoom-in; }
.up-file-doc.up-mini { width:auto; padding:6px 10px; gap:8px; }
.up-file-doc.up-mini .up-name { max-width:150px; font-size:14px; }
.up-file-doc.up-mini .doc-actions { display:inline-flex; gap:8px; align-items:center; }
.up-file-doc.up-mini .doc-actions a { display:inline-flex; align-items:center; gap:4px; color:#3D9BFF; text-decoration:none; font-size:15px; padding:6px 12px; border:1px solid rgba(61,155,255,.4); border-radius:7px; background:rgba(61,155,255,.12); white-space:nowrap; line-height:1; cursor:pointer; }
.up-file-doc.up-mini .doc-actions a:hover { background:rgba(61,155,255,.25); border-color:#3D9BFF; }