/* ============================================================
   豆小包 · 共享样式（豆小黑风格）
   特征：44px 顶栏 + logo 图、小字号、浅灰面板头、圆角 10px、
   主蓝 #2563eb、灰阶 #5c6675/#98a1b0、toast 底部弹出
   ============================================================ */
:root {
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-soft: #e8eeff;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #18212f;
  --muted: #98a1b0;
  --text-2: #5c6675;
  --border: #e8edf4;
  --border-soft: #eef1f5;
  --green: #16a34a;
  --green-soft: #e6f6ec;
  --orange: #d97706;
  --orange-soft: #fdf3e3;
  --red: #b42318;
  --red-soft: #fdecec;
  --gray: #98a1b0;
  --gray-soft: #eef1f5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(24, 33, 47, .04);
  --shadow-lg: 0 10px 30px rgba(24, 33, 47, .14);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Vue 挂载前隐藏未渲染模板，修复打开页面时模板堆叠「闪现」 */
[v-cloak] { display: none !important; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶栏（原生软件式 44px） ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 44px;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 14px;
  display: flex; align-items: center; gap: 9px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; letter-spacing: .2px; }
.brand .logo-img {
  height: 26px; width: auto; flex: none;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 14px; }

/* ===== 卡片（panel 式） ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.card + .card, .card.mt16 { margin-top: 10px; }
.card.mt24 { margin-top: 12px; }
.card-title {
  font-size: 12.5px; font-weight: 700; margin: 0 0 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* ===== KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; margin-bottom: 10px; }
.kpi {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 9px 12px; min-height: 64px; background: #fafbfd;
  display: flex; flex-direction: column;
}
.kpi .label { color: var(--text-2); font-size: 11px; font-weight: 650; white-space: nowrap; }
.kpi .value { font-family: var(--mono); font-size: 22px; font-weight: 750; line-height: 1; margin-top: 7px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px;
  border: 1px solid #e2e7ef; background: #fff; color: var(--text-2);
  border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.btn:hover { background: #f2f4f7; }
.btn.primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 11px -6px rgba(37, 99, 235, .6);
}
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: #f6caca; background: var(--red-soft); }
.btn.danger-solid {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 4px 11px -6px rgba(180, 35, 24, .6);
}
.btn.danger-solid:hover { background: #9a1c15; }
.btn.sm { height: 25px; padding: 0 9px; font-size: 11px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; font-size: 12px; }
th { color: var(--muted); font-weight: 650; font-size: 11px; background: #fafbfd; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fafd; }

/* ===== 徽章 ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; padding: 1.5px 8px; border-radius: 20px; font-weight: 650;
  white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--gray-soft); color: var(--gray); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ===== 表单 ===== */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  font-family: inherit; font-size: 13px;
  border: 1px solid #dbe2ec; border-radius: 8px; padding: 7px 10px;
  background: #fff; color: var(--text); outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
input::placeholder, textarea::placeholder { color: #c3cad6; }
textarea { resize: vertical; min-height: 56px; }

/* CK 输入框：固定高度内部滚动，超长内容不撑爆弹窗 */
.ck-input {
  width: 100%; height: 64px; min-height: 64px; max-height: 64px;
  overflow-y: auto; resize: none; margin-top: 6px;
  font-family: var(--mono); font-size: 11px; line-height: 1.5;
  word-break: break-all; color: #334155;
}

/* ===== Toast（底部弹出，豆小黑式） ===== */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(14px);
  background: #1b2330; color: #fff; padding: 8px 16px; border-radius: 9px;
  font-size: 12px; z-index: 999; box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease-out; max-width: 78%; text-align: center;
}
.toast.err { background: #b42318; }
.toast.ok { background: #16a34a; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f4f7fe 0%, #eef2fb 100%);
}
.login-card { width: 340px; padding: 30px 28px; box-shadow: var(--shadow-lg); }

/* ===== 成员端 ===== */
.member-hero { text-align: center; padding: 34px 0 10px; }
.member-hero h1 { font-size: 21px; margin: 0 0 5px; letter-spacing: .3px; }
.member-hero p { color: var(--muted); margin: 0; font-size: 12.5px; }
.card-key-input {
  text-align: center; font-size: 21px; letter-spacing: 3px; text-transform: uppercase;
  padding: 12px; width: 100%; font-weight: 700; font-family: var(--mono);
}

/* ===== 成员端 · 账号选号列表（卡片式，移动端友好） ===== */
.account-list { display: flex; flex-direction: column; gap: 10px; }
.account-item {
  display: flex; flex-direction: column;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 12px; background: #fff; transition: border-color .15s;
}
.account-item:hover { border-color: #d6e0f2; background: #fafcff; }
.acc-head { display: flex; align-items: center; gap: 10px; }
.acc-avatar {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
img.acc-avatar { object-fit: cover; }
.acc-main { flex: 1; min-width: 0; }
.acc-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.acc-name { font-weight: 700; font-size: 15px; color: var(--text); }
.acc-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-soft);
}
/* 选号卡片：紧凑三列额度/设备数值（当前时段剩余 / 近7天剩余 / 在线设备） */
.quota-nums {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-soft);
}
@media (max-width: 560px) { .quota-nums { grid-template-columns: 1fr 1fr; } .quota-nums .qn:last-child { grid-column: span 2; } }
.qn { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qn-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.qn-label { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.qn-val { font-size: 16px; font-weight: 800; color: var(--text); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.qn-val.low { color: var(--red); }
.qn-val.mid { color: var(--orange); }
.qn-reset { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 登录方式推荐提示条 */
.scan-first-tip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12.5px; color: #1d4ed8; background: var(--primary-soft);
  border: 1px solid #dbeafe; border-radius: 10px; padding: 9px 12px; margin-bottom: 10px;
}
.acc-chip {
  font-size: 12px; color: var(--text-2);
  background: #f4f6fa; border-radius: 999px; padding: 5px 11px;
}
.acc-chip b { color: var(--text); font-family: var(--mono); font-weight: 700; }
.acc-chip.warn { background: #fff7ed; color: var(--orange); }
.acc-chip.warn b { color: var(--orange); }
.acc-chip.login-method { font-weight: 600; }
.acc-chip.login-method.sms-ok { background: var(--green-soft); color: var(--green); }
.acc-chip.login-method.qr-only { background: #eef1f5; color: var(--text-2); }
.acc-chip.plan { font-weight: 600; }
.acc-chip.at-limit { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; font-weight: 600; }

/* ===== 成员端 · 登录方式选择 ===== */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px 14px; background: #fff; cursor: pointer;
  transition: all .15s; font-family: inherit; text-align: center;
}
.method-option:hover { border-color: var(--primary); box-shadow: 0 6px 18px -8px rgba(37, 99, 235, .35); }
.method-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); background: var(--primary-soft);
}
.method-icon svg { width: 24px; height: 24px; }
.method-name { font-weight: 700; font-size: 14px; }
.method-desc { font-size: 11.5px; color: var(--muted); }

/* ===== 扫码登录 ===== */
.qr-frame {
  display: inline-block; padding: 12px; background: #fff;
  border: 1px solid var(--border-soft); border-radius: 12px;
  box-shadow: var(--shadow);
}
.qr-tip { margin-top: 12px; font-size: 12px; color: var(--text-2); }
.qr-tip.ok { color: var(--green); }
.qr-tip.err { color: var(--red); }

/* ===== 倒计时 & 提示框 ===== */
.countdown { font-size: 30px; font-weight: 800; font-family: var(--mono); letter-spacing: 1px; line-height: 1.1; }
.tip-buff { font-size: 11px; color: var(--muted); }
.warn-box {
  border: 1px solid #f3d9a4; background: var(--orange-soft); color: #8a4b0f;
  border-radius: 8px; padding: 9px 12px; font-size: 12px; line-height: 1.5;
}
.warn-box.ok { border-color: #b7e3c6; background: var(--green-soft); color: var(--green); }

/* ===== 登录引导 ===== */
.guide-box { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px; background: #fafbfd; }
.guide-box h4 { margin: 0 0 8px; font-size: 13.5px; }
.phone-big { font-size: 20px; font-weight: 750; color: var(--primary); letter-spacing: 1px; font-family: var(--mono); }

/* ===== 空状态 ===== */
.empty { text-align: center; color: var(--muted); padding: 28px 0; font-size: 12px; }

/* ===== 模态 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(24, 33, 47, .42); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: 480px; max-width: 92vw; box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto; }
.modal h3 { margin: 0 0 14px; font-size: 15px; }

/* 确认弹窗 */
.confirm-modal { width: 340px; text-align: center; }
.confirm-modal h3 { margin: 0 0 6px; }
.confirm-icon {
  width: 52px; height: 52px; border-radius: 50%; margin: 4px auto 12px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--primary-soft);
}
.confirm-icon.danger { background: var(--red-soft); }
.confirm-msg { color: var(--text-2); font-size: 13px; line-height: 1.6; }
.confirm-msg b { color: var(--red); }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 10px; } .mt24 { margin-top: 12px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; }

/* ===== 后台 · 账号池卡片网格 ===== */
.acc-pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.acc-card {
  border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px; background: #fff;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.acc-card:hover { border-color: #d6e0f2; box-shadow: 0 8px 20px -12px rgba(37, 99, 235, .22); }
.acc-card-head { display: flex; align-items: center; gap: 10px; }
.acc-card-avatar { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: none; background: var(--primary-soft); }
.acc-card-avatar-fallback { display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700; font-size: 17px; }
.acc-card-title { flex: 1; min-width: 0; }
.acc-card-name { font-weight: 700; font-size: 14px; }
.acc-card-phone { font-size: 12px; color: var(--text-2); margin-top: 1px; word-break: break-all; }
.acc-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-card-quota {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 0;
  border-top: 1px dashed var(--border-soft); border-bottom: 1px dashed var(--border-soft);
}
.acc-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.acc-card-meta { font-size: 11px; color: var(--text-2); display: flex; gap: 10px; flex-wrap: wrap; line-height: 1.9; }
.acc-card-meta b { color: var(--text); }
.acc-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-card-note { font-size: 11px; color: var(--muted); border-top: 1px dashed var(--border-soft); padding-top: 8px; white-space: normal; }
