/* Pearl surface system, inspired by scaffold-master (MIT).
   Website adaptation: keep public navigation and the existing character artwork. */
:root {
  --ink: #191814; --muted: #69655e; --paper: #fff9ed; --surface: #fffdf7;
  --blue-deep: #2867d7; --green: #b8f63e;
  --border: 1px solid rgba(46,58,62,.11);
  --shadow: 0 8px 28px rgba(24,36,40,.055), inset 0 1px 0 rgba(255,255,255,.9);
  --radius-xl: 24px; --radius-lg: 16px;
  --pearl-line: rgba(46,58,62,.11); --pearl-blue: #236de9;
}
html, body, body[data-page=me] { background: var(--paper); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; }
.noise { display: none; }
:focus-visible { outline: 2px solid var(--pearl-blue); outline-offset: 4px; }
.site-header { background: rgba(250,252,251,.92); border-bottom: 1px solid var(--pearl-line); }
.header-inner { min-height: 76px; }
.brand { font-weight: 700; }
.brand-word { font-size: 21px; letter-spacing: -.02em; }
.brand-symbol { filter: none; }
.brand-status { font-weight: 400; }
.desktop-nav { border: 1px solid var(--pearl-line); background: #eef1f0; padding: 4px; gap: 3px; }
.nav-link { font-weight: 550; min-height: 40px; padding-inline: 20px; color: var(--muted); }
.nav-link:hover { background: rgba(255,255,255,.75); color: var(--ink); }
.nav-link.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px #1824280c; }
.icon-button, .profile-button { border: var(--border); box-shadow: 0 2px 6px #18242805; min-height: 44px; min-width: 44px; font-weight: 550; }
.profile-icon-bg { border: 0; background: #edf3ff; color: var(--pearl-blue); }
.icon-button:active, .profile-button:active, .outline-button:active, .round-button:active { transform: scale(.97); box-shadow: none; }
.hero { min-height: 490px; padding: 48px; border-radius: 28px; background: radial-gradient(ellipse at 87% 25%,#e6edf8 0,transparent 47%),linear-gradient(130deg,#fff,#f0f4f3); box-shadow: var(--shadow); }
.hero::after, .hero::before, .hero h1 em::after { display: none; }
.hero h1 { font-size: clamp(36px,4.3vw,56px); font-weight: 700; line-height: 1.2; letter-spacing: -.04em; }
.hero h1 em { color: var(--pearl-blue); text-shadow: none; }
.eyebrow, .section-kicker { color: var(--muted); font-weight: 500; letter-spacing: .06em; }
.eyebrow span { background: var(--pearl-blue); height: 3px; width: 18px; }
.hero-desc { font-size: 15px; font-weight: 400; color: var(--muted); }
.hero-search { min-height: 60px; background: #fff; border: var(--border); box-shadow: 0 4px 16px #18242806; border-radius: 16px; }
.hero-search > button { border: 0; background: var(--pearl-blue); font-weight: 550; }
.quick-searches { font-weight: 400; }
.quick-searches button { border: 1px solid var(--pearl-line); background: #fff9; color: var(--muted); }
.universe-core { border: var(--border); box-shadow: 0 18px 50px #1d365014,inset 0 1px 0 #fff; background: #ffffffd9; }
.universe-core::before { border: 1px solid var(--pearl-line); }
.universe-core img { filter: none; }
.orbit { border: 1px dashed #becad8; }
.spark { text-shadow: none; color: #8ca9d6; }
.product-orbit { border: 1px solid #ffffffc4; box-shadow: 0 8px 24px #1824280c; font-weight: 550; background: #fff9; backdrop-filter: blur(12px); }
.worlds, .continue-section, .recommendations { padding-top: 64px; }
.section-heading { margin-bottom: 22px; }
.section-heading h2 { font-size: clamp(25px,3vw,34px); font-weight: 650; letter-spacing: -.035em; }
.text-link { color: var(--pearl-blue); font-weight: 550; font-size: 14px; }
.world-card { min-height: 414px; padding: 26px; border-radius: 24px; box-shadow: var(--shadow); }
.world-card:hover { transform: translateY(-4px); box-shadow: 0 14px 36px #18242812; }
.toolbox-card { background: linear-gradient(150deg,#fff,#fff4eb); }
.guide-card { background: linear-gradient(150deg,#fff,#edf3ff); }
.games-card { color: var(--ink); background: linear-gradient(150deg,#fff,#f1ecfc); }
.world-card-copy h3, .guide-card .world-card-copy h3, .games-card .world-card-copy h3 { font-size: 30px; font-weight: 650; letter-spacing: -.03em; margin-bottom: 15px; }
.world-card-copy p, .world-number { color: var(--muted); font-weight: 500; }
.world-badge, .games-card .world-badge { border: var(--border); background: #ffffffb3; color: var(--muted); font-weight: 500; }
.world-action { font-weight: 550; color: var(--pearl-blue); }
.world-action i, .games-card .world-action i { background: #edf3ff; color: var(--pearl-blue); }
.tool-chip { border: var(--border); box-shadow: 0 4px 12px #1824280d; font-weight: 550; }
.continue-card, .recommend-card, .ending-card, .catalog-card, .content-panel, .note-panel, .article-body, .article-toc, .compat-grid article, .profile-grid > section { border: var(--border); box-shadow: var(--shadow); border-radius: 20px; }
.continue-card, .catalog-card.tool, .catalog-card.guide, .catalog-card.game { background: #fff; }
.continue-card:hover { box-shadow: 0 10px 30px #18242812; }
.continue-copy h3 { font-weight: 600; }
.continue-icon, .compact-symbol { border: var(--border); box-shadow: none; background: #f0f4f9; }
.round-button, .outline-button { border: var(--border); box-shadow: none; font-weight: 550; background: #fff; }
.feature-tool { background: #eef4ff; }
.guide-recommend { background: #f5f7fb; }
.compact-card.purple { background: #f3effb; }
.compact-card.yellow, .ending-card { background: #eef3f2; }
.ending-card h2 { font-weight: 650; font-size: clamp(26px,3.3vw,40px); }
.recommend-copy h3, .compact-card h3 { font-weight: 600; }
.site-footer { border-top: 1px solid var(--pearl-line); background: #edf1ef; }
.footer-links { font-weight: 400; font-size: 12px; }
.toast { border: 0; box-shadow: 0 8px 30px #10141826; font-weight: 500; }
.search-results { box-shadow: 0 12px 36px #18242816; }
.search-result:hover, .search-result:focus-visible { background: #edf3ff; }
.route-hero, .detail-hero { border: var(--border); box-shadow: var(--shadow); border-radius: 24px; }
.route-hero.tools, .route-hero.guide, .route-hero.games, .detail-hero.tool, .detail-hero.guide { background: linear-gradient(120deg,#fff,#edf2f6); }
.route-hero h1, .detail-hero h1 { font-weight: 650; font-size: clamp(32px,4vw,48px); letter-spacing: -.035em; line-height: 1.2; }
.route-hero > p, .detail-hero > div > p { font-weight: 400; color: var(--muted); font-size: 15px; }
.route-count { font-weight: 500; }
.catalog-card h2 { font-size: 24px; font-weight: 600; }
.catalog-card > p { font-weight: 400; font-size: 14px; }
.catalog-type, .status-pill { border: 0; font-size: 12px; font-weight: 500; padding: 5px 10px; }
.catalog-type { background: #eef2f7; color: #526272; }
.status-pill.ready { color: #39741d; background: #edf7e6; }
.status-pill.planned { background: #f0f2f1; color: var(--muted); }
.tag-row span { background: #f4f6f5; color: var(--muted); font-size: 12px; font-weight: 400; }
.catalog-card-bottom small { font-size: 12px; font-weight: 400; }
.primary-link, .favorite-button { border: 1px solid transparent; background: var(--pearl-blue); box-shadow: none; font-size: 14px; font-weight: 550; }
.favorite-button { background: #fff; border: var(--border); color: var(--muted); }
.favorite-button.saved { background: #edf3ff; color: var(--pearl-blue); }
.primary-link.disabled { background: #eef1f0; color: #65706a; border: 0; }
.detail-mark, .flow-list > div, .mini-list a { border: var(--border); box-shadow: none; }
.note-panel, .article-toc { background: #edf3ff; }
.upload-placeholder { border: 1px dashed #afbed0; background: #f5f8fc; }
.article-lead { font-weight: 500; }
/* Account content uses the existing mini-program data and markup. */
.web-profile-page { padding-top: 28px; background: transparent; }
.web-profile-page .header-title { font-weight: 650; }
.web-profile-page .identity-card { background: #fff; border: var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.web-profile-page .profile-hero { margin-bottom: 24px; }
.web-profile-page .profile-large { border: 1px solid #dde5ec; background: #edf3ff; box-shadow: 0 4px 14px #18242808; color: var(--pearl-blue); }
.web-profile-page .web-profile-nickname { font-size: 28px; font-weight: 600; color: var(--ink); }
.web-profile-page .identity-tip, .web-profile-page .input-label { color: var(--muted); }
.web-profile-page .id-strip { background: #f5f7f8; border: 1px solid #e8edef; border-radius: 12px; box-shadow: none; padding: 12px 16px; }
.web-profile-page .id-label, .web-profile-page .id-value { color: var(--muted); font-weight: 400; }
.web-profile-page .web-auth-button, .web-auth-button { border: 0; background: var(--pearl-blue); color: #fff; box-shadow: none; font-weight: 550; }
.web-profile-page .web-auth-button:hover, .web-auth-button:hover { background: #1d5fcc; }
.web-profile-page .web-auth-button:active { transform: scale(.98); }
.web-auth-status, .web-account-note { color: var(--muted); font-weight: 400; }
.web-account-panel h2, .web-account-panel h3 { font-weight: 600; }
.web-account-stats>div.checkin-card { background: #fff; border: var(--border); box-shadow: var(--shadow); padding: 22px; }
.web-account-stats strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.web-account-stats span { color: var(--muted); }
.web-service-records>div.record-card { background: #fff; border: var(--border); box-shadow: var(--shadow); border-radius: 16px; }
.web-service-records .record-title { color: var(--ink); font-weight: 550; }
/* Native tool pages retain their behavior while sharing the surface system. */
body[data-page=currency], body[data-page=lookup] { background: var(--paper); }
#native-app .currency-page, #native-app .lookup-page { background: transparent; }
#native-app :is(.hero-card,.query-card,.result-card,.currency-card,.board-card,.section-card,.search-card,.lookup-card) { border: var(--border); background: #fff; box-shadow: var(--shadow); border-radius: 20px; }
.article-card { background: #eef3fb; }
.article-meta, .article-index { border-color: var(--pearl-line); font-weight: 500; }
.filter-tabs { border: var(--border); background: #eef1f0; }
.filter-tabs button { min-height: 44px; font-weight: 500; }
.filter-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px #1824280a; }
.content-type { border: 0; font-weight: 500; }
.recommend-card > button, .ending-card > button { background: var(--pearl-blue); border: 0; font-size: 14px; font-weight: 550; }
.pixel-card { background: #202a3a; }
.pixel-card > button { background: #fff; color: #202a3a; }
#native-app { box-shadow: none; }
#native-app :is(.currency-converter,.currency-board,.editor-card,.preview-card) { background: #fff; border: var(--border); box-shadow: var(--shadow); border-radius: 24px; }
#native-app .guide-card { background: #edf3ff; border: 1px solid #e1e9f5; box-shadow: none; }
#native-app .guide-mark { background: #dce8ff; color: #235ba4; }
#native-app :is(.header-title,.section-title,.lookup-query-value) { color: var(--ink); font-weight: 600; }
#native-app :is(.guide-copy,.field-hint,.header-subtitle) { color: var(--muted); }
#native-app :is(.lookup-query,.primary-button) { background: var(--pearl-blue); color: #fff; border: 0; box-shadow: none; }
#native-app :is(.lookup-my-ip,.lookup-copy) { background: #edf3ff; border: 1px solid #dae5f5; color: #235ba4; }
#native-app .lookup-input { background: #f8fafc; border-color: #dce3e9; color: var(--ink); }
#native-app :is(.country-select,.picker-search) { background: #f7f9fc; border-color: #dce5ef; box-shadow: none; }
#native-app .country-select-copy { border-color: #8daee2; }
#native-app .country-select-code { background: #fff; border-color: #dae4f1; color: #426693; font-weight: 500; }
#native-app :is(.country-name,.amount-input) { font-weight: 600; }
#native-app :is(.result-number,.result-symbol,.mode-tab-active,.board-filter-active) { color: var(--pearl-blue); }
#native-app .swap-button { background: #edf3ff; color: var(--pearl-blue); box-shadow: 0 4px 16px #236de915; }
#native-app .mode-tab-active::before, #native-app .board-filter-active::before { background: var(--pearl-blue); }
#native-app :is(.currency-label,.amount-code,.result-code,.amount-prefix) { color: var(--muted); font-weight: 500; }
#native-app :is(.back-button,.back-btn) { background: #fff; color: var(--muted); border: var(--border); box-shadow: none; }
@media(max-width:720px) {
  .header-inner { min-height: 66px; }
  .hero { padding: 28px 22px 230px; min-height: 0; margin-top: 20px; border-radius: 22px; }
  .hero h1 { font-size: clamp(28px,7.2vw,40px); }
  .hero-desc { font-size: 14px; }
  .worlds, .continue-section, .recommendations { padding-top: 40px; }
  .world-card { min-height: 380px; }
  .route-hero h1, .detail-hero h1 { font-size: 32px; }
  .mobile-nav { background: #ffffffed; border: 1px solid var(--pearl-line); box-shadow: 0 -4px 24px #18242806; }
  .mobile-nav a { color: var(--muted); font-weight: 500; }
  .mobile-nav a.active { color: var(--pearl-blue); background: #edf3ff; }
  .web-profile-page { padding-top: 16px; }
  .web-profile-page .web-profile-nickname { font-size: 23px; }
  .web-profile-page .profile-hero { padding: 22px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* Original Qiguai palette and cover treatments, with the lighter layout above. */
.site-header { background: rgba(255,249,237,.94); }
.desktop-nav, .filter-tabs { background: #f4eddf; }
.profile-icon-bg { background: var(--yellow); color: var(--ink); }
.hero { background: radial-gradient(circle at 82% 22%,rgba(111,168,255,.38),transparent 30%),radial-gradient(circle at 72% 78%,rgba(124,85,231,.27),transparent 31%),linear-gradient(135deg,#fff4d1 0%,#fffaf0 54%,#ffeadb 100%); }
.hero h1 em { color: var(--purple); }
.hero-search > button { background: var(--ink); }
.spark { color: #f0b63a; }
.product-tools { background: #ffd2bf; }
.product-guide { background: #d7e6ff; }
.product-games { background: #ded4ff; }
.toolbox-card { background: radial-gradient(ellipse at 85% 12%,rgba(255,235,137,.85),transparent 65%),linear-gradient(155deg,#ffae6e 0%,#ff874e 40%,#ff654b 75%,#f95255 100%); }
.world-card.guide-card { background: radial-gradient(ellipse at 52% 35%,rgba(255,231,177,.72),transparent 58%),linear-gradient(155deg,#f1d4a3 0%,#dfb27c 40%,#c49160 75%,#ae784e 100%); }
.games-card { background: radial-gradient(ellipse at 85% 12%,rgba(255,254,226,.88),transparent 62%),linear-gradient(180deg,#fff4d6 0%,#f7dcaa 35%,#eab978 70%,#d8934f 100%); color: #49351f; }
.world-card-copy p, .world-number { color: inherit; }
.world-action { color: var(--ink); }
.world-action i { background: var(--ink); color: #fff; }
.games-card .world-action { color: #49351f; }
.games-card .world-action i { background: #49351f; color: #fff; }
.games-card .world-badge { background: #ffffffb3; color: #49351f; }
.catalog-card.tool { background: #fff1e9; }
.catalog-card.guide { background: #edf4ff; }
.catalog-card.game { background: #f0eaff; }
.route-hero.tools { background: radial-gradient(ellipse at 85% 12%,rgba(255,235,137,.85),transparent 65%),linear-gradient(155deg,#ffae6e 0%,#ff874e 40%,#ff654b 75%,#f95255 100%); }
.route-hero.guide { background: radial-gradient(ellipse at 52% 35%,rgba(255,231,177,.72),transparent 58%),linear-gradient(155deg,#f1d4a3 0%,#dfb27c 40%,#c49160 75%,#ae784e 100%); }
.route-hero.games { background: radial-gradient(ellipse at 85% 12%,rgba(255,254,226,.88),transparent 62%),linear-gradient(180deg,#fff4d6 0%,#f7dcaa 35%,#eab978 70%,#d8934f 100%); color: #49351f; }
.route-hero > p, .route-hero .section-kicker { color: #49351f; }
.route-hero.games > p, .route-hero.games .section-kicker { color: #49351f; }
.feature-tool { background: #ffe8db; }
.article-card { background: var(--blue); }
.pixel-card { background: #302047; }
.pixel-card > button { background: var(--green); color: var(--ink); }
.compact-card.purple { background: #dcd0ff; }
.compact-card.yellow, .ending-card { background: var(--yellow); }
.compact-symbol { background: #ffffff8c; }
.recommend-card > button, .ending-card > button, .primary-link { background: var(--ink); }
.primary-link.disabled { background: #e8e4db; color: #5e5a54; }
.site-footer { background: #f5eddf; }
.note-panel { background: var(--yellow); }
.article-toc { background: #d8e7ff; }
.web-profile-page .identity-card { background: linear-gradient(135deg,#ff7044,#ff9662); }
.web-profile-page .profile-large { background: var(--yellow); color: var(--ink); border-color: #ffffff80; }
.web-profile-page .identity-tip, .web-profile-page .input-label { color: #4a281b; }
.web-profile-page .id-strip { background: #fff6e8b8; border-color: #fff3; }
.web-profile-page .id-label, .web-profile-page .id-value { color: #684a2d; }
.web-profile-page .web-auth-button { background: #fff8eb; color: #744323; }
.web-profile-page .web-auth-button:hover { background: #fff0d6; }
.web-account-stats>div.checkin-card, .web-service-records>div.record-card { background: #fffaf0; }

/* Reuse the mini-game home sprite: pad source rect [0,0,850,724]. */
.games-card .arcade {
  width: 260px; height: 221.46px; left: 50%; top: 70px; margin-left: -130px;
  border: 0; border-radius: 0; box-shadow: none;
  background: url('./gamebox-home-art.webp') left top / 255.5294118% 100% no-repeat;
  transform: rotate(-4deg);
  filter: drop-shadow(0 14px 12px rgba(32,20,72,.20));
  animation: gamepad-float 3.4s ease-in-out infinite;
}
.games-card:hover .arcade { animation-duration: 2.8s; }
@keyframes gamepad-float {
  0%,100% { transform: translateY(3px) rotate(-4deg); }
  50% { transform: translateY(-7px) rotate(-1deg); }
}
.games-card .arcade > * { display: none; }
@media(max-width:720px) {
  .games-card .arcade { width: 230px; height: 195.91px; margin-left: -115px; top: 52px; }
}
@media(prefers-reduced-motion:reduce) { .games-card .arcade { animation: none; } }

/* Match each section header to its homepage character. */
.route-hero.tools, .route-hero.games { padding-right: 310px; }
.route-hero.tools::before, .route-hero.games::before {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  width: 240px; height: 240px; right: 45px; top: 65px;
  filter: drop-shadow(0 12px 12px rgba(73,42,20,.18));
}
.route-hero.tools::before { background: url('./toolbox-chest-v3.png') center / contain no-repeat; animation: chest-float 2.8s ease-in-out infinite; }
.route-hero.games::before { width: 260px; height: 221.46px; right: 35px; top: 78px; background: url('./gamebox-home-art.webp') left top / 255.5294118% 100% no-repeat; animation: gamepad-float 3.4s ease-in-out infinite; }
.route-guide-art { animation: guide-float 3.3s ease-in-out infinite; }
@media(max-width:980px) {
  .route-hero.tools, .route-hero.games { padding-right: 215px; }
  .route-hero.tools::before { width: 170px; height: 170px; right: 24px; }
  .route-hero.games::before { width: 180px; height: 153.32px; right: 20px; }
}
@media(max-width:720px) {
  .route-hero.tools, .route-hero.games { padding-right: 22px; padding-bottom: 150px; }
  .route-hero.tools::before { width: 140px; height: 140px; top: auto; bottom: 4px; right: 16px; }
  .route-hero.games::before { width: 160px; height: 136.28px; top: auto; bottom: 8px; right: 12px; }
}
@media(prefers-reduced-motion:reduce) { .route-hero::before, .route-guide-art { animation: none; } }

/* Tighter section banners: balance the title block against larger artwork. */
@media(min-width:981px) {
  .route-hero { min-height: 280px; padding: 36px 390px 36px 44px; }
  .route-hero.tools, .route-hero.guide, .route-hero.games { padding-right: 390px; }
  .route-hero .back-link { margin-bottom: 26px; }
  .route-hero h1 { margin: 10px 0 12px; font-size: 52px; }
  .route-hero.tools::before { width: 330px; height: 280px; right: 65px; top: 2px; }
  .route-guide-art { width: 260px; height: 260px; right: 85px; top: 18px; }
  .route-hero.games::before { width: 300px; height: 255.53px; right: 70px; top: 16px; }
}
.continue-icon.approved-recent-icon { position:relative; overflow:hidden; background:#fff8ef; border:1px solid #efe0cd; }
.approved-recent-icon img { width:100%; height:100%; object-fit:contain; padding:5px; visibility:hidden; }
.approved-recent-icon[data-art-state="ready"] img { visibility:visible; }
.approved-recent-icon.controller-crop img { position:absolute; width:300%; max-width:none; height:100%; padding:0; object-fit:fill; left:0; top:0; }
.recent-art-loading { width:22px; height:22px; border:2px solid #ead9c4; border-top-color:#ad7144; border-radius:50%; animation:recent-art-spin .8s linear infinite; position:absolute; }
.recent-art-loading[hidden],.recent-art-retry[hidden] { display:none; }
.recent-art-retry { position:absolute; inset:0; background:#fff8ef; color:#795138; font-size:12px; border:0; cursor:pointer; min-height:44px; }
@keyframes recent-art-spin { to { transform:rotate(360deg); } }
:root { --qiguai-approved-theme: approved-game-gradient-3; }

/* Keep primary navigation centered independently of either action column. */
html { scrollbar-gutter: stable; }
@media (min-width:721px) {
  .site-header .header-inner { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
  .site-header .header-inner > .brand { justify-self:start; }
  .site-header .header-inner > .desktop-nav { justify-self:center; }
  .site-header .header-inner > .header-actions,
  .site-header .header-inner > .profile-button { justify-self:end; }
}
@media (min-width:721px) and (max-width:860px) {
  .site-header .desktop-nav .nav-link { padding-inline:14px; }
}
