:root {
  --brand: #e2413a;
  --brand-dark: #a32d2d;
  --ink: #1f2329;
  --mut: #7a7f87;
  --bg: #f6f6f4;
  --card: #ffffff;
  --line: #e8e6e0;
  --ok: #1d9e75;
  --warn: #ba7517;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1080px; }
.btn {
  display: inline-block; border: 0; cursor: pointer; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 500;
  padding: 11px 22px; text-align: center; transition: filter .15s;
}
.btn:active { filter: brightness(.92); }
.btn.plain { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost { background: #f0efeb; color: var(--ink); }
.btn.sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn.blk { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
}
.tag {
  display: inline-block; font-size: 11px; border-radius: 6px; padding: 1px 7px;
  background: #fdecea; color: var(--brand); margin-left: 6px; vertical-align: 2px;
}
.tag.g { background: #e1f5ee; color: var(--ok); }
.tag.b { background: #e6f1fb; color: #185fa5; }
.mut { color: var(--mut); font-size: 13px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font-size: 15px; background: #fff; outline: none; margin-bottom: 10px;
}
input:focus { border-color: var(--brand); }
label.fl { display: block; font-size: 13px; color: var(--mut); margin: 8px 0 4px; }
.topbar {
  position: sticky; top: 0; z-index: 9; background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.topbar .in { max-width: 480px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.logo { font-weight: 700; font-size: 18px; color: var(--brand); letter-spacing: 1px; }
.logo small { color: var(--mut); font-weight: 400; font-size: 11px; margin-left: 4px; letter-spacing: 0; }
.tabs { display: flex; border-top: 1px solid var(--line); }
.tabs button {
  flex: 1; background: none; border: 0; padding: 10px 0; font-size: 13px;
  color: var(--mut); cursor: pointer; border-bottom: 2px solid transparent;
}
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(31,35,41,.92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; z-index: 99; max-width: 80vw; display: none;
}
.lv { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.hero {
  background: linear-gradient(160deg, #a32d2d, #e2413a 60%, #f0713f);
  color: #fff; padding: 34px 0 26px; text-align: center;
}
.hero h1 { font-size: 30px; letter-spacing: 2px; }
.hero .sub { opacity: .92; margin-top: 6px; font-size: 14px; }
.stats { display: flex; gap: 8px; margin-top: 18px; }
.stats div { flex: 1; background: rgba(255,255,255,.14); border-radius: 10px; padding: 10px 4px; }
.stats b { font-size: 18px; display: block; }
.stats span { font-size: 11px; opacity: .85; }
.sect { margin: 18px 0 10px; font-weight: 500; font-size: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.feat b { display: block; margin-bottom: 4px; font-size: 14px; }
.feat span { font-size: 12px; color: var(--mut); }
.prod { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.prod .l b { font-size: 15px; }
.prod .l .mut { margin-top: 2px; }
.prod .r { text-align: right; min-width: 96px; }
.price { color: var(--brand); font-weight: 700; font-size: 19px; }
.price small { font-size: 11px; font-weight: 400; color: var(--mut); }
.strike { text-decoration: line-through; color: #b9bcc0; font-size: 12px; margin-right: 6px; }
.offers { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.offers div { display: flex; justify-content: space-between; font-size: 12px; color: var(--mut); padding: 2px 0; }
.offers div.best { color: var(--ok); font-weight: 500; }
.rankrow { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rankrow .no { width: 26px; height: 26px; border-radius: 8px; background: #f0efeb; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--mut); flex: none; }
.rankrow:nth-child(1) .no { background: #fdecea; color: var(--brand); }
.rankrow:nth-child(2) .no { background: #faeeda; color: #854f0b; }
.rankrow:nth-child(3) .no { background: #faf3e0; color: #a3812d; }
.rankrow .nm { flex: 1; }
.rankrow .od { color: var(--mut); font-size: 13px; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.tb th { color: var(--mut); font-weight: 400; }
.adminwrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kpi b { font-size: 22px; display: block; }
.kpi span { font-size: 12px; color: var(--mut); }
.adminnav { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.adminnav button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 16px; cursor: pointer; font-size: 14px; }
.adminnav button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal.on { display: flex; }
.modal .box { background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 420px; max-height: 86vh; overflow: auto; }
.modal .box h3 { margin-bottom: 12px; font-size: 16px; }
.balance { font-size: 30px; font-weight: 700; color: var(--brand); }
.fbar { display: flex; gap: 8px; }
.fbar input { margin-bottom: 0; }
.pill { display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; }
.pill.s0 { background:#faeeda; color:#854f0b; } .pill.s1 { background:#e1f5ee; color:#0f6e56; }
.pill.s2 { background:#fdecea; color:#a32d2d; }
.notice { background: #fff8e8; border: 1px solid #f2ddb0; color: #6b4e0d; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
