/* ============================================================
   桌游合集 · 门户样式
   七套主题通过 <html data-theme="…"> 切换，所有组件只读变量
   ============================================================ */

/* ---------------- 主题变量 ---------------- */
:root,
html[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0b0714;
  --bg2: #170c27;
  --surface: rgba(30, 20, 46, .72);
  --surface-solid: #1e142e;
  --surface2: #2a1c3f;
  --ink: #f5eefc;
  --muted: #a99bc4;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .2);
  --accent: #b57bff;
  --accent2: #f5c66b;
  --accent-soft: rgba(181, 123, 255, .16);
  --shadow: 0 22px 60px rgba(5, 0, 15, .55);
  --glow-a: rgba(150, 80, 255, .32);
  --glow-b: rgba(245, 198, 107, .18);
  --nav: rgba(16, 9, 28, .68);
}

html[data-theme="parchment"] {
  color-scheme: light;
  --bg: #f6ead3;
  --bg2: #e8d3ae;
  --surface: rgba(255, 251, 242, .82);
  --surface-solid: #fffaf0;
  --surface2: #f3e4c8;
  --ink: #3a2a18;
  --muted: #8b7154;
  --line: rgba(90, 60, 25, .14);
  --line-strong: rgba(90, 60, 25, .26);
  --accent: #a9742c;
  --accent2: #8c3f36;
  --accent-soft: rgba(169, 116, 44, .14);
  --shadow: 0 22px 50px rgba(120, 85, 40, .18);
  --glow-a: rgba(210, 160, 90, .3);
  --glow-b: rgba(140, 63, 54, .14);
  --nav: rgba(250, 241, 224, .8);
}

html[data-theme="bamboo"] {
  color-scheme: light;
  --bg: #eef8ef;
  --bg2: #d7ecdd;
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #ffffff;
  --surface2: #e6f4ea;
  --ink: #22372a;
  --muted: #6b8474;
  --line: rgba(30, 70, 45, .12);
  --line-strong: rgba(30, 70, 45, .22);
  --accent: #2c9c68;
  --accent2: #7fbf8f;
  --accent-soft: rgba(44, 156, 104, .13);
  --shadow: 0 22px 50px rgba(40, 100, 65, .14);
  --glow-a: rgba(90, 200, 140, .3);
  --glow-b: rgba(180, 220, 160, .3);
  --nav: rgba(244, 252, 246, .8);
}

html[data-theme="neon"] {
  color-scheme: dark;
  --bg: #050711;
  --bg2: #0c0a20;
  --surface: rgba(15, 22, 44, .74);
  --surface-solid: #101728;
  --surface2: #16203a;
  --ink: #e6f7ff;
  --muted: #8ba4c7;
  --line: rgba(120, 220, 255, .14);
  --line-strong: rgba(120, 220, 255, .28);
  --accent: #34e5d0;
  --accent2: #ff54d8;
  --accent-soft: rgba(52, 229, 208, .14);
  --shadow: 0 22px 60px rgba(0, 10, 25, .6);
  --glow-a: rgba(52, 229, 208, .28);
  --glow-b: rgba(255, 84, 216, .22);
  --nav: rgba(7, 12, 26, .74);
}

html[data-theme="sunset"] {
  color-scheme: light;
  --bg: #fff3e6;
  --bg2: #ffd8c3;
  --surface: rgba(255, 253, 249, .84);
  --surface-solid: #fffdf9;
  --surface2: #ffe9d8;
  --ink: #4a2c1e;
  --muted: #a2765f;
  --line: rgba(120, 60, 30, .13);
  --line-strong: rgba(120, 60, 30, .24);
  --accent: #ef6f3c;
  --accent2: #ffb347;
  --accent-soft: rgba(239, 111, 60, .14);
  --shadow: 0 22px 50px rgba(200, 110, 60, .18);
  --glow-a: rgba(255, 150, 90, .32);
  --glow-b: rgba(255, 200, 120, .3);
  --nav: rgba(255, 245, 235, .82);
}

html[data-theme="forest"] {
  color-scheme: dark;
  --bg: #08130f;
  --bg2: #112a20;
  --surface: rgba(18, 40, 32, .76);
  --surface-solid: #142b22;
  --surface2: #1c3a2e;
  --ink: #e9f5ed;
  --muted: #94b8a5;
  --line: rgba(160, 220, 190, .12);
  --line-strong: rgba(160, 220, 190, .24);
  --accent: #5ecb8d;
  --accent2: #e3c56a;
  --accent-soft: rgba(94, 203, 141, .14);
  --shadow: 0 22px 60px rgba(0, 20, 12, .55);
  --glow-a: rgba(70, 190, 130, .26);
  --glow-b: rgba(227, 197, 106, .16);
  --nav: rgba(10, 26, 20, .72);
}

html[data-theme="mono"] {
  color-scheme: light;
  --bg: #f8f8f6;
  --bg2: #e9e9e5;
  --surface: rgba(255, 255, 255, .9);
  --surface-solid: #ffffff;
  --surface2: #f1f1ee;
  --ink: #1d1d1b;
  --muted: #767672;
  --line: rgba(0, 0, 0, .1);
  --line-strong: rgba(0, 0, 0, .22);
  --accent: #2b2b28;
  --accent2: #8d8d86;
  --accent-soft: rgba(0, 0, 0, .06);
  --shadow: 0 20px 46px rgba(0, 0, 0, .1);
  --glow-a: rgba(0, 0, 0, .06);
  --glow-b: rgba(0, 0, 0, .04);
  --nav: rgba(252, 252, 250, .85);
}

/* ---------------- 基础 ---------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .45s ease, color .45s ease;
}

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------------- 背景 ---------------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-grad {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 12% -10%, var(--glow-a) 0%, transparent 55%),
    radial-gradient(90% 80% at 95% 8%, var(--glow-b) 0%, transparent 52%),
    linear-gradient(170deg, var(--bg) 0%, var(--bg2) 100%);
  transition: background .45s ease;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
}
.orb-a { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: var(--glow-a); }
.orb-b { width: 34vw; height: 34vw; right: -8vw; top: 18vh; background: var(--glow-b); animation-delay: -7s; }
.orb-c { width: 40vw; height: 40vw; left: 30vw; bottom: -22vw; background: var(--glow-a); opacity: .3; animation-delay: -13s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3vw, 4vh, 0) scale(1.08); }
}
.grid-lines {
  position: absolute; inset: 0; opacity: .16;
  background-image:
    linear-gradient(var(--line-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-strong) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
}
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 50% 40%, transparent 45%, rgba(0, 0, 0, .22) 100%);
}
html[data-theme="parchment"] .vignette,
html[data-theme="bamboo"] .vignette,
html[data-theme="sunset"] .vignette,
html[data-theme="mono"] .vignette { opacity: .35; }
.sparkles { position: absolute; inset: 0; }
.sparkles i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent); opacity: .55;
  animation: twinkle 5s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(.7); }
  50% { opacity: .8; transform: scale(1.3); }
}

/* ---------------- 顶栏 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px clamp(16px, 4vw, 48px);
  background: var(--nav);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.brand-mark { display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 17px; letter-spacing: .06em; color: var(--ink); }
.brand-text i {
  font-style: normal; font-size: 9px; letter-spacing: .28em;
  color: var(--muted); margin-top: 4px;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--ink);
  transition: border-color .2s, transform .2s, background .2s;
}
.nav-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.nav-ico { font-size: 15px; color: var(--accent); line-height: 1; }
.nav-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, .18);
  margin-left: 1px;
}

/* ---------------- 公网访问面板 ---------------- */
.tunnel-state {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface2); font-size: 13.5px;
}
.tunnel-state b { font-weight: 700; }
.tunnel-state span:last-child { color: var(--muted); font-size: 12.5px; margin-left: auto; text-align: right; }
.tunnel-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
  background: var(--muted); opacity: .5;
}
.tunnel-dot.on { background: #35d07f; opacity: 1; box-shadow: 0 0 0 4px rgba(53, 208, 127, .16); }
.tunnel-dot.wait { background: var(--accent2); opacity: 1; animation: tunnelPulse 1.1s ease-in-out infinite; }
.tunnel-dot.bad { background: #e0575f; opacity: 1; }
@keyframes tunnelPulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

.tunnel-url-row { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.tunnel-url-row .text-input { font-size: 13px; }
.tunnel-actions { display: flex; gap: 10px; align-items: center; }
.tunnel-actions .btn-primary { flex: 1; }
.tunnel-note {
  margin: 16px 0 0; font-size: 12.5px; line-height: 1.7;
  color: var(--muted); border-top: 1px dashed var(--line); padding-top: 13px;
}
.profile-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .2s, transform .2s;
}
.profile-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.profile-chip img {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); object-fit: cover;
  border: 1px solid var(--line-strong);
}
.pc-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.pc-text b { font-size: 12.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-text i { font-style: normal; font-size: 9.5px; color: var(--muted); margin-top: 2px; letter-spacing: .06em; }
.pc-edit { font-size: 12px; color: var(--muted); }

/* ---------------- 首屏 ---------------- */
main { position: relative; z-index: 1; width: min(1240px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

.hero-copy { min-width: 0; }

.hero {
  display: grid; grid-template-columns: 1.05fr .95fr;
  align-items: center; gap: clamp(20px, 5vw, 60px);
  padding: clamp(40px, 7vw, 92px) 0 clamp(30px, 4vw, 52px);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .24em; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hero h1 {
  font-size: clamp(44px, 8.4vw, 92px);
  line-height: .98; letter-spacing: .04em;
  margin: 18px 0 20px;
  font-weight: 800;
  background: linear-gradient(120deg, var(--ink) 20%, var(--accent) 78%, var(--accent2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 站名较长（个人互动项目演示站-交互作品）：单独降到标题级字号，
   中文按字断行正好两行，不会把首屏撑爆，也不影响短标题场景。 */
.hero h1.is-long {
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 1.14; letter-spacing: .01em;
}
@media (max-width: 430px) {
  .hero h1.is-long { font-size: clamp(25px, 7.4vw, 34px); line-height: 1.2; }
}

.lede {
  font-size: clamp(14px, 1.5vw, 16.5px); line-height: 1.85;
  color: var(--muted); max-width: 34em;
  overflow-wrap: anywhere; word-break: break-word;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 14px 30px -12px var(--accent);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
html[data-theme="parchment"] .btn-primary,
html[data-theme="bamboo"] .btn-primary,
html[data-theme="sunset"] .btn-primary,
html[data-theme="mono"] .btn-primary { color: #fff; }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 18px 36px -14px var(--accent); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: border-color .2s, transform .2s;
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-1px); }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: clamp(18px, 3vw, 34px);
  list-style: none; margin-top: 34px;
}
.hero-stats li { display: flex; flex-direction: column; gap: 4px; }
.hero-stats b { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; letter-spacing: .02em; }
.hero-stats span { font-size: 11px; color: var(--muted); letter-spacing: .1em; }

.hero-art { position: relative; aspect-ratio: 1 / .9; max-height: 460px; }
.table-scene { width: 100%; height: 100%; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .35)); }
html[data-theme="parchment"] .table-scene,
html[data-theme="bamboo"] .table-scene,
html[data-theme="sunset"] .table-scene,
html[data-theme="mono"] .table-scene { filter: drop-shadow(0 24px 40px rgba(90, 60, 30, .2)); }
.seat { animation: bob 5.5s ease-in-out infinite; transform-origin: center; }
.seat:nth-of-type(2) { animation-delay: -1.4s; }
.seat:nth-of-type(3) { animation-delay: -2.8s; }
.seat:nth-of-type(4) { animation-delay: -4.2s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.float-star { animation: twinkle 4s ease-in-out infinite; }

/* ---------------- 区块 ---------------- */
.section { padding: clamp(34px, 5vw, 64px) 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 24px;
}
.section-head h2 {
  font-size: clamp(22px, 3.2vw, 30px); font-weight: 800; letter-spacing: .04em;
}
.section-head p { font-size: 13px; color: var(--muted); margin-top: 8px; }
.section-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--muted);
}

/* ---------------- 游戏卡片 ---------------- */
.game-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 20px);
}
.game-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 0;
  padding: 22px 22px 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  text-align: left;
  transition: transform .28s cubic-bezier(.2, .7, .3, 1), border-color .28s, box-shadow .28s;
}
.game-card::before {
  content: ""; position: absolute; inset: -1px;
  background: radial-gradient(80% 60% at 20% 0%, var(--game-accent, var(--accent)) 0%, transparent 62%);
  opacity: .16; transition: opacity .3s; pointer-events: none;
  z-index: 0;
}
/* 玻璃遮罩是绝对定位伪元素，会把普通流文字压在下面 —— 内容统一抬到遮罩之上 */
.game-card > * { position: relative; z-index: 1; }
.game-card::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--game-accent, var(--accent));
  box-shadow: var(--shadow);
}
.game-card:hover::before { opacity: .3; }

.gc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gc-icon {
  width: 74px; height: 74px; border-radius: 20px; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 22px -12px var(--game-accent, var(--accent));
}
.gc-icon img { width: 100%; height: 100%; object-fit: cover; }
.gc-index {
  font-size: 34px; font-weight: 900; letter-spacing: -.04em;
  color: var(--game-accent, var(--accent)); opacity: .22; line-height: 1;
}
.gc-name { font-size: 21px; font-weight: 800; margin-top: 18px; letter-spacing: .02em; }
.gc-tagline { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.6; min-height: 2.4em; }
.gc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.gc-tags span {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--game-accent, var(--accent));
  border: 1px solid var(--line);
}
.gc-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 20px; padding-top: 15px;
  border-top: 1px dashed var(--line);
}
.gc-meta { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.gc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.gc-dot.on { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.gc-play {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; color: #fff;
  background: linear-gradient(120deg, var(--game-accent, var(--accent)), var(--game-accent2, var(--accent2)));
  box-shadow: 0 10px 20px -12px var(--game-accent, var(--accent));
  transition: filter .2s, transform .2s;
}

/* 卡片上的「复制邀请链接」按钮：整页跳转后，链接分享改由这里完成 */
.gc-foot-actions { display: inline-flex; align-items: center; gap: 8px; }
.gc-share {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: 50%; font-size: 15px; line-height: 1;
  color: var(--ink-soft, var(--text)); background: var(--surface2, var(--surface));
  border: 1px solid var(--line);
  cursor: pointer; opacity: .75;
  transition: opacity .2s, transform .2s, border-color .2s;
}
.gc-share:hover { opacity: 1; transform: scale(1.06); border-color: var(--accent); }
.gc-share:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.game-card:hover .gc-play { filter: brightness(1.08); transform: translateX(2px); }

.skeleton {
  height: 320px; border-radius: 24px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  border: 1px solid var(--line);
}
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }

.add-game-card {
  margin-top: clamp(12px, 1.8vw, 20px);
  border: 1.5px dashed var(--line-strong);
  border-radius: 22px; padding: 18px 22px;
  background: transparent;
  transition: border-color .2s, background .2s;
}
.add-game-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.agc-inner { display: flex; align-items: center; gap: 16px; }
.agc-plus {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 22px;
  color: var(--accent); background: var(--surface2);
  border: 1px solid var(--line);
}
.agc-inner b { font-size: 14px; }
.agc-inner p { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.agc-inner code {
  padding: 1px 6px; border-radius: 5px; font-size: 11px;
  background: var(--accent-soft); color: var(--accent);
}

/* ---------------- 特性 ---------------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 18px);
}
.feature {
  padding: 22px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--surface);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .24s, border-color .24s;
}
.feature:hover { transform: translateY(-4px); border-color: var(--accent); }
.f-ico {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; font-size: 19px;
  background: var(--accent-soft); border: 1px solid var(--line);
}
.feature h3 { font-size: 14.5px; margin: 14px 0 8px; letter-spacing: .02em; }
.feature p { font-size: 12.5px; line-height: 1.8; color: var(--muted); }

/* ---------------- 代码 / 步骤 ---------------- */
.code-card {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(16px, 2.4vw, 30px);
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: 24px; border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.code-tree pre { overflow-x: auto; padding: 4px; }
.code-tree code {
  font-size: 12px; line-height: 1.85; color: var(--ink);
  white-space: pre; letter-spacing: .01em;
}
.code-tree i { color: var(--muted); font-style: normal; }
.steps { list-style: none; display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
.steps li {
  position: relative; padding-left: 40px; counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--line-strong);
}
.steps b { font-size: 13.5px; display: block; }
.steps span { font-size: 12px; color: var(--muted); line-height: 1.7; display: block; margin-top: 4px; }
.steps code {
  padding: 1px 5px; border-radius: 5px; font-size: 11px;
  background: var(--accent-soft); color: var(--accent);
}

/* ---------------- 页脚 ---------------- */
.foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 10px; padding: 36px 20px 44px;
  font-size: 11.5px; color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.foot-dot { opacity: .5; }
.foot-disclaimer {
  flex: 1 0 100%;
  text-align: center;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: .3px;
  color: var(--muted);
  opacity: .78;
}
.foot a:hover { color: var(--accent); }

/* ---------------- 弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(5, 3, 10, .6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sheet-mask.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: min(760px, 100%); max-height: 90vh; overflow-y: auto;
  padding: clamp(20px, 2.6vw, 30px);
  border-radius: 26px;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  animation: sheetIn .26s cubic-bezier(.2, .8, .3, 1);
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.sheet-narrow { width: min(560px, 100%); }
.sheet-wide { width: min(860px, 100%); }

.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.sheet-head h3 { font-size: 18px; letter-spacing: .04em; }
.sheet-head p { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.x-btn {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px;
  color: var(--muted); border: 1px solid var(--line);
  transition: color .2s, border-color .2s, transform .2s;
}
.x-btn:hover { color: var(--ink); border-color: var(--accent); transform: rotate(90deg); }

/* 主题面板 */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-opt {
  display: flex; align-items: center; gap: 13px;
  padding: 12px; border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--surface-solid);
  transition: border-color .2s, transform .2s;
  text-align: left;
}
.theme-opt:hover { transform: translateY(-2px); }
.theme-opt.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-swatch {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  border: 1px solid var(--line-strong);
  position: relative; overflow: hidden;
}
.theme-swatch i {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  right: 5px; bottom: 5px;
}
.theme-opt b { font-size: 13px; display: block; }
.theme-opt span { font-size: 10.5px; color: var(--muted); display: block; margin-top: 3px; }

/* 资料 */
.profile-preview {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 22px;
}
.pp-avatar {
  width: 66px; height: 66px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: var(--accent-soft);
  border: 2px solid var(--accent);
  display: grid; place-items: center;
}
.pp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pp-meta b { font-size: 16px; display: block; }
.pp-meta span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 6px; line-height: 1.6; }

.field-label {
  display: block; font-size: 11.5px; font-weight: 700;
  color: var(--muted); letter-spacing: .08em; margin: 18px 0 9px;
}
.text-input {
  width: 100%; padding: 12px 14px; border-radius: 13px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.text-input::placeholder { color: var(--muted); opacity: .7; }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.avatar-opt {
  aspect-ratio: 1; border-radius: 50%; overflow: hidden; padding: 0;
  border: 2px solid transparent; background: var(--surface2);
  transition: transform .18s, border-color .18s;
}
.avatar-opt img { width: 100%; height: 100%; object-fit: cover; }
.avatar-opt:hover { transform: scale(1.08); }
.avatar-opt.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.upload-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.upload-btn {
  display: inline-flex; align-items: center;
  padding: 10px 16px; border-radius: 999px;
  border: 1px dashed var(--line-strong); background: var(--surface);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.upload-tip { font-size: 11px; color: var(--muted); }

.sheet-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
}
.foot-right { display: flex; gap: 10px; margin-left: auto; }
.foot-note { font-size: 11px; color: var(--muted); }
.btn-text-danger {
  font-size: 12px; color: var(--muted); text-decoration: underline;
  text-underline-offset: 3px; transition: color .2s;
}
.btn-text-danger:hover { color: #ef6b6b; }

/* 表情中心 */
.emoji-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.etab {
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  transition: all .2s;
}
.etab:hover { color: var(--ink); border-color: var(--line-strong); }
.etab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.emoji-body { min-height: 240px; }
.emoji-block { margin-bottom: 22px; }
.emoji-block h4 {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .1em; margin-bottom: 10px;
}
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 5px; }
.emoji-cell {
  aspect-ratio: 1; border-radius: 11px; font-size: 21px; line-height: 1;
  display: grid; place-items: center;
  border: 1px solid transparent; background: transparent;
  transition: background .16s, transform .16s;
}
.emoji-cell:hover { background: var(--accent-soft); transform: scale(1.14); }

.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pack-cell {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px 8px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .2s, transform .2s;
}
.pack-cell:hover { border-color: var(--accent); transform: translateY(-2px); }
.pack-cell span { font-size: 24px; line-height: 1.1; }
.pack-cell em { font-style: normal; font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.3; }

.game-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.game-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted);
  transition: all .2s;
}
.game-tab img { width: 22px; height: 22px; border-radius: 6px; }
.game-tab.active { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }

.custom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.custom-item { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.custom-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.custom-item b {
  display: block; font-size: 10.5px; font-weight: 600; color: var(--muted);
  padding: 6px 7px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.custom-del {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px;
  background: rgba(0, 0, 0, .55); color: #fff;
  opacity: 0; transition: opacity .2s;
}
.custom-item:hover .custom-del { opacity: 1; }
.custom-add {
  display: grid; place-items: center; gap: 4px;
  border-radius: 14px; border: 1.5px dashed var(--line-strong);
  background: transparent; color: var(--muted);
  aspect-ratio: 1; font-size: 11px; font-weight: 700;
  transition: border-color .2s, color .2s;
}
.custom-add span { font-size: 22px; line-height: 1; }
.custom-add:hover { border-color: var(--accent); color: var(--accent); }
.empty-tip {
  font-size: 12px; color: var(--muted); line-height: 1.9;
  padding: 26px; border-radius: 16px; text-align: center;
  border: 1px dashed var(--line-strong);
}

/* 游戏窗口 */
.game-head { padding: 16px 18px; margin: 0; border-bottom: 1px solid var(--line); align-items: center; }
.gh-left { display: flex; align-items: center; gap: 12px; }
.gh-left img { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); }
.gh-left h3 { font-size: 16px; }
.gh-left p { font-size: 11px; color: var(--muted); margin-top: 4px; }
.gh-actions { display: flex; align-items: center; gap: 8px; }
.icon-txt-btn {
  padding: 7px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  border: 1px solid var(--line); color: var(--muted);
  transition: color .2s, border-color .2s;
}
.icon-txt-btn:hover { color: var(--accent); border-color: var(--accent); }

.game-frame-wrap { position: relative; flex: 1; min-height: 380px; background: var(--surface2); }
.frame-loading {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--surface-solid); font-size: 12.5px; color: var(--muted);
}
.frame-loading[hidden] { display: none; }
[hidden] { display: none !important; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line-strong); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.game-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.btn-small { padding: 8px 14px; font-size: 11.5px; }

/* Toast */
.toast-wrap {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 20px; border-radius: 999px;
  background: var(--surface-solid); color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600;
  opacity: 0; transform: translateY(8px);
  animation: toastIn .26s ease forwards;
}
.toast.err { border-color: #ef6b6b; color: #ef6b6b; }
@keyframes toastIn { to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-card { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-height: 340px; margin: 0 auto; width: min(420px, 100%); }
  .hero h1 { letter-spacing: .02em; }
}

@media (max-width: 760px) {
  .nav { padding: 10px 14px; gap: 10px; }
  .brand-text i { display: none; }
  .nav-label { display: none; }
  .nav-btn { padding: 9px 11px; }
  .profile-chip { padding: 4px 9px 4px 4px; }
  .pc-text i { display: none; }
  .pc-text b { max-width: 76px; font-size: 12px; }
  .pc-edit { display: none; }

  main { padding: 0 14px; }
  .hero { padding-top: 30px; gap: 14px; }
  .hero-art { max-height: 230px; }
  .hero-stats { gap: 18px 26px; margin-top: 24px; }
  .pc-only { display: none; }

  .game-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .game-card { padding: 18px; border-radius: 20px; }
  .gc-share { width: 40px; height: 40px; font-size: 17px; }
  .gc-icon { width: 60px; height: 60px; border-radius: 16px; }
  .gc-index { font-size: 26px; }

  .sheet-mask { padding: 0; align-items: flex-end; }
  .sheet {
    width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
  .theme-grid { grid-template-columns: 1fr; }
  .code-tree code { font-size: 10.5px; }
  .foot { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
  .aa-tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============ 分页面音频（增量追加）：音乐按钮与弹窗复用大厅现有控件变量 ============ */
body{
  --hg-ink:var(--ink); --hg-surface:var(--surface); --hg-surface-solid:var(--surface-solid);
  --hg-surface2:var(--surface2); --hg-line:var(--line); --hg-accent:var(--accent);
  --hg-accent-soft:var(--accent-soft); --hg-shadow:var(--shadow); --hg-round:16px;
}
/* 和顶栏 nav-btn 完全同尺寸，融进导航条 */
.nav-actions .hubmus-btn{min-height:38px;padding:9px 14px;font-size:13px;box-shadow:none;}
@media (max-width:720px){ .nav-actions .hubmus-btn{width:44px;min-width:44px;height:44px;min-height:44px;padding:0;} }

/* ============ 窄屏（手机，含 PWA 独立窗口）头部修正 ============
   390px 这类宽度下，品牌会被 .nav-actions 挤压到逐字换行，
   同时整行 nowrap 会把页面顶出横向滚动条。这里让品牌不被压缩、
   操作区在自身内部横向滚动，页面宽度不再溢出。 */
@media (max-width: 430px) {
  /* 390px 下：品牌 118 + 操作区 256 + 间距 8 会超出内容宽 362，
     所以把两侧的内边距和间隙一起收紧，正好放下且不产生横向滚动。 */
  .nav { gap: 6px; }
  .brand { flex: 0 0 auto; gap: 8px; }
  .brand-text b { white-space: nowrap; }
  .nav-actions { gap: 6px; }
  .nav-btn { padding: 9px 9px; }
  .nav-actions {
    /* 不参与收缩：按内容宽度排，否则头像芯片会被压窄、右侧被裁。
       右对齐交给 .nav 的 space-between，这里再加 auto 边距会和它抢空余空间。 */
    flex: 0 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 1px;
  }
  .nav-actions::-webkit-scrollbar { display: none; }
  /* 子项一律不压缩：否则头像芯片会被挤窄、头像溢出到屏幕外 */
  .nav-actions > * { flex: 0 0 auto; }
  /* 头像芯片只留头像，名字与编辑按钮收起 */
  .profile-chip .pc-text,
  .profile-chip .pc-edit { display: none; }
  .profile-chip { padding: 4px; }
}

/* 超窄屏（≤371px，如 360px 安卓）：只留图标，保证整行仍能放下 */
@media (max-width: 371px) {
  .brand-text { display: none; }
}

/* 首屏合规说明（非经营性等） */
.hero-fine {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .3px;
}
