/* ============================================
   LAA GAME STORE — 商品购买页
   2+2+1 布局：上排 50/50，下排 62/38，底部全宽
   ============================================ */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #0b0b0d;
  --text-2: #1a1d23;
  --text-3: #777983;
  --border: #e8e8ed;
  --brand: #111827;
  --brand-hover: color-mix(in srgb, var(--brand) 82%, black);
  --brand-soft: #f8fafc;
  --brand-border: var(--brand);
  --red: #e24b4a;
  --green: #1d9e75;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== 导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav__inner { max-width: 1320px; margin: 0 auto; padding: 0 28px; height: 64px; display: flex; align-items: center; gap: 24px; }
.nav__logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav__logo-img { display: block; width: 72px; height: 23px; object-fit: contain; flex-shrink: 0; }
.nav__logo-zh { font-size: 13px; font-weight: 600; color: var(--text); }
.nav__logo-text { font-size: 10.5px; font-weight: 500; color: var(--text-3); letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; }
.nav__search { flex: 1; max-width: 360px; position: relative; }
.nav__search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.nav__search-input { width: 100%; height: 40px; border: 1px solid var(--border); background: #f5f6f8; border-radius: 12px; padding: 0 14px 0 38px; font-size: 13px; color: var(--text); outline: none; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.nav__search-input:focus { background: #fff; border-color: var(--brand-border); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.nav__search-input::placeholder { color: var(--text-3); }
.nav__links { display: flex; gap: 2px; }
.nav__link { padding: 8px 12px; font-size: 13.5px; color: var(--text-2); border-radius: 8px; transition: background-color .2s, color .2s; white-space: nowrap; }
.nav__link:hover { color: var(--text); background: rgba(0,0,0,.04); }
.nav__link--active { color: var(--text); font-weight: 600; }
.nav__right { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }
.nav__currency { font-size: 12px; color: var(--text-2); padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.nav__auth-btn { font-size: 13px; color: #fff; background: var(--brand); padding: 8px 18px; border-radius: 980px; font-weight: 500; transition: background .2s; }
.nav__auth-btn:hover { background: var(--brand-hover); }

/* ===== 面包屑 ===== */
.breadcrumb { background: #fff; border-bottom: 1px solid var(--border); }
.breadcrumb__inner { max-width: 1320px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.breadcrumb__inner a { color: var(--text-3); }
.breadcrumb__inner a:hover { color: var(--brand); }
.breadcrumb__sep { color: var(--border); user-select: none; }
.breadcrumb__inner strong { color: var(--text); font-weight: 600; }

/* ===== 购买主体 ===== */
.purchase { padding: 28px 0 64px; background: var(--bg); }

/* 上排：游戏介绍 + 留空 */
.purchase__row--top {
  max-width: 1320px; margin: 0 auto 24px; padding: 0 28px;
  display: grid; grid-template-columns: 1fr;
}
.purchase__game { padding-right: 0; }

/* 下排：面额选择 + 填写信息下单 */
.purchase__row--main {
  max-width: 1320px; margin: 0 auto 0; padding: 0 28px;
  display: grid; grid-template-columns: minmax(0, 13fr) minmax(320px, 7fr); gap: 28px; align-items: start;
}
.purchase__denom {
  position: sticky; top: 80px; min-width: 0;
}
.purchase__form {
  position: sticky; top: 80px; min-width: 0;
}

/* 底部全宽 */
.purchase__bottom {
  max-width: 1320px; margin: 40px auto 0; padding: 0 28px;
}

/* ===== 游戏品牌 ===== */
.game-brand {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 34px 36px; display: flex; gap: 28px; align-items: center;
  box-shadow: var(--shadow-sm);
}
.game-brand__logo {
  width: 132px; height: 132px; border-radius: 16px;
  overflow: hidden; flex-shrink: 0;
}
.game-brand__logo-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.game-brand__info { display: flex; flex-direction: column; gap: 8px; }
.game-brand__flag { font-size: 13.5px; color: var(--text-3); }
.game-brand__name { font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--text); }
.game-brand__tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.game-brand__tags[hidden] { display: none; }
.game-brand__tag {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); padding: 4px 12px; border-radius: 8px;
}

/* ===== Tab 切换（底部全宽） ===== */
.info-tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 4px; margin-bottom: 16px; }
.info-tab { flex: 1; border: 0; background: transparent; color: var(--text-3); font-size: 13px; font-weight: 500; padding: 10px 0; border-radius: 12px; transition: background-color .2s, box-shadow .2s, color .2s; }
.info-tab:hover { color: var(--text); }
.info-tab--active { background: var(--text); color: #fff; font-weight: 600; }
.info-panels { background: #fff; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 24px; }
.info-panel { display: none; padding: 24px; }
.info-panel--active { display: block; }
.info-panel p { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.info-panel h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; color: var(--text); }

.info-steps { display: flex; flex-direction: column; gap: 10px; padding-left: 20px; font-size: 13.5px; color: var(--text-2); }
.info-steps li::marker { color: var(--brand); font-weight: 600; }
.info-faq { display: flex; flex-direction: column; gap: 14px; }
.info-faq dt { font-size: 13.5px; font-weight: 600; color: var(--text); }
.info-faq dd { font-size: 13px; color: var(--text-2); margin-left: 0; line-height: 1.6; }
code { background: #f2f4f7; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--brand); }

/* 推荐商品（底部全宽） */
.related-products { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px 24px; }
.related-products__title { font-size: 14.5px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.related-products__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.related-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; transition: background-color .2s, border-color .2s, transform .2s; }
.related-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.related-item__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--text); color: #fff; font-size: 14px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.related-item__name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.related-item__arrow { color: var(--text-3); font-size: 14px; }

/* ===== 面额区 ===== */
.purchase-section__title--standalone {
  font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 14px;
  padding-left: 12px; border-left: 4px solid var(--brand);
}

/* 面额卡片 3 列网格 */
.denom-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.denom-card {
  --theme-color: var(--product-theme);
  --theme-light: var(--product-theme-light);
  --theme-border: var(--product-theme-border);
  position: relative;
  display: flex; align-items: center; flex-direction: column; gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 238px;
  padding: 24px 20px 22px;
  cursor: pointer;
  width: 100%; min-width: 0; appearance: none; font-family: inherit; text-align: left;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.denom-card:hover { border-color: var(--theme-border); background: var(--theme-light); }
.denom-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--theme-color) 22%, transparent); outline-offset: 2px; }

.denom-card__icon {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--theme-light); color: var(--theme-color); font-size: 10px; font-weight: 800; letter-spacing: .5px;
  display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
}
.denom-card__icon-img {
  width: 56px; height: 56px; object-fit: contain; display: block;
}
.denom-card__body { width: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.denom-card__value { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.2; }
.denom-card__divider { width: 100%; height: 1px; background: #e5e7eb; }
.denom-card__prices { margin-top: auto; display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.denom-card__current { font-size: 24px; font-weight: 700; color: var(--theme-color); line-height: 1.15; }
.denom-card__original { font-size: 12.5px; color: var(--text-3); text-decoration: line-through; }

/* 选中态 */
.denom-card--active { border: 2px solid var(--theme-border); background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.denom-card--active .denom-card__current { color: var(--theme-color); }

.denom-card__check {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--theme-color); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  opacity: 0; transition: opacity .15s;
}
.denom-card--active .denom-card__check { opacity: 1; }
.denom-card__stock {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  padding: 5px 8px; border-radius: 999px;
  color: #fff; background: #626975; font-size: 11px; font-weight: 700; line-height: 1;
}
.denom-card--sold-out,
.denom-card--sold-out:hover {
  cursor: not-allowed; border-color: #e3e5e8; background: #f5f6f7; box-shadow: none; opacity: .72;
}
.denom-card--sold-out .denom-card__icon { filter: grayscale(1); }
.denom-card--sold-out .denom-card__current { color: #737983; }

/* ===== 右侧填写区 ===== */
.purchase-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-md);
}
.purchase-section__title {
  font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 14px;
  padding-left: 12px; border-left: 4px solid var(--brand);
}
.purchase-section { margin-bottom: 0; }

.purchase-field { margin-bottom: 12px; }
.purchase-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.purchase-input {
  width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 12px;
  padding: 0 14px; font-size: 14px; color: var(--text); outline: none; background: #fafbfc;
  transition: border-color .2s, box-shadow .2s;
}
.purchase-input:focus { border-color: var(--brand-border); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); background: #fff; }
.purchase-input--invalid { border-color: var(--red); background: #fffafa; box-shadow: 0 0 0 3px rgba(226,75,74,.1); }
.purchase-input::placeholder { color: var(--text-3); }
.purchase-hint { display: block; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.purchase-memory { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; color: var(--text-3); font-size: 12px; }
.purchase-memory button { appearance: none; border: 0; padding: 0; color: var(--brand); background: transparent; font: inherit; font-weight: 700; cursor: pointer; }
.purchase-memory button:focus-visible { outline: 2px solid var(--brand-border); outline-offset: 2px; border-radius: 4px; }
.btn-secondary--saved { border-color: color-mix(in srgb, var(--brand) 48%, #fff); background: var(--brand-soft); color: var(--brand-hover); }
.btn-secondary--saved svg { fill: currentColor; }

/* 订单摘要 */
.order-summary {
  background: #f8f9fb; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.order-summary__row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.order-summary__row span { color: var(--text-3); }
.order-summary__row strong { font-weight: 600; color: var(--text); }
.order-summary__divider { height: 1px; background: var(--border); margin: 2px 0; }
.order-summary__row--total strong { font-size: 24px; font-weight: 800; color: var(--red); letter-spacing: -0.5px; }

/* 购买按钮 */
.btn-submit {
  width: 100%; height: 50px; border: 0; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
  letter-spacing: 0; cursor: pointer; transition: background .2s, box-shadow .2s, transform .2s;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 24%, transparent);
}
.btn-submit:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 22%, transparent); outline-offset: 2px; }
.btn-submit:active { transform: translateY(0); }
.purchase-actions { margin-top: 8px; display: flex; justify-content: center; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text-2); border: 1px solid var(--border);
  padding: 10px 24px; border-radius: 980px; font-size: 13.5px; font-weight: 500;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

/* 底部推荐商品 hover 调整 */
.related-item:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ===== 未找到 ===== */
.not-found { padding: 80px 28px; text-align: center; background: var(--bg); min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.not-found__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.not-found__icon { font-size: 48px; color: var(--text-3); font-weight: 100; }
.not-found h2 { font-size: 22px; font-weight: 700; }
.not-found p { font-size: 14px; color: var(--text-3); }

/* ===== 按钮组件 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 980px; font-size: 14px; font-weight: 500; transition: background-color .2s, box-shadow .2s, color .2s, transform .2s; padding: 12px 28px; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); }
.btn--full { width: 100%; padding: 12px 0; }

/* ===== Footer ===== */
.footer { background: #fff; border-top: 1px solid var(--border); }
.footer__inner { max-width: 1320px; margin: 0 auto; padding: 24px 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.footer__logo { font-weight: 800; font-size: 18px; color: var(--text); transform: skewX(-12deg); display: inline-block; font-style: italic; }
.footer__name { font-size: 12px; color: var(--text-2); }
.footer__links { display: flex; gap: 24px; margin-left: auto; }
.footer__links a { font-size: 12.5px; color: var(--text-2); }
.footer__links a:hover { color: var(--brand); }
.footer__copy { font-size: 12px; color: var(--text-3); }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.4); backdrop-filter: blur(8px); }
.modal-overlay--open { display: flex; }
.modal { width: min(460px, 100%); background: #fff; border-radius: 18px; padding: 30px 28px 24px; position: relative; box-shadow: var(--shadow-lg); animation: modalIn .25s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #f2f2f4; color: var(--text-2); display: grid; place-items: center; transition: background .2s; }
.modal__close:hover { background: #e5e5ea; }
.modal__title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.modal__sub { font-size: 13px; color: var(--text-2); margin-bottom: 18px; }
.modal__field { margin-bottom: 14px; }
.modal__input { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font-size: 14px; outline: none; transition: border-color .2s; }
.modal__input:focus { border-color: var(--brand-border); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: #f2f2f4; border-radius: 12px; padding: 4px; }
.auth-tab { flex: 1; border: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; padding: 9px 0; border-radius: 8px; cursor: pointer; transition: background-color .2s, box-shadow .2s, color .2s; }
.auth-tab--active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-error { min-height: 18px; font-size: 12.5px; color: var(--red); margin: -4px 0 8px; }
.auth-password { position: relative; }
.auth-password .modal__input { padding-right: 58px; }
.auth-password__toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-2); font-size: 12px; cursor: pointer; padding: 5px 7px; }
.auth-password__toggle:hover { color: var(--text); }
.auth-check { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); font-size: 12px; line-height: 1.5; margin: -2px 0 10px; cursor: pointer; }
.auth-check input { margin: 3px 0 0; accent-color: var(--brand); }
.auth-check a { color:var(--brand); text-decoration:underline; text-underline-offset:2px; }
.auth-hint { color: var(--text-3); font-size: 12px; line-height: 1.5; margin: -3px 0 9px; }
.auth-mode-actions { display: flex; justify-content: flex-end; margin: -6px 0 12px; }
.auth-mode-actions button { border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 12.5px; cursor: pointer; padding: 2px 0; }
.auth-mode-actions button:hover { text-decoration: underline; }

.result-icon { font-size: 48px; margin-bottom: 12px; }
.result-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.result-msg { font-size: 13.5px; color: var(--text-2); white-space: pre-line; line-height: 1.6; }
.result-cdk { display: inline-block; margin: 12px 0; padding: 12px 20px; background: var(--brand-soft); color: var(--brand); border-radius: 10px; font-size: 15px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.result-actions { margin-top: 16px; display: flex; justify-content: center; gap: 10px; }

.query-results { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 320px; overflow-y: auto; }
.query-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 20px 0; }

.toast-container { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(11,11,13,.92); color: #fff; font-size: 13px; padding: 10px 20px; border-radius: 980px; animation: toastIn .25s ease; }
.toast--error { background: rgba(226,75,74,.94); }
.toast--success { background: rgba(29,158,117,.94); }
.toast--out { opacity: 0; transition: opacity .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .purchase__row--top, .purchase__row--main { grid-template-columns: 1fr; }
  .purchase__denom, .purchase__form { position: static; }
  .purchase__game { padding-right: 0; }
  .denom-grid { grid-template-columns: repeat(3, 1fr); }
  .related-products__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__logo-zh, .nav__logo-text { display: none; }
  .nav__search { max-width: none; }
  .nav__currency { display: none; }
}
@media (max-width: 640px) {
  .purchase { padding-top: 20px; }
  .purchase__row--top, .purchase__row--main, .purchase__bottom { padding-left: 16px; padding-right: 16px; }
  .purchase__row--top { margin-bottom: 20px; }
  .purchase__bottom { margin-top: 28px; }
  .game-brand { padding: 24px 20px; gap: 16px; }
  .game-brand__logo { width: 96px; height: 96px; border-radius: 12px; }
  .game-brand__name { font-size: 20px; }
  .denom-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .denom-card { min-height: 214px; padding: 18px 12px 16px; gap: 10px; }
  .denom-card__icon { width: 80px; height: 80px; }
  .denom-card__icon-img { width: 52px; height: 52px; }
  .denom-card__prices { flex-wrap: wrap; gap: 3px 7px; }
  .purchase-card { padding: 20px; }
  .breadcrumb__inner { padding: 10px 16px; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer__links { margin-left: 0; flex-wrap: wrap; gap: 16px; }
}
