/* DAT 终端商城 — LootBar 风格(橙黑游戏充值电商) · 原创自托管 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0c0d11; --bg2: #13141b; --card: #191b24; --card2: #21242f;
  --line: #2a2d39; --txt: #f2f3f7; --sub: #9298ad; --mut: #646a82;
  --acc: #ff7a18; --acc2: #ff9d45; --acc-d: #ff5e2e;
  --grad: linear-gradient(135deg, #ff8a2b, #ff5e2e);
  --ok: #2ecc71; --warn: #f39c12; --err: #e74c3c;
}
body { font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--txt); line-height: 1.55; min-height: 100vh;
  -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; }
input, select { font: inherit; }
.hidden { display: none !important; }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

/* ===== 顶部导航 ===== */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(12,13,17,.9);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav-in { max-width: 1280px; margin: 0 auto; padding: 0 22px; height: 66px;
  display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.32rem; font-weight: 900;
  letter-spacing: -.5px; flex-shrink: 0; }
.logo .dot { width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; font-size: 1.1rem; box-shadow: 0 4px 14px rgba(255,94,46,.4); }
.logo span:last-child { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.search { flex: 1; max-width: 440px; position: relative; }
.search::before { content: "🔍"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: .82rem; opacity: .5; }
.search input { width: 100%; height: 42px; border-radius: 21px; background: var(--card);
  border: 1px solid var(--line); color: var(--txt); padding: 0 16px 0 38px; outline: none; transition: .15s; }
.search input:focus { border-color: var(--acc); background: var(--bg2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sel { height: 38px; background: var(--card); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 0 8px; outline: none; cursor: pointer; }
.sel:hover { border-color: var(--acc); }
.btn { height: 38px; padding: 0 16px; border-radius: 10px; background: var(--card2);
  color: var(--txt); border: 1px solid var(--line); font-weight: 600; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--acc); color: var(--acc2); }
.btn-p { background: var(--grad); border: none; color: #fff; box-shadow: 0 4px 14px rgba(255,94,46,.35); }
.btn-p:hover { filter: brightness(1.08); color: #fff; }
.wallet { display: flex; align-items: center; gap: 5px; font-size: .88rem; color: var(--sub);
  background: var(--card); border: 1px solid var(--line); height: 38px; padding: 0 13px; border-radius: 10px; cursor: pointer; }
.wallet:hover { border-color: var(--acc); }
.wallet b { color: var(--acc2); font-size: .95rem; }

/* ===== 分类条 ===== */
.cats { background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 66px; z-index: 40; }
.cats-in { max-width: 1280px; margin: 0 auto; padding: 0 22px; display: flex; gap: 6px;
  overflow-x: auto; height: 52px; align-items: center; scrollbar-width: none; }
.cats-in::-webkit-scrollbar { display: none; }
.ctab { height: 34px; padding: 0 16px; border-radius: 18px; background: transparent; color: var(--sub);
  font-weight: 600; font-size: .9rem; white-space: nowrap; display: flex; align-items: center; gap: 6px;
  border: 1px solid transparent; transition: .15s; }
.ctab:hover { color: var(--txt); background: var(--card); }
.ctab.on { background: var(--grad); color: #fff; box-shadow: 0 3px 10px rgba(255,94,46,.3); }

/* ===== 主区 ===== */
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 22px 70px; }

/* Hero */
.hero { border-radius: 20px; padding: 44px 40px; margin-bottom: 30px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #1c1408 0%, #241405 40%, #14151d 100%);
  border: 1px solid #3a2a14; }
.hero::before { content: ""; position: absolute; right: -60px; top: -80px; width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(255,122,24,.35), transparent 65%); }
.hero::after { content: ""; position: absolute; right: 80px; bottom: -120px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(255,94,46,.22), transparent 65%); }
.hero .tag { display: inline-block; background: rgba(255,122,24,.15); color: var(--acc2);
  font-size: .76rem; font-weight: 700; padding: 5px 12px; border-radius: 20px; margin-bottom: 14px;
  border: 1px solid rgba(255,122,24,.3); }
.hero h1 { font-size: 2.3rem; font-weight: 900; margin-bottom: 10px; letter-spacing: -1px; position: relative; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--sub); font-size: 1.02rem; position: relative; max-width: 520px; }

/* 区块标题 */
.sec-title { font-size: 1.22rem; font-weight: 800; margin: 30px 0 18px; display: flex;
  align-items: center; gap: 10px; }
.sec-title::before { content: ""; width: 5px; height: 22px; background: var(--grad); border-radius: 3px; }
.sec-title .fire { color: var(--acc); }

/* ===== 游戏海报卡片网格 ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 13px; }
.gcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  cursor: pointer; transition: .2s; display: flex; flex-direction: column; }
.gcard:hover { transform: translateY(-5px); border-color: var(--acc);
  box-shadow: 0 14px 32px rgba(255,94,46,.22); }
.poster { aspect-ratio: 4 / 5; position: relative; display: grid; place-items: center; overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .ic { font-size: 2rem; font-weight: 900; color: rgba(255,255,255,.92);
  text-shadow: 0 4px 18px rgba(0,0,0,.4); letter-spacing: -1px; }
.poster .glow { position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 55%); }
.poster .badge { position: absolute; top: 10px; left: 10px; background: var(--grad); color: #fff;
  font-size: .66rem; font-weight: 800; padding: 3px 9px; border-radius: 8px; letter-spacing: .5px;
  box-shadow: 0 3px 10px rgba(255,94,46,.4); }
.poster .badge.rec { background: linear-gradient(135deg,#3aa0ff,#5b6bff); box-shadow: 0 3px 10px rgba(91,107,255,.4); }
.ginfo { padding: 9px 10px 11px; flex: 1; display: flex; flex-direction: column; }
.gname { font-weight: 700; font-size: .82rem; line-height: 1.3; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.gmeta { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; }
.gprice { color: var(--acc2); font-weight: 900; font-size: .95rem; }
.gprice .from { color: var(--mut); font-size: .72rem; font-weight: 500; margin-left: 2px; }
.gtype { font-size: .68rem; color: var(--mut); background: var(--card2); padding: 2px 7px; border-radius: 6px; }
.empty { text-align: center; color: var(--mut); padding: 70px 0; }

/* ===== 模态 ===== */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100;
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal { background: var(--bg2); border: 1px solid var(--line); border-radius: 20px;
  width: 100%; max-width: 430px; padding: 28px; max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 1.3rem; margin-bottom: 18px; font-weight: 800; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; color: var(--sub); margin-bottom: 6px; }
.field input { width: 100%; height: 44px; border-radius: 11px; background: var(--card);
  border: 1px solid var(--line); color: var(--txt); padding: 0 14px; outline: none; transition: .15s; }
.field input:focus { border-color: var(--acc); }
.modal-act { display: flex; gap: 10px; margin-top: 22px; }
.modal-act .btn { flex: 1; height: 46px; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tabs .tab { flex: 1; height: 40px; border-radius: 11px; background: var(--card);
  color: var(--sub); font-weight: 700; transition: .15s; }
.tabs .tab.on { background: var(--grad); color: #fff; }
.row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.row:last-child { border: none; }
.row .v { color: var(--acc2); font-weight: 800; }

/* ===== 订单 ===== */
.olist .oitem { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 17px; margin-bottom: 11px; display: flex; justify-content: space-between; align-items: center; transition: .15s; }
.olist .oitem:hover { border-color: var(--acc); }
.tag { font-size: .72rem; padding: 3px 11px; border-radius: 8px; font-weight: 700; }
.t1 { background: #2a2d44; color: var(--sub); } .t2 { background: #2a2440; color: #b09bff; }
.t3 { background: #2a3a44; color: #3ea6c9; } .t4 { background: #1e3a2a; color: var(--ok); }
.t5 { background: #3a2020; color: var(--err); } .t6 { background: #3a3020; color: var(--warn); }

/* ===== 提示 ===== */
.toast { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 10000;
  background: var(--card2); border: 1px solid var(--acc); color: var(--txt); padding: 12px 24px;
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-weight: 600; }

/* ===== 页脚 ===== */
.foot { border-top: 1px solid var(--line); margin-top: 50px; padding: 34px 22px;
  text-align: center; color: var(--mut); font-size: .85rem; }
.foot .svc { margin-bottom: 8px; color: var(--sub); }

/* ===== 响应式 ===== */
@media (max-width: 760px) {
  /* 顶栏改自适应换行:操作按钮多时折到第二行,消除横向溢出 */
  .nav-in { gap: 8px; padding: 8px 12px; height: auto; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; display: none; }
  .logo { font-size: 1.15rem; } .logo .dot { width: 30px; height: 30px; }
  .nav-right { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .sel { padding: 0 5px; font-size: .82rem; height: 34px; } .btn { padding: 0 10px; font-size: .85rem; height: 34px; }
  .wallet { padding: 0 9px; }
  .cats { top: 0; } .cats-in { padding: 0 14px; height: 48px; }
  .wrap { padding: 18px 14px 60px; }
  .hero { padding: 30px 22px; border-radius: 16px; } .hero h1 { font-size: 1.55rem; }
  .hero p { font-size: .9rem; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .poster .ic { font-size: 2.1rem; }
}
@media (max-width: 380px) { .grid { gap: 10px; } .gname { font-size: .85rem; } }

/* ===== 亮色主题 ===== */
body.light { --bg: #f4f5fa; --bg2: #ffffff; --card: #ffffff; --card2: #eef0f6;
  --line: #e4e7ef; --txt: #1b1e2a; --sub: #5b6275; --mut: #9aa0b4; }
body.light .nav { background: rgba(255,255,255,.92); }
body.light .cats { background: #ffffff; }
body.light .hero { background: linear-gradient(120deg,#fff6ea,#ffe9d6 45%,#f4f5fa); border-color: #ffd9b3; }
body.light .hero p { color: #8a755c; }
body.light .toast { box-shadow: 0 10px 30px rgba(0,0,0,.12); }
body.light .search input, body.light .dt-inp, body.light .dt-face, body.light .dt-qty input { background: #f7f8fc; }

/* ===== 通用弹窗(主题感知) ===== */
.oem-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 9999; padding: 16px; }
.oem-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; max-height: 90vh; overflow-y: auto;
  max-width: 440px; width: 100%; color: var(--txt); max-height: 85vh; overflow: auto; }
.oem-box h3 { margin: 0 0 14px; font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; }
.oem-box .x { cursor: pointer; color: var(--mut); font-size: 22px; line-height: 1; }
.oem-lrow { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.oem-cardk { margin-top: 14px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }

/* ===== 商品详情页 ===== */
.dt-back { background: var(--card); border: 1px solid var(--line); color: var(--txt); height: 38px;
  padding: 0 16px; border-radius: 10px; font-weight: 600; margin-bottom: 18px; }
.dt-back:hover { border-color: var(--acc); color: var(--acc2); }
.dt-head { display: flex; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; margin-bottom: 20px; }
.dt-cover { width: 96px; height: 120px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center;
  overflow: hidden; box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.dt-cover img { width: 100%; height: 100%; object-fit: cover; }
.dt-cover span { font-size: 2.6rem; font-weight: 900; color: #fff; text-shadow: 0 3px 12px rgba(0,0,0,.4); }
.dt-htext h2 { font-size: 1.6rem; font-weight: 900; margin-bottom: 10px; }
.dt-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-tags span { font-size: .76rem; color: var(--acc2); background: rgba(255,122,24,.12);
  border: 1px solid rgba(255,122,24,.25); padding: 4px 10px; border-radius: 8px; }
.dt-body { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.dt-main { display: flex; flex-direction: column; gap: 20px; }
.dt-block { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.dt-step { font-weight: 800; font-size: 1.02rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.dt-step b { width: 24px; height: 24px; border-radius: 7px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: .85rem; }
.dt-faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.dt-face { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer;
  transition: .15s; background: var(--bg2); }
.dt-face:hover { border-color: var(--acc); }
.dt-face.on { border-color: var(--acc); background: rgba(255,122,24,.08); box-shadow: 0 4px 14px rgba(255,94,46,.2); }
.dt-face-name { font-weight: 600; font-size: .9rem; margin-bottom: 8px; min-height: 2.4em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dt-face-price { color: var(--acc2); font-weight: 800; font-size: 1.05rem; }
.dt-inp { width: 100%; height: 46px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line);
  color: var(--txt); padding: 0 14px; outline: none; margin-bottom: 10px; }
.dt-inp:focus { border-color: var(--acc); }
.dt-qty { display: flex; align-items: center; width: fit-content; border: 1px solid var(--line);
  border-radius: 11px; overflow: hidden; }
.dt-qty button { width: 44px; height: 44px; background: var(--card2); color: var(--txt); font-size: 1.2rem; }
.dt-qty button:hover { color: var(--acc2); }
.dt-qty input { width: 64px; height: 44px; text-align: center; background: var(--bg2); border: none;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line); color: var(--txt); outline: none; }
.dt-side { position: sticky; top: 132px; }
.dt-summary { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.dt-summary h3 { font-size: 1.05rem; margin-bottom: 14px; }
.dt-srow { display: flex; justify-content: space-between; padding: 8px 0; color: var(--sub); font-size: .9rem; }
.dt-srow span:last-child { color: var(--txt); font-weight: 600; text-align: right; max-width: 60%; }
.dt-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 6px;
  border-top: 1px solid var(--line); margin-top: 6px; }
.dt-totalv { color: var(--acc2); font-weight: 900; font-size: 1.5rem; }
.dt-buy { width: 100%; height: 50px; background: var(--grad); color: #fff; border-radius: 12px;
  font-weight: 800; font-size: 1.05rem; margin-top: 14px; box-shadow: 0 6px 18px rgba(255,94,46,.35); }
.dt-buy:hover { filter: brightness(1.08); }
.dt-note { text-align: center; color: var(--mut); font-size: .78rem; margin-top: 10px; }
@media (max-width: 760px) {
  .dt-body { grid-template-columns: 1fr; } .dt-side { position: static; }
  .dt-faces { grid-template-columns: repeat(2, 1fr); }
  .dt-head { padding: 16px; } .dt-cover { width: 72px; height: 90px; } .dt-htext h2 { font-size: 1.25rem; }
}

/* 详情页商品说明(富文本渲染) */
.dt-desc { color: var(--sub); line-height: 1.75; font-size: .92rem; word-break: break-word; }
.dt-desc img { max-width: 100%; border-radius: 10px; margin: 8px 0; }
.dt-desc h3 { color: var(--txt); margin: 12px 0 6px; font-size: 1.05rem; }
.dt-desc ul, .dt-desc ol { padding-left: 22px; margin: 8px 0; }
.dt-desc hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.dt-desc a { color: var(--acc2); }
.dt-desc b, .dt-desc strong { color: var(--txt); }

/* ===== 账户中心表格(订单/资金流水:表头 + 行 + 统计行) ===== */
.acct-tbl { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.acct-tbl th { text-align: left; padding: 11px 13px; color: var(--mut); font-size: .78rem; font-weight: 600;
  border-bottom: 1px solid var(--line); background: rgba(127,127,127,.06); white-space: nowrap; }
.acct-tbl td { padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.acct-tbl tbody tr:hover td { background: rgba(127,127,127,.05); }
.acct-tbl tfoot td { border-bottom: none; font-weight: 700; background: rgba(127,127,127,.06); }
.acct-tblwrap { overflow-x: auto; border-radius: 12px; }
.acct-pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 2px;
  color: var(--mut); font-size: .85rem; flex-wrap: wrap; }
.acct-pager .btn[disabled] { opacity: .4; cursor: not-allowed; }

@media (max-width: 760px) {
  .acct-tbl { min-width: 560px; font-size: .82rem; }
  .acct-tbl th, .acct-tbl td { padding: 8px 9px; }
  #acctCard { padding: 14px 16px; gap: 12px; }
}

/* 手机端就近购买键(数量选择下方):桌面隐藏(右侧摘要已有),商品说明长时不必拉到底 */
.dt-buy-m { display: none; }
@media (max-width: 760px) {
  .dt-buy-m { display: block; width: 100%; margin-top: 14px; }
}

/* 顶部用户名下拉(重置密码/安全设置/退出) */
.userdd { position: relative; }
.userdd .caret { font-size: .7rem; opacity: .7; margin-left: 2px; }
.userdd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; z-index: 60;
  background: var(--card2, #1b1f2a); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); overflow: hidden; }
.userdd-menu a { display: block; padding: 11px 14px; font-size: .9rem; color: inherit;
  cursor: pointer; white-space: nowrap; }
.userdd-menu a:hover { background: rgba(255,255,255,.07); color: var(--acc2); }
.userdd-menu a + a { border-top: 1px solid var(--line); }
@media (max-width: 600px) { .userdd-menu { min-width: 132px; } }
