/* 场馆物资验收进度看板 */
:root {
  --bg: #f2f4f8;
  --card: #fff;
  --ink: #1c2733;
  --muted: #68788c;
  --line: #dde4ee;
  --brand: #16457e;
  --brand-2: #2d6cb5;
  --ok: #1e9e5a;
  --bad: #d64541;
  --warn: #b97f10;
  --demo: #e8862c;
  --accent: #7a4fb3;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }

/* ---- 顶栏 ---- */
#topbar {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; padding: 14px 22px 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
#topbar h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: 1px; }
#topbar .meta { font-size: 12px; opacity: .92; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 7px 14px; cursor: pointer; font-size: 13px;
}
.btn:hover { border-color: var(--brand-2); }
.btn.primary { background: #fff; color: var(--brand); font-weight: 700; border-color: #fff; }
.demo-switch { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; user-select: none; }
.demo-switch input { transform: scale(1.15); }
#demo-banner {
  background: #fdf1e3; color: #9a5a10; border-bottom: 1px solid #f0d9b8;
  padding: 7px 22px; font-size: 13px; font-weight: 600;
}

/* ---- 导航 ---- */
#tabs {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 18px; display: flex; align-items: center; gap: 4px;
  position: sticky; top: 0; z-index: 30;
}
#tabs a {
  padding: 12px 18px; text-decoration: none; color: var(--muted);
  font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap;
}
#tabs a.active { color: var(--brand); font-weight: 700; border-bottom-color: var(--brand); }
#refresh-note { margin-left: auto; }

/* ---- 布局 ---- */
main { padding: 18px 22px 60px; max-width: 1500px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(28, 39, 51, .05);
}
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--brand); }
.card .sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }

/* ---- KPI ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; position: relative;
}
.kpi .k { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.kpi .v { font-size: 26px; font-weight: 700; line-height: 1; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi.ok .v { color: var(--ok); }
.kpi.bad .v { color: var(--bad); }
.kpi.brand .v { color: var(--brand); }

.progress-wrap { background: #e9eef6; border-radius: 8px; height: 18px; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--brand-2), var(--brand)); height: 100%; border-radius: 8px; transition: width .4s; box-shadow: 0 0 0 1px rgba(22,69,126,.25); }
.progress-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 6px 2px 0; }

.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.charts-row .full { grid-column: 1 / -1; }
.chart { width: 100%; }
.chart-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.chart-mode button { border: 0; background: #fff; padding: 3px 12px; font-size: 12px; cursor: pointer; color: var(--muted); }
.chart-mode button.active { background: var(--brand); color: #fff; font-weight: 700; }
.filter-bar input[type="date"] { cursor: pointer; }
@media (max-width: 1000px) { .charts-row { grid-template-columns: 1fr; } }

.notice { background: #fffbe8; border: 1px solid #efe3ad; color: #7a6410; border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 14px; }
.notice b { cursor: pointer; }
.notice ul { margin: 6px 0 2px; padding-left: 18px; }

/* ---- 表格 ---- */
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 6px 9px; text-align: center; white-space: nowrap; }
table.grid th { background: #eef2f9; color: var(--brand); font-weight: 700; position: sticky; top: 47px; z-index: 5; }
table.grid tbody tr:nth-child(even) { background: #f8fafd; }
table.grid tbody tr.clickable { cursor: pointer; }
table.grid tbody tr.clickable:hover { background: #e9f1fc; }
.table-scroll { max-height: 620px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.table-scroll > table.grid th { top: 0; }
td.left { text-align: left; white-space: normal; min-width: 140px; }

.badge { display: inline-block; border-radius: 4px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e3f6ec; color: var(--ok); }
.badge.bad { background: #fde9e8; color: var(--bad); }
.badge.pending { background: #eef1f5; color: var(--muted); }
.badge.other { background: #f0eaff; color: var(--accent); }
.badge.demo { background: #fdf0e2; color: var(--demo); border: 1px dashed var(--demo); }
.badge.outlier { background: #f0eaff; color: var(--accent); }

/* ---- 筛选条 ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filter-bar select, .filter-bar input {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 13px; background: #fff; max-width: 230px;
}
/* 可搜索下拉框 */
.combo { position: relative; display: inline-block; min-width: 200px; }
.combo input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 24px 6px 8px; font-size: 13px; background: #fff; }
.combo input:focus { outline: none; border-color: var(--brand-2); }
.combo-caret { position: absolute; right: 8px; top: 7px; color: var(--muted); pointer-events: none; font-size: 11px; }
.combo-list { position: absolute; top: calc(100% + 2px); left: 0; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 6px; max-height: 280px; overflow: auto; min-width: 100%; box-shadow: 0 8px 24px rgba(20, 35, 60, .18); }
.combo-item { padding: 6px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.combo-item:hover { background: #e9f1fc; }
.combo-item .muted { font-size: 11px; }
.combo-more { padding: 6px 10px; font-size: 12px; color: var(--muted); }
.filter-bar .kw { width: 200px; }
.mode-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mode-tabs button { border: 0; background: #fff; padding: 6px 14px; cursor: pointer; font-size: 13px; color: var(--muted); }
.mode-tabs button.active { background: var(--brand); color: #fff; font-weight: 700; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 13px; }
.pager button { min-width: 30px; }

/* ---- 详情 ---- */
.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.detail-head .id { font-size: 22px; font-weight: 800; color: var(--brand); }
.detail-head .nm { font-size: 15px; font-weight: 600; }
.backlink { display: inline-block; margin-bottom: 10px; color: var(--brand-2); text-decoration: none; font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 18px; }
.fields .f { border-bottom: 1px dashed var(--line); padding: 6px 2px; font-size: 13px; display: flex; gap: 8px; }
.fields .f .k { color: var(--muted); min-width: 90px; flex-shrink: 0; }
.fields .f .v { font-weight: 600; word-break: break-all; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.photo-grid img {
  width: 150px; height: 150px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); cursor: zoom-in; background: #fff;
}
.photo-grid img.broken { object-fit: contain; padding: 30px 8px; }
.ph-empty { color: var(--muted); font-size: 12px; }
.hist-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; background: #fafcff; }
.hist-card .hd { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; font-weight: 700; }

/* ---- 灯箱 ---- */
#lightbox {
  position: fixed; inset: 0; background: rgba(10, 16, 26, .9); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.lb-body { max-width: 86vw; max-height: 88vh; text-align: center; }
#lb-img { max-width: 86vw; max-height: 80vh; border-radius: 6px; background: #fff; }
#lb-caption { color: #d6e2f2; font-size: 13px; margin-top: 10px; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0;
  font-size: 26px; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
}
.lb-close { top: 18px; right: 22px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.28); }

/* ---- 弹窗 ---- */
#dl-modal { position: fixed; inset: 0; background: rgba(15, 24, 38, .45); z-index: 90; display: flex; align-items: center; justify-content: center; }
.modal-card { background: #fff; border-radius: 12px; padding: 20px 24px; width: 520px; max-width: 92vw; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-card h3 { margin: 0 0 14px; color: var(--brand); }
.form-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.form-row > label:first-child { min-width: 62px; padding-top: 6px; color: var(--muted); font-size: 13px; }
.form-row select, .form-row input[type=text] { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.checks { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 6px; }

