:root {
  --bg: #f1f6ff;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf2ff;
  --primary-line: #cfe0ff;
  --text: #14233c;
  --muted: #6b7f9e;
  --border: #e3ecfa;
  --hit: #12834d;
  --hit-soft: #e6f7ee;
  --miss: #7b8aa3;
  --miss-soft: #f0f3f8;
  --warn: #b45309;
  --warn-soft: #fff6e6;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --shadow: 0 10px 30px rgba(37, 99, 235, 0.08), 0 2px 6px rgba(20, 35, 60, 0.04);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; position: relative; overflow-x: hidden; }

.bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 12% -8%, #d8e8ff 0%, rgba(216, 232, 255, 0) 70%),
    radial-gradient(620px 380px at 92% 4%, #e2f0ff 0%, rgba(226, 240, 255, 0) 72%),
    linear-gradient(180deg, #f6faff 0%, #eef5ff 100%);
  z-index: -1;
}

.hidden { display: none !important; }
.w100 { width: 100%; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(37, 99, 235, 0.14);
  padding: 34px 30px 30px;
  text-align: center;
}
.login-card h1 { margin: 16px 0 6px; font-size: 20px; letter-spacing: .3px; }
.login-sub { margin: 0 0 24px; font-size: 12.5px; color: var(--muted); }
.login-card .field { text-align: left; margin-bottom: 14px; }
.login-err { min-height: 18px; margin-top: 10px; font-size: 12.5px; color: var(--danger); }

.brand-mark {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 15px;
  background: linear-gradient(150deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}
.brand-mark.lg { width: 60px; height: 60px; font-size: 30px; border-radius: 18px; margin: 0 auto; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px) 8px;
  max-width: 1320px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-text h1 { margin: 0; font-size: 19px; letter-spacing: .3px; }
.brand-text p { margin: 3px 0 0; font-size: 12px; color: var(--muted); letter-spacing: .4px; }

.nav { display: flex; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 4px; box-shadow: var(--shadow); }
.nav-btn {
  border: none; background: transparent; color: var(--muted);
  font-size: 13px; padding: 8px 16px; border-radius: 9px; cursor: pointer;
  font-family: inherit; transition: .16s;
}
.nav-btn:hover { color: var(--primary); background: var(--primary-soft); }
.nav-btn.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.26); }

.user-chip { display: flex; align-items: center; gap: 10px; }
.uname { font-size: 13px; font-weight: 600; color: var(--primary-dark); }

.conn {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted);
  background: #fff; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px;
}
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.conn.live .dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .16); }
.conn.live { color: #12834d; }

/* ---------- 布局 ---------- */
.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 40px) 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.grid-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  grid-template-areas: "plat plat" "card progress";
}
.plat-card { grid-area: plat; }
.grid-top > .card:not(.plat-card):not(.progress-card) { grid-area: card; }
.grid-top > .progress-card { grid-area: progress; }
.grid-bottom { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* 三个视图各自是纵向流式容器，卡片间距在这一层 */
#viewDesk, #viewConfig, #viewAdmin, #viewProj { display: flex; flex-direction: column; gap: 18px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.card-head h2 {
  margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: .2px;
  display: flex; align-items: center; gap: 8px;
}
.card-head h2::before {
  content: ""; width: 4px; height: 15px; border-radius: 3px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.hint-inline { font-size: 11.5px; color: var(--muted); font-weight: 400; }

.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-line); white-space: nowrap; }
.pill.light { background: #f4f8ff; color: var(--muted); border-color: var(--border); }
.pill.ok { background: var(--hit-soft); color: var(--hit); border-color: #c7ebd7; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: #f7d2ce; }

.hint { margin: 8px 0 14px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }

.input {
  width: 100%; min-width: 0;
  padding: 11px 13px;
  font-size: 13.5px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition: .18s;
  font-family: inherit;
}
.input.mono, #cardInput, #cfgCardNo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1px; }
.input:focus { border-color: #93b8f7; background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }

.input-row { display: flex; gap: 10px; margin-top: 10px; }

.btn {
  border: none; cursor: pointer;
  font-size: 14px; font-weight: 600;
  border-radius: 12px;
  padding: 12px 20px;
  transition: .18s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .22); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { background: #9db8ea; box-shadow: none; cursor: default; transform: none; }

/* ---------- 平台项目绑定 ---------- */
.bind-block { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: #fbfdff; }
.bind-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bind-head b { font-size: 13px; }
.bind-head .dim { font-size: 11.5px; color: var(--muted); }
.bind-add {
  margin-left: auto; background: var(--primary-soft); color: var(--primary-dark);
  border: 0; border-radius: 8px; padding: 5px 10px; font-size: 11.5px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.bind-add:hover { background: #dbeafe; }
.bind-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.bind-row .input { padding: 7px 9px; font-size: 12px; }
.bind-on { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.bind-on input { accent-color: var(--primary); cursor: pointer; }
.bind-del {
  background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px;
  font-size: 11.5px; color: var(--danger); cursor: pointer; font-family: inherit;
}
.bind-del:hover { background: var(--danger-soft); border-color: var(--danger); }
.bind-empty { font-size: 11.5px; color: var(--muted); padding: 4px 2px; }
.bind-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- 熊猫出站通道 ---------- */
.net-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.net-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.net-field.full { grid-column: 1 / -1; }
.net-field > span { font-size: 11.5px; color: var(--muted); }
.net-field select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.net-field input[readonly] { color: var(--muted); background: #f7fbff; }
.net-test { display: grid; gap: 6px; margin-top: 12px; }
.net-test:empty { display: none; }
.net-test .row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.net-test .row b { color: var(--text); font-weight: 600; }
.net-test .row span { word-break: break-all; }
.net-test .row .ok { color: var(--hit); font-weight: 700; }
.net-test .row .bad { color: var(--danger); font-weight: 700; }
@media (max-width: 720px) {
  .net-form { grid-template-columns: minmax(0, 1fr); }
}
.btn-ghost { background: #fff; color: var(--primary-dark); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary-line); color: var(--primary); }
.btn-ghost:disabled { color: var(--muted); cursor: default; }

.card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 14px; }
.kv { background: #f7fbff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.kv span { font-size: 11.5px; color: var(--muted); }
.kv b { font-size: 17px; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.kv b.small { font-size: 13px; font-weight: 600; }

.progress { height: 8px; border-radius: 999px; background: #eaf1fb; overflow: hidden; }
.progress.lg { height: 10px; margin-top: 14px; }
.progress .bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width .5s cubic-bezier(.22,.61,.36,1); }

/* ---------- 平台 ---------- */
.platforms { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
/* 五个发号平台：宽屏五列，中屏 3+2，窄屏 2 列，手机上单列 */
@media (max-width: 1360px) {
  .platforms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.plat-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; padding: 2px 2px 0; word-break: break-all; }
.plat-none { margin: 12px 2px 0; padding: 12px 14px; border-radius: 10px; background: #fff8e6; border: 1px solid #ffe0a3; color: #8a6100; font-size: 13px; }
/* 平台授权勾选（账号管理） */
.chk-inline { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; margin-bottom: 8px; }
.chk-inline input { width: 15px; height: 15px; accent-color: #2563eb; }
.plat-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 6px; }
.plat-checks label { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: #f8fbff; font-size: 12.5px; cursor: pointer; }
.plat-checks label:has(input:checked) { border-color: #2563eb; background: #eef5ff; color: #1d4ed8; font-weight: 600; }
.plat-checks input { width: 14px; height: 14px; accent-color: #2563eb; }
.plat-checks.disabled { opacity: .45; pointer-events: none; }

.plat {
  position: relative;
  background: #fbfdff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 15px 12px;
  transition: .18s;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.plat.need-cfg { background: #f8fafc; border-style: dashed; }
.plat.need-cfg .plat-main { opacity: .68; }
.plat.need-cfg .take-state { cursor: not-allowed; opacity: .75; }
.plat.need-cfg .plat-check { pointer-events: none; opacity: .45; }
.plat-main { display: block; cursor: pointer; min-width: 0; }
.plat:hover { border-color: #b9d2fb; }
.plat.selected {
  border-color: var(--primary);
  background: linear-gradient(160deg, #f2f8ff, #e8f1ff);
  box-shadow: 0 8px 22px rgba(37, 99, 235, .14);
}
.plat-check {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px; accent-color: var(--primary);
  cursor: pointer;
}
.plat-top { display: flex; align-items: center; gap: 8px; padding-right: 26px; }
.plat-name { font-size: 14px; font-weight: 650; }
.plat-badge { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.plat-meta { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; margin-top: 6px; }
/* 次可用 + 今日取号 必须贴在一起，来码可以作为第二个 flex item 自己换行 */
.plat-inline { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.plat-times { display: flex; align-items: baseline; gap: 5px; }
.plat-times b { font-size: 22px; font-weight: 750; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.plat-times i { font-size: 11.5px; color: var(--muted); font-style: normal; }
.plat-today { display: flex; align-items: baseline; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.plat-today b { font-size: 13px; font-weight: 700; color: #1d4ed8; font-variant-numeric: tabular-nums; }
.plat-code { display: flex; align-items: baseline; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.plat-code b { font-size: 13px; font-weight: 700; color: #047857; font-variant-numeric: tabular-nums; }

/* 取号状态 */
.take-state {
  margin-top: 9px;
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
  background: #f5f9ff;
  border-radius: 9px;
  padding: 6px 9px;
  min-height: 29px;
  transition: background .2s;
}
.take-state .tdot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; flex: none; }
.take-state .ttext { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take-state .ttimer { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); flex: none; }

.take-state.s-waiting { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.take-state.s-waiting .tdot { background: var(--primary); animation: pulse 1.1s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,99,235,.45); }
  70% { box-shadow: 0 0 0 7px rgba(37,99,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}
.take-state.s-ok { color: var(--hit); background: var(--hit-soft); font-weight: 600; }
.take-state.s-ok .tdot { background: var(--hit); }
.take-state.s-empty { color: var(--warn); background: var(--warn-soft); font-weight: 600; }
.take-state.s-empty .tdot { background: #f59e0b; }
.take-state.s-error { color: var(--danger); background: var(--danger-soft); font-weight: 600; }
.take-state.s-error .tdot { background: var(--danger); }

/* ---------- 项目下拉 ---------- */
.proj-pick { position: relative; margin-top: 8px; }
.proj-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 10px; font-size: 11.5px; color: var(--muted); cursor: pointer;
  font-family: inherit; transition: .15s;
}
.proj-btn:hover { border-color: #b9d2fb; color: var(--text); }
.proj-btn.picked { border-color: var(--primary-line); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.proj-cur { overflow: hidden; white-space: normal; word-break: break-all; line-height: 1.35; text-align: left; }
.proj-arrow { font-style: normal; font-size: 10px; transition: transform .18s; flex: none; }
.proj-pick.open .proj-arrow { transform: rotate(180deg); }
.proj-panel {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 60;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 32px rgba(20, 35, 60, .14); padding: 6px; max-height: 210px; overflow-y: auto;
}
.proj-pick.open .proj-panel { display: block; }
.proj-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 7px; border-radius: 8px;
  font-size: 11.5px; color: var(--text);
}
.proj-item:hover { background: #f4f9ff; }
.proj-item.on { background: #f2f8ff; }
.proj-sel-l { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; cursor: pointer; }
.proj-item input { width: 14px; height: 14px; accent-color: var(--primary); flex: none; cursor: pointer; }
.proj-name { flex: 1; white-space: normal; word-break: break-all; line-height: 1.35; }
.proj-times { font-size: 10.5px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.proj-det {
  display: flex; align-items: center; gap: 3px; flex: none; cursor: pointer;
  font-size: 10.5px; color: var(--primary-dark); background: var(--primary-soft);
  border-radius: 6px; padding: 2px 6px;
}
.proj-det input { width: 12px; height: 12px; }
.proj-det:has(input:not(:checked)) { color: var(--muted); background: #f1f4f9; }
.proj-foot { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 5px; }
.proj-all {
  width: 100%; background: none; border: 0; color: var(--primary); font-size: 11.5px;
  padding: 4px; cursor: pointer; font-family: inherit; border-radius: 7px;
}
.proj-all:hover { background: var(--primary-soft); }
.proj-empty { padding: 10px; text-align: center; font-size: 11.5px; color: var(--muted); }

/* ---------- 运行控制 ---------- */
.pc-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pc-main {
  flex: 1 0 auto; display: grid; align-items: center;
  grid-template-columns: auto minmax(max-content, 1fr) auto; gap: 8px;
}
.pc-run .btn { width: auto; white-space: nowrap; }
.pc-main label { text-align: center; white-space: nowrap; }
.pc-actions .quick { margin-top: 0; }
.stepper { display: flex; align-items: center; background: #f7fbff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; width: fit-content; }
.stepper input {
  width: 66px; border: none; background: transparent; outline: none;
  text-align: center; font-size: 15px; font-weight: 650; color: var(--text);
  padding: 10px 0; font-family: inherit; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step { width: 36px; height: 40px; border: none; background: transparent; font-size: 17px; color: var(--primary); cursor: pointer; transition: .15s; }
.step:hover { background: var(--primary-soft); }

.quick { display: flex; gap: 6px; margin-top: 8px; }
.quick button {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  font-size: 12px; padding: 5px 11px; border-radius: 8px; cursor: pointer;
  transition: .15s; font-family: inherit;
}
.quick button:hover { border-color: #b9d2fb; color: var(--primary); background: var(--primary-soft); }

.btn-run { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; padding: 13px 30px; box-shadow: 0 10px 24px rgba(37, 99, 235, .28); }
.btn-run:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-run:disabled { background: #b9cbea; box-shadow: none; cursor: default; transform: none; }
.btn-stop { background: #fff; color: var(--danger); border: 1.5px solid #f3c9c4; padding: 12px 24px; }
.btn-stop:hover { background: #fdf3f2; }

/* ---------- 统计 ---------- */
.progress-card .card-head { margin-bottom: 2px; }
.progress-card .stat-row { margin-top: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stat { background: #f8fbff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.ok b { color: var(--danger); }
.stat.no b { color: var(--hit); }
.stat b.small { font-size: 13px; font-family: ui-monospace, Menlo, monospace; }

/* ---------- 表格 ---------- */
.table-card { padding-bottom: 8px; min-width: 0; }
.grid-bottom > .card { min-width: 0; }
.table-wrap { max-height: 460px; overflow: auto; min-width: 0; margin-top: 10px; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f4f9ff; text-align: center; font-weight: 600; color: var(--muted);
  font-size: 12px; padding: 11px 6px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 11px 6px; border-bottom: 1px solid #f1f6fd; color: var(--text); text-align: center; }
/* 桌面端固定主要列宽，剩余留白放在时间文字右侧 */
@media (min-width: 641px) {
  table { table-layout: fixed; width: 100%; min-width: 644px; }
  thead th:nth-child(1), tbody td:nth-child(1) { width: 26px; }
  thead th:nth-child(2), tbody td:nth-child(2) { width: 92px; }
  thead th:nth-child(3), tbody td:nth-child(3) { width: 52px; }
  thead th:nth-child(4), tbody td:nth-child(4) { width: 96px; overflow-wrap: anywhere; }
  thead th:nth-child(5), tbody td:nth-child(5) { width: 62px; }
  thead th:nth-child(6), tbody td:nth-child(6) { width: 78px; }
  thead th:nth-child(7), tbody td:nth-child(7) { width: 118px; }
  thead th:nth-child(8), tbody td:nth-child(8) { width: 54px; font-variant-numeric: tabular-nums; }
  thead th:nth-child(9), tbody td:nth-child(9) { width: auto; text-align: left; }
  .result-time-text { display: inline-block; min-width: 56px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
  thead th, tbody td { padding: 9px 5px; }
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafdff; }
tbody td.phone { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; letter-spacing: .2px; cursor: pointer; transition: .15s; }
tbody td.phone:hover { color: var(--primary); text-decoration: underline dotted; }
tbody td.phone.copied { color: var(--hit); background: var(--hit-soft); border-radius: 5px; }
tbody td.phone::after { content: ''; }
tbody td.phone.copied::after { content: ' ✓'; font-size: 11px; }
.empty-row td { text-align: center; color: var(--muted); padding: 34px 12px; font-size: 13px; }

.tag { display: inline-block; font-size: 11.5px; padding: 3px 9px; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.tag.hit { background: var(--danger-soft); color: var(--danger); }
.tag.miss { background: var(--hit-soft); color: var(--hit); }
.tag.err { background: var(--danger-soft); color: var(--danger); }
.tag.wait { background: var(--warn-soft); color: var(--warn); }
.tag.ptag { background: var(--primary-soft); color: var(--primary); }
.tag.skip { background: #eef2f8; color: #5b6b82; }
/* 取码状态拥有独立颜色，避免跟“老/新”结果标签共用 hit/miss 语义 */
.tag.code-ok { background: var(--hit-soft); color: var(--hit); }
.tag.code-bad { background: var(--danger-soft); color: var(--danger); }

/* 验证码 / 取码状态 */
.code-cell { min-width: 78px; }
.sms {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; letter-spacing: 1.5px; color: var(--hit);
  background: var(--hit-soft); padding: 2px 8px; border-radius: 6px;
  user-select: all; cursor: pointer; transition: .15s;
}
.sms:hover { background: #d7f0e3; box-shadow: inset 0 0 0 1px #9fd9bd; }
.sms.copied { background: var(--hit); color: #fff; }
.sms.copied::after { content: ' ✓'; font-size: 10px; letter-spacing: 0; }
.dim { color: #b6c4d8; font-size: 12px; }
.code-slots {
  display: grid; grid-template-columns: 62px 40px; gap: 6px;
  align-items: center; text-align: center;
}
.code-slots > .tag { padding: 3px 2px; white-space: normal; overflow-wrap: anywhere; }
.code-slots .cd {
  font-size: 1em; font-style: normal; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.code-slots .cd.urgent { color: var(--danger); font-weight: 600; }

/* ---------- 结果过滤 ---------- */
.head-tools { display: flex; align-items: center; gap: 10px; }
.filter-chk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted);
  background: #f7fbff; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px 5px 9px;
  cursor: pointer; user-select: none; transition: .16s;
}
.filter-chk:hover { border-color: #b9d2fb; color: var(--primary); }
.filter-chk input {
  width: 14px; height: 14px; margin: 0;
  accent-color: var(--primary); cursor: pointer;
}
.filter-chk.on {
  background: var(--warn-soft); border-color: #f5d9a8; color: var(--warn); font-weight: 600;
}

/* ---------- 提示音开关 ---------- */
.sound-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--border);
  background: #f7fbff; color: var(--muted);
  font-size: 12.5px; cursor: pointer; transition: .16s;
  font-family: inherit;
}
.sound-btn:hover { border-color: #b9d2fb; color: var(--primary); }
.sound-btn.on { background: var(--primary-soft); border-color: #c8ddfb; color: var(--primary); font-weight: 600; }
.sound-btn.on:hover { background: #e3efff; }

/* ---------- 轻提示 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 42px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(24, 38, 60, .93); color: #fff;
  font-size: 13px; line-height: 1.5; padding: 10px 20px;
  border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 999; max-width: 82vw; text-align: center;
  box-shadow: 0 10px 28px rgba(24, 38, 60, .24);
}
@media (max-width: 640px) { #toast { bottom: 24px; font-size: 12.5px; padding: 9px 16px; } }

/* ---------- 日志 ---------- */
.log-card { display: flex; flex-direction: column; }
.logs {
  margin-top: 10px; height: 460px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.75;
  background: #f8fbff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.log-line { display: flex; gap: 8px; }
.log-line time { color: #a5b6cd; flex: none; }
.log-line .txt { word-break: break-all; }
.log-line.ok .txt { color: var(--hit); }
.log-line.warn .txt { color: var(--warn); }
.log-line.error .txt { color: var(--danger); }

.icon-btn {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  font-size: 12px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  transition: .15s; font-family: inherit;
}
.icon-btn:hover { color: var(--primary); border-color: #b9d2fb; background: var(--primary-soft); }

/* ---------- 配置页 ---------- */
.cfg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 6px; }
.cfg-grid.three { grid-template-columns: repeat(3, 1fr); }
.cfg-block { background: #f9fcff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cfg-block h3 { margin: 0; font-size: 13.5px; color: var(--primary-dark); }
.cfg-verify { font-size: 12.5px; color: var(--muted); padding: 11px 0; min-height: 20px; }
.cfg-verify.ok { color: var(--hit); }
.cfg-verify.bad { color: var(--danger); }
.cfg-actions { margin-top: 16px; display: flex; gap: 10px; }

/* ---------- 用户列表 ---------- */
.user-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2.1fr) auto;
  gap: 14px; align-items: center;
  border: 1px solid var(--border); border-radius: 14px; padding: 13px 16px;
  background: #fbfdff;
}
.user-row.disabled { opacity: .62; }
.user-main { display: flex; flex-direction: column; gap: 4px; }
.account-create { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; align-items: end; }
.account-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.account-filters > input { flex: 1 1 190px; min-width: 0; }
.account-filters > select { width: auto; }
.account-create select { min-width: 0; }
.account-empty { margin: 0; padding: 18px 12px; color: var(--muted); text-align: center; }
.account-dialog { width: min(460px, calc(100% - 32px)); max-height: calc(100% - 24px); overflow: auto; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; color: var(--text); }
.account-dialog::backdrop { background: rgba(15, 35, 62, .42); }
.account-edit-fields { display: grid; gap: 12px; }
.account-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.account-dialog-actions .btn { width: auto; }

/* 雷霆订单反馈 */
/* 反馈功能已移除 */
.account-error { color: var(--danger); font-size: 13px; }
.user-name { font-size: 14px; font-weight: 650; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.user-meta { overflow-wrap: anywhere; }
.user-tag.agent { background: #e8f2ff; color: var(--primary-dark); }
.user-tag { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.user-tag.super { background: #fff2d9; color: #b45309; }
.user-tag.off { background: var(--miss-soft); color: var(--muted); }
.user-meta { font-size: 11.5px; color: var(--muted); }
.user-cfg { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 7px;
  background: #fff; border: 1px solid var(--border); color: var(--muted);
}
.cfg-chip.set { color: var(--hit); border-color: #c7ebd7; background: var(--hit-soft); }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .grid-top { grid-template-columns: 1fr; grid-template-areas: "plat" "card" "progress"; }
  .grid-bottom { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .cfg-grid, .cfg-grid.three { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 1fr; }
  .user-actions { justify-content: flex-start; }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar { padding: 14px 14px 4px; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav-btn { flex: 1; padding: 8px 10px; font-size: 12.5px; }
  .user-chip { margin-left: auto; }
}

@media (max-width: 640px) {
  .brand-mark { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
  .brand-text h1 { font-size: 16px; }
  .brand-text p { display: none; }
  .wrap { padding: 6px 12px 40px; gap: 14px; }
  #viewDesk, #viewConfig, #viewAdmin, #viewProj { gap: 14px; }
  .card { padding: 16px 15px; border-radius: 16px; }
  .platforms { grid-template-columns: 1fr; }
  .card-meta { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat b { font-size: 16px; }
  .bind-row { grid-template-columns: 1fr 1fr; }
  .bind-row .bind-on { justify-self: start; }
  .btn-run, .btn-stop { width: 100%; }
  .pc-main { gap: 6px; }
  .pc-main label { font-size: 13px; }
  .pc-main .btn { font-size: 13px; padding-inline: 12px; }
  .pc-main .step { width: 28px; }
  .pc-main .stepper input { width: 40px; }
  .table-wrap { max-height: 520px; }
  .logs { height: 300px; }

  /* 手机端只保留 号码 / 结果 / 验证码 / 取码 四列，其余收进号码小字 */
  .table-wrap { overflow-x: hidden; }
  table { table-layout: fixed; width: 100%; }
  thead th, tbody td { padding: 8px 4px; }
  #resultBody tr:not(.empty-row) td:nth-child(1),
  #resultBody tr:not(.empty-row) td:nth-child(3),
  #resultBody tr:not(.empty-row) td:nth-child(4),
  #resultBody tr:not(.empty-row) td:nth-child(8),
  #resultBody tr:not(.empty-row) td:nth-child(9),
  thead th:nth-child(1), thead th:nth-child(3),
  thead th:nth-child(4), thead th:nth-child(8),
  thead th:nth-child(9) { display: none; }
  /* 固定列宽，避免内容把卡片撑破 */
  thead th:nth-child(2), tbody td:nth-child(2) { width: 34%; }
  thead th:nth-child(5), tbody td:nth-child(5) { width: 15%; }
  thead th:nth-child(6), tbody td:nth-child(6) { width: 21%; }
  thead th:nth-child(7), tbody td:nth-child(7) { width: 30%; }
  thead th, tbody td { padding: 8px 3px; }
  /* 号码必须完整可见：字号按视口自适应 + 允许折行，不再用省略号截断 */
  tbody td.phone {
    font-size: clamp(11.5px, 3.2vw, 13px);
    letter-spacing: -0.1px;
    font-variant-numeric: tabular-nums;
    white-space: normal;
    overflow-wrap: anywhere;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
  }
  tbody td.phone::before {
    content: attr(data-plat);
    display: block; font-size: 10px; font-weight: 400;
    color: #a5b6cd; margin-bottom: 2px; letter-spacing: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  tbody td.phone.copied::after { content: ''; }
  .tag { font-size: 10.5px; padding: 2px 6px; }
  .code-cell { min-width: 0; }
  .sms { font-size: 11px; padding: 1px 6px; letter-spacing: .5px; }
  .code-slots { grid-template-columns: minmax(0, 1.5fr) minmax(34px, 1fr); gap: 4px; }
  .code-slots .cd { font-size: 12px; }
  .code-slots > .tag { padding: 2px 0; }
  .code-slots .dim { font-size: 11px; }
  .login-card { padding: 28px 22px 24px; }
}

@media (max-width: 360px) {
  thead th:nth-child(2), tbody td:nth-child(2) { width: 36%; }
  thead th:nth-child(5), tbody td:nth-child(5) { width: 15%; }
  thead th:nth-child(6), tbody td:nth-child(6) { width: 20%; }
  thead th:nth-child(7), tbody td:nth-child(7) { width: 29%; }
  tbody td.phone { font-size: 12.5px; letter-spacing: -0.2px; }
  .sms { padding-inline: 2px; letter-spacing: 0; }
  .code-slots { gap: 3px; }
  .code-slots .cd { font-size: 11px; }
}
