/* 环球卡铺 · 站点样式（手机优先） */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #edf0f3;
  --text: #141920;
  --muted: #5b6573;
  --border: #dfe3e8;
  --accent: #0a7a5d;
  --accent-hover: #086549;
  --accent-ink: #ffffff;
  --accent-soft: #e1f2ec;
  --hi-bg: #e4f4ed;
  --hi-text: #075f48;
  --warn-bg: #fff3d6;
  --warn-text: #6f4500;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1013;
    --surface: #161a1f;
    --surface-2: #1e242b;
    --text: #e7eaee;
    --muted: #9ba4af;
    --border: #2a3139;
    --accent: #33c197;
    --accent-hover: #4fd2aa;
    --accent-ink: #04201a;
    --accent-soft: #123229;
    --hi-bg: #11302a;
    --hi-text: #6fe0bc;
    --warn-bg: #3a2b0a;
    --warn-text: #f1cd85;
    --danger: #f97066;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1013;
  --surface: #161a1f;
  --surface-2: #1e242b;
  --text: #e7eaee;
  --muted: #9ba4af;
  --border: #2a3139;
  --accent: #33c197;
  --accent-hover: #4fd2aa;
  --accent-ink: #04201a;
  --accent-soft: #123229;
  --hi-bg: #11302a;
  --hi-text: #6fe0bc;
  --warn-bg: #3a2b0a;
  --warn-text: #f1cd85;
  --danger: #f97066;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 0.5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 0.75em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 0.85rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.link-btn {
  border: 0; background: none; padding: 0; color: var(--accent);
  font: inherit; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); cursor: pointer; font-size: 1.4rem;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }

/* 公告与页头 */
.announcement { background: var(--accent-soft); color: var(--hi-text); font-size: 0.9rem; padding: 8px 0; }
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 1.1rem; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 7px; }
.header-actions { display: flex; align-items: center; gap: 2px; }
.btn-contact { min-height: 36px; padding: 0 12px; margin-left: 4px; }
.main-nav { order: 3; width: 100%; display: flex; gap: 4px; }
.main-nav a {
  flex: 1; text-align: center; padding: 6px 8px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 600;
}
.main-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (min-width: 720px) {
  .brand { margin-right: 8px; }
  .main-nav { order: 0; width: auto; flex: 1; }
  .main-nav a { flex: 0 0 auto; }
}

/* 区块 */
.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.page-head { margin-bottom: 16px; }
.empty { color: var(--muted); padding: 24px 0; }
.notice {
  background: var(--warn-bg); color: var(--warn-text);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.95rem;
}

/* 首页主标题区 */
.hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 16px; box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(1.45rem, 5.2vw, 2.3rem); letter-spacing: -0.01em; }
.hero-sub { color: var(--muted); max-width: 46em; }
@media (min-width: 720px) { .hero { padding: 40px 36px; } }

/* 搜索框 */
.search-form { display: flex; gap: 8px; margin-top: 12px; }
.search-form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font: inherit;
}
.search-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search-form .btn { height: 44px; }
.search-form-lg input, .search-form-lg .btn { height: 50px; font-size: 1.05rem; }

/* 应用卡片 */
.app-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.app-tile {
  display: flex; gap: 12px; align-items: center; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); box-shadow: var(--shadow); min-width: 0;
}
.app-tile:hover { text-decoration: none; border-color: var(--accent); }
.app-tile-body { display: flex; flex-direction: column; min-width: 0; }
.app-tile-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-tile-store { color: var(--muted); font-size: 0.85rem; }
.app-tile-price { font-size: 0.9rem; color: var(--hi-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.app-tile-price.muted { color: var(--muted); font-weight: 400; }
.app-icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border);
}
.app-icon-lg { width: 64px; height: 64px; border-radius: 16px; }
.app-icon-fallback {
  display: inline-grid; place-items: center; font-weight: 800; color: var(--muted); font-size: 1.2rem;
}

/* 礼品卡卡片 */
.card-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.card-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); box-shadow: var(--shadow); min-width: 0;
}
.card-tile:hover { text-decoration: none; border-color: var(--accent); }
.card-tile-title { font-weight: 700; font-size: 0.95rem; line-height: 1.35; }
.card-tile-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }
.card-tile-price { color: var(--hi-text); font-weight: 700; }
.card-tile.soldout .card-face { filter: grayscale(1); opacity: 0.6; }
.card-tile.soldout .card-tile-price { color: var(--muted); }

/* 卡面（CSS 生成，不使用官方 Logo） */
.card-face {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 1.586; width: 100%; padding: 12px 14px; border-radius: 10px;
  color: #fff; overflow: hidden; isolation: isolate;
}
.card-face::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 80%; aspect-ratio: 1;
  border-radius: 50%; background: rgba(255, 255, 255, 0.08); z-index: -1;
}
.card-face-img { display: block; height: auto; object-fit: cover; padding: 0; }
.cf-brand { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.01em; }
.cf-kind { font-size: 0.8rem; opacity: 0.85; margin-top: -0.4em; }
.cf-meta { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; opacity: 0.95; }
.brand-apple { background: linear-gradient(135deg, #24262b 0%, #4c5058 100%); }
.brand-googleplay { background: linear-gradient(135deg, #0b4f8a 0%, #12907a 100%); }
.brand-steam { background: linear-gradient(135deg, #111b27 0%, #26445f 100%); }

/* 使用步骤与问答 */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.steps li > span:last-child { display: flex; flex-direction: column; }
.step-no {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--hi-text); font-weight: 800;
}
.prose-block p { max-width: 46em; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 8px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

/* 列表筛选标签 */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab, .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 0.9rem; font-weight: 600;
}
.tab:hover, .chip:hover { text-decoration: none; border-color: var(--accent); }
.tab[aria-current="page"], .chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tab-count { font-weight: 400; opacity: 0.75; font-size: 0.85em; }

/* 比价页 */
.app-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; margin-bottom: 16px; }
.app-head h1 { margin: 0; }
.app-head-text p { margin: 0; }
.app-head-text { min-width: 0; }
.app-updated { grid-column: 1 / -1; margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
@media (min-width: 720px) {
  .app-head { grid-template-columns: auto 1fr auto; }
  .app-updated { grid-column: auto; margin: 0; }
}
.item-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.item-single { color: var(--muted); }

.price-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.price-table th {
  text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 600;
  padding: 10px 14px; background: var(--surface-2);
}
.price-table td { padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.price-table .col-cny { font-weight: 700; white-space: nowrap; }
.price-table .col-buy { text-align: right; }
.price-table tr.cheapest td { background: var(--hi-bg); }
.price-table tr.cheapest .col-cny { color: var(--hi-text); }
.price-table tr.missing td { color: var(--muted); font-size: 0.9rem; padding-top: 6px; padding-bottom: 6px; }
.price-table tr.missing .col-cny { font-weight: 400; }
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; vertical-align: 1px;
}
.age { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.btn-buy { min-height: 32px; padding: 0 10px; font-size: 0.85rem; background: var(--accent-soft); border-color: transparent; color: var(--hi-text); }
.btn-buy:hover { background: var(--accent); color: var(--accent-ink); }
.table-note { font-size: 0.85rem; margin-top: 10px; }
.detail-foot { margin-top: 24px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.detail-foot p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.detail-foot p:last-child { margin-bottom: 0; }

/* 窄屏：比价表每行变成两行网格，不横向溢出 */
@media (max-width: 640px) {
  .price-table thead { display: none; }
  .price-table, .price-table tbody { display: block; }
  .price-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px;
    padding: 10px 12px; border-top: 1px solid var(--border);
  }
  .price-table tr:first-child { border-top: 0; }
  .price-table td { display: block; padding: 0; border: 0; background: none !important; }
  .price-table tr.cheapest { background: var(--hi-bg); }
  .price-table .col-region { grid-column: 1; grid-row: 1; font-weight: 600; }
  .price-table .col-cny { grid-column: 2; grid-row: 1; text-align: right; }
  .price-table .col-local { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 0.9rem; }
  .price-table .col-buy { grid-column: 2; grid-row: 2; }
  .price-table .col-buy:empty { display: none; }
  .price-table tr.missing { padding-top: 6px; padding-bottom: 6px; }
  .price-table tr.missing .col-local { display: none; }
  .price-table tr.missing .col-region { font-weight: 400; }
}

/* 客服弹窗 */
.contact-dialog {
  width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); padding: 18px;
}
.contact-dialog::backdrop { background: rgba(8, 12, 16, 0.5); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dialog-head h2 { margin: 0; }
.dialog-head form { margin: 0; }
.copy-box {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px;
}
.copy-box p { margin: 0; white-space: pre-wrap; font-weight: 600; }
.channels { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.channel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.channel-name { min-width: 72px; font-weight: 700; }
.channel-id { font-size: 1rem; }
.channel-qr { flex-basis: 100%; width: 180px; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; }

/* 404 */
.not-found { text-align: center; padding: 40px 0; }
.not-found .search-form { max-width: 520px; margin: 16px auto; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 24px 0 32px; color: var(--muted); font-size: 0.88rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; }
.footer-links a { color: var(--text); }
.footer-note { max-width: 60em; }
.footer-contact .link-btn { font-size: inherit; }
.footer-copy { margin: 0; }

/* 商城筛选与分页 */
.filter-form { display: flex; align-items: center; gap: 8px; margin: -4px 0 16px; flex-wrap: wrap; }
.filter-form label { color: var(--muted); font-size: 0.9rem; }
.filter-form select {
  height: 38px; padding: 0 10px; min-width: 0; max-width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.pager-info { color: var(--muted); font-size: 0.9rem; }

/* 商品页 */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.9rem; color: var(--muted); margin-bottom: 12px; }
.card-detail { display: grid; gap: 16px; }
.card-detail-face { max-width: 360px; }
.card-detail-main h1 { margin-bottom: 4px; }
@media (min-width: 760px) {
  .card-detail { grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
}
.purchase { margin-top: 12px; display: grid; gap: 14px; }
.faces { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.faces legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.face-option { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.face-option input { position: absolute; opacity: 0; pointer-events: none; }
.face-text {
  display: inline-block; padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.face-option input:checked + .face-text { border-color: var(--accent); background: var(--accent-soft); color: var(--hi-text); }
.face-option input:focus-visible + .face-text { outline: 2px solid var(--accent); outline-offset: 2px; }
.face-option.is-soldout { cursor: not-allowed; }
.face-option.is-soldout .face-text { color: var(--muted); text-decoration: line-through; opacity: 0.7; }
.face-tag { font-size: 0.75rem; color: var(--danger); font-weight: 700; }
.qty { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.qty input {
  width: 88px; height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.btn-lg { min-height: 48px; font-size: 1.05rem; padding: 0 22px; justify-self: start; }
@media (max-width: 520px) { .btn-lg { justify-self: stretch; } }

.info-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.info-table th, .info-table td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.info-table tr:first-child th, .info-table tr:first-child td { border-top: 0; }
.info-table th { width: 7.5em; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* 说明文字 */
.prose { max-width: 46em; }
.prose h1 { margin-bottom: 0.6em; }
.prose h2 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 0.9em; }
.prose li { margin-bottom: 0.3em; }
.prose code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.help { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 18px; }
.help-more { margin-top: 24px; }
.help-more ul { padding-left: 1.2em; }
.empty-state { padding: 24px 0; }
.empty-state p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
