/* ========================================
   s001 - base.css
   基础变量、重置、公共样式
   ======================================== */

/* CSS 变量 - 支持换肤 */
:root {
  /* 背景色 */
  --bg-primary: #090B21;
  --bg-secondary: #0f1232;
  --bg-card: #151840;
  --bg-hover: #1c2050;
  --bg-nav: rgba(9, 11, 33, 0.95);
  --bg-nav-scroll: rgba(9, 11, 33, 0.98);
  --bg-search: rgba(152, 152, 152, 0.2);
  --bg-tag: rgba(255, 255, 255, 0.08);
  --bg-tag-hover: rgba(255, 255, 255, 0.15);

  /* 文字色 */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.35);

  /* 强调色 */
  --accent-gold: #FFD700;
  --accent-red: #FF4757;
  --accent-orange: #FF6B35;
  --accent-blue: #3B82F6;
  --accent-green: #10B981;

  /* 排名色 */
  --rank-1: #FF4757;
  --rank-2: #FF6B35;
  --rank-3: #FFD700;

  /* 圆角 */
  --radius-sm: 2px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 19px;

  /* 字体 */
  --font-family: -apple-system, system-ui, "system-ui", arial, "Segoe UI", Roboto, "Hiragino Sans GB", STHeiti, "Microsoft YaHei", "Helvetica Neue", Helvetica, SimSun, Tahoma, sans-serif, "Apple Color Emoji";
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 13px;
  --font-size-md: 14px;
  --font-size-nav: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 22px;
  --font-size-xxl: 28px;
  --font-size-banner: 36px;

  /* 间距 */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 16px;
  --gap-xl: 24px;
  --gap-xxl: 32px;

  /* 容器 */
  --container-max: 1366px;
  --container-padding: 30px;

  /* 导航 */
  --nav-height: 56px;
  --subnav-height: 40px;

  /* 动画 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* 阴影 */
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-nav: 0 2px 12px rgba(0, 0, 0, 0.3);

  /* 占位渐变 */
  --placeholder-gradient: linear-gradient(135deg, #1a1d3e 0%, #0d1030 50%, #1a1d3e 100%);
  --placeholder-gradient-warm: linear-gradient(135deg, #2d1b3e 0%, #1a1030 50%, #2d1b3e 100%);
  --placeholder-gradient-cool: linear-gradient(135deg, #1b2d3e 0%, #101a30 50%, #1b2d3e 100%);
}

/* 浅色主题 (换肤用) */
[data-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f0f0;
  --bg-nav: rgba(255, 255, 255, 0.95);
  --bg-nav-scroll: rgba(255, 255, 255, 0.98);
  --bg-search: rgba(0, 0, 0, 0.06);
  --bg-tag: rgba(0, 0, 0, 0.05);
  --bg-tag-hover: rgba(0, 0, 0, 0.1);
  --text-primary: #1a1a1a;
  --text-secondary: rgba(0, 0, 0, 0.65);
  --text-tertiary: rgba(0, 0, 0, 0.45);
  --text-muted: rgba(0, 0, 0, 0.3);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-secondary);
}

ul, ol {
  list-style: none;
}

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

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

input {
  border: none;
  outline: none;
  font-family: inherit;
  background: none;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* 横向滚动条 */
.scroll-x::-webkit-scrollbar {
  height: 4px;
}

.scroll-x::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
}

.scroll-x::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* 公共类 */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-ellipsis-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 占位图背景 */
.placeholder-bg {
  background: var(--placeholder-gradient);
  position: relative;
}

.placeholder-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(9, 11, 33, 0.6) 0%, transparent 50%);
}

.placeholder-bg-warm {
  background: var(--placeholder-gradient-warm);
}

.placeholder-bg-cool {
  background: var(--placeholder-gradient-cool);
}
