/* ==========================================================================
   PickFun Shared Design System — Direction B: Playful Neo-Pop / Bento
   包含：全局色彩令牌、点阵背景、统一街机顶栏、胶囊分段器、立体硬阴影按钮、提示条
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* 基础背景与墨色 */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --muted: #64748b;

  /* 标志性 Neo-Pop 描边与主题色 */
  --border: #0f172a;
  --indigo: #4f46e5;
  --indigo-hover: #4338ca;
  --indigo-soft: #e0e7ff;
  --coral: #ff5470;
  --coral-hover: #f43f5e;
  --coral-soft: #ffe4e8;
  --mint: #10b981;
  --mint-hover: #059669;
  --mint-soft: #d1fae5;
  --amber: #fbbf24;
  --amber-soft: #fef3c7;
  --sky: #38bdf8;
  --sky-soft: #e0f2fe;

  /* 圆角规范 */
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* 硬朗偏移立体阴影 */
  --shadow-xs: 0 2px 0 var(--border);
  --shadow-sm: 0 3px 0 var(--border);
  --shadow-md: 0 4px 0 var(--border);
  --shadow-lg: 0 6px 0 var(--border), 0 14px 28px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 9px 0 var(--border), 0 20px 38px rgba(15, 23, 42, 0.12);

  /* 字体与布局 */
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --app-max: 720px;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 12%, rgba(79, 70, 229, 0.09) 0%, transparent 36%),
    radial-gradient(circle at 90% 16%, rgba(255, 84, 112, 0.1) 0%, transparent 36%),
    radial-gradient(circle at 50% 88%, rgba(16, 185, 129, 0.09) 0%, transparent 42%),
    radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 24px 24px;
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
}

.app {
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ==========================================================================
   统一顶部导航栏 (.site-header)
   ========================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-sticker {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--indigo);
  border: 2.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  transform: rotate(-4deg);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-spring);
}

.brand-sticker:hover {
  transform: rotate(4deg) scale(1.06);
}

.brand-title {
  margin: 0;
  font-size: clamp(1.4rem, 4.5vw, 1.85rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid var(--border);
}

.brand-sub {
  margin: 3px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

/* 子页面标题区 */
.subpage-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.subpage-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--indigo-soft);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-xs);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.subpage-badge--coral {
  background: var(--coral-soft);
}

.subpage-title {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--ink);
}

.subpage-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

/* 返回首页胶囊按钮 */
.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s var(--ease-spring), box-shadow 0.12s ease, background 0.15s ease;
}

.back-pill:hover,
.back-pill:focus-visible {
  background: var(--amber-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  outline: none;
}

.back-pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border);
}

/* 语言切换器 */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.lang-btn {
  appearance: none;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn[aria-pressed="true"],
.lang-btn.active {
  background: var(--indigo);
  color: #ffffff;
  border-color: var(--border);
}

.lang-btn:hover:not(.active):not([aria-pressed="true"]) {
  color: var(--ink);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

.lang-sep {
  display: none;
}

/* ==========================================================================
   公共街机控制栏 (.arcade-toolbar) 与分段胶囊 (.seg-control)
   ========================================================================== */
.arcade-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 2.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-secondary);
}

.seg-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #e2e8f0;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  flex-wrap: wrap;
}

.seg-btn {
  appearance: none;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.12s var(--ease-spring), background 0.15s ease, color 0.15s ease;
}

.seg-btn:hover:not(.active) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.seg-btn.active {
  background: var(--amber);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: 0 2px 0 var(--border);
}

.seg-btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* 街机按钮 (.btn-pop / .btn) */
.btn-pop,
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s var(--ease-spring), box-shadow 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn-pop:hover:not(:disabled),
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--surface-soft);
}

.btn-pop:active:not(:disabled),
.btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border);
}

.btn-pop:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-xs);
}

.btn-pop:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

.btn-pop--indigo,
.btn-primary {
  background: var(--indigo);
  color: #ffffff;
}

.btn-pop--indigo:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: var(--indigo-hover);
}

.btn-pop--coral {
  background: var(--coral);
  color: #ffffff;
}

.btn-pop--coral:hover:not(:disabled) {
  background: var(--coral-hover);
}

.btn-pop--mint {
  background: var(--mint);
  color: #ffffff;
}

.btn-pop--mint:hover:not(:disabled) {
  background: var(--mint-hover);
}

/* 底部玩法说明条 */
.arcade-hint,
.hint {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 2px dashed #cbd5e1;
  color: var(--ink-secondary);
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 480px) {
  .app {
    padding: 14px 12px 32px;
  }

  .arcade-toolbar {
    padding: 10px 12px;
  }

  .back-pill {
    padding: 6px 11px;
    font-size: 0.82rem;
  }
}
