/* 次元游廊 light storefront (2026-10-15). Loaded after design.css; re-tokens the site and
   reshapes cards, chips and panels into a bright app-store layout. */
:root,:root[data-theme=light],:root[data-theme=dark] {
  color-scheme: light;
  --page: #f4f5f7; --surface: #fff; --raised: #f0f1f4;
  --ink: #16181d; --muted: #6b7079; --subtle: #9aa0a8;
  --accent: #ff5a1f; --accent-ink: #fff; --accent-soft: #fff1ea;
  --hot: #f0352b;
  --line: #e7e9ee; --header: #fff; --overlay: #101217cc;
  --radius: 14px; --shadow: 0 1px 2px #1018280a, 0 2px 10px #10182808;
}
body { background: var(--page); font-size: 15px; }
.theme-toggle { display: none !important; }

/* Header */
.topbar { background: #fff; border-bottom: 0; box-shadow: 0 1px 0 var(--line); }
.top-inner { height: 58px; }
.brandmark { background: linear-gradient(135deg,#ff7a3d,#ff4d1a); color: #fff; transform: none; border-radius: 9px; font-size: 18px; width: 30px; height: 30px; }
.brand strong { font-size: 19px; letter-spacing: 0; }
.icon-button:hover { background: var(--raised); }
.header-saved { border-right-color: var(--line); }

/* Home heading + search */
.home-heading { margin: 18px 0 12px; gap: 12px; }
.home-heading h1 { font-size: 22px; letter-spacing: 0; }
.catalog-count-banner { font-size: 13px; }
.discovery-search { height: 46px; border-radius: 12px; border-color: var(--line); background: #fff; box-shadow: var(--shadow); padding-left: 14px; }
.discovery-search input { font-size: 15px; }
.discovery-search button { height: 34px; border-radius: 9px; padding: 0 16px; font-size: 14px; background: var(--ink); color: #fff; }

/* Category chips */
.home-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 16px; padding: 2px 20px; }
.home-chips::-webkit-scrollbar { display: none; }
.home-chips a { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 14px; color: #3a3f48; }
.home-chips a:first-child { background: var(--ink); border-color: var(--ink); color: #fff; }
.home-chips .ui-icon { width: 16px; height: 16px; color: var(--accent); }
.home-chips a:first-child .ui-icon { color: #ffb08a; }
.home-chips a:hover { border-color: var(--accent); }

/* Feature carousel */
.feature-rail { border-radius: 16px; background: #1c1f26; }
.feature-slide { min-height: 260px; }
.feature-image::after { background: linear-gradient(0deg,#0d0f14ee 0%,#0d0f1499 28%,#0d0f1400 62%); }
.feature-genre { display: inline-block; background: var(--accent); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 5px; margin-bottom: 8px; }
.feature-copy { padding: 18px; }
.feature-copy h2 { font-size: 30px; letter-spacing: 0; }
.feature-actions { margin-top: 12px; }
.feature-actions .button { background: #fff; color: var(--ink); border-radius: 99px; min-height: 38px; padding: 8px 16px; }
.feature-actions .button.ghost { background: #ffffff26; color: #fff; border: 1px solid #ffffff59; backdrop-filter: blur(6px); }
.feature-selector-row { gap: 8px; margin-top: 10px; }
.feature-selector { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; min-height: 52px; color: var(--muted); }
.feature-selector.active { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 1px var(--accent) inset; }
.feature-selector img { border-radius: 8px; }

/* Section heads */
.section-head { margin-bottom: 12px; }
.section-head h2,.genre-section h2 { font-size: 20px; letter-spacing: 0; font-weight: 750; }
.text-link { font-size: 13px; min-height: 36px; }
.text-link:hover { color: var(--accent); }

/* Gift shelf */
.home-gifts { background: #fff; border-radius: var(--radius); padding: 14px 14px 6px; box-shadow: var(--shadow); }
.home-gifts .seo-guide { padding-bottom: 10px; }
.home-gifts .guide-art { border-radius: 10px; }
.home-gifts .seo-guide strong { font-size: 14px; line-height: 1.5; }
.home-gifts .seo-guide span { font-size: 12px; color: var(--hot); font-weight: 600; }
.seo-guide { background: transparent; }
.guide-art { border-radius: 12px; }
.seo-guide span { color: var(--hot); font-weight: 600; }

/* QQ is already in the top strip; the home duplicate goes. */
.home-utility,.home-community { display: none; }
.home-feature-layout { margin-bottom: 28px; }

/* Discount lanes as tiles */
.discount-hub { margin-bottom: 28px; }
.discount-lanes { gap: 10px; }
.discount-lane { background: #fff; border: 0; border-radius: var(--radius); padding: 14px 12px; box-shadow: var(--shadow); }
.discount-lane>strong { color: var(--hot); font-size: 28px; }
.discount-lane>span { font-size: 13px; }
.discount-lane>small { font-size: 12px; }
.discount-lane:hover { box-shadow: 0 0 0 1.5px var(--accent) inset; }

/* Legend feature tiles */
.legend-collection { margin-bottom: 28px; }
.legend-feature { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.legend-feature-art { border-radius: 0; height: 150px; }
.legend-feature-copy { padding: 10px 34px 12px 12px; }
.legend-feature-copy h3 { font-size: 16px; }
.legend-feature-copy>.ui-icon { right: 12px; top: 14px; }

/* Game cards: image, name, one benefit line. Download lives on the detail page. */
.game-grid,.related-grid { gap: 12px; }
.game-card { position: relative; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s; }
.game-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px #1018281a; }
.card-cover { position: relative; aspect-ratio: 16/10; border-radius: 0; background: linear-gradient(110deg,#eceef2 30%,#f6f7f9 50%,#eceef2 70%) 0 0/300% 100%; animation: cover-wait 1.4s linear infinite; }
.card-cover:has(img:not([data-src])) { animation: none; background: #eceef2; }
@keyframes cover-wait { to { background-position: -150% 0; } }
.card-cover .discount-badge { position: absolute; left: 8px; top: 8px; background: var(--hot); color: #fff; border-radius: 6px; min-height: 20px; padding: 0 6px; font-size: 11px; box-shadow: 0 1px 4px #0003; }
.card-fav { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 99px; background: #ffffffe0; color: #6b7079; box-shadow: 0 1px 4px #0002; }
.card-fav .ui-icon { width: 17px; height: 17px; }
.card-fav.selected { color: var(--hot); }
.card-content { padding: 10px 10px 4px; }
.card-main { gap: 8px; }
.game-icon { width: 34px; height: 34px; border-radius: 9px; }
.card-main h3 { font-size: 15px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.card-main p { font-size: 12px; margin-top: 2px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.card-benefit { font-size: 13px; line-height: 1.45; font-weight: 650; color: var(--hot); padding: 2px 10px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.game-card>.card-main:last-child,.game-card>.card-benefit:last-child { padding-bottom: 12px; }
.game-card>.card-main:last-child { padding-bottom: 12px; }
/* Cards rendered by older page builders still carry the meta/action rows. */
.game-card .card-content .card-meta { margin: 8px 0; }
.game-card .card-actions { padding-bottom: 10px; }
.card-download { border-radius: 99px; border-color: var(--line); min-height: 36px; }
.buyout-benefit { color: var(--hot) !important; font-weight: 650; padding: 0 10px; font-size: 13px !important; }

/* Library controls */
.library-search { border-radius: 12px; background: #fff; box-shadow: var(--shadow); border-color: var(--line); }
.filter { border-radius: 99px; background: #fff; border: 1px solid var(--line); color: #3a3f48; min-height: 36px; padding: 6px 15px; }
.filter.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.discount-filter { border-radius: 99px; min-height: 32px; padding: 4px 11px; }
.discount-filter.active { color: var(--hot); background: #ffeceb; }
.paging a { border-radius: 99px; background: #fff; }
.page-directory summary { border-radius: 12px; }
.empty-state { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Mobile nav + footer */
.bottom-nav { background: #fffffff2; backdrop-filter: blur(10px); border-top: 0; box-shadow: 0 -1px 0 var(--line); height: calc(58px + env(safe-area-inset-bottom)); }
.bottom-nav>a,.bottom-nav>button { min-height: 50px; color: #8a8f98; }
.bottom-nav .active { color: var(--accent); }
.footer { border-top-color: var(--line); }

/* Detail page */
.breadcrumbs { padding: 14px 0; }
.detail-hero { border-radius: 16px; }
.detail-title-icon { border-radius: 14px; box-shadow: var(--shadow); }
.detail-title-row h1 { letter-spacing: 0; font-size: 24px; }
.detail-tags>span:not(.discount-badge):not(:empty) { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; }
.detail-tags .discount-badge { background: var(--hot); color: #fff; border-radius: 99px; padding: 1px 10px; }
.version-benefits p { color: var(--hot) !important; font-weight: 650; font-size: 16px !important; }
.version-benefits strong { color: var(--hot) !important; }
.hero-actions .button { border-radius: 99px; min-height: 46px; font-size: 15px; }
.button { border-radius: 99px; }
.button.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.detail-section { background: #fff; border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.detail-section h2 { font-size: 19px; letter-spacing: 0; margin-bottom: 12px; }
.related-grid .game-card { box-shadow: none; border: 1px solid var(--line); }
.prose { color: #3d424b; font-size: 15px; line-height: 1.85; }
.screenshot { border-radius: 10px; }
.screenshot img { height: 240px; }
.detail-info { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.detail-save { border-radius: 99px; background: var(--raised); }
.mobile-cta { background: #fffffff2; backdrop-filter: blur(10px); border-top: 0; box-shadow: 0 -1px 0 var(--line); padding-top: 10px; }
.mobile-cta>button { border-radius: 99px; background: var(--raised); color: var(--hot); }
.mobile-cta .button { min-height: 44px; }
.collection-heading h1 { font-size: 26px; letter-spacing: 0; }
.collection-symbol { display: none; }
.detail-video-row button { border-radius: 99px; background: #fff; border: 1px solid var(--line); }
dialog { border-radius: 16px; border: 0; }
.toast { background: #16181dee; color: #fff; border: 0; border-radius: 99px; }

/* Legend and editorial widgets share the panel look. */
.legend-topic-nav>a,.legend-version,.legend-scope { background: #fff; border-color: var(--line); }
.home-main .legend-topic-nav>a { background: transparent; }

@media (min-width: 768px) {
  .top-inner { height: 66px; }
  .home-heading { margin: 26px 0 14px; }
  .home-heading h1 { font-size: 26px; }
  .home-chips { margin: 0 0 20px; padding: 2px 0; }
  .feature-slide { min-height: 380px; }
  .feature-image::after { background: linear-gradient(90deg,#0d0f14f0 0%,#0d0f14a0 30%,#0d0f1400 70%); }
  .feature-copy { padding: 34px; }
  .feature-copy h2 { font-size: 44px; }
  .section-head h2,.genre-section h2 { font-size: 22px; }
  .discount-hub { display: block; border: 0; padding: 0; }
  .discount-hub .section-head { flex-direction: row; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .discount-lanes { gap: 14px; }
  .discount-lane { grid-template-columns: 1fr auto; padding: 16px 18px; }
  .discount-lane>strong { font-size: 36px; }
  .discount-note { grid-column: auto; }
  .legend-feature-art { height: 230px; }
  .game-grid { gap: 18px; }
  .card-main h3 { font-size: 16px; }
  .detail-title-row h1 { font-size: 30px; }
  .detail-section { padding: 24px; }
  .detail-info { top: 84px; }
  .screenshot img { height: 300px; }
}
@media (min-width: 1100px) {
  .home-gifts { border-left: 0; padding: 16px 18px 4px; }
  .home-gifts .seo-guide { border-bottom-color: var(--line); }
  .game-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
/* Card name row sits beside its icon (the link carries both card-content and card-main). */
.game-card>.card-main { flex-direction: row; align-items: center; text-align: left; }
.game-card>.card-main>div { min-width: 0; flex: 1; }
@media (max-width: 767px) {
  .home-gifts .seo-guides { grid-template-columns: 1fr; gap: 0; }
  .home-gifts .seo-guide { flex-direction: row; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .home-gifts .seo-guide:last-child { border-bottom: 0; }
  .home-gifts .guide-art { width: 52px; height: 52px; }
  .home-gifts .seo-guide strong { font-size: 14px; line-height: 1.45; }
}

/* ===== App-store layout (round 2): list rows, entry icons, shelves ===== */
.sr-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.home-heading { display: block; margin: 12px 0 12px; }
.home-heading .catalog-count-banner { margin-top: 8px; }
.home-main .feature-stage { margin-bottom: 0; }
.home-main .feature-slide { min-height: 0; aspect-ratio: 16/8; }
.home-main .feature-copy { padding: 14px 16px; }
.home-main .feature-copy h2 { font-size: 24px; }
.home-main .feature-copy>p { margin-top: 2px; font-size: 12px; }
.home-main .feature-genre { margin-bottom: 4px; }
.home-main .feature-actions { display: none; }
.home-main .feature-selector-row { display: none; }

.home-entries { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; margin: 18px 0 8px; }
.home-entries a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: #3a3f48; padding: 4px 0; }
.home-entries i { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
.home-entries .ui-icon { width: 24px; height: 24px; }
.e-red { background: linear-gradient(135deg,#ff6b5b,#f0352b); }
.e-orange { background: linear-gradient(135deg,#ffa24d,#ff6a1f); }
.e-purple { background: linear-gradient(135deg,#a98bff,#7656f0); }
.e-green { background: linear-gradient(135deg,#46d39a,#14a86a); }
.e-blue { background: linear-gradient(135deg,#5aa8ff,#2f6ff0); }

.pick-list,.shelf { margin-top: 22px; }
.home-main .discount-hub { margin-top: 22px; }
.home-main .catalog-section { margin-top: 22px; }

/* List rows */
.row-list,.game-grid,.related-grid { display: grid; grid-template-columns: 1fr; gap: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 14px; }
.game-card.app-row { display: grid; grid-template-columns: 60px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 0; background: transparent; border-radius: 0; box-shadow: none; overflow: visible; transform: none; }
.game-card.app-row+.game-card.app-row { border-top: 1px solid #f0f1f4; }
.game-card.app-row:hover { transform: none; box-shadow: none; }
.row-icon { width: 60px; height: 60px; border-radius: 15px; overflow: hidden; background: #eceef2; display: block; }
.row-icon img { width: 100%; height: 100%; object-fit: cover; }
.row-body { min-width: 0; display: block; }
.row-body h3 { font-size: 16px; font-weight: 700; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-tags { display: flex; gap: 5px; margin-top: 4px; overflow: hidden; white-space: nowrap; }
.row-tags span { font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 4px; background: #f2f3f6; color: #5b616b; flex-shrink: 0; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.row-tags .discount-badge { background: #ffeceb; color: var(--hot); min-height: 0; font-weight: 700; }
.row-benefit { margin-top: 5px; font-size: 13px; font-weight: 650; color: var(--hot); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-desc { margin-top: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-get { display: inline-flex; align-items: center; justify-content: center; min-width: 62px; height: 32px; padding: 0 14px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; }
.row-get:hover { background: var(--accent); color: #fff; }
.game-grid .empty-state { box-shadow: none; }
.catalog-loading .game-card { opacity: .45; }

/* Horizontal shelves */
.shelf-row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px 6px; scroll-snap-type: x proximity; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-tile { flex: none; scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0; }
.gift-tile { width: 128px; }
.tile-art { width: 128px; height: 160px; object-fit: cover; object-position: center 20%; border-radius: 14px; background: #eceef2; box-shadow: var(--shadow); }
.gift-tile:has(img[data-src]) .tile-art, .gift-tile img[data-src] { visibility: visible; }
.shelf-tile strong { font-size: 14px; font-weight: 700; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-tile small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.gift-tile em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--hot); margin-top: 3px; }
.icon-tile { width: 76px; align-items: center; text-align: center; }
.tile-icon { width: 68px; height: 68px; border-radius: 17px; object-fit: cover; background: #eceef2; box-shadow: var(--shadow); }
.icon-tile strong { font-size: 13px; max-width: 100%; }
.icon-tile small { max-width: 100%; }
img.tile-art[data-src],img.tile-icon[data-src] { visibility: visible; color: transparent; }

/* Library header tighter */
.catalog-controls { margin-bottom: 12px; }

/* Detail: name, benefit and download first; artwork after. */
@media (max-width: 767px) {
  .detail-opening { gap: 14px; }
  .detail-intro { order: -1; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
  .detail-hero { aspect-ratio: 16/9; }
  .detail-title-icon { width: 72px; height: 72px; border-radius: 18px; }
  .detail-title-row h1 { font-size: 20px; }
  .detail-tags { margin: 12px 0; }
}
.related-grid>.game-card:last-child { display: grid; }

@media (min-width: 768px) {
  .home-main .feature-slide { aspect-ratio: auto; min-height: 340px; }
  .home-main .feature-copy h2 { font-size: 40px; }
  .home-main .feature-actions { display: flex; }
  .home-main .feature-selector-row { display: grid; }
  .home-entries { grid-template-columns: repeat(5,96px); justify-content: start; gap: 18px; }
  .home-heading { display: grid; grid-template-columns: minmax(0,560px) auto; align-items: center; gap: 18px; margin: 22px 0 18px; }
  .home-heading .catalog-count-banner { margin: 0; }
  .shelf-row { margin: 0; padding: 2px 0 6px; }
  .gift-tile { width: 150px; } .tile-art { width: 150px; height: 188px; }
  .row-list,.game-grid,.related-grid { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 32px; padding: 0 20px; }
  .game-card.app-row+.game-card.app-row { border-top: 0; }
  .game-card.app-row { border-bottom: 1px solid #f0f1f4; }
}
@media (min-width: 1100px) {
  .row-list,.game-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .related-grid { grid-template-columns: 1fr; }
}
.row-body .row-benefit { color: var(--hot); font-size: 13px; line-height: 1.4; }
.row-body .row-desc { color: var(--muted); font-size: 12px; line-height: 1.4; }
