/* ============ 群活码系统 统一样式 ============ */
:root {
  --primary: #1668dc;
  --primary-dark: #0b4699;
  --ink: #17202a;
  --sub: #6b7785;
  --line: #e9edf3;
  --bg: #f4f6fa;
  --card: #ffffff;
  --success: #0e9f6e;
  --warn: #d97706;
  --danger: #e02424;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { display: block; }
input, textarea, select, button { font-family: inherit; font-size: 15px; }

/* ---------------- 客户端 ---------------- */
.wrap { max-width: 520px; margin: 0 auto; padding-bottom: 42px; }

.hero {
  background: linear-gradient(155deg, #1f7ae0 0%, #1668dc 45%, #0b4699 100%);
  color: #fff;
  padding: 30px 24px 46px;
  border-radius: 0 0 26px 26px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; right: -50px; top: -60px;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.hero h1 { font-size: 22px; margin: 0 0 8px; font-weight: 700; letter-spacing: .5px; }
.hero p { margin: 0; font-size: 14px; opacity: .88; }
.hero .price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 18px; }
.hero .price { font-size: 34px; font-weight: 700; letter-spacing: -.5px; }
.hero .price small { font-size: 15px; font-weight: 500; opacity: .85; }
.hero .badge {
  display: inline-block; margin-top: 14px; padding: 4px 12px;
  border-radius: 999px; background: rgba(255,255,255,.18);
  font-size: 13px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  margin: 12px 16px 16px;
  padding: 20px;
  box-shadow: 0 8px 26px rgba(23, 32, 42, .07);
  position: relative;
}
.panel h2 { font-size: 16px; margin: 0 0 14px; font-weight: 600; }
.panel .tip { font-size: 13px; color: var(--sub); line-height: 1.7; }

/* 付款区 */
.paybox {
  background: #f7f9fc; border: 1px dashed #cfdcee; border-radius: 12px;
  padding: 16px; text-align: center;
}
.paybox .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px; word-break: break-all; color: #0b4699;
  background: #fff; border-radius: 8px; padding: 10px 12px; border: 1px solid var(--line);
  line-height: 1.6;
}
.copy-btn {
  margin-top: 10px; border: none; background: var(--primary); color: #fff;
  padding: 9px 22px; border-radius: 999px; font-size: 14px; cursor: pointer;
}
.copy-btn:active { transform: scale(.97); }
.payimg { width: 200px; margin: 0 auto; border-radius: 10px; }

.field { margin-top: 16px; }
.field label { display: block; font-size: 14px; color: #3d4854; margin-bottom: 7px; font-weight: 500; }
.field input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfe; outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--primary); background: #fff; }
.field .hint { font-size: 12px; color: #97a1ad; margin-top: 6px; }

.btn-main {
  display: block; width: 100%; margin-top: 20px; padding: 15px;
  border: none; border-radius: 12px; color: #fff; font-weight: 600; font-size: 16px;
  background: linear-gradient(135deg, #1f7ae0, #0b4699);
  box-shadow: 0 8px 18px rgba(22, 104, 220, .28);
  cursor: pointer;
}
.btn-main:active { transform: translateY(1px); }
.btn-main.disabled { opacity: .55; pointer-events: none; }

.steps { display: flex; gap: 6px; margin: 18px 16px 0; }
.steps span {
  flex: 1; text-align: center; font-size: 12px; color: var(--sub);
  background: #fff; border-radius: 10px; padding: 9px 4px; border: 1px solid var(--line);
}
.steps span b { display: block; color: var(--primary); font-size: 15px; }

.notice-card {
  margin: 16px; background: #fff; border-radius: 14px; padding: 14px 16px;
  font-size: 13px; color: var(--sub); border-left: 3px solid var(--primary);
}
.footer { text-align: center; font-size: 12px; color: #9aa5b1; margin-top: 22px; padding: 0 24px; }

/* 群卡片 */
.batch-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 22px 6px;
}
.batch-head .t { font-size: 19px; font-weight: 700; }
.batch-head .n { font-size: 13px; color: var(--sub); }
.success-strip {
  margin: 10px 16px 4px; background: linear-gradient(135deg,#e7f7ef,#f2fbf7);
  border: 1px solid #c6ecd9; color: #0b7a54; border-radius: 12px;
  padding: 12px 16px; font-size: 14px; display: flex; gap: 8px; align-items: center;
}

.g-item {
  background: #fff; border-radius: 16px; margin: 0 16px 14px; padding: 16px;
  box-shadow: 0 4px 16px rgba(23,32,42,.05);
}
.g-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.g-idx {
  width: 26px; height: 26px; border-radius: 8px; background: #eaf1fd; color: var(--primary);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.g-name {
  font-size: 16px; font-weight: 600; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.g-mem {
  font-size: 12px; color: var(--primary); background: #eaf1fd;
  padding: 3px 10px; border-radius: 999px; flex-shrink: 0;
}
.g-qr-wrap { text-align: center; padding: 4px 0 6px; }
.g-qr-wrap img {
  width: 100%; max-width: 260px; margin: 0 auto; border-radius: 10px;
  border: 1px solid var(--line);
}
.g-qr-wrap .cap { font-size: 12px; color: #98a3af; margin-top: 8px; }
.g-noqr {
  height: 120px; display: flex; align-items: center; justify-content: center;
  background: #f7f9fc; border-radius: 10px; color: #9aa5b1; font-size: 13px;
}

.after-box {
  margin: 6px 16px 0; background: #fff; border-radius: 14px; padding: 16px;
  font-size: 13px; color: var(--sub);
}
.after-box strong { color: var(--ink); }

/* 等待页 */
.waiting-box { text-align: center; padding: 60px 24px; }
.spinner {
  width: 46px; height: 46px; border: 4px solid #e3ecf9; border-top-color: var(--primary);
  border-radius: 50%; margin: 0 auto 18px; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 后台 ---------------- */
.admin { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; background: #101a2b; color: #c7d2e0; flex-shrink: 0;
  padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { color: #fff; font-size: 17px; font-weight: 700; padding: 0 10px 4px; }
.sidebar .brand span { display: block; font-size: 11px; color: #7d8ea3; font-weight: 400; margin-top: 2px; }
.sidebar nav { margin-top: 22px; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  color: #c7d2e0; font-size: 14px;
}
.sidebar nav a:hover { background: #1a2740; }
.sidebar nav a.on { background: #1668dc; color: #fff; }
.sidebar .out { margin-top: 24px; padding: 0 12px; font-size: 12px; color: #6b7d94; }

.main { flex: 1; padding: 26px 30px 60px; max-width: 1180px; }
.main h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
.main .crumb { color: var(--sub); font-size: 13px; margin-bottom: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border-radius: 14px; padding: 18px 20px; border: 1px solid var(--line);
}
.stat .k { font-size: 13px; color: var(--sub); }
.stat .v { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--sub); margin-left: 4px; }
.stat.accent .v { color: var(--primary); }

.box {
  background: #fff; border-radius: 16px; border: 1px solid var(--line);
  padding: 20px; margin-top: 18px;
}
.box h3 { font-size: 15px; margin: 0 0 14px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
th { color: var(--sub); font-weight: 500; font-size: 12.5px; background: #fafbfd; }
tr:hover td { background: #fafcff; }
td .thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.tag.ok { background: #e6f6ee; color: #0b7a54; }
.tag.wait { background: #fef3e2; color: #b45309; }
.tag.no { background: #fdeaea; color: #c81e1e; }
.tag.gray { background: #eef1f6; color: #6b7785; }

.mini-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 5px 12px; border-radius: 8px; font-size: 12.5px; cursor: pointer;
  white-space: nowrap; display: inline-block;
}
.mini-btn:hover { border-color: var(--primary); color: var(--primary); }
.mini-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.mini-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.input, select.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fbfcfe; outline: none;
}
.input:focus { border-color: var(--primary); background: #fff; }
textarea.input { min-height: 130px; resize: vertical; font-family: inherit; }
label.lbl { display: block; font-size: 13px; color: #3d4854; margin-bottom: 6px; font-weight: 500; }
.help { font-size: 12px; color: #97a1ad; margin-top: 5px; line-height: 1.55; }

.btn-primary {
  background: var(--primary); color: #fff; border: none; padding: 11px 22px;
  border-radius: 10px; font-size: 14px; cursor: pointer; font-weight: 500;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  padding: 11px 20px; border-radius: 10px; cursor: pointer;
}

.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-size: 13px; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert.ok { background: #e9f8f0; color: #0b7a54; border: 1px solid #c6ecd9; }
.alert.err { background: #fdecec; color: #b42318; border: 1px solid #f7cccc; }

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #0e1a2e, #16233d 60%, #1b3a63);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 18px;
  padding: 34px 30px; box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.login-card h1 { font-size: 21px; margin: 0 0 4px; }
.login-card p { color: var(--sub); font-size: 13px; margin: 0 0 24px; }

.actcode-box { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.actcode-box img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 12px; }
.actcode-box .info { flex: 1; min-width: 240px; }
.url-line {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; word-break: break-all; margin-bottom: 10px;
}

@media (max-width: 760px) {
  .admin { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px; }
  .sidebar .brand { padding: 0 6px; }
  .sidebar .brand span { display: none; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; margin: 0; gap: 4px; }
  .sidebar nav a { padding: 7px 10px; font-size: 12.5px; }
  .sidebar .out { display: block; margin: 0; padding: 4px 10px; }
  .sidebar .out a { display: inline-block; padding: 6px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; color: #cbd6e4 !important; font-size: 12.5px; }
  .main { padding: 18px 14px 50px; }
  .main h1 { font-size: 19px; }
}

/* ---------------- 客服悬浮按钮 / 弹层 ---------------- */
.fab {
  position: fixed; right: 14px; top: 14px; z-index: 60;
  background: #fff; color: var(--primary);
  border: 1px solid #dbe7fa; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(23, 32, 42, .16);
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.fab:active { transform: scale(.97); }

/* 客服下方的「加入代理」入口 */
.fab-join {
  position: fixed; right: 14px; top: 60px; z-index: 60;
  background: var(--primary); color: #fff;
  border: 1px solid var(--primary); border-radius: 999px;
  box-shadow: 0 6px 18px rgba(24, 92, 211, .28);
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.fab-join:active { transform: scale(.97); }

/* 客服下方第二个入口：查看我已加入的群 */
.fab-mine {
  position: fixed; right: 14px; top: 106px; z-index: 60;
  background: #fff; color: #4b5563;
  border: 1px solid #dbe7fa; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(23, 32, 42, .10);
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.fab-mine:active { transform: scale(.97); }

.mask {
  position: fixed; inset: 0; background: rgba(15, 20, 30, .5);
  z-index: 99; display: none; align-items: center; justify-content: center; padding: 24px;
}
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 18px; padding: 26px 22px 22px;
  width: 100%; max-width: 330px; text-align: center; position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal .close {
  position: absolute; right: 12px; top: 6px; border: none; background: none;
  font-size: 24px; color: #9aa5b1; cursor: pointer; line-height: 1;
}
.modal h3 { font-size: 16px; margin: 0 0 6px; }
.modal p { font-size: 13px; color: var(--sub); margin: 0 0 14px; }
.modal img { width: 210px; height: 210px; object-fit: contain; margin: 4px auto 12px;
  border-radius: 12px; border: 1px solid var(--line); }
.modal .wx {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px;
  background: #f6f8fc; border-radius: 9px; padding: 10px; color: #0b4699; margin-bottom: 12px;
}
.modal .copy-btn { width: 100%; }

/* 代理端 */
.agent-hero {
  background: linear-gradient(150deg, #1f7ae0, #0b4699); color: #fff;
  padding: 26px 22px 34px; border-radius: 0 0 24px 24px;
}
.agent-hero .who { font-size: 13px; opacity: .85; }
.agent-hero .bal { font-size: 38px; font-weight: 700; letter-spacing: -1px; margin-top: 6px; }
.agent-hero .bal small { font-size: 15px; font-weight: 500; opacity: .85; }
.agent-hero .sub { font-size: 12.5px; opacity: .8; margin-top: 4px; }
.wd-item {
  background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--line); font-size: 13px;
}
.wd-item .top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.wd-item .amt { font-weight: 700; font-size: 16px; }


/* 付款页库存提示 */
.stock-alert{ margin:0 0 12px; padding:13px 15px; border-radius:12px; font-size:14px; line-height:1.6; }
.stock-alert .sub{ font-size:12px; opacity:.88; margin-top:5px; }
.stock-alert.bad{ background:#fff1f0; border:1px solid #ffccc7; color:#b42318; }
.stock-alert.warn{ background:#fffbe6; border:1px solid #ffe58f; color:#8a5300; }


/* ---- 全站表格筛选器 ---- */
.tbl-utils{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0 8px}
.tbl-search{flex:1 1 220px;min-width:150px;padding:8px 11px;border:1px solid #d9dfe6;border-radius:9px;font-size:13px;background:#fff}
.tbl-sel{padding:8px 9px;border:1px solid #d9dfe6;border-radius:9px;font-size:13px;background:#fff;max-width:190px}
.tbl-reset{padding:8px 13px;border:1px solid #d9dfe6;background:#f6f8fa;border-radius:9px;font-size:13px;cursor:pointer;color:#2b2b2b}
.tbl-reset:hover{background:#eef2f6}
.tbl-info{color:#8a8a8a;font-size:12px;margin-left:auto}
@media (max-width:760px){.tbl-search{flex:1 1 100%}.tbl-sel{flex:1 1 46%;max-width:none}.tbl-info{margin-left:0}}
