/*
Theme Name: CNFans Clone
Theme URI: https://example.com
Author: Developer
Description: WordPress WooCommerce 仿 CNFans 反代海淘平台主题
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: cnfans-clone
*/

/* ========== Reset & Base ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #ff4400;
    --primary-dark: #cc3700;
    --secondary: #1a1a2e;
    --accent: #16213e;
    --text: #333333;
    --text-light: #666666;
    --bg: #f5f5f5;
    --white: #ffffff;
    --border: #e0e0e0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--accent);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ========== Header ========== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-logo .logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
}

.main-nav a {
    color: var(--text);
    font-weight: 500;
    padding: 8px 0;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-actions .cart-icon {
    position: relative;
}

.header-actions .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Hero Section ========== */
.hero-section {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 42px;
    margin-bottom: 16px;
}

.hero-section p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
}

/* ========== Features ========== */
.features-section {
    padding: 60px 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-item i {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 16px;
}

.feature-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.feature-item p {
    color: var(--text-light);
}

/* ========== Submit Product Page ========== */
.submit-product-page {
    padding: 40px 0;
}

.search-box {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.search-box h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.search-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-tabs .tab {
    padding: 8px 20px;
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.search-tabs .tab.active,
.search-tabs .tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 68, 0, 0.05);
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="text"],
.search-form input[type="url"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 15px;
    display: none;
}

.image-upload-area.active {
    display: block;
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: rgba(255, 68, 0, 0.02);
}

/* ========== Product Results ========== */
.product-results {
    margin-top: 30px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.product-card .product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-info {
    padding: 12px;
}

.product-card .product-title {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.product-card .product-source {
    font-size: 11px;
    color: var(--text-light);
    padding: 2px 8px;
    background: var(--bg);
    border-radius: 10px;
    display: inline-block;
}

.product-card .product-actions {
    padding: 0 12px 12px;
}

.product-card .btn-add-cart {
    width: 100%;
    padding: 8px;
    font-size: 12px;
}

/* ========== Order Status ========== */
.order-tracker {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.status-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 30px 0;
}

.status-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
}

.status-step {
    position: relative;
    text-align: center;
    flex: 1;
}

.status-step .step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    position: relative;
    z-index: 1;
    color: var(--text-light);
}

.status-step.completed .step-icon {
    background: var(--success);
    color: var(--white);
}

.status-step.active .step-icon {
    background: var(--primary);
    color: var(--white);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 68, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 68, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 68, 0, 0); }
}

.status-step .step-label {
    font-size: 12px;
    color: var(--text-light);
}

.status-step.completed .step-label,
.status-step.active .step-label {
    color: var(--text);
    font-weight: 600;
}

/* ========== QC Photos ========== */
.qc-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.qc-gallery .qc-thumb {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.qc-gallery .qc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.qc-gallery .qc-thumb:hover img {
    transform: scale(1.1);
}

/* ========== Footer ========== */
.site-footer {
    background: var(--secondary);
    color: rgba(255,255,255,0.8);
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 15px;
    font-size: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.footer-col ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
}

/* ========== Loading Spinner ========== */
.cnfans-loading {
    display: none;
    text-align: center;
    padding: 30px;
}

.cnfans-loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-nav ul {
        gap: 12px;
    }

    .hero-section {
        padding: 50px 0;
    }

    .hero-section h1 {
        font-size: 28px;
    }

    .search-form {
        flex-direction: column;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .status-steps {
        flex-direction: column;
        gap: 15px;
    }

    .status-steps::before {
        top: 0;
        bottom: 0;
        left: 20px;
        right: auto;
        width: 3px;
        height: auto;
    }

    .status-step {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .status-step .step-icon {
        margin: 0;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}