/* ═══════════════════════════════════════════════════════
   CAROX 统一设计系统 CSS v1.0
   UI Designer 制定 — 2026-06-19
   适用范围：前台所有页面（欧美消费者）
   ═══════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   一、设计令牌（Design Tokens）
   ═══════════════════════════════════════════════════════ */

:root {
  /* ─── 品牌主色 ─── */
  --orange-50:  #fff7ed;
  --orange-100: #ffedd5;
  --orange-400: #fb923c;
  --orange-500: #f97316;   /* 主品牌色 */
  --orange-600: #ea580c;
  --orange-700: #c2410c;

  /* ─── 功能色 ─── */
  --blue-500:   #3b82f6;
  --red-500:    #ef4444;
  --green-500:  #22c55e;
  --yellow-500: #eab308;

  /* ─── 中性色 ─── */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* ─── 背景色 ─── */
  --bg-white:   #ffffff;
  --bg-page:    #ffffff;
  --bg-card:    #ffffff;
  --bg-card-alt: #f8fafc;

  /* ─── 文字色 ─── */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* ─── 边框/阴影 ─── */
  --border-light: rgba(0, 0, 0, 0.06);
  --border-normal: #e2e8f0;

  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 4px 24px rgba(249, 115, 22, 0.15);

  /* ─── 间距（4px 基础）─── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ─── 圆角 ─── */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-pill: 999px;

  /* ─── 字体 ─── */
  --font: 'Inter', 'Segoe UI', -apple-system,
         BlinkMacSystemFont, 'SF Pro Display', Arial, sans-serif;

  /* ─── 过渡 ─── */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════
   二、全局基础样式
   ═══════════════════════════════════════════════════════ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════
   三、顶部 3px 色条动画（所有页面统一）
   ═══════════════════════════════════════════════════════ */

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
}

/* 主页：灰色渐变 */
body.product-page::before {
  background: linear-gradient(90deg, var(--gray-300), var(--gray-400), var(--gray-300));
}

/* 客服页：蓝色渐变 */
body.support-page::before {
  background: linear-gradient(90deg, var(--blue-500), #60a5fa, var(--blue-500), #2563eb, var(--blue-500));
  background-size: 300% 100%;
  animation: barShift 4s ease infinite;
}

/* 视频页：红色渐变 */
body.video-page::before {
  background: linear-gradient(90deg, var(--red-500), var(--orange-500), var(--red-500), #dc2626, var(--red-500));
  background-size: 300% 100%;
  animation: barShift 4s ease infinite;
}

/* 说明书页：绿色渐变 */
body.manual-page::before {
  background: linear-gradient(90deg, var(--green-500), #4ade80, var(--green-500), #16a34a, var(--green-500));
  background-size: 300% 100%;
  animation: barShift 4s ease infinite;
}

/* 促销页：橙色渐变 */
body.promo-page::before {
  background: linear-gradient(90deg, var(--orange-500), var(--orange-400), var(--orange-500), #c2410c, var(--orange-500));
  background-size: 300% 100%;
  animation: barShift 4s ease infinite;
}

@keyframes barShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ═══════════════════════════════════════════════════════
   四、统一卡片组件
   ═══════════════════════════════════════════════════════ */

/* 基础卡片 */
.card-base {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card-base:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* 左侧色条（用于二级页面卡片） */
.card-accent-left {
  position: relative;
  overflow: hidden;
}

.card-accent-left::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  transition: width var(--transition-normal);
  z-index: 2;
}

.card-accent-left:hover::before {
  width: 5px;
}

/* ═══════════════════════════════════════════════════════
   五、统一按钮组件
   ═══════════════════════════════════════════════════════ */

/* 主按钮（CTA） */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  background: var(--orange-500);
  color: #ffffff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--orange-600);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(249, 115, 22, 0.25);
}

/* 次要按钮（描边） */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--orange-500);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid var(--orange-500);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-outline:hover {
  background: rgba(249, 115, 22, 0.06);
}

/* 危险按钮 */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  background: var(--red-500);
  color: #ffffff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   六、统一图标样式
   ═══════════════════════════════════════════════════════ */

.icon-base {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

a:hover .icon-base,
button:hover .icon-base {
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════
   七、返回按钮（所有二级页面统一）
   ═══════════════════════════════════════════════════════ */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: clamp(13px, 3vw, 15px);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.02);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.back-btn:hover {
  color: var(--orange-500);
  background: rgba(249, 115, 22, 0.06);
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

/* ═══════════════════════════════════════════════════════
   八、Logo 样式（所有页面统一）
   ═══════════════════════════════════════════════════════ */

.logo-base {
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
  transition: transform var(--transition-fast);
}

.logo-base:hover {
  transform: scale(1.02);
}

/* ═══════════════════════════════════════════════════════
   九、页面标题区（所有二级页面统一）
   ═══════════════════════════════════════════════════════ */

.page-header {
  text-align: center;
  margin-bottom: var(--space-6);
  position: relative;
  z-index: 1;
}

.page-title {
  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.page-sub {
  font-size: clamp(12px, 3vw, 14px);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   十、顶部栏布局（所有二级页面统一）
   ═══════════════════════════════════════════════════════ */

.topbar {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  margin-bottom: var(--space-6);
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════
   十一、页脚（所有页面统一）
   ═══════════════════════════════════════════════════════ */

.footer-base {
  margin-top: var(--space-10);
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════
   十二、动画关键帧
   ═══════════════════════════════════════════════════════ */

@keyframes badgeShimmer {
  0%, 100% {
    box-shadow: 0 3px 14px rgba(249, 115, 22, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
  50% {
    box-shadow: 0 4px 22px rgba(249, 115, 22, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════
   十三、响应式断点
   ═══════════════════════════════════════════════════════ */

@media (min-width: 600px) {
  .main-content {
    max-width: 560px;
  }
}

@media (max-height: 680px) {
  .compact-mode .logo-base {
    width: min(120px, 32vw) !important;
  }
  .compact-mode .page-title {
    font-size: clamp(15px, 4vw, 19px) !important;
  }
}
