/* =====================================================================
   视觉基线 v2 · 深墨蓝 + 中性灰 + 单一暖金点缀
   ---------------------------------------------------------------------
   改版思路：
   1. 主色不再用中饱和蓝，改为偏墨的深蓝（#15507F）。同一个界面里大面积
      铺蓝，饱和度越高越费眼；政务后台一天看八小时，收敛一点更耐久。
   2. 层次靠「留白 + 极浅描边 + 极短投影」三件套，而不是靠色块和粗边框。
      投影一律带负扩散（-16px 以上），看起来是纸片浮起，不是发光。
   3. 圆角统一到 8 / 14 / 18 三档：控件 8、卡片 14、弹窗 18。
      混用 4/6/10 会让界面显得没画完。
   4. 状态色只出现在必须马上看见的地方（标签、异常数值、阻断提示）。
      其余位置一律回到中性灰，避免整屏都是彩色。
   ===================================================================== */
:root {
  /* 品牌 */
  --c-brand: #15507f;
  --c-brand-d: #0e3a5f;
  --c-brand-l: #2c7fc4;
  --c-brand-bg: #edf4fb;
  --c-brand-soft: rgba(21, 80, 127, .07);
  --c-ink: #0f1b2b;

  /* 状态 */
  --c-accent: #b4842f;
  --c-ok: #1c7a4e;
  --c-ok-bg: #e9f6ef;
  --c-warn: #a9690f;
  --c-warn-bg: #fdf4e4;
  --c-err: #a62b2b;
  --c-err-bg: #fceceb;
  --c-info: #2c7fc4;
  --c-info-bg: #edf4fb;

  /* 文字 */
  --t-1: #101b2b;
  --t-2: #44536a;
  --t-3: #77869b;
  --t-4: #a6b2c2;

  /* 面 */
  --bg: #f5f7fa;
  --bg-2: #fafbfd;
  --bg-card: #ffffff;
  --bd: #e4e9f0;
  --bd-l: #eef2f7;
  --bd-strong: #d5dde8;

  /* 圆角 */
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-full: 999px;

  /* 投影：三档，均带负扩散，避免大面积灰雾 */
  --shadow-xs: 0 1px 2px rgba(16, 27, 43, .04);
  --shadow: 0 1px 2px rgba(16, 27, 43, .04), 0 10px 28px -18px rgba(16, 27, 43, .28);
  --shadow-l: 0 2px 6px rgba(10, 22, 38, .06), 0 28px 64px -28px rgba(10, 22, 38, .38);
  --shadow-brand: 0 8px 20px -10px rgba(21, 80, 127, .55);

  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Mono", "SF Mono", "Consolas", "Courier New", monospace;
}

* { box-sizing: border-box; }

/* 原生勾选框默认是系统蓝，与品牌色差一截；统一成品牌色，成本极低但整屏更整 */
input[type="checkbox"], input[type="radio"] { accent-color: var(--c-brand); width: 15px; height: 15px; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.62;
  color: var(--t-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

a { color: var(--c-brand-l); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(44, 127, 196, .18); }

/* 滚动条：默认系统滚动条在灰底上很重，换成细签 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #ccd6e2;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-full);
}
*::-webkit-scrollbar-thumb:hover { background: #aebbcc; background-clip: content-box; }

:focus-visible { outline: 2px solid rgba(44, 127, 196, .55); outline-offset: 2px; }

/* ------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px;
  font-size: 13px;
  font-family: inherit;
  color: var(--t-1);
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .1s;
  white-space: nowrap;
  user-select: none;
  box-shadow: var(--shadow-xs);
}
.btn:hover {
  border-color: #c3d4e6;
  color: var(--c-brand);
  box-shadow: 0 2px 6px -2px rgba(16, 27, 43, .12);
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled], .btn.disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #1b5f95 0%, var(--c-brand) 100%);
  border-color: var(--c-brand-d);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  color: #fff;
  background: linear-gradient(180deg, #1f6ca8 0%, #175c8f 100%);
  border-color: var(--c-brand-d);
  box-shadow: 0 10px 24px -10px rgba(21, 80, 127, .7);
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--t-2); box-shadow: none; }
.btn-ghost:hover { background: var(--c-brand-soft); border-color: transparent; color: var(--c-brand); box-shadow: none; }

.btn-danger { color: var(--c-err); border-color: #eccdcc; background: #fff; }
.btn-danger:hover { background: var(--c-err-bg); border-color: var(--c-err); color: var(--c-err); }

.btn-sm { height: 28px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-lg { height: 42px; padding: 0 24px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ 表单 */
.field { margin-bottom: 16px; }
.field > label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t-2);
  letter-spacing: .01em;
}
.field .req::after { content: " *"; color: var(--c-err); }
.field .hint { margin-top: 6px; font-size: 12px; color: var(--t-3); line-height: 1.6; }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--t-1);
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.textarea { height: auto; padding: 9px 11px; line-height: 1.65; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--bd-strong); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-brand-l);
  box-shadow: 0 0 0 3px rgba(44, 127, 196, .13);
}
.input::placeholder, .textarea::placeholder { color: var(--t-4); }

/* 原生下拉箭头在各浏览器里粗细位置不一，统一换成自绘箭头 */
.select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2377869b' d='M2.4 4.4h7.2L6 8.9 2.4 4.4Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 11px 11px;
  cursor: pointer;
}
.select::-ms-expand { display: none; }
.input[disabled], .select[disabled], .textarea[disabled] {
  background: #f4f6f9;
  color: var(--t-3);
  cursor: not-allowed;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute;
  inset: 0;
  background: #ccd6e2;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background .2s;
}
.switch i::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(16, 27, 43, .25);
  transition: transform .2s;
}
.switch input:checked + i { background: var(--c-ok); }
.switch input:checked + i::before { transform: translateX(18px); }
.switch input:disabled + i { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------ 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .01em;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.tag-ok { color: var(--c-ok); background: var(--c-ok-bg); }
.tag-warn { color: var(--c-warn); background: var(--c-warn-bg); }
.tag-err { color: var(--c-err); background: var(--c-err-bg); }
.tag-info { color: var(--c-brand); background: var(--c-brand-bg); }
.tag-gray { color: var(--t-3); background: #eef2f7; }
.tag-line { color: var(--t-2); background: #fff; border: 1px solid var(--bd); }

/* ------------------------------------------------------------ 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--bd-l);
}
.card-hd h3 {
  position: relative;
  margin: 0;
  padding-left: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}
/* 标题前的一小段品牌色，是最省力的“有设计感”：不用图标也不用色块 */
.card-hd h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 14px;
  margin-top: -7px;
  border-radius: var(--r-full);
  background: linear-gradient(180deg, var(--c-brand-l), var(--c-brand));
}
.card-hd .sub { font-size: 12px; color: var(--t-3); font-weight: 400; margin-left: 8px; }
.card-bd { padding: 20px; }
.card-bd.tight { padding: 0; }

/* ------------------------------------------------------------ 表格 */
.tb-wrap { width: 100%; overflow-x: auto; }
table.tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.tb th {
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--t-3);
  background: var(--bg-2);
  border-bottom: 1px solid var(--bd);
  white-space: nowrap;
}
table.tb td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--bd-l);
  vertical-align: middle;
}
table.tb tbody tr { transition: background .12s; }
table.tb tbody tr:hover td { background: #f7fafd; }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.tb .muted { color: var(--t-3); }
table.tb .nowrap { white-space: nowrap; }
table.tb td .btn + .btn { margin-left: 6px; }
table.tb td .btn.btn-ghost { padding: 0 7px; }
table.tb td .btn.btn-ghost + .btn.btn-ghost { position: relative; }

/* 长地址、长编码允许在任意位置断开：表格是自动布局，
   一个不可断的长串会把相邻列挤到换行，看起来像列宽没配好。 */
.brk { word-break: break-all; }

/* 多个标签并排：横向排列、不换行，避免一个状态列把行高撑高 */
.tag-row { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }

/* ------------------------------------------------------------ 弹窗 */
.mask {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 20px;
  background: rgba(12, 22, 36, .38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(-12px) scale(.994) } to { opacity: 1; transform: none } }

.modal {
  width: 580px;
  max-width: 100%;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-l);
  animation: rise .22s cubic-bezier(.22, .68, .32, 1);
  overflow: hidden;
}
.modal.wide { width: 880px; }
.modal.xwide { width: 1100px; }
.modal-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--bd-l);
}
.modal-hd h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.modal-hd .sub { margin-top: 4px; font-size: 12.5px; color: var(--t-3); line-height: 1.6; }
.modal-x {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  color: var(--t-3);
  background: none;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .14s, color .14s;
}
.modal-x:hover { background: #f0f3f7; color: var(--t-1); }
.modal-bd { padding: 22px; max-height: calc(100vh - 250px); overflow-y: auto; }
.modal-ft {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--bd-l);
  background: var(--bg-2);
}
.modal-ft .left { margin-right: auto; font-size: 12px; color: var(--t-3); }

/* ------------------------------------------------------------ 提示条 */
.note {
  display: flex;
  gap: 10px;
  padding: 12px 15px;
  font-size: 13px;
  line-height: 1.7;
  border-radius: 10px;
  border-left: 3px solid var(--c-info);
  background: var(--c-info-bg);
  color: #1b4a70;
}
.note.warn { border-left-color: var(--c-warn); background: var(--c-warn-bg); color: #6f4506; }
.note.err { border-left-color: var(--c-err); background: var(--c-err-bg); color: #7c1c1c; }
.note.ok { border-left-color: var(--c-ok); background: var(--c-ok-bg); color: #11583a; }
.note b { font-weight: 600; }

/* ------------------------------------------------------------ toast */
#toasts {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  max-width: 520px;
  padding: 11px 18px;
  font-size: 13px;
  color: #fff;
  background: #1b2838;
  border-radius: 10px;
  box-shadow: 0 12px 32px -12px rgba(10, 22, 38, .55);
  animation: rise .22s ease;
}
.toast.ok { background: #186b45; }
.toast.err { background: #972525; }
.toast.warn { background: #96600d; }

/* ------------------------------------------------------------ 空态 */
.empty {
  padding: 52px 20px;
  text-align: center;
  color: var(--t-3);
  font-size: 13px;
}
.empty .big { font-size: 15px; color: var(--t-2); margin-bottom: 7px; font-weight: 500; }

/* ------------------------------------------------------------ 工具类 */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--t-3); }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.tr { text-align: right; } .tc { text-align: center; }
