/* ==========================================================================
   base.css — Reset / Variables / Base Typography (mobile-first强制)
   ========================================================================== */

:root {
  /* Brand palette - Poki-inspired but distinct */
  --c-bg: #0f1023;
  --c-bg-2: #161830;
  --c-bg-3: #1d2046;
  --c-card: #232852;
  --c-card-hover: #2c3168;
  --c-border: #2f3470;
  --c-text: #ffffff;
  --c-text-2: #b8bee0;
  --c-text-3: #8089b3;
  --c-accent: #ffce00;
  --c-accent-2: #ff5d8f;
  --c-accent-3: #4ad6ff;
  --c-accent-4: #7c5cff;
  --c-success: #44d87b;
  --c-warn: #ffb547;
  --c-danger: #ff5263;
  --c-overlay: rgba(8, 9, 24, 0.78);

  /* Sizing — 强制移动端优先 */
  --page-w: 100%;
  --page-max-w: 480px; /* 视口最大宽度 480px,桌面端也按移动样式渲染 */
  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-5: 20px;
  --gap-6: 24px;
  --gap-7: 32px;

  --radius-1: 8px;
  --radius-2: 12px;
  --radius-3: 16px;
  --radius-4: 20px;
  --radius-5: 28px;

  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.36);
  --shadow-glow: 0 0 0 1px rgba(255, 206, 0, 0.25), 0 0 24px rgba(255, 206, 0, 0.18);

  --header-h: 56px;
  --bottom-h: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  /* 强制移动端样式:禁止桌面缩放 */
  width: 100%;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(74, 214, 255, 0.10), transparent 65%),
    var(--c-bg);
}

img, svg, video, canvas { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
  -webkit-touch-callout: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
}

ul, ol { list-style: none; padding: 0; margin: 0; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p { margin: 0 0 var(--gap-3); }
p:last-child { margin-bottom: 0; }

/* 强制移动端视口容器:即使是桌面浏览器,内容也被限制在移动宽度 */
.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--page-max-w);
  min-height: 100vh;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.app-main {
  flex: 1 1 auto;
  padding-top: var(--header-h);
  padding-bottom: calc(20px + var(--safe-bottom));
  position: relative;
}

@media (min-width: 481px) {
  body::before {
    /* 桌面端展示一个友好的提示边框,说明这是移动端样式网站 */
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--c-accent), var(--c-accent-2), var(--c-accent-3));
    z-index: 9999;
  }
}

/* 通用文本渐变 */
.text-grad {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 60%, var(--c-accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 通用按钮风格 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-3);
  font-weight: 600;
  font-size: 14px;
  background: var(--c-card);
  color: var(--c-text);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--c-accent) 0%, #ffa940 100%);
  color: #1a1a1a;
  box-shadow: 0 4px 14px rgba(255, 158, 0, 0.35);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--c-border);
}

/* 实用工具类 */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--gap-1); }
.gap-2 { gap: var(--gap-2); }
.gap-3 { gap: var(--gap-3); }
.gap-4 { gap: var(--gap-4); }
.gap-5 { gap: var(--gap-5); }
.center { justify-content: center; align-items: center; }
.between { justify-content: space-between; }
.flex-1 { flex: 1; }
.muted { color: var(--c-text-2); }
.muted-2 { color: var(--c-text-3); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.no-scroll { overflow: hidden; }

/* 滚动条 */
::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; -ms-overflow-style: none; }
