/* 竞遇智能吊牌 SaaS —— 公共样式 */
:root {
  --primary: #e8453c;
  --primary-dark: #c93a32;
  --gold: #f5b942;
  --ink: #1f2333;
  --muted: #7a8199;
  --line: #e7e9f2;
  --bg: #f4f5fa;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px; -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: var(--primary); color: #fff; transition: all .18s; border: none;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f3c6c6; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.card {
  background: var(--card); border-radius: 14px; border: 1px solid var(--line);
  padding: 20px; box-shadow: 0 1px 3px rgba(31,35,51,.04);
}
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge.on { background: #e7f7ee; color: var(--ok); }
.badge.off { background: #fdeeee; color: var(--danger); }
.badge.gray { background: #eef0f6; color: var(--muted); }
.badge.gold { background: #fdf3dd; color: var(--warn); }

/* toast */
#toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%) translateY(-80px);
  background: #22263a; color: #fff; padding: 10px 22px; border-radius: 10px;
  font-size: 14px; z-index: 999; opacity: 0; transition: all .25s; box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

/* modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,22,38,.45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 86vh; overflow: auto; padding: 24px; animation: pop .2s ease;
}
.modal h3 { font-size: 18px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.modal .close { font-size: 22px; color: var(--muted); cursor: pointer; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* form */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fafbff; transition: border .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); background: #fff; }
.field textarea { min-height: 70px; resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row .field { flex: 1; }

/* table */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; background: #fafbff; }
tbody tr:hover { background: #fafbff; }
.tbl-wrap { overflow: auto; max-height: 480px; }

/* ---------- 控制台 ---------- */
.console {
  display: flex; min-height: 100vh;
}
.sidebar {
  width: 220px; background: #1c1f33; color: #cfd3e6; padding: 22px 14px; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.sidebar .logo .dot {
  width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #ff7a45);
  display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff;
}
.sidebar .logo b { color: #fff; font-size: 16px; letter-spacing: 1px; }
.sidebar .logo small { display: block; color: #7d8299; font-size: 11px; font-weight: 400; }
.sidebar nav { flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  color: #b9bed6; margin-bottom: 4px; font-weight: 500; font-size: 14px; transition: all .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar .user { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 10px 4px; font-size: 13px; }
.sidebar .user .name { color: #fff; font-weight: 600; }
.sidebar .user .out { color: #8a90ab; font-size: 12px; cursor: pointer; margin-left: 8px; }
.sidebar .user .out:hover { color: #fff; }

.main { flex: 1; padding: 26px 30px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar h1 { font-size: 22px; }
.topbar p { color: var(--muted); margin-top: 3px; font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
}
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 6px; }
.stat .v.red { color: var(--primary); }
.stat .v.gold { color: var(--warn); }
.stat .v.green { color: var(--ok); }

.campaign-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.campaign-head h2 { font-size: 17px; }

.prize-tag {
  display: inline-block; background: #fdf3f2; color: var(--primary); border: 1px solid #fadcd9;
  padding: 2px 8px; border-radius: 6px; font-size: 12px; margin: 2px 3px 2px 0;
}

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty .big { font-size: 36px; margin-bottom: 8px; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1000px 500px at 20% 10%, #2b2f52 0%, #1c1f33 55%, #14162a 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 36px 34px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-card .brand { text-align: center; margin-bottom: 26px; }
.login-card .brand .dot {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #ff7a45);
  display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff;
}
.login-card .brand h2 { font-size: 20px; }
.login-card .brand p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.login-card .tip { background: #f6f7fc; border-radius: 10px; padding: 10px 14px; font-size: 12.5px; color: var(--muted); margin-top: 16px; line-height: 1.8; }

/* ---------- 消费者 H5 ---------- */
.h5 {
  min-height: 100vh; color: #fff;
  background: linear-gradient(180deg, #2a1733 0%, #4a1420 45%, #7c1f1f 100%);
  padding: 0 0 40px; max-width: 520px; margin: 0 auto;
}
.h5 .hero { text-align: center; padding: 34px 22px 18px; }
.h5 .hero .logo-tag {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25); padding: 6px 16px; border-radius: 999px; font-size: 13px; letter-spacing: 2px;
}
.h5 .hero h1 { font-size: 26px; margin-top: 16px; letter-spacing: 1px; }
.h5 .hero p { color: rgba(255,255,255,.75); margin-top: 8px; font-size: 14px; }
.h5 .panel {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px; margin: 0 16px 16px; padding: 20px; backdrop-filter: blur(6px);
}
.h5 .panel h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.h5 input {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12); color: #fff; font-size: 18px; letter-spacing: 4px; text-align: center;
}
.h5 input::placeholder { color: rgba(255,255,255,.4); letter-spacing: 1px; font-size: 14px; }
.h5 .btn-big {
  width: 100%; margin-top: 12px; padding: 14px; border-radius: 12px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), #ff8c42); color: #4a2410;
}
.h5 .btn-big:disabled { opacity: .5; cursor: not-allowed; }

/* 盲盒 */
.box-stage { text-align: center; padding: 10px 0 6px; }
.box {
  width: 150px; height: 150px; margin: 0 auto; position: relative; cursor: pointer;
  animation: float 2.6s ease-in-out infinite;
}
.box .lid {
  position: absolute; top: 0; left: 14px; right: 14px; height: 52px;
  background: linear-gradient(180deg, #ffd98a, #f5b942); border-radius: 12px 12px 4px 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 2;
}
.box .body {
  position: absolute; top: 46px; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #f5b942, #e08c1f); border-radius: 4px 4px 14px 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,.35); z-index: 1;
}
.box .body::before {
  content: "竞遇"; position: absolute; top: 26px; left: 0; right: 0; text-align: center;
  color: #7c4300; font-size: 22px; font-weight: 900; letter-spacing: 8px;
}
.box.shaking { animation: shake .5s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-10px) rotate(-3deg)} 40%{transform:translateX(10px) rotate(3deg)} 60%{transform:translateX(-8px)} 80%{transform:translateX(8px)} }
.box-tip { color: rgba(255,255,255,.7); font-size: 13px; margin-top: 12px; }

/* 开奖结果 */
.reveal { text-align: center; padding: 8px 0; }
.reveal .prize {
  font-size: 30px; font-weight: 900; margin: 10px 0 4px; letter-spacing: 1px;
  background: linear-gradient(180deg, #ffe9a8, #ffb83d); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.reveal .sub { color: rgba(255,255,255,.8); font-size: 14px; }
.reveal .points { display: inline-block; margin-top: 14px; background: rgba(255,255,255,.14); padding: 8px 18px; border-radius: 999px; font-size: 13px; }
.reveal .btns { display: flex; gap: 10px; margin-top: 16px; }
.reveal .btns .btn-big { margin-top: 0; flex: 1; }
.reveal .btns .btn-ghost2 {
  flex: 1; padding: 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3);
}

/* 会员 */
.member-top { text-align: center; padding: 8px 0 4px; }
.member-top .avatar { font-size: 46px; }
.member-top .lvl { font-size: 20px; font-weight: 800; margin-top: 6px; }
.member-top .pts { color: var(--gold); font-size: 26px; font-weight: 900; margin-top: 4px; }
.member-top .pts small { font-size: 13px; color: rgba(255,255,255,.7); font-weight: 500; }
.member-bar { height: 10px; background: rgba(255,255,255,.15); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.member-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #ff8c42); border-radius: 999px; transition: width .6s; }
.rec { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.rec:last-child { border-bottom: none; }
.rec .r { color: rgba(255,255,255,.6); font-size: 12px; }
.rec .prize2 { font-weight: 700; }
.rec .plus { color: var(--gold); font-weight: 700; }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px;
  display: flex; background: rgba(24,20,34,.92); border-top: 1px solid rgba(255,255,255,.08); z-index: 50;
}
.tabbar a {
  flex: 1; text-align: center; padding: 10px 0 12px; color: rgba(255,255,255,.55); font-size: 11px;
}
.tabbar a.active { color: var(--gold); }
.tabbar a i { display: block; font-size: 20px; font-style: normal; margin-bottom: 2px; }
.h5-page { padding-bottom: 70px; }

.hide { display: none !important; }

/* ---------- 图表 ---------- */
.hbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.hbar-label { width: 84px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { flex: 1; height: 14px; background: #eef0f6; border-radius: 7px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--primary), #ff7a45); transition: width .5s; }
.hbar b { width: 46px; text-align: right; font-weight: 700; }
.chart2col { grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) { .chart2col { grid-template-columns: 1fr; } }

/* ---------- 订单 ---------- */
.ord-ok { color: var(--ok); font-weight: 700; }

/* ---------- 产品富内容编辑器 ---------- */
.ph-section { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ph-section:first-of-type { margin-top: 4px; }
.block-list { display: flex; flex-direction: column; gap: 8px; }
.block-row { display: flex; gap: 8px; align-items: flex-start; padding: 10px; background: #fafbff; border: 1px solid var(--line); border-radius: 10px; }
.block-row .type-pill { display: inline-block; min-width: 56px; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; text-align: center; color: #fff; background: var(--primary); }
.block-row .type-pill.t-h2 { background: #4f46e5; }
.block-row .type-pill.t-p { background: var(--primary); }
.block-row .type-pill.t-img { background: var(--ok); }
.block-row .type-pill.t-divider { background: #9ca3af; }
.block-row input, .block-row textarea { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; font-family: inherit; }
.block-row textarea { min-height: 60px; resize: vertical; }
.block-row .del-btn { background: #fff; border: 1px solid #f3c6c6; color: var(--danger); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }

/* ---------- H5 产品详情高端样式 ---------- */
.h5 .pro-hero { width: 100%; aspect-ratio: 1/1; max-height: 380px; background: #fff center/cover no-repeat; }
.h5 .pro-video { width: 100%; background: #000; }
.h5 .pro-video video { width: 100%; display: block; }
.h5 .pro-section { padding: 18px 18px 0; }
.h5 .pro-section h2 { font-size: 17px; font-weight: 800; color: #fff; margin-bottom: 8px; letter-spacing: 0.5px; }
.h5 .pro-section p { color: rgba(255,255,255,.88); font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.h5 .pro-section .img-block { width: 100%; border-radius: 10px; margin: 8px 0; display: block; }
.h5 .pro-section .img-cap { color: rgba(255,255,255,.5); font-size: 12px; text-align: center; margin-top: -4px; }
.h5 .pro-section .divider { height: 1px; background: rgba(255,255,255,.18); margin: 12px 0; }
.h5 .qc-card { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.h5 .qc-card .ic { font-size: 22px; }
.h5 .qc-card .info { flex: 1; min-width: 0; }
.h5 .qc-card .info .t1 { font-size: 14px; font-weight: 700; color: #fff; }
.h5 .qc-card .info .t2 { font-size: 11.5px; color: rgba(255,255,255,.6); margin-top: 2px; }
.h5 .qc-card .open { padding: 6px 12px; border-radius: 999px; background: linear-gradient(135deg,#f5b942,#ff8c42); color: #4a2410; font-size: 12px; font-weight: 700; text-decoration: none; }
.h5 .social-card { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.h5 .social-card .qr { width: 78px; height: 78px; border-radius: 10px; background: #fff center/cover no-repeat; flex-shrink: 0; }
.h5 .social-card .info { flex: 1; min-width: 0; }
.h5 .social-card .platform { font-size: 12px; color: var(--gold); font-weight: 700; letter-spacing: 1px; }
.h5 .social-card .handle { font-size: 14px; font-weight: 700; color: #fff; margin: 2px 0; }
.h5 .social-card .text { font-size: 12px; color: rgba(255,255,255,.65); line-height: 1.5; }
.h5 .pro-back { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.8); font-size: 13px; padding: 8px 12px; margin: 12px 0 0 18px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; }
