:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --brand: #2b6cff;
  --brand-2: #6a5cff;
  --ok: #16a34a;
  --warn: #e11d48;
  --line: #e8ebf2;
  --shadow: 0 8px 30px rgba(31, 36, 48, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eef2fb 0%, #f5f7fb 100%);
  color: var(--ink);
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 18px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow); margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 18px; border: 1px solid var(--line);
}
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fbfcfe; color: var(--ink); outline: none; transition: border .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; transition: transform .08s, opacity .15s;
}
.btn:hover { opacity: .94; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #eef2fb; color: var(--brand); }
.btn.danger { background: var(--warn); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.ok { background: #e7f7ee; color: var(--ok); }
.tag.warn { background: #fdeaef; color: var(--warn); }
.tag.mut { background: #eef2fb; color: var(--muted); }
.notice {
  border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--line); background: #fbfcfe;
}
.notice.redline { border-color: #f6c9d4; background: #fff5f7; }
.notice.tip { border-color: #cfe0ff; background: #f3f7ff; }
.redline h3 { color: var(--warn); margin: 0 0 8px; font-size: 15px; }
.redline ul { margin: 6px 0 0; padding-left: 20px; }
.redline li { margin: 4px 0; }

/* 计时器 */
.timer {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 26px; border-radius: 16px; background: linear-gradient(135deg, #2b6cff, #6a5cff); color: #fff;
}
.timer .big { font-size: 52px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.timer .lbl { font-size: 13px; opacity: .9; }
.bar { height: 8px; background: #eef2fb; border-radius: 999px; overflow: hidden; margin-top: 14px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .9s linear; }

/* 仿真 Kimi 工作区 */
.kimi { display: grid; grid-template-columns: 220px 1fr; min-height: 460px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.kimi .side { background: #f7f9fd; border-right: 1px solid var(--line); padding: 14px; }
.kimi .side .t { font-weight: 700; margin-bottom: 10px; }
.kimi .side .conv { font-size: 13px; color: var(--muted); padding: 8px; border-radius: 8px; background: #fff; margin-bottom: 6px; border: 1px solid var(--line); }
.kimi .main { display: flex; flex-direction: column; background: #fff; }
.kimi .chat { flex: 1; padding: 18px; overflow-y: auto; }
.msg { max-width: 78%; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 14px; line-height: 1.6; }
.msg.me { margin-left: auto; background: #eef2fb; border-bottom-right-radius: 4px; }
.msg.ai { background: #f3f5fa; border-bottom-left-radius: 4px; }
.kimi .input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.kimi .input input { flex: 1; }

.center { text-align: center; }
.muted { color: var(--muted); }
.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  background: #1f2430; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99;
}
.toast.show { opacity: 1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr:hover td { background: #fafbff; }
.code-pill { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 1px; background: #f3f7ff; padding: 4px 8px; border-radius: 8px; color: var(--brand); }
.kbd { font-family: ui-monospace, Menlo, Consolas, monospace; background: #eef2fb; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px){ .split { grid-template-columns: 1fr; } .kimi { grid-template-columns: 1fr; } .kimi .side{ display:none; } }

/* 弹窗 / 扫码登录 iframe */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(20,24,34,.55); z-index: 100; padding: 18px; }
.modal-box { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); width: min(860px, 100%); max-height: 92vh; overflow: auto; padding: 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.frame-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; height: 560px; }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Cookie 登录引导 */
.cookie-guide { margin-top: 4px; }
.cg-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; font-size: 14px; line-height: 1.6; }
.cg-num { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; margin-top: 2px; }
.cg-code-wrap { display: flex; gap: 10px; align-items: center; margin-top: 8px; background: #0f172a; border-radius: 10px; padding: 10px 12px; }
.cg-code-wrap code { color: #7dd3fc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; flex: 1; user-select: all; }
.cookie-input { width: 100%; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #fbfcfe; resize: vertical; }

/* 登录方式分组 + bookmarklet */
.cg-method { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 4px; margin: 12px 0; background: #fafbff; }
.cg-method-title { font-weight: 700; font-size: 14px; color: var(--brand); margin-bottom: 4px; }
.bookmarklet { display: inline-block; margin-top: 8px; padding: 9px 16px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff !important; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: grab; box-shadow: 0 2px 8px rgba(43,108,255,.3); }

/* 登录方式选项卡 */
.tabs { display: inline-flex; gap: 8px; background: #f1f4fb; padding: 6px; border-radius: 12px; }
.tab { border: 0; background: transparent; padding: 9px 16px; border-radius: 9px; font-size: 14px; color: var(--muted); cursor: pointer; transition: all .15s; }
.tab.on { background: var(--card); color: var(--brand); font-weight: 600; box-shadow: 0 2px 8px rgba(31,36,48,.08); }

/* ===== 管理后台：左侧菜单布局 ===== */
body.admin { background: #f5f7fb; }
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidenav {
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.sidenav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 6px 10px 18px; }
.sidenav-brand .dot { width: 11px; height: 11px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.sidenav nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  text-align: left; border: 0; background: transparent; padding: 11px 14px; border-radius: 10px;
  font-size: 14px; color: var(--muted); cursor: pointer; transition: all .15s; font-weight: 500;
}
.nav-item:hover { background: #f1f4fb; color: var(--ink); }
.nav-item.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600; }
.sidenav-foot { padding-top: 14px; border-top: 1px solid var(--line); }
.content { padding: 26px 26px 60px; max-width: 1080px; }
.content h1 { font-size: 22px; margin: 0 0 18px; }
.view .card { margin-bottom: 16px; }

/* 仪表盘统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.stat-num { font-size: 30px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .sidenav nav { flex-direction: row; flex-wrap: wrap; }
  .stat-grid, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 提货码：批次 + 工具条 + 宽表 ===== */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input { width: 250px; }
.toolbar select { width: auto; }
.toolbar input, .toolbar select { flex: 0 0 auto; padding: 8px 10px; font-size: 13px; }
.tbl-wrap { overflow-x: auto; }
.tbl-wrap table { min-width: 840px; font-size: 13px; }
.tbl-wrap th, .tbl-wrap td { padding: 9px; white-space: nowrap; }
.tbl-wrap td.mut2 { white-space: normal; min-width: 110px; max-width: 150px; }
/* 操作列常驻右侧，宽表横向滚动时按钮不会被裁掉 */
.tbl-wrap th:last-child, .tbl-wrap td:last-child {
  position: sticky; right: 0; background: #fff; z-index: 1;
  box-shadow: -8px 0 10px -10px rgba(23, 32, 61, .35);
}
.tbl-wrap tr:hover td:last-child { background: #fafbff; }
.code-out { width: 100%; min-height: 96px; margin-top: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: .5px; background: #f8faff; resize: vertical; }
.batch-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.num { font-variant-numeric: tabular-nums; }
