/* ==========================================
   CSS变量/设计系统（主题色、间距、字体）
   ========================================== */

:root {
  /* 主色调 */
  --primary: #FF6B9D;
  --primary-light: #FF8FAB;
  --primary-dark: #E91E8C;
  --secondary: #4A90E2;
  --accent: #50E3C2;
  --gold: #FFD700;

  /* 背景 */
  --bg-primary: linear-gradient(160deg, #FF6B9D 0%, #FF8FAB 60%, #FFB3CC 100%);
  --bg-achievement: linear-gradient(160deg, #87CEEB 0%, #4FC3F7 100%);
  --bg-settings: linear-gradient(160deg, #6C63FF 0%, #5A52D5 100%);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* 文字色 */
  --text-primary: #2C2C2C;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-white: #FFFFFF;
  --text-on-primary: #FFFFFF;

  /* 边框 */
  --border-radius-sm: 8px;
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --border-radius-xl: 32px;
  --border-radius-full: 999px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  --shadow-card: 0 8px 32px rgba(255, 107, 157, 0.25);
  --shadow-ssr: 0 0 20px rgba(255, 215, 0, 0.6), 0 8px 32px rgba(0,0,0,0.2);

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-md: 17px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;
  --font-size-3xl: 48px;

  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* 视口高度（JS动态设置） */
  --vh: 1vh;

  /* Tab高度 */
  --tab-height: 60px;
  --tab-safe-area: env(safe-area-inset-bottom, 0px);

  /* 稀有度色 */
  --rarity-n: #9E9E9E;
  --rarity-sr: #7B1FA2;
  --rarity-ssr: #F57F17;
  --rarity-legend: #E91E63;
}

/* 字体大小响应式 */
[data-font-size="small"] {
  font-size: 13px;
}
[data-font-size="medium"] {
  font-size: 15px;
}
[data-font-size="large"] {
  font-size: 17px;
}

/* 全局重置 */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html {
  height: 100%;
  font-size: var(--font-size-base);
}

body {
  height: 100%;
  height: calc(var(--vh, 1vh) * 100);
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

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

input, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  -webkit-appearance: none;
}

img {
  max-width: 100%;
  display: block;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 2px;
}

/* 工具类 */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

.emoji {
  font-style: normal;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
