:root, [data-theme="dark"] {
  --bg: #151c2e; --bg-2: #1c2438; --surface: #232c44; --surface-2: #2a3550; --line: #2a3656;
  --text: #e8edfa; --muted: #92a0c4; --faint: #5e6b8c;
  --amber: #f4b740; --amber-ink: #3a2c07; --price: #f4b740;
  --green: #3fd29a; --blue: #5b9dff; --red: #ff6b6b; --violet: #8b7cf6;
  --radius: 14px; --shadow: 0 10px 30px rgba(0,0,0,.35);
  --amber-soft: rgba(244,183,64,.13); --amber-ring: rgba(244,183,64,.30);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f5ed; --bg-2: #ffffff; --surface: #ffffff; --surface-2: #eef2f9; --line: #d7deea;
  --text: #16203a; --muted: #566388; --faint: #8c97b3;
  --amber: #cf8a00; --amber-ink: #ffffff; --price: #d99500;
  --green: #12895a; --blue: #2563eb; --red: #d64545; --violet: #6d28d9;
  --shadow: 0 8px 26px rgba(22,32,58,.10);
  --amber-soft: rgba(207,138,0,.12); --amber-ring: rgba(207,138,0,.26);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.hidden { display: none !important; }

/* ---------- header ---------- */
header.top { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
header.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 66px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--amber); color: var(--amber-ink); display: grid; place-items: center; font-size: 18px; font-weight: 900; }
.brand .b2 { color: var(--amber); }
nav.main { display: flex; gap: 4px; }
nav.main a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; position: relative; }
nav.main a:hover { color: var(--text); }
nav.main a.active { color: var(--text); background: var(--surface); }
nav.main a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -2px; height: 2px; background: var(--amber); border-radius: 2px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--faint); }
.btn.icon { width: 38px; padding: 0; font-size: 16px; }
.btn.amber { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.btn.amber:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; height: 44px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.bal-chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--amber-soft); border: 1px solid var(--amber-ring); color: var(--price); font-weight: 700; }
.user-menu { position: relative; }
.dropdown { position: absolute; right: 0; top: 46px; min-width: 200px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60; }
.dropdown.show { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface); }
.dropdown .em { padding: 8px 12px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }

/* ---------- home blocks ---------- */
main { padding: 22px 0 80px; }
.announce { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 22px; }
.announce b { color: var(--text); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.step { display: flex; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.step .n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--amber); color: var(--amber-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.step h4 { margin: 0 0 3px; font-size: 14.5px; }
.step p { margin: 0; color: var(--muted); font-size: 12.5px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.pill { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 500; font-size: 12.5px; cursor: pointer; text-transform: uppercase; letter-spacing: .01em; }
.pill:hover { color: var(--text); }
.pill.active { background: rgba(139,124,246,.16); color: #c9c0ff; border-color: var(--violet); }
[data-theme="light"] .pill.active { background: #5c4621; color: #fff; border-color: #5c4621; }

.cat-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; flex-wrap: wrap; }
.cat-head h2 { margin: 0; font-size: 19px; padding-left: 12px; border-left: 4px solid var(--amber); text-transform: uppercase; letter-spacing: .01em; }
.cat-head .count { font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-soft); padding: 3px 10px; border-radius: 999px; }
.cat-head .tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.input, select.input, textarea.input { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); outline: none; min-width: 0; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.search { position: relative; }
.search .input { padding-left: 32px; width: 200px; }
.search::before { content: "⌕"; position: absolute; left: 11px; top: 8px; color: var(--faint); font-size: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; user-select: none; }

/* ---------- product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; transition: .15s; }
.card:hover { border-color: var(--faint); transform: translateY(-1px); }
.card .head { display: flex; gap: 12px; align-items: flex-start; }
.ico { flex: 0 0 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; }
.card .title { flex: 1; font-weight: 600; font-size: 14px; line-height: 1.35; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 57px; }
.card .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.tag.instant { color: var(--green); background: rgba(63,210,154,.12); }
.tag.later { color: var(--blue); background: rgba(91,157,255,.12); }
.card .meta { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; }
.lbl { font-size: 10.5px; font-weight: 600; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.stock { font-weight: 600; font-size: 13px; color: var(--green); display: flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock.out { color: var(--red); }
.price { font-size: 21px; font-weight: 800; color: var(--price); letter-spacing: -.02em; text-align: right; }
.card .acts { display: flex; gap: 8px; }
.card .acts .btn.amber { flex: 1; }
.card.out { opacity: .62; }
.card.out .btn.amber { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- services ---------- */
.svc-layout { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .ph { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.panel .pb { padding: 16px; }
.sticky { position: sticky; top: 84px; }
.svc-list { display: flex; flex-direction: column; }
.svc { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.svc:last-child { border-bottom: 0; }
.svc:hover { background: var(--surface-2); }
.svc.sel { background: var(--amber-soft); box-shadow: inset 3px 0 0 var(--amber); }
.svc .sid { font-size: 12px; color: var(--faint); font-weight: 600; }
.svc .sn { font-weight: 600; }
.svc .sm { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.svc .sr { text-align: right; }
.svc .sr b { color: var(--price); font-size: 16px; }
.svc .sr small { display: block; color: var(--faint); font-size: 11px; }
.svc-group { padding: 10px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 12.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--faint); }
.field .input { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.total { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin: 6px 0 14px; }
.total b { font-size: 22px; color: var(--price); }
.err { color: var(--red); font-size: 13px; margin: -4px 0 10px; min-height: 0; }
.ok { color: var(--green); }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5,8,18,.6); backdrop-filter: blur(6px); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 30px 16px; overflow-y: auto; }
.overlay.show { display: flex; }
.modal { width: 100%; max-width: 440px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.modal.wide { max-width: 560px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal .mh { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { margin: 0; font-size: 16px; flex: 1; }
.modal .mb { padding: 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.seg button { height: 34px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--amber); color: var(--amber-ink); }
.cart-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: var(--surface); }
.cart-box .ttl { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .08em; margin-bottom: 10px; }
.cart-line { display: flex; align-items: center; gap: 12px; }
.cart-line .nm { flex: 1; min-width: 0; }
.cart-line .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line .nm small { color: var(--muted); }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.qty button { width: 30px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 16px; }
.qty input { width: 54px; height: 32px; border: 0; background: var(--surface-2); text-align: center; outline: none; border-radius: 6px; }
.cart-line .lp { font-weight: 800; color: var(--price); min-width: 64px; text-align: right; }
.pay-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pay-opt { border: 1px solid var(--line); background: var(--surface); padding: 11px 12px; border-radius: 12px; cursor: pointer; text-align: left; }
.pay-opt b { display: block; font-size: 13.5px; }
.pay-opt small { color: var(--muted); }
.pay-opt.on { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); word-break: break-all; display: flex; gap: 8px; align-items: center; }
.addr span { flex: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
.st { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.st.Completed { color: var(--green); background: rgba(63,210,154,.12); }
.st.Pending, .st.Processing, .st.pending { color: var(--amber); background: var(--amber-soft); }
.st.In-progress { color: var(--blue); background: rgba(91,157,255,.12); }
.st.Partial { color: var(--violet); background: rgba(139,124,246,.14); }
.st.Canceled, .st.Failed, .st.rejected { color: var(--red); background: rgba(255,107,107,.12); }
.st.Review { color: var(--red); background: rgba(255,107,107,.12); }
.st.approved { color: var(--green); background: rgba(63,210,154,.12); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.ellip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; }
.result-box { white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 300px; overflow: auto; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.page-title h1 { font-size: 22px; margin: 0; }
pre.code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; font-size: 12.5px; margin: 8px 0 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv > div { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.kv > div:nth-child(odd) { background: var(--bg-2); color: var(--muted); font-weight: 600; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }

/* ---------- toast & support ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--bg-2); border: 1px solid var(--line); padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transition: .2s; z-index: 200; pointer-events: none; font-weight: 500; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { border-color: var(--red); color: var(--red); }
.support { position: fixed; right: 20px; bottom: 20px; z-index: 40; height: 46px; padding: 0 20px; border-radius: 999px; background: var(--amber); color: var(--amber-ink); font-weight: 700; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow); }
footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--faint); font-size: 12.5px; }
footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .svc-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 720px) {
  header.top .wrap { gap: 10px; }
  nav.main { order: 3; width: 100%; overflow-x: auto; }
  .top-actions { gap: 6px; }
  .top-actions .hide-sm { display: none; }
  .steps { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .cat-head .tools { margin-left: 0; width: 100%; }
  .search .input { width: 100%; }
  .search { flex: 1; }
  .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .support span { display: none; }
  .support { padding: 0 15px; }
}

/* payment spinner */
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--amber); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buy-USDT guide */
.buy-guide{display:flex;align-items:center;gap:12px;width:100%;margin-top:14px;padding:12px 14px;border-radius:12px;border:1px dashed var(--line);background:var(--bg-2);color:var(--text);cursor:pointer;font:inherit}
.buy-guide:hover{border-color:var(--amber)}
.buy-guide b{display:block;font-size:14px}
.buy-guide small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.guide-steps{list-style:none;counter-reset:g;margin:0;padding:0;display:grid;gap:12px}
.guide-steps li{counter-increment:g;display:grid;grid-template-columns:28px 1fr;column-gap:12px;row-gap:3px;align-items:start}
.guide-steps li::before{content:counter(g);grid-row:span 2;width:28px;height:28px;border-radius:50%;background:var(--amber);color:#1a1300;font-weight:800;display:grid;place-items:center;font-size:13px}
.guide-steps li b{font-size:14px}
.guide-steps li span{color:var(--muted);font-size:13px;line-height:1.6}

/* Google sign-in */
.google-btn{display:flex;align-items:center;justify-content:center;gap:10px;background:#fff;color:#1f1f1f;border:1px solid #dadce0;font-weight:600;text-decoration:none}
.google-btn:hover{background:#f7f8f8;color:#1f1f1f}
.or-line{display:flex;align-items:center;gap:10px;color:var(--faint);font-size:12px;margin:14px 0}
.or-line::before,.or-line::after{content:"";flex:1;height:1px;background:var(--line)}
