/* 
 * assets/css/theme.css
 * TICKET-2026-0320-043 - 全新色彩与布局系统
 * 主色调: 蓝色系 (专业、信任)
 * 辅助色: 橙色 (行动、活力)
 */

/* ===== CSS Variables ===== */
:root {
    /* Primary Colors - Blue */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* Accent Colors - Orange */
    --accent-50: #fff7ed;
    --accent-100: #ffedd5;
    --accent-200: #fed7aa;
    --accent-300: #fdba74;
    --accent-400: #fb923c;
    --accent-500: #f97316;
    --accent-600: #ea580c;
    --accent-700: #c2410c;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Semantic Colors */
    --color-primary: var(--primary-600);
    --color-primary-hover: var(--primary-700);
    --color-accent: var(--accent-500);
    --color-accent-hover: var(--accent-600);
    
    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);
    
    /* Text */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-500);
    --text-white: #ffffff;
    
    /* Border */
    --border-color: var(--gray-200);
    --border-color-light: var(--gray-100);
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Typography */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Container */
    --container-max: 1280px;
    --container-padding: 1rem;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --bg-tertiary: var(--gray-700);
    
    --text-primary: var(--gray-100);
    --text-secondary: var(--gray-300);
    --text-tertiary: var(--gray-400);
    
    --border-color: var(--gray-700);
    --border-color-light: var(--gray-800);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--color-primary-hover);
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--space-16) 0;
}

.section-sm {
    padding: var(--space-12) 0;
}

.section-lg {
    padding: var(--space-20) 0;
}

.bg-light {
    background-color: var(--bg-secondary);
}

.bg-primary {
    background-color: var(--color-primary);
    color: var(--text-white);
}

/* ===== Grid System ===== */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .grid-4,
    .grid-3,
    .grid-2 { grid-template-columns: 1fr; }
}

/* ===== Typography ===== */
.section-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-8);
    text-align: center;
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-12);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1.5;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--text-white);
}

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

.btn-accent {
    background-color: var(--color-accent);
    color: var(--text-white);
}

.btn-accent:hover {
    background-color: var(--color-accent-hover);
    color: var(--text-white);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--text-white);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn-block {
    width: 100%;
}

/* ===== Cards ===== */
.card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (max-width: 767px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Alerts ===== */
.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.hidden { display: none; }

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.header-top {
    background-color: var(--primary-900);
    color: var(--text-white);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
}

.header-top a {
    color: var(--primary-200);
}

.header-main {
    padding: var(--space-4) 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-primary);
}

.nav-main {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-main a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: var(--space-2) 0;
    position: relative;
}

.nav-main a:hover,
.nav-main a.active {
    color: var(--color-primary);
}

.nav-main a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-primary);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    padding: var(--space-20) 0;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: var(--text-white);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-6);
}

.hero-desc {
    font-size: var(--text-xl);
    color: var(--primary-100);
    margin-bottom: var(--space-8);
}

.hero-actions {
    display: flex;
    gap: var(--space-4);
}

/* ===== Footer ===== */
.site-footer {
    background-color: var(--gray-900);
    color: var(--gray-300);
}

.footer-main {
    padding: var(--space-16) 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-12);
}

.footer-brand h3 {
    color: var(--text-white);
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
}

.footer-brand p {
    color: var(--gray-400);
    margin-bottom: var(--space-6);
}

.footer-title {
    color: var(--text-white);
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-6);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a {
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding: var(--space-6) 0;
}

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

@media (max-width: 767px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .footer-bottom-inner {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 48px;
    height: 48px;
    background-color: var(--color-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 99;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-4px);
}

/* ===== Products Page Layout ===== */
.products-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--space-8);
    align-items: start;
}

@media (max-width: 1023px) {
    .products-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.products-sidebar {
    position: sticky;
    top: var(--space-8);
}

.products-sidebar .filter-box {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.products-sidebar .filter-box h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}

.products-sidebar .filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.products-sidebar .filter-list li {
    margin-bottom: var(--space-2);
}

.products-sidebar .filter-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.products-sidebar .filter-list li a:hover,
.products-sidebar .filter-list li.active a {
    background-color: var(--primary-50);
    color: var(--color-primary);
}

.products-sidebar .filter-list li.active a {
    font-weight: 500;
}

.products-sidebar .filter-list .count {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.products-sidebar .filter-list li.active .count {
    color: var(--color-primary);
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tag-cloud .tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background-color: var(--gray-100);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.tag-cloud .tag:hover {
    background-color: var(--color-primary);
    color: white;
}

/* Contact Box */
.products-sidebar .contact-box {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
}

.products-sidebar .contact-box h3 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.2);
}

.products-sidebar .contact-box p {
    color: var(--primary-100);
    margin-bottom: var(--space-4);
}

/* Main Content */
.products-main {
    min-width: 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.products-header .section-title {
    margin: 0;
}

.products-header .search-form {
    display: flex;
    gap: var(--space-2);
}

.products-header .search-box {
    display: flex;
    gap: var(--space-2);
}

.products-header .search-box input {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    min-width: 200px;
}

.results-info {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.results-info strong {
    color: var(--text-primary);
}

/* Product Card */
.product-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-card .product-badges {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    display: flex;
    gap: var(--space-1);
    z-index: 1;
}

.product-card .badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.product-card .badge-new {
    background-color: var(--accent-500);
    color: white;
}

.product-card .badge-hot {
    background-color: #ef4444;
    color: white;
}

.product-card .product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card .product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background-color: var(--gray-100);
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-info {
    padding: var(--space-4);
}

.product-card .product-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
    line-height: 1.4;
}

.product-card .product-attrs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.product-card .product-attrs .attr {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    background-color: var(--gray-100);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.product-card .product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.product-card .price-wholesale {
    display: flex;
    flex-direction: column;
}

.product-card .price-wholesale .label {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.product-card .price-wholesale .amount {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-accent);
}

.product-card .product-moq {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.product-card .btn-inquiry {
    display: block;
    margin: 0 var(--space-4) var(--space-4);
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-8);
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-3);
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination .page-link:hover {
    background-color: var(--primary-50);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination .page-link.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-2);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* Responsive */
@media (max-width: 767px) {
    .products-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .products-header .search-box {
        width: 100%;
    }
    
    .products-header .search-box input {
        flex: 1;
        min-width: 0;
    }
}
