/* ============================================================
   扫码下单系统 - 共用样式（自包含，不依赖外部 CDN）
   ============================================================ */
:root {
  --bg: #060a13;
  --panel: rgba(23, 32, 52, 0.78);
  --panel-2: rgba(15, 23, 42, 0.9);
  --line: rgba(148, 163, 184, 0.16);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --dim: #64748b;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --green: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --cyan: #22d3ee;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 90% -10%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(800px 600px at -10% 20%, rgba(139, 92, 246, 0.12), transparent 55%),
    radial-gradient(900px 600px at 50% 120%, rgba(16, 185, 129, 0.08), transparent 60%),
    linear-gradient(180deg, #060a13 0%, #0a1122 60%, #0b1120 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
::selection { background: rgba(59, 130, 246, 0.4); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

.card {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.72));
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  padding: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, 'Courier New', monospace; }
.flex { display: flex; gap: 8px; }
.between { justify-content: space-between; align-items: center; }
.wrap { flex-wrap: wrap; }
.col { flex-direction: column; }
.grow { flex: 1; }
.center { align-items: center; }
.hide { display: none !important; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.p12 { padding: 12px; }
.tac { text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* 输入 */
label.f { display: block; font-size: 12px; color: var(--dim); margin-bottom: 4px; }
input, select, textarea {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  border-radius: 10px;
  padding: 9px 12px;
  width: 100%;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.16); }
input::placeholder, textarea::placeholder { color: #475569; }
select option { background: #0f172a; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: 10px; transition: all .18s; color: #fff;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.btn-green { background: linear-gradient(135deg, #10b981, #047857); }
.btn-amber { background: linear-gradient(135deg, #f59e0b, #b45309); }
.btn-rose { background: linear-gradient(135deg, #f43f5e, #be123c); }
.btn-violet { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.btn-ghost { background: rgba(51,65,85,.6); border: 1px solid rgba(148,163,184,.2); }
.btn-ghost:hover { background: rgba(71,85,105,.7); color:#fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn-block { width: 100%; }

/* 徽章 */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.b-green { background: rgba(16,185,129,.14); color: #34d399; border: 1px solid rgba(16,185,129,.35); }
.b-red { background: rgba(244,63,94,.14); color: #fb7185; border: 1px solid rgba(244,63,94,.35); }
.b-amber { background: rgba(245,158,11,.14); color: #fbbf24; border: 1px solid rgba(245,158,11,.35); }
.b-blue { background: rgba(59,130,246,.14); color: #60a5fa; border: 1px solid rgba(59,130,246,.35); }
.b-gray { background: rgba(100,116,139,.16); color: #94a3b8; border: 1px solid rgba(100,116,139,.3); }
.b-violet { background: rgba(139,92,246,.14); color: #a78bfa; border: 1px solid rgba(139,92,246,.35); }

/* 表格 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl thead th {
  text-align: left; padding: 10px 12px; font-size: 12px; color: var(--dim);
  background: rgba(15,23,42,.75); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl tbody td { padding: 9px 12px; border-bottom: 1px solid rgba(148,163,184,.07); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(30,41,59,.35); }
.tbl tbody tr:last-child td { border-bottom: none; }
.clickable { cursor: pointer; }

/* 弹窗 */
.overlay {
  position: fixed; inset: 0; background: rgba(2,6,23,.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100;
}
.modal {
  background: linear-gradient(170deg, #172034, #0d1422);
  border: 1px solid var(--line); border-radius: 16px; max-width: 640px; width: 100%;
  max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 90px -20px rgba(0,0,0,.7);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(13,20,34,.96); border-radius: 16px 16px 0 0; z-index: 2; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: rgba(13,20,34,.96); border-radius: 0 0 16px 16px; }
.x { background: none; border: none; color: var(--dim); font-size: 20px; cursor: pointer; }
.x:hover { color: #fff; }

/* Toast */
#toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 11px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; min-width: 200px; max-width: 340px;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.55); animation: tin .25s ease; border: 1px solid;
}
.t-ok { background: rgba(6,78,59,.95); color:#6ee7b7; border-color: rgba(16,185,129,.4); }
.t-err { background: rgba(127,29,29,.95); color:#fda4af; border-color: rgba(244,63,94,.4); }
.t-info { background: rgba(30,58,138,.95); color:#93c5fd; border-color: rgba(59,130,246,.4); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px);} to { opacity: 1; transform: none; } }

/* 骨架屏 / spinner */
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: rot .8s linear infinite; }
.spin-lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes rot { to { transform: rotate(360deg); } }
.btn .spin { width: 14px; height: 14px; }

/* 统计卡 */
.stat { background: linear-gradient(160deg, rgba(30,41,59,.5), rgba(15,23,42,.7)); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat .num { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }

/* 顶栏 */
.topbar {
  background: rgba(9,13,26,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148,163,184,.12);
  position: sticky; top: 0; z-index: 50;
}
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; font-size: 18px;
}
.wrap-max { max-width: 1200px; margin: 0 auto; padding: 18px 16px; }

/* 后台选项卡 */
.navtab { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.navtab .it { padding: 9px 14px; font-size: 14px; color: var(--muted); cursor: pointer; border-radius: 10px 10px 0 0; border-bottom: 2px solid transparent; font-weight: 600; }
.navtab .it:hover { color: #e2e8f0; }
.navtab .it.on { color: #60a5fa; border-bottom-color: #3b82f6; background: linear-gradient(180deg, rgba(59,130,246,.1), transparent); }

/* 开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; flex-shrink: 0; }
.switch input { display: none; }
.switch .sl { position: absolute; inset: 0; background: #334155; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .sl:before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .sl { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.switch input:checked + .sl:before { transform: translateX(18px); }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(148,163,184,.12); }
.sw-row:last-child { border-bottom: none; }
.sw-row .lbl { font-size: 13.5px; }
.sw-row .tip { font-size: 12px; color: var(--dim); }

/* 移动下单页 */
.mp-wrap { max-width: 520px; margin: 0 auto; padding: 16px 14px 40px; }
.mp-logo { width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(135deg,#3b82f6,#8b5cf6); display:flex; align-items:center; justify-content:center; font-size:28px; margin: 14px auto 10px; box-shadow: 0 10px 30px -8px rgba(59,130,246,.5); }
.amount-input { text-align: center; font-size: 42px; font-weight: 800; padding: 12px; border-radius: 14px; }
.quick-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid rgba(59,130,246,.4); background: rgba(59,130,246,.1); color: #bfdbfe;
  border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 700; cursor: pointer; transition: .15s; user-select: none;
}
.quick-chip:active { transform: scale(.94); background: rgba(59,130,246,.35); }
