/* ==========================================
   1. 全局变量定义
   ========================================== */
:root {
    --gradient-primary-from: rgb(59, 130, 246);      /* blue-500 */
    --gradient-primary-to: rgb(236, 72, 153);        /* pink-500 */
    --gradient-primary-from-hover: rgb(37, 99, 235); /* blue-600 */
    --gradient-primary-to-hover: rgb(219, 39, 119);   /* pink-600 */

    --gradient-text-from: rgb(37, 99, 235);         /* blue-600 */
    --gradient-text-to: rgb(236, 72, 153);           /* pink-500 */

    --gradient-bg-from: rgb(239, 246, 255);         /* blue-50 */
    --gradient-bg-via: rgb(252, 231, 243);          /* pink-50 */
    --gradient-bg-to: rgb(250, 245, 255);           /* purple-50 */

    --gradient-light-from: rgb(239, 246, 255);       /* blue-50 */
    --gradient-light-to: rgb(252, 231, 243);         /* pink-50 */
}

/* ==========================================
   2. 基础元素重置 (Reset)
   ========================================== */
*, ::before, ::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    line-height: inherit;
    overflow-x: hidden; /* 防止移动端左右晃动 */
}

hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
    border-color: #e5e7eb;
}

a {
    color: inherit;
    text-decoration: inherit;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

img, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   3. 核心视觉与渐变工具类
   ========================================== */
.gradient-bg {
    background: linear-gradient(to bottom right, var(--gradient-bg-from), var(--gradient-bg-via), var(--gradient-bg-to));
}

.gradient-btn {
    background: linear-gradient(to right, var(--gradient-primary-from), var(--gradient-primary-to));
    color: white;
    transition: all 0.3s ease;
}

.gradient-btn:active {
    transform: scale(0.95); /* 移动端点击反馈 */
}

.gradient-text {
    background: linear-gradient(to right, var(--gradient-text-from), var(--gradient-text-to));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero 背景图样式 */
.hero-bg-custom {
    background-image: url('img/hero-bg.jpg');
    background-size: cover;
    background-position: center;
}

/* ==========================================
   4. 常用布局与定位 (Flex / Grid / Size)
   ========================================== */
.absolute { position: absolute; }
.relative { position: relative; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.inline-flex { display: inline-flex; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 间距控制 - 基础 (移动端优先) */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-10 { gap: 2.5rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-10 { margin-top: 2.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

/* ==========================================
   5. 形状与视觉样式
   ========================================== */
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }

.bg-white { background-color: rgb(255 255 255); }
.bg-white\/80 { background-color: rgb(255 255 255 / 0.8); }
.bg-gray-50 { background-color: rgb(249 250 251); }
.bg-gray-900 { background-color: rgb(17, 24, 39); }
.bg-blue-50 { background-color: rgb(239, 246, 255); }

.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* ==========================================
   6. 文本排版
   ========================================== */
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.leading-relaxed { line-height: 1.625; }
.leading-tight { line-height: 1.25; }

.text-white { color: white; }
.text-gray-500 { color: rgb(107, 114, 128); }
.text-gray-600 { color: rgb(75, 85, 99); }
.text-gray-700 { color: rgb(55, 65, 81); }
.text-gray-900 { color: rgb(17, 24, 39); }
.text-blue-600 { color: rgb(37, 99, 235); }

/* ==========================================
   7. 响应式适配 (Responsive)
   ========================================== */

/* 移动端特定优化 (小于 640px) */
@media (max-width: 639px) {
    .text-4xl { font-size: 1.75rem; line-height: 2.25rem; }
    .py-12 { padding-top: 2rem; padding-bottom: 2rem; }
    .px-4 { padding-left: 1.25rem; padding-right: 1.25rem; }

    /* 调整 Hero 区域高度和按钮 */
    .h-\[600px\] { height: 500px; }
    .w-64 { width: 100%; max-width: 280px; }

    /* 详情页卡片内边距缩小 */
    .p-8 { padding: 1.25rem; }
    .sm\:p-10 { padding: 1.25rem; }
}

/* 平板及以上 (sm: 640px) */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:flex-row { flex-direction: row; }
    .sm\:text-xl { font-size: 1.25rem; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
}

/* 桌面端 (md: 768px, lg: 1024px) */
@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}