:root {
  --bg: #eef5fb;
  --bg-elev: #f7fbff;
  --card: #ffffff;
  --card-2: #f3f8fd;
  --line: #d7e6f4;
  --line-hi: #9ec4e8;
  --text: #17324d;
  --muted: #6b849c;
  --brand: #3a8fd6;
  --brand-hi: #2f7fc4;
  --brand-soft: #e8f3fc;
  --ok: #1f9d6a;
  --warn: #c9851a;
  --danger: #d45353;
  --shadow: 0 10px 28px rgba(40, 90, 140, .08);
  --radius: 14px;
  --font: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(900px 420px at 15% -5%, rgba(90,170,230,.22), transparent 55%),
    radial-gradient(700px 380px at 90% 0%, rgba(150,205,245,.18), transparent 50%),
    linear-gradient(180deg, #f4f9fd 0%, var(--bg) 40%, #e8f1f9 100%);
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px; }

.topbar {
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line-hi);
  background: linear-gradient(145deg, #5aaae0, #3a8fd6);
  color: #fff; display: grid; place-items: center; font-size: 13px;
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; margin-top: 1px; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nav a, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; padding: 9px 14px;
  border: 1px solid var(--line);
  background: #fff; color: var(--text);
  cursor: pointer; font-size: 14px;
}
.nav a:hover, .btn:hover { border-color: var(--brand); color: var(--brand-hi); background: var(--brand-soft); }
.btn-primary {
  background: linear-gradient(180deg, #4ea0df, var(--brand));
  border-color: #2f7fc4; color: #fff; font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.04); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1.05fr 1.2fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h2, .card h3 { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 13px; }
.section-title {
  margin: 4px 0 14px; font-size: 16px; font-weight: 650;
  color: var(--brand-hi);
}
.gold { color: var(--brand-hi); }
.divider-title {
  display: flex; align-items: center; gap: 12px;
  justify-content: center; margin: 4px 0 14px;
  color: var(--brand-hi); font-weight: 700; letter-spacing: .06em;
}
.divider-title::before, .divider-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line-hi);
}

.cat, .sku {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: #f8fbfe; cursor: pointer; transition: .15s ease;
}
.cat:hover, .sku:hover { border-color: var(--line-hi); background: #fff; }
.cat.active, .sku.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58,143,214,.14);
  background: #fff;
}
.sku .price {
  color: var(--brand-hi); font-weight: 700; font-size: 20px; margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-block; font-size: 12px; padding: 3px 8px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand-hi); border: 1px solid #c9e1f5;
}
.tag.out { background: #fff1f1; color: var(--danger); border-color: #f0c7c7; }
.tag.ok { background: #e9f9f1; color: var(--ok); border-color: #bfe8d3; }
.tag.warn { background: #fff7e8; color: var(--warn); border-color: #f0d7a8; }

.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font: inherit; color: var(--text);
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(58,143,214,.15);
}
.field textarea { min-height: 140px; resize: vertical; font-family: var(--mono); font-size: 13px; }

.pay-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.paybox {
  text-align: center;
  border: 1px solid var(--line-hi);
  background: linear-gradient(180deg, #f7fbff, #eef6fc);
  border-radius: 14px; padding: 22px 20px 18px;
}
.qr {
  width: 200px; height: 200px; margin: 14px auto;
  border-radius: 12px; background: #fff; color: #17324d;
  border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  position: relative;
  box-shadow: var(--shadow);
}
.qr::after {
  content: "USDT";
  width: 42px; height: 42px; border-radius: 50%;
  background: #26a17b; color: #fff;
  display: grid; place-items: center; font-size: 11px;
}
.addr {
  word-break: break-all; text-align: left;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-size: 13px;
  margin-top: 10px; font-family: var(--mono); color: #244868;
}
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.kv th { color: var(--muted); font-weight: 500; width: 38%; }
.kv td.amount { color: var(--brand-hi); font-weight: 700; font-size: 18px; }

.sticky-pay {
  position: sticky; bottom: 12px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line-hi);
  border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  backdrop-filter: blur(8px);
}

.layout-admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, #1f4f7a, #173b5c);
  color: #eaf4fc; padding: 18px 12px;
}
.side .brand { color: #fff; padding: 8px 10px 18px; }
.side .brand .logo {
  background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.25); color: #fff;
}
.side .brand small { color: rgba(234,244,252,.75); }
.side a {
  display: block; padding: 10px 12px; border-radius: 10px; color: #d5e8f7; margin-bottom: 4px;
}
.side a.active, .side a:hover { background: rgba(255,255,255,.12); color: #fff; }
.main { padding: 22px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.table th { color: var(--muted); font-weight: 600; }
.stat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat .card { padding: 16px; }
.stat .num { font-size: 28px; font-weight: 700; margin-top: 6px; color: var(--brand-hi); }
.preview-index .links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.preview-index a.card:hover { border-color: var(--brand); }
.warn-line {
  display: flex; gap: 8px; align-items: flex-start;
  color: var(--muted); font-size: 12px; margin-top: 10px; text-align: left;
}
.lock-note { margin-top: 12px; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .stat, .preview-index .links, .layout-admin, .pay-layout { grid-template-columns: 1fr; }
}
