﻿/* 深云境汇科技 - 主样式表 */
:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: #818CF8;
    --secondary: #06B6D4;
    --accent: #F59E0B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #1E293B;
    --gray-900: #0F172A;
    --gray-800: #1E293B;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748B;
    --gray-400: #94A3B8;
    --gray-300: #CBD5E1;
    --gray-200: #E2E8F0;
    --gray-100: #F1F5F9;
    --gray-50: #F8FAFC;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

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

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-top {
    background: var(--gray-900);
    color: var(--gray-300);
    font-size: 13px;
    padding: 6px 0;
}
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-top a { color: var(--gray-300); }
.header-top a:hover { color: var(--white); }
.header-main {
    padding: 12px 0;
}
.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.logo:hover { color: var(--primary-dark); }
.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

/* Search */
.search-box {
    flex: 1;
    max-width: 500px;
    display: flex;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    outline: none;
    font-size: 14px;
}
.search-box button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.search-box button:hover { background: var(--primary-dark); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-actions a, .header-actions .action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-600);
    font-size: 14px;
    cursor: pointer;
    position: relative;
    text-decoration: none;
}
.header-actions a:hover { color: var(--primary); }
.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Navigation */
.nav {
    border-top: 1px solid var(--gray-200);
}
.nav .container { display: flex; gap: 0; }
.nav a {
    padding: 12px 24px;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 0;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 40px 0 20px;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}
.footer-col h4 {
    color: var(--white);
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}
.footer-col p, .footer-col a {
    color: var(--gray-400);
    font-size: 14px;
    line-height: 2;
    display: block;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
}

/* Banner */
.banner-section {
    margin-bottom: 40px;
}
.banner-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    min-height: 350px;
    display: flex;
    align-items: center;
}
.banner-slide {
    display: none;
    padding: 60px;
    width: 100%;
    color: white;
    text-align: center;
}
.banner-slide.active { display: block; }
.banner-slide h2 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
}
.banner-slide p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 24px;
}
.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}
.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.3s;
}
.banner-dot.active { background: white; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-white { background: white; color: var(--primary); }
.btn-white:hover { background: var(--gray-100); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Section Title */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
    margin-right: 12px;
}
.section-title a { font-size: 14px; font-weight: 400; }

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}
.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
}
.category-card:nth-child(1) .category-icon { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.category-card:nth-child(2) .category-icon { background: linear-gradient(135deg, #f093fb, #f5576c); color: white; }
.category-card:nth-child(3) .category-icon { background: linear-gradient(135deg, #4facfe, #00f2fe); color: white; }
.category-card h3 { font-size: 18px; margin-bottom: 8px; }
.category-card p { color: var(--gray-500); font-size: 14px; margin-bottom: 12px; }
.category-count { color: var(--primary); font-size: 13px; font-weight: 500; }

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.product-image {
    position: relative;
    height: 200px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-image .placeholder-icon {
    font-size: 48px;
    color: var(--gray-400);
}
.product-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}
.tag-hot { background: linear-gradient(135deg, #f5576c, #f093fb); }
.tag-new { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.tag-recommend { background: linear-gradient(135deg, #667eea, #764ba2); }
.product-info {
    padding: 16px;
}
.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 44px;
}
.product-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.price-current {
    font-size: 20px;
    font-weight: 700;
    color: var(--danger);
}
.price-original {
    font-size: 13px;
    color: var(--gray-400);
    text-decoration: line-through;
}
.product-sales {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}
.add-cart-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    opacity: 0;
    transform: translateY(10px);
}
.product-card:hover .add-cart-btn {
    opacity: 1;
    transform: translateY(0);
}
.add-cart-btn:hover { background: var(--primary-dark); transform: scale(1.1); }

/* Feature Section */
.feature-section {
    background: white;
    padding: 60px 0;
    margin: 40px 0;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}
.feature-item {
    padding: 20px;
}
.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
}
.feature-item h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--gray-800);
}
.feature-item p {
    font-size: 13px;
    color: var(--gray-500);
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}
.product-gallery {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-gallery .placeholder-icon { font-size: 80px; color: var(--gray-400); }
.detail-info h1 { font-size: 24px; margin-bottom: 16px; }
.detail-price {
    background: linear-gradient(135deg, #fef2f2, #fff7ed);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.detail-price .price-current { font-size: 32px; }
.detail-meta { margin-bottom: 20px; }
.detail-meta span {
    display: inline-block;
    margin-right: 20px;
    color: var(--gray-500);
    font-size: 14px;
}
.detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.detail-actions .quantity-input {
    width: 60px;
    text-align: center;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px;
    font-size: 16px;
}
.detail-content {
    margin-top: 40px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Cart Table */
.cart-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.cart-table th {
    background: var(--gray-50);
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}
.cart-table td {
    padding: 16px;
    border-top: 1px solid var(--gray-100);
    font-size: 14px;
}
.cart-product {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cart-product-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-qty {
    width: 50px;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 6px;
}
.cart-remove {
    color: var(--danger);
    cursor: pointer;
    font-size: 13px;
    background: none;
    border: none;
}
.cart-summary {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-top: 20px;
    text-align: right;
}
.cart-summary .total {
    font-size: 24px;
    color: var(--danger);
    font-weight: 700;
}

/* Forms */
.form-card {
    max-width: 400px;
    margin: 40px auto;
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}
.form-card h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.form-switch {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--gray-500);
}
.form-switch a { color: var(--primary); font-weight: 500; }

/* User Center */
.user-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
}
.user-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.user-info {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 16px;
}
.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}
.user-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.user-balance { font-size: 14px; color: var(--danger); font-weight: 600; }
.user-menu { list-style: none; }
.user-menu li a {
    display: block;
    padding: 10px 16px;
    color: var(--gray-600);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 4px;
}
.user-menu li a:hover, .user-menu li a.active {
    background: var(--primary);
    color: white;
}
.user-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Orders */
.order-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 12px;
}
.order-no { font-size: 14px; color: var(--gray-600); }
.order-time { font-size: 13px; color: var(--gray-500); }
.order-items { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--gray-50);
    border-radius: var(--radius);
}
.order-item-img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
}
.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.order-total { font-size: 16px; color: var(--dark); }
.order-total strong { color: var(--danger); }
.order-actions { display: flex; gap: 8px; }

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-shipped { background: #d1fae5; color: #065f46; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Recharge */
.recharge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.recharge-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.recharge-card:hover, .recharge-card.selected {
    border-color: var(--primary);
    background: #f5f3ff;
}
.recharge-amount { font-size: 24px; font-weight: 700; color: var(--primary); }
.recharge-desc { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Loading & Empty */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty p { font-size: 14px; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}
.modal h3 { margin-bottom: 20px; font-size: 18px; }
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-500);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 4px;
}
.tab {
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-600);
    transition: all 0.2s;
    border: none;
    background: none;
}
.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .product-detail { grid-template-columns: 1fr; }
    .user-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .recharge-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .header-main .container { flex-wrap: wrap; }
    .search-box { order: 3; max-width: 100%; flex-basis: 100%; }
    .nav { overflow-x: auto; }
    .banner-slide h2 { font-size: 28px; }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: 1fr; }
}
