/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 颜色变量定义 */
:root {
    --primary: #1E40AF;
    --primary-light: #3B82F6;
    --secondary: #1D4ED8;
    --dark: #111827;
    --light: #F9FAFB;
    --gray: #6B7280;
}

/* 基础样式 */
body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background-color: var(--light);
}

/* 排版优化 */
 h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

p {
    line-height: 1.6;
    color: var(--gray);
}

/* 自定义字体 */
.font-inter {
    font-family: 'Inter', sans-serif;
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 响应式导航栏滚动效果 */
.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(30, 64, 175, 0.1);
}

/* 商品卡片悬停效果增强 */
.product-card-hover {
    transition: all 0.3s ease;
}

.product-card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 按钮样式 */
.btn-primary {
    @apply px-6 py-3 rounded-lg font-semibold transition-colors duration-200 shadow-sm transform hover:-translate-y-1 transition-transform duration-300;
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary);
}

.btn-secondary {
    @apply px-6 py-3 bg-white rounded-lg font-semibold hover:bg-blue-50 transition-colors duration-200 shadow-sm transform hover:-translate-y-1 transition-transform duration-300;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* 渐变文本 */
.gradient-text {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(to right, var(--primary), var(--primary-light));
}

/* 数字增长动画 */
.count-up {
    transition: all 0.5s ease;
}

/* 自定义输入框焦点样式 */
.input-focus:focus {
    @apply ring-2 ring-blue-500 border-blue-500;
}

/* 加载动画 */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 媒体查询断点扩展 */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
}

/* 卡片阴影层次 */
.card-shadow-1 {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.card-shadow-2 {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-shadow-3 {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 文本省略号 */
.text-ellipsis-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* 自定义背景图案 */
.bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 自定义过渡效果 */
.transition-all-300 {
    transition: all 0.3s ease;
}

/* 骨架屏加载效果 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 自定义滚动进度条 */
.scroll-progress {
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 0%;
    transition: width 0.2s ease;
}

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

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 粘性定位增强 */
.sticky-top-20 {
    position: sticky;
    top: 80px;
    z-index: 10;
}

/* 响应式网格布局 */
.grid-cols-auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* 自定义分隔线 */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}

/* 自定义滚动提示 */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* 自定义数字计数动画 */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-animate {
    animation: countUp 0.5s ease-out forwards;
}

/* 自定义渐变按钮 */
.btn-gradient {
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    transition: all 0.3s ease;
    color: white;
    font-weight: 600;
}

.btn-gradient:hover {
    background: linear-gradient(to right, var(--secondary), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

/* 自定义输入框标签动画 */
.input-group {
    position: relative;
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    transition: all 0.2s ease;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: 0;
    left: 12px;
    font-size: 12px;
    padding: 0 4px;
    background-color: white;
    color: #3b82f6;
}

/* 自定义加载中按钮 */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-loading span {
    opacity: 0;
}

/* 自定义标签样式 */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-primary {
    @apply text-white;
    background-color: var(--primary);
}

.badge-secondary {
    @apply text-white;
    background-color: var(--primary-light);
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

/* 自定义卡片悬停缩放效果 */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.03);
}

/* 自定义导航栏活动项指示 */
.nav-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    transition: all 0.3s ease;
}

/* 自定义模态框背景 */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* 自定义滚动到顶部按钮 */
.scroll-top-btn {
    @apply fixed bottom-6 right-6 bg-blue-600 text-white p-3 rounded-full shadow-lg opacity-0 invisible transition-all duration-300 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 z-50;
}

.scroll-top-btn.visible {
    @apply opacity-100 visible;
}

/* 自定义表单验证样式 */
.input-error {
    @apply border-red-500;
}

.error-message {
    @apply text-red-500 text-sm mt-1;
}

/* 自定义表格样式 */
.table-responsive {
    overflow-x: auto;
}

.table {
    @apply min-w-full divide-y divide-gray-200;
}

.table th {
    @apply px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-500;
}

.table tr:nth-child(even) {
    @apply bg-gray-50;
}

/* 自定义价格标签 */
.price-tag {
    @apply font-bold text-red-500;
}

.original-price {
    @apply text-gray-400 line-through ml-2 text-sm;
}

/* 自定义标签页 */
.tabs {
    @apply border-b border-gray-200;
}

.tab {
    @apply px-4 py-2 font-medium text-gray-500 hover:text-gray-700 hover:border-b-2 hover:border-blue-500 transition-colors duration-200;
}

.tab.active {
    @apply text-blue-600 border-b-2 border-blue-500;
}

/* 自定义徽章动画 */
.badge-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 自定义滚动进度指示器 */
.progress-container {
    width: 100%;
    height: 3px;
    background: transparent;
    position: fixed;
    top: 0;
    z-index: 1000;
}

.progress-bar {
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    width: 0%;
}