/* ============================================================
 * base.css — shadcn/ui 设计令牌 + 全局重置
 * 颜色使用 HSL 通道，与 shadcn/ui 完全一致
 * ============================================================ */

/* ---------- shadcn/ui 设计令牌 ---------- */
:root {
  /* 基础 */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;

  /* 主色（shadcn 默认深灰黑） */
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;

  /* 次要 */
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;

  /* 柔和 */
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;

  /* 强调 */
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;

  /* 破坏/危险 */
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;

  /* 边框/输入 */
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;

  /* 圆角统一 */
  --radius: 0.5rem;

  /* 间距体系（4的倍数） */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* 字体 */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;

  /* 字重 */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* 阴影（shadcn 风格：极浅） */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* 功能色：涨（绿）/ 跌（红） */
  --up: 142.1 76.2% 36.3%;
  --down: 0 72.2% 50.6%;

  /* 档期类型标签色（保留） */
  --tag-cny: 6 78% 57%;     /* 春节红 #e74c3c */
  --tag-summer: 207 70% 53%; /* 暑假蓝 #3498db */
  --tag-xmas: 145 55% 42%;   /* 圣诞绿 #27ae60 */
  --tag-a4: 271 52% 47%;     /* A4 紫 #8e44ad */
  --tag-custom: 210 5% 60%;  /* 自定义灰 */
}

/* ---------- 全局重置 ---------- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  min-height: 100vh;
}

a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.85; }

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

/* ---------- HSL 便捷类 ---------- */
.bg-background { background: hsl(var(--background)); }
.bg-card { background: hsl(var(--card)); }
.bg-muted { background: hsl(var(--muted)); }
.bg-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.bg-secondary { background: hsl(var(--secondary)); }

.text-foreground { color: hsl(var(--foreground)); }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }

.border { border: 1px solid hsl(var(--border)); }
.rounded { border-radius: var(--radius); }

/* ---------- 涨跌颜色 ---------- */
.up { color: hsl(var(--up)); font-weight: var(--fw-semibold); }
.down { color: hsl(var(--down)); font-weight: var(--fw-semibold); }
.neutral { color: hsl(var(--foreground)); }

/* ---------- 动画 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
 * 移动端响应式
 * ============================================================ */

/* 平板/小屏 (≤768px) */
@media (max-width: 768px) {
  html { font-size: 15px; }
  :root {
    --fs-3xl: 1.5rem;
    --fs-2xl: 1.25rem;
    --fs-xl: 1.125rem;
    --fs-lg: 1rem;
  }
}

/* 手机 (≤480px) */
@media (max-width: 480px) {
  html { font-size: 14px; }
  :root {
    --fs-3xl: 1.375rem;
    --fs-2xl: 1.125rem;
    --fs-base: 0.9375rem;
  }
  body { -webkit-text-size-adjust: 100%; }
  /* 防止 iOS 输入框自动缩放 */
  input, select, textarea { font-size: 16px !important; }
}
