/* ============================================================
   短信集中接收平台 · 原型设计系统 v2
   新增：主题（皮肤）可切换 / 圆角可调 / 侧边栏深浅可调
   ============================================================ */

:root {
  --brand: #1677ff;
  --brand-rgb: 22, 119, 255;
  --brand-hover: #0958d9;
  --brand-press: #003eb3;
  --brand-bg: #e8f1ff;
  --brand-bg-2: #f4f8ff;
  --brand-bg-3: #eef4ff;
  --brand-line: #dbe8ff;
  --brand-soft: #cfe2ff;
  --brand-soft2: #9cc4ff;
  --brand-mid: #4c9aff;
  --brand-deep: #0b4bb8;
  --brand-deep2: #4a6fa5;

  --page: #f5f7fa;
  --card: #ffffff;
  --card-soft: #fafbfc;

  --border: #e9ecf2;
  --border-strong: #d8dde6;

  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --text-4: #b6bcc6;

  --ok: #00b42a;
  --ok-bg: #e8f8eb;
  --warn: #ff7d00;
  --warn-bg: #fff4e8;
  --err: #f53f3f;
  --err-bg: #fdecec;
  --purple: #7a5af8;
  --purple-bg: #f1edff;
  --teal: #0fc6c2;
  --teal-bg: #e6f9f9;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-phone: 38px;

  --sd-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --sd-2: 0 4px 12px rgba(16, 24, 40, .07);
  --sd-3: 0 12px 32px rgba(16, 24, 40, .12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
}

/* ---- 圆角档位 ---- */
html[data-radius="sharp"] { --r-sm: 3px; --r: 4px; --r-lg: 6px; --r-xl: 8px; --r-phone: 20px; }
html[data-radius="round"] { --r-sm: 9px; --r: 14px; --r-lg: 20px; --r-xl: 26px; --r-phone: 44px; }

/* ---- 侧边栏深色 ---- */
html[data-sidebar="dark"] .sidebar { background: #1a1f2b; border-right-color: #232a38; }
html[data-sidebar="dark"] .brand { border-bottom-color: #232a38; }
html[data-sidebar="dark"] .brand-name { color: #eef1f6; }
html[data-sidebar="dark"] .brand-sub { color: #7b8494; }
html[data-sidebar="dark"] .nav-group { color: #5d6675; }
html[data-sidebar="dark"] .nav-item { color: #a9b2c1; }
html[data-sidebar="dark"] .nav-item:hover { background: #232a38; color: #eef1f6; }
html[data-sidebar="dark"] .nav-item.active { background: rgba(var(--brand-rgb), .18); color: #fff; }
html[data-sidebar="dark"] .sidebar-foot { border-top-color: #232a38; }
html[data-sidebar="dark"] .plan-card { background: rgba(var(--brand-rgb), .12); border-color: rgba(var(--brand-rgb), .28); }
html[data-sidebar="dark"] .plan-card .t { color: #b9cdff; }
html[data-sidebar="dark"] .plan-card .d { color: #8595b5; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }

/* ---------------- 应用骨架 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  flex: 0 0 224px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px;
  flex: 0 0 34px;
  letter-spacing: -.5px;
}
.brand-name { font-size: 14.5px; font-weight: 600; letter-spacing: -.2px; }
.brand-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.nav { padding: 12px 10px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-group { font-size: 11.5px; color: var(--text-4); padding: 12px 8px 6px; font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--card-soft); color: var(--text); }
.nav-item.active { background: var(--brand-bg); color: var(--brand); font-weight: 500; }
.nav-item svg { flex: 0 0 16px; opacity: .9; }
.nav-item .badge {
  margin-left: auto; background: var(--err); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 9px; font-weight: 500;
}

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.plan-card {
  background: linear-gradient(135deg, var(--brand-bg-2), var(--brand-bg-3));
  border: 1px solid var(--brand-line);
  border-radius: var(--r);
  padding: 11px 12px;
}
.plan-card .t { font-size: 12.5px; font-weight: 600; color: var(--brand-deep); }
.plan-card .d { font-size: 11.5px; color: var(--brand-deep2); margin-top: 3px; line-height: 1.5; }

/* ---------------- 主区 ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px; flex: 0 0 60px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.topbar .crumb b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--page);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px; width: 240px;
  color: var(--text-3); font-size: 13px;
}
.searchbox:focus-within { background: #fff; border-color: var(--brand); }
.searchbox input {
  border: 0; background: transparent; outline: none; width: 100%;
  font-family: var(--font); font-size: 13px; color: var(--text);
}

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-2); cursor: pointer; position: relative;
  border: 0; background: transparent;
}
.icon-btn:hover { background: var(--page); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--err); border: 1.5px solid #fff;
}

.userbox { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 8px; }
.userbox:hover { background: var(--page); }
.avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
  color: #fff; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600;
}
.avatar.g { background: linear-gradient(135deg, #00b42a, #4ad07a); }
.avatar.o { background: linear-gradient(135deg, #ff7d00, #ffb552); }
.avatar.p { background: linear-gradient(135deg, #7a5af8, #a78bfa); }
.userbox .nm { font-size: 13px; font-weight: 500; }
.userbox .rl { font-size: 11.5px; color: var(--text-3); }

.content { padding: 22px 24px 40px; flex: 1; }

/* ---------------- 主题切换器 ---------------- */
.theme-pop {
  position: absolute; top: 50px; right: 0; width: 292px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sd-3); padding: 16px; z-index: 40; display: none;
}
.theme-pop.on { display: block; }
.theme-pop .ph { font-size: 12.5px; color: var(--text-3); margin-bottom: 9px; font-weight: 500; }
.theme-swatches { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.theme-sws {
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  position: relative; transition: transform .14s;
}
.theme-sws:hover { transform: scale(1.08); }
.theme-sws.on { border-color: var(--text); }
.theme-sws.on::after {
  content: ""; position: absolute; inset: 0; border-radius: 7px;
  background: rgba(255,255,255,.9); transform: scale(.42); opacity: .95;
  clip-path: polygon(28% 52%, 44% 68%, 74% 34%, 82% 42%, 44% 82%, 20% 58%);
}
.theme-opt { display: flex; gap: 6px; margin-bottom: 10px; }
.theme-opt button {
  flex: 1; height: 30px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: #fff; font-size: 12.5px; font-family: var(--font); color: var(--text-2); cursor: pointer;
}
.theme-opt button.on { border-color: var(--brand); background: var(--brand-bg-2); color: var(--brand); font-weight: 500; }

/* ---------------- 页头 ---------------- */
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; letter-spacing: -.3px; }
.page-head .desc { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sd-1);
}
.card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.c-2-1 { grid-template-columns: 2fr 1fr; }
.grid.c-1-2 { grid-template-columns: 1fr 2fr; }
.grid.c-3-2 { grid-template-columns: 3fr 2fr; }
@media (max-width: 1200px) { .grid.c4, .grid.c5 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 980px) { .grid.c3, .grid.c2, .grid.c-2-1, .grid.c-1-2, .grid.c-3-2 { grid-template-columns: 1fr; } }

/* ---------------- 指标卡 ---------------- */
.stat {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px;
  box-shadow: var(--sd-1);
  position: relative; overflow: hidden;
}
.stat .lbl { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 26px; font-weight: 600; letter-spacing: -.8px; margin-top: 8px; line-height: 1.15; }
.stat .val .unit { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.stat .foot { font-size: 12px; color: var(--text-3); margin-top: 7px; display: flex; align-items: center; gap: 5px; }
.stat .ico {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
}
.ico.i-blue { background: var(--brand-bg); color: var(--brand); }
.ico.i-green { background: var(--ok-bg); color: var(--ok); }
.ico.i-amber { background: var(--warn-bg); color: var(--warn); }
.ico.i-red { background: var(--err-bg); color: var(--err); }
.ico.i-purple { background: var(--purple-bg); color: var(--purple); }
.ico.i-teal { background: var(--teal-bg); color: var(--teal); }

.trend { font-size: 12px; font-weight: 500; }
.trend.up { color: var(--err); }
.trend.down { color: var(--ok); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text);
  font-size: 13px; font-family: var(--font); font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(var(--brand-rgb), .3);
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--page); color: var(--text); }
.btn-danger { color: var(--err); border-color: #ffc9c9; }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 22px; font-size: 14.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  font-family: var(--font); font-size: 13.5px; color: var(--text);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .1);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 12.5px; }

/* 密码显隐（由 assets/ui.js 自动增强，无需修改页面标记） */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap > .input, .pwd-wrap > .m-input { padding-right: 44px; }
.pwd-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; display: grid; place-items: center;
  cursor: pointer; color: var(--text-3); transition: color .15s, background .15s;
}
.pwd-eye:hover { background: rgba(31, 35, 41, .06); color: var(--brand); }
.pwd-eye.on { color: var(--brand); }
.pwd-eye svg { display: block; }

/* 动态模态宿主（由 pages-admin.js / pages-mobile.js 生成，页面无需预置标记） */
.modal-host { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.modal-host .mh-mask { position: absolute; inset: 0; background: rgba(20, 24, 31, .42); }
.modal-host .modal { position: relative; z-index: 1; max-height: calc(100vh - 48px); overflow-y: auto; }
.modal-host.wide .modal { width: 640px; }
.cred-row {
  display: flex; align-items: center; gap: 8px; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; margin-bottom: 8px;
}
.cred-row .k { flex: 0 0 92px; font-size: 12.5px; color: var(--text-3); }
.cred-row .v { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px;
  word-break: break-all; }

.switch {
  width: 40px; height: 22px; border-radius: 11px; background: #d8dde6;
  position: relative; cursor: pointer; flex: 0 0 40px; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(18px); }

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--brand); width: 15px; height: 15px; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--page); color: var(--text-2);
}
.tag.blue { background: var(--brand-bg); color: var(--brand-hover); }
.tag.green { background: var(--ok-bg); color: #00801e; }
.tag.amber { background: var(--warn-bg); color: #b35a00; }
.tag.red { background: var(--err-bg); color: #c22c2c; }
.tag.purple { background: var(--purple-bg); color: #5b3ddb; }
.tag.teal { background: var(--teal-bg); color: #0a9c99; }
.tag.gray { background: #f2f3f5; color: var(--text-2); }
.tag-line { border: 1px solid var(--border-strong); background: #fff; }

.dot-s { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-s.green { background: var(--ok); }
.dot-s.gray { background: var(--text-4); }
.dot-s.red { background: var(--err); }
.dot-s.amber { background: var(--warn); }
.pulse { box-shadow: 0 0 0 3px rgba(0,180,42,.18); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,180,42,.35); }
  70% { box-shadow: 0 0 0 6px rgba(0,180,42,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,180,42,0); }
}

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--text-2);
  font-size: 12.5px; padding: 10px 14px;
  background: var(--card-soft); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--brand-bg-2); }
.table .nm { font-weight: 500; }
.table .sm { font-size: 12px; color: var(--text-3); }
.table .mono { font-family: var(--mono); font-size: 12.5px; }
.table td.right, .table th.right { text-align: right; }

/* ---------------- 权限矩阵 ---------------- */
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.matrix th, .matrix td { padding: 0; border-bottom: 1px solid var(--border); }
.matrix thead th {
  background: var(--card-soft); font-weight: 500; font-size: 12.5px;
  color: var(--text-2); padding: 10px 12px; text-align: center;
}
.matrix thead th:first-child { text-align: left; position: sticky; left: 0; z-index: 2; }
.matrix tbody th {
  text-align: left; font-weight: 400; padding: 10px 12px;
  background: #fff; position: sticky; left: 0; z-index: 1;
  border-right: 1px solid var(--border);
}
.matrix tbody td { text-align: center; }
.cell {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; margin: 0 auto;
  cursor: pointer; font-size: 11.5px; font-weight: 600;
  transition: transform .12s, box-shadow .12s;
}
.cell:hover { transform: scale(1.08); box-shadow: var(--sd-2); }
.cell.full { background: var(--brand-bg); color: var(--brand-hover); }
.cell.otp { background: var(--ok-bg); color: #00801e; }
.cell.count { background: var(--warn-bg); color: #b35a00; }
.cell.none { background: #f4f5f7; color: var(--text-4); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- 时间线 / 列表 ---------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border-strong);
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-strong);
}
.tl-item.ok::before { border-color: var(--ok); }
.tl-item.blue::before { border-color: var(--brand); }
.tl-item.warn::before { border-color: var(--warn); }
.tl-item .ttl { font-size: 13.5px; font-weight: 500; }
.tl-item .tm { font-size: 12px; color: var(--text-3); }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--brand-bg-2); }

/* ---------------- 短信条目 ---------------- */
.sms-item {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.sms-item:hover { background: var(--brand-bg-2); }
.sms-item .top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sms-item .from { font-size: 13px; font-weight: 500; }
.sms-item .txt { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.sms-item .otp-inline {
  font-family: var(--mono); font-weight: 600; color: var(--brand);
  background: var(--brand-bg); padding: 1px 6px; border-radius: 5px;
}
.otp-big {
  font-family: var(--mono); font-size: 32px; font-weight: 700;
  letter-spacing: 4px; color: var(--brand); line-height: 1;
}
.otp-box {
  background: linear-gradient(135deg, var(--brand-bg-2), var(--brand-bg));
  border: 1px solid var(--brand-line); border-radius: var(--r);
  padding: 14px 16px; text-align: center;
}
.ttl-bar { height: 4px; border-radius: 2px; background: #e9ecf2; overflow: hidden; margin-top: 10px; }
.ttl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-mid)); border-radius: 2px; }
.ttl-bar.warn i { background: linear-gradient(90deg, #ff7d00, #ffb552); }

/* ---------------- 弹窗 / 抽屉 ---------------- */
.overlay {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .35);
  display: grid; place-items: center; z-index: 50;
}
.modal {
  background: #fff; border-radius: var(--r-lg); width: 520px; max-width: 92%;
  box-shadow: var(--sd-3); overflow: hidden;
}
.modal-head { padding: 18px 20px 0; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 16px 20px; }
.modal-foot {
  padding: 14px 20px; background: var(--card-soft);
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ---------------- 向导 ---------------- */
.steps { display: flex; align-items: center; gap: 8px; }
.step { display: flex; align-items: center; gap: 9px; }
.step .num {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
  background: #f2f3f5; color: var(--text-3);
}
.step.active .num { background: var(--brand); color: #fff; }
.step.done .num { background: var(--ok-bg); color: var(--ok); }
.step .lbl { font-size: 13px; color: var(--text-3); }
.step.active .lbl { color: var(--text); font-weight: 500; }
.step-line { width: 32px; height: 1px; background: var(--border-strong); }

/* ---------------- 进度 ---------------- */
.bar { height: 6px; border-radius: 3px; background: #eef0f4; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.bar i.g { background: var(--ok); }
.bar i.a { background: var(--warn); }
.bar i.r { background: var(--err); }

/* ---------------- 代码块 ---------------- */
.code {
  background: #1e293b; color: #e2e8f0; border-radius: var(--r);
  padding: 14px 16px; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.75; overflow-x: auto; white-space: pre;
}
.code .k { color: #7dd3fc; }
.code .s { color: #86efac; }
.code .c { color: #94a3b8; }

.kbd {
  font-family: var(--mono); font-size: 12px;
  background: #f4f5f7; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
}

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty .t { font-size: 13.5px; margin-top: 10px; }

/* ---------------- 提示条 ---------------- */
.alert {
  display: flex; gap: 10px; padding: 12px 14px;
  border-radius: var(--r); font-size: 13px; line-height: 1.6;
  border: 1px solid;
}
.alert .ic { flex: 0 0 16px; margin-top: 1px; }
.alert.info { background: var(--brand-bg-2); border-color: var(--brand-line); color: var(--brand-deep); }
.alert.warn { background: var(--warn-bg); border-color: #ffe0bd; color: #8f4a00; }
.alert.err { background: var(--err-bg); border-color: #ffd0d0; color: #a52020; }
.alert.ok { background: var(--ok-bg); border-color: #c6ecd0; color: #00691a; }

/* ---------------- 原型外壳元素 ---------------- */
.proto-note {
  background: #fffbeb; border: 1px dashed #fcd34d;
  color: #92400e; font-size: 12.5px; padding: 9px 14px;
  border-radius: var(--r); margin-bottom: 18px; line-height: 1.6;
}
.proto-note b { font-weight: 600; }

.phone-wrap {
  min-height: 100vh; display: flex; align-items: flex-start; justify-content: center;
  gap: 32px; padding: 32px 20px; background: #eef1f6;
}
.phone {
  width: 390px; flex: 0 0 390px; height: 844px;
  background: #fff; border-radius: var(--r-phone); overflow: hidden;
  box-shadow: 0 0 0 10px #1f2329, 0 24px 60px rgba(15,23,42,.28);
  position: relative; display: flex; flex-direction: column;
}
.phone-status {
  height: 44px; flex: 0 0 44px; display: flex; align-items: flex-end;
  justify-content: space-between; padding: 0 22px 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.phone-notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 104px; height: 26px; background: #1f2329; border-radius: 14px; z-index: 10;
}
.phone-body { flex: 1; overflow-y: auto; background: var(--page); }
.phone-body::-webkit-scrollbar { width: 0; }
.phone-tabs {
  flex: 0 0 62px; display: flex; background: #fff;
  border-top: 1px solid var(--border); padding-bottom: 8px;
}
.phone-tabs .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; font-size: 10.5px; color: var(--text-3);
  cursor: pointer;
}
.phone-tabs .tab.active { color: var(--brand); font-weight: 500; }
.phone-nav {
  flex: 0 0 48px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: #fff; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 600;
}
.m-nav-title { font-size: 16px; font-weight: 600; }

.m-card { background: #fff; border-radius: 12px; padding: 14px; margin: 12px 12px 0; }
.m-sec { padding: 16px 16px 6px; font-size: 12.5px; color: var(--text-3); font-weight: 500; }

/* ============================================================
   真机（窄屏）：把「演示外壳」收掉，按真实移动端全屏渲染
   ------------------------------------------------------------
   这些移动页原本是给**桌面演示**用的：左边一个 390×844 的机身框、
   右边一块说明面板。在手机上看，这套外壳就变成了灾难——
   390px 的机身框 + 32px 间距 + 300px 说明栏挤在 390px 的视口里，
   机身框被压扁、说明文字盖在表单上、内容只剩一条缝（实测截图里
   连输入框都显示不全）。
   所以：窄屏下直接按「真实 App」渲染 —— 去掉机身框、去说明面板，
   页面铺满视口，底部页签贴底并让出安全区。
   ============================================================ */
@media (max-width: 560px) {
  html, body { height: 100%; background: var(--page); }

  .phone-wrap {
    display: block; min-height: 0; height: 100%;
    padding: 0; gap: 0; background: var(--page);
  }
  .phone {
    width: 100%; flex: none; max-width: none;
    height: 100vh; height: 100dvh;      /* dvh：地址栏收起/展开时不跳动 */
    border-radius: 0;
    box-shadow: none;                    /* 去掉那圈 10px 黑色机身描边 */
  }
  /* 机身装饰：刘海与假状态栏（真机上会和系统状态栏叠在一起） */
  .phone-notch, .phone-status { display: none !important; }
  .phone-body { border-radius: 0; }

  /* 演示说明面板：真机上看不到它，也不该看到 */
  .m-notes { display: none !important; }

  /* 底部页签让出 iPhone 的 Home 指示条区域 */
  .phone-tabs { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }

  /* 触控友好：输入框按移动端习惯放大。
     font-size 必须 ≥16px —— 小于 16px 时 iOS Safari 会在聚焦输入框时
     自动放大整个页面，而且放大后不会自己缩回来，用户得手动双指捏回。

     这里必须用 !important：各移动页在自己的 <style> 里也定义了 .m-input
     （height:46px; font-size:14px），而**页面内样式表在外部样式表之后生效**，
     同优先级下会直接盖掉这条媒体查询——实测正是如此（量出来还是 46px/14px）。 */
  .m-input { height: 48px !important; font-size: 16px !important; }
  .phone-tabs .tab { font-size: 11.5px; }
}

/* ============================================================
   通用分页条（所有列表页共用，由 pages-admin.js 的 pager() 渲染）
   ============================================================ */
.pager {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--border);
}
.pager .pg-info { font-size: 12.5px; color: var(--text-3); }
.pager .pg-info b { color: var(--text); font-weight: 600; }
.pager .pg-gap { flex: 1; }
.pager .pg-size { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.pager .pg-size select { height: 28px; padding: 0 6px; border-radius: 7px;
  border: 1px solid var(--border-strong); font-size: 12.5px; font-family: var(--font); background: #fff; }
.pager .pg-nums { display: flex; align-items: center; gap: 4px; }
.pager .pg-num {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-2);
  font-size: 12.5px; font-family: var(--font); cursor: pointer;
}
.pager .pg-num:hover:not(:disabled) { border-color: var(--brand-line); color: var(--brand); }
.pager .pg-num.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .pg-num:disabled { opacity: .45; cursor: not-allowed; }
.pager .pg-dots { color: var(--text-4); padding: 0 2px; }
.pager .pg-jump { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); }
.pager .pg-jump input { width: 52px; height: 28px; padding: 0 6px; border-radius: 7px;
  border: 1px solid var(--border-strong); font-size: 12.5px; font-family: var(--mono); text-align: center; }

/* 真机（窄屏）下的分页：收起跳页与页码窗口，只留上一页/下一页 */
@media (max-width: 760px) {
  .pager { padding: 10px 14px; }
  .pager .pg-nums .pg-num:not(.pg-prev):not(.pg-next) { display: none; }
  .pager .pg-jump { display: none; }
}

/* 大屏值班 */
.kpi-strip { display: flex; gap: 1px; background: var(--border); border-radius: var(--r); overflow: hidden; }
.kpi-strip > div { flex: 1; background: #fff; padding: 12px 14px; }

/* 工具类 */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.t-xs { font-size: 12px; } .t-sm { font-size: 12.5px; } .t-md { font-size: 13.5px; }
.t-lg { font-size: 16px; } .t-xl { font-size: 19px; }
.c2 { color: var(--text-2); } .c3 { color: var(--text-3); } .c4 { color: var(--text-4); }
.cb { color: var(--brand); } .cok { color: var(--ok); } .cwarn { color: var(--warn); } .cerr { color: var(--err); }
.bold { font-weight: 600; } .medium { font-weight: 500; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.hr { height: 1px; background: var(--border); margin: 16px 0; }
.nowrap { white-space: nowrap; }
