/* Endfield 仓库转移辅助 - 介绍落地页
   沿用 Web UI 深色主题（--bg #0f172a / 强调 #38bdf8）保持品牌一致。 */
:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-hover: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --border: #334155;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ---------- 顶部 Hero ---------- */
.hero {
  padding: 48px 24px 40px;
  text-align: center;
  background: linear-gradient(180deg, #16233d 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin: 0 auto 40px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; font-size: 17px; }

.version-badge {
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.hero .sub {
  max-width: 620px;
  margin: 0 auto 28px;
  color: var(--text-secondary);
  font-size: 15px;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}

.hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s, transform 0.05s;
}

.btn.primary {
  background: var(--accent);
  color: #0f172a;
}
.btn.primary:hover { background: var(--accent-hover); }

.btn.ghost {
  background: var(--panel-hover);
  color: var(--text);
  opacity: 0.85;
}
.btn.ghost:hover { background: #475569; opacity: 1; }

.btn.link {
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  width: auto;
  padding: 10px 18px;
  font-size: 13px;
}
.btn.link:hover { color: var(--accent); border-color: var(--accent); }

.btn.hidden { display: none; }
.btn.disabled { pointer-events: none; opacity: 0.5; }

/* ---------- 功能卡片 ---------- */
main { max-width: 960px; margin: 0 auto; padding: 48px 24px; }

.features h2,
.safety h2 {
  text-align: center;
  font-size: 22px;
  margin: 0 0 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* 核心功能固定单行 4 列（窄屏自动降列避免挤压） */
.grid.four { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 820px) {
  .grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .grid.four { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.card h3 { margin: 0 0 8px; font-size: 16px; color: var(--accent); }
.card p { margin: 0; font-size: 13px; color: var(--text-secondary); }

/* ---------- 安全透明说明 ---------- */
.safety {
  margin-top: 56px;
  padding: 32px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--panel) 0%, transparent 100%);
}

.safety h2 { margin-bottom: 8px; }

.safety .lead {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 640px;
  margin: 0 auto 24px;
}

.safety .disclaimer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin: 24px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ---------- 页脚 ---------- */
footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}
footer p { margin: 0; }

/* ---------- 功能演示视频播放层 ---------- */
.demo-modal {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.demo-modal.open { display: flex; }
.demo-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .82);
  animation: demoFade .18s ease-out;
}
.demo-body {
  position: relative;
  width: 100%; max-width: 1080px;
  /* 无边框、无盒底色，让视频融入深色背景，去掉突兀的外框 */
  border: none;
  border-radius: 12px;
  overflow: hidden;
  animation: demoUp .22s ease-out;
}
.demo-close {
  position: absolute; top: 8px; right: 10px; z-index: 10;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(15, 23, 42, .7); border: 1px solid rgba(148, 163, 184, .3);
  color: var(--text-secondary); font-size: 16px; font-weight: 700;
  cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.demo-close:hover { color: var(--accent); border-color: var(--accent); }
.demo-title {
  position: relative;
  height: 42px;
  padding: 0 40px 0 2px;
  font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center;
}
.demo-frame {
  padding: 0;
  aspect-ratio: 16 / 9;
}
.demo-frame video {
  width: 100%; height: 100%;
  display: block;
  background: #000;
  border-radius: 10px;
  object-fit: contain;
}
.demo-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
}
.demo-ph-icon {
  font-size: 40px; color: var(--accent); opacity: .85;
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(56, 189, 248, .12);
}
.demo-ph-text { font-size: 14px; }
@keyframes demoFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes demoUp {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- 响应式：窄屏时网格降列，避免卡片过挤 ---------- */
@media (max-width: 760px) {
  .grid.four, .grid.three { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid.four, .grid.three { grid-template-columns: 1fr; }
}


/* ============ 购买授权 Modal ============ */
.buy-modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.buy-modal.open { display: flex; }
.buy-modal-mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.8);
  animation: buyFadeIn .18s ease-out;
}
.buy-modal-body {
  position: relative;
  width: 100%; max-width: 520px; max-height: 94vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: buySlideUp .22s ease-out;
}
.buy-modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 20px; font-weight: 700;
  cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.buy-modal-close:hover { color: var(--accent); border-color: var(--accent); }
.buy-modal-inner {
  flex: 1; overflow-y: auto;
  padding: 4px 0 20px;
}
.buy-modal-inner .wrap { padding: 8px 16px 32px; max-width: 100%; }
@keyframes buyFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes buySlideUp {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: none; }
}


/* ============ 购买 UI ============ */
/* ====== Endfield 深色品牌主题 ====== */
:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-hover: #334155;
  --border: #334155;
  --text: #f1f5f9;
  --text-sec: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --price: #fbbf24;
  --ok: #22c55e;
  --ok-dark: #4ade80;
  --err: #ef4444;
  --r: 14px;
  --r-sm: 10px;
}
.card.theme-alipay { --pay-ch: #1677ff; --pay-ch-hover: #4096ff; }
.card.theme-wechat { --pay-ch: #07c160; --pay-ch-hover: #2ba84a; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.5; min-height: 100vh;
}

/* ====== Hero ====== */
.hero {
  padding: 24px 24px 18px; text-align: center;
  background: linear-gradient(180deg, #16233d 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.hero .sub { color: var(--text-sec); font-size: 12px; }

.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 60px; }

/* ====== 商品区标题 ====== */
.section-title {
  font-size: 14px; font-weight: 600; color: var(--text-sec);
  margin: 4px 0 12px; letter-spacing: .3px;
}

/* ====== 商品横排 ====== */
.goods-scroll {
  display: flex; gap: 12px;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 4px; margin-bottom: 16px;
}
.goods-scroll::-webkit-scrollbar { display: none; }

.goods-card {
  flex-shrink: 0;
  width: 150px;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.goods-card.selected {
  border-color: var(--accent);
  background: rgba(56,189,248,.06);
}
.goods-card.selected .goods-name { color: var(--accent); }
.goods-card .goods-name {
  font-size: 15px; font-weight: 700; color: var(--text);
  text-align: center; margin-bottom: 4px;
}
.goods-card .goods-spec {
  font-size: 11px; color: var(--text-sec);
  text-align: center; margin-bottom: 10px;
  min-height: 28px; line-height: 1.4;
}
.goods-card .goods-price {
  font-size: 22px; font-weight: 800; color: var(--price);
  text-align: center; letter-spacing: -.5px;
}
.goods-card .goods-orig {
  font-size: 11px; color: var(--text-sec);
  text-align: center; margin-top: 2px;
}

/* ====== 选中商品详情区 ====== */
.selected-detail {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px; margin-bottom: 14px;
}
.selected-detail .sd-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.selected-detail .sd-name { font-size: 16px; font-weight: 700; }
.selected-detail .sd-orig { font-size: 12px; color: var(--text-sec); text-decoration: line-through; }

/* ====== 按钮 ====== */
.btn {
  border: none; border-radius: var(--r-sm);
  padding: 12px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .05s, opacity .12s;
  font-family: inherit; width: 100%;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-brand { background: var(--accent); color: #0f172a; }
.btn-brand:not(:disabled):hover { background: var(--accent-hover); }
.btn-ok { background: var(--ok); color: #052e16; }
.btn-ok:not(:disabled):hover { opacity: .9; }
.btn-ghost {
  background: transparent; color: var(--text-sec);
  border: 1px solid var(--border);
  margin-top: 8px;
}
.btn-ghost:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.btn-mini {
  width: auto; padding: 6px 12px; font-size: 12px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-sec); border-radius: 8px;
}
.btn-mini:hover { color: var(--accent); border-color: var(--accent); }

.spin {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -2px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 支付方式 tab（在 QR 区内） ====== */
.pay-tabs {
  display: inline-flex; gap: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.pay-tab {
  padding: 8px 2px; font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--text-sec);
  border: none; background: transparent;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  font-family: inherit; margin: 0;
}
.pay-tab.active { color: var(--text); }
.pay-tab[data-ch="alipay"].active { border-bottom-color: #1677ff; color: #1677ff; }
.pay-tab[data-ch="wechat"].active { border-bottom-color: #07c160; color: #07c160; }

/* ====== QR 区（整合后的支付卡片） ====== */
.qr-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px; margin-bottom: 14px;
  transition: border-color .2s;
}
.qr-section.theme-alipay { border-color: rgba(22,119,255,.5); }
.qr-section.theme-wechat { border-color: rgba(7,193,96,.5); }

.qr-section .qs-amount {
  text-align: center; margin-bottom: 4px;
}
.qr-section .qs-amount .cur { font-size: 13px; color: var(--text-sec); margin-right: 4px; }
.qr-section .qs-amount .price {
  font-size: 36px; font-weight: 800; color: var(--price);
  letter-spacing: -1px;
}
.qr-section .qs-discount {
  text-align: center; font-size: 12px; color: var(--text-sec);
  margin-bottom: 14px;
}
.qr-section .qs-discount s { opacity: .6; margin-right: 4px; }
.qr-section .qs-discount b { color: var(--ok); font-weight: 700; }

.qr-wrap {
  display: flex; justify-content: center; align-items: center;
  margin: 0 auto 10px; padding: 14px;
  background: #fff; border-radius: var(--r);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  width: fit-content; min-width: 220px;
}
.qr-wrap canvas, .qr-wrap img { display: block; border-radius: 6px; }

.qs-meta {
  text-align: center; font-size: 12px; color: var(--text-sec);
  font-family: "SF Mono", "Menlo", Consolas, monospace;
  letter-spacing: 1px; margin: 6px 0;
}
.qs-meta .label { font-family: inherit; letter-spacing: 0; opacity: .7; margin-right: 6px; }

.qs-countdown { text-align: center; font-size: 12px; color: var(--text-sec); margin: 8px 0 10px; }
.qs-countdown.warn { color: var(--err); font-weight: 600; }

.err { color: var(--err); font-size: 12px; min-height: 16px; text-align: center; margin-top: 6px; }
.err.small { min-height: 14px; margin-top: 4px; }

/* ====== 进度/取件子视图 ====== */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px; margin-bottom: 14px;
}
.amount-sm { text-align: center; font-size: 22px; font-weight: 800; color: var(--accent); margin: 6px 0; }
.hint { text-align: center; font-size: 12px; color: var(--text-sec); line-height: 1.6; }
.steps { margin: 16px 0 10px; }
.step-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.step-row:last-child { border-bottom: none; }
.step-dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--panel-hover); color: var(--text-sec);
  text-align: center; line-height: 22px;
  font-size: 12px; font-weight: 700;
}
.step-row.done .step-dot { background: var(--ok); color: #052e16; }
.step-row.done .step-label { color: var(--ok-dark); font-weight: 600; }
.step-label { font-size: 14px; color: var(--text-sec); }

.keybox {
  background: rgba(56,189,248,.08);
  border: 1px dashed var(--accent);
  border-radius: var(--r-sm);
  padding: 16px 44px 16px 16px;
  margin-top: 12px; text-align: center;
  word-break: break-all; font-size: 14px; color: var(--accent); font-weight: 600;
  user-select: all; position: relative;
}
.keybox .copy-btn {
  position: absolute; right: 8px; top: 8px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--accent); background: transparent; cursor: pointer;
}
.keybox .copy-btn:active { background: var(--accent); color: #0f172a; }

.footer-link { text-align: center; font-size: 13px; margin-top: 20px; }
.footer-link a { color: var(--accent); text-decoration: none; }
.footer-link a:active { opacity: .7; }

.pickup-form label { display: block; font-size: 13px; color: var(--text-sec); margin: 14px 0 6px; }
.pickup-form input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--panel); color: var(--text);
  font-size: 15px; font-family: inherit;
  letter-spacing: 1px; transition: border-color .15s;
}
.pickup-form input::placeholder { color: var(--text-sec); opacity: .6; }
.pickup-form input:focus { outline: none; border-color: var(--accent); }

.hidden { display: none !important; }
.loading-text { text-align: center; color: var(--text-sec); padding: 40px 0; font-size: 13px; }
.empty-text { text-align: center; color: var(--text-sec); padding: 30px 0; font-size: 13px; }

.view { animation: viewIn .22s ease-out; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .15s;
}
.mask .dlg {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r);
  padding: 24px; max-width: 320px; width: 100%; text-align: center;
  animation: dlgIn .2s ease-out;
}
.mask .dlg h3 { font-size: 16px; margin-bottom: 10px; }
.mask .dlg p { font-size: 13px; color: var(--text-sec); line-height: 1.6; margin-bottom: 16px; }
.mask .dlg .actions { display: flex; gap: 8px; }
.mask .dlg .actions .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlgIn { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: 18px; text-align: center; margin: 8px 0 16px; font-weight: 700; letter-spacing: .5px; }