/* 它石数采 · 采集员支持系统 —— 全站样式 */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e7eaf0;
  --line-2: #f1f3f7;
  --brand: #2f6bff;
  --brand-dark: #1f4fd8;
  --brand-soft: #eaf0ff;
  --nanyang: #2f6bff;
  --nanyang-soft: #eaf0ff;
  --suqian: #f08a24;
  --suqian-soft: #fff3e4;
  --ok: #12a150;
  --ok-soft: #e6f6ec;
  --warn: #d98218;
  --warn-soft: #fff5e6;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 60px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 20px 96px; }
.wrap-tight { max-width: 900px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, #4b7dff, #2f6bff 55%, #1f4fd8);
  color: #fff; font-weight: 700; font-size: 17px;
  display: grid; place-items: center; letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(47, 107, 255, .32);
}
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 12.5px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.stamp { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---------------- 标签导航 ---------------- */
.tabs {
  display: flex; gap: 6px; padding: 10px 20px 0; max-width: 1180px;
  margin: 0 auto; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; border: 0; background: transparent; color: var(--muted);
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  font-size: 14.5px; font-weight: 600; white-space: nowrap; transition: .16s;
}
.tab:hover { background: #eef1f7; color: var(--ink-2); }
.tab.on { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(47, 107, 255, .26); }

/* ---------------- 通用块 ---------------- */
.page { display: none; }
.page.on { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}
.card-tight { padding: 14px 16px; }
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.card-title { font-size: 16.5px; font-weight: 700; margin: 0; }
.card-hint { font-size: 13px; color: var(--muted); }
.spacer { margin-left: auto; }

.section-title {
  font-size: 15px; font-weight: 700; color: var(--ink-2);
  margin: 22px 0 10px; display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--brand);
}

/* ---------------- 产量看板 ---------------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.region-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 16px;
}
.region-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c, var(--brand));
}
.region-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.region-name { font-size: 19px; font-weight: 700; color: var(--c, var(--brand)); }
.region-meta { font-size: 12.5px; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--line-2); border-radius: 12px; padding: 10px 12px; text-align: center;
}
.stat-label { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.stat-total { margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; }
.stat-total b { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* 图表 */
.chart { width: 100%; height: 220px; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.chart-bar { transition: opacity .15s; }
.chart-bar:hover { opacity: .78; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-text { fill: #98a2b3; font-size: 11px; }
.chart-grid { stroke: var(--line-2); stroke-width: 1; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 600; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cfd6e4; background: #fafbfe; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(.94); }
.btn-danger { background: #fff; border-color: #f3c6c8; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 13px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field-label span { color: var(--muted); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 15px; color: var(--ink); background: #fff;
  font-family: inherit; transition: .15s; outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .14);
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.input-lg { padding: 14px 16px; font-size: 17px; border-radius: 13px; }
.form-row { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.field-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }

/* ---------------- 标签 / 徽标 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--line-2); color: var(--muted);
  white-space: nowrap;
}
.badge-ny { background: var(--nanyang-soft); color: var(--nanyang); }
.badge-sq { background: var(--suqian-soft); color: var(--suqian); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-off { background: var(--line-2); color: var(--muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }

.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 6px 13px; border-radius: 999px; font-size: 13.5px; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.chip:hover { border-color: #cfd6e4; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 表格 ---------------- */
.table-box { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.tb th, table.tb td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.tb th {
  background: #fafbfd; font-weight: 600; color: var(--muted); font-size: 12.5px;
  white-space: nowrap; position: sticky; top: 0;
}
table.tb tbody tr:hover { background: #fafbff; }
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.row-actions { display: flex; gap: 6px; }

/* ---------------- 空状态 / 加载 ---------------- */
.empty { text-align: center; color: var(--muted); padding: 42px 20px; font-size: 14px; }
.empty-icon { font-size: 30px; opacity: .5; display: block; margin-bottom: 8px; }
.loading { text-align: center; color: var(--muted); padding: 42px; font-size: 14px; }
.spin {
  width: 22px; height: 22px; border-radius: 50%; margin: 0 auto 10px;
  border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 版本对照 ---------------- */
.big-search { display: flex; gap: 10px; flex-wrap: wrap; }
.big-search .input { flex: 1 1 260px; }
.ver-hit {
  border: 1.5px solid var(--brand); background: linear-gradient(180deg, #f7faff, #fff);
  border-radius: var(--radius); padding: 16px 18px; margin-top: 14px;
  box-shadow: 0 8px 26px rgba(47, 107, 255, .12);
}
.ver-flow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 12px; }
.ver-box {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 15px; min-width: 130px;
}
.ver-box small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.ver-box b { font-size: 18px; letter-spacing: .3px; }
.ver-arrow { color: var(--brand); font-size: 20px; font-weight: 700; }
.ver-note { font-size: 13.5px; color: var(--ink-2); background: var(--line-2); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; }
.ver-miss {
  border: 1.5px dashed #f3c6c8; background: #fffafa; border-radius: var(--radius);
  padding: 15px 17px; margin-top: 14px;
}

/* ---------------- 设备卡片 ---------------- */
.dev-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.dev-head { padding: 14px 16px 12px; display: flex; align-items: flex-start; gap: 10px; }
.dev-no { font-size: 17px; font-weight: 700; letter-spacing: .3px; word-break: break-all; }
.dev-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.dev-body { padding: 0 16px 14px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumb {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: var(--line-2); border: 1px solid var(--line); cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; margin-top: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; cursor: pointer;
}
.video-item:hover { border-color: #cfd6e4; background: #f5f7fd; }
.video-play {
  width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 12px;
}
.video-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-line { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.meta-line b { color: var(--ink-2); font-weight: 600; }

/* ---------------- 问题库 ---------------- */
.qa { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 10px; overflow: hidden; }
.qa-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; transition: .15s;
}
.qa-head:hover { background: #fafbff; }
.qa-title { font-weight: 600; font-size: 15.5px; flex: 1; min-width: 0; }
.qa-arrow { color: var(--muted); transition: transform .2s; flex: none; }
.qa.open .qa-arrow { transform: rotate(90deg); }
.qa-body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--line-2); }
.qa.open .qa-body { display: block; animation: fade .18s ease; }
.qa-block { margin-top: 13px; }
.qa-block h4 {
  margin: 0 0 5px; font-size: 13px; color: var(--brand); font-weight: 700; letter-spacing: .3px;
}
.qa-block .qa-text { font-size: 14.5px; white-space: pre-wrap; color: var(--ink-2); }
.qa-fix {
  background: var(--ok-soft); border-left: 3px solid var(--ok); border-radius: 8px;
  padding: 11px 13px; font-size: 14.5px; white-space: pre-wrap; color: #14532d;
}

/* ---------------- 弹层 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .62); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 22px;
  backdrop-filter: blur(3px);
}
.mask.on { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-width: 860px; width: 100%; max-height: 88vh; overflow: auto; padding: 20px 22px;
}
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-title { font-size: 17px; font-weight: 700; margin: 0; }
.modal-close {
  margin-left: auto; border: 0; background: var(--line-2); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 17px; color: var(--muted); line-height: 1;
}
.modal-close:hover { background: var(--line); }
.viewer img, .viewer video { width: 100%; max-height: 76vh; object-fit: contain; background: #0b0f19; border-radius: 12px; }

/* 轻提示 */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease; max-width: 84vw;
}
.toast.ok { background: #0f7b3f; }
.toast.err { background: #b42318; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 上传进度 */
.progress { height: 7px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .18s; }
.up-item { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; background: #fafbfe; }
.up-item.done { border-color: #bfe6cd; background: var(--ok-soft); }
.up-item.fail { border-color: #f3c6c8; background: var(--danger-soft); }
.up-name { font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.up-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 后台布局 ---------------- */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: #fff; border-right: 1px solid var(--line); padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.side .brand { padding: 0 8px 18px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 14.5px; transition: .15s;
  border: 0; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--line-2); }
.nav-item.on { background: var(--brand-soft); color: var(--brand); }
.nav-ico { width: 20px; text-align: center; }
.side-foot { margin-top: 18px; padding: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.main { padding: 22px 26px 90px; max-width: 1100px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-size: 21px; font-weight: 700; margin: 0; }
.page-sub { font-size: 13px; color: var(--muted); }

.login-box { max-width: 380px; margin: 10vh auto; }
.login-box .brand { justify-content: center; margin-bottom: 18px; }

.panel { border: 1px dashed #cfd6e4; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; background: #fbfcff; }

.list-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  background: #fff; transition: .15s;
}
.list-item:hover { border-color: #d8dfea; box-shadow: 0 4px 14px rgba(16, 24, 40, .05); }
.list-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list-item-title { font-weight: 600; font-size: 15px; }
.list-item-meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; display: flex; gap: 12px; flex-wrap: wrap; }
.list-item-body { font-size: 13.5px; color: var(--ink-2); margin-top: 7px; white-space: pre-wrap; }

.mini-thumbs { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.mini-thumb { width: 62px; height: 62px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; background: var(--line-2); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-value { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }

/* ---------------- 手机适配 ---------------- */
@media (max-width: 860px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: auto 0 0 0; height: auto; z-index: 60;
    border-right: 0; border-top: 1px solid var(--line);
    display: flex; gap: 4px; overflow-x: auto; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }
  .side .brand, .side-foot { display: none; }
  .nav-item { flex: none; flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; }
  .nav-ico { font-size: 17px; }
  .main { padding: 16px 14px 110px; }
}

@media (max-width: 640px) {
  .wrap { padding: 14px 14px 92px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-value { font-size: 21px; }
  .card { padding: 15px 15px; border-radius: 14px; }
  .topbar-inner { padding: 10px 14px; }
  .tabs { padding: 8px 12px 0; }
  .tab { padding: 8px 13px; font-size: 14px; }
  .chart { height: 190px; }
  .modal { padding: 16px; max-height: 92vh; }
  .brand-sub { display: none; }
}
