/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    color: #202223;
    background-color: #f6f6f7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* Header and Navigation */
header {
    background-color: #ffffff;
    color: #202223;
    padding: 20px 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.75rem;
    font-weight: 700;
    color: #202223;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: opacity 0.2s ease;
}

.logo a:hover {
    opacity: 0.7;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-menu a {
    color: #202223;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.nav-menu a:hover {
    color: #006aff;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #006aff;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f6f6f7 0%, #ffffff 100%);
    color: #202223;
    padding: 80px 0 120px;
    text-align: center;
    margin-bottom: 80px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: #616161;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 24px;
    background-color: #202223;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    line-height: 1;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.btn:hover {
    background-color: #2c2c2c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: #006aff;
}

.btn-primary:hover {
    background-color: #0057cc;
}

.btn-secondary {
    background-color: #ffffff;
    color: #202223;
    border: 1px solid #d3d3d3;
}

.btn-secondary:hover {
    background-color: #f6f6f7;
    border-color: #bfbfbf;
}

.btn-danger {
    background-color: #e63946;
}

.btn-danger:hover {
    background-color: #d62828;
}

.btn-small {
    padding: 10px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 18px 32px;
    font-size: 16px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
    margin: 60px 0 80px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    border-color: #e0e0e0;
}

.product-image {
    width: 100%;
    height: 320px;
    overflow: hidden;
    background-color: #f9f9f9;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 24px;
}

.product-category {
    display: inline-block;
    background-color: #f6f6f7;
    color: #616161;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.product-info h3 {
    margin: 12px 0 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.product-info h3 a {
    color: #202223;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-info h3 a:hover {
    color: #006aff;
}

.product-description {
    color: #616161;
    font-size: 14px;
    margin: 8px 0 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 24px;
    color: #202223;
    font-weight: 700;
    margin: 16px 0 8px;
    letter-spacing: -0.5px;
}

.product-stock {
    color: #616161;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    margin: 40px 0 60px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background-color: #ffffff;
    color: #202223;
    text-decoration: none;
    border-radius: 24px;
    transition: all 0.2s ease;
    border: 1px solid #d3d3d3;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover {
    background-color: #f6f6f7;
    border-color: #bfbfbf;
}

.filter-btn.active {
    background-color: #202223;
    color: white;
    border-color: #202223;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 60px 0 80px;
}

.pagination span {
    color: #616161;
    font-size: 15px;
    font-weight: 500;
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    background: white;
    padding: 60px;
    border-radius: 16px;
    margin: 40px 0 80px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.product-image-large {
    background-color: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
}

.product-image-large img {
    width: 100%;
    border-radius: 12px;
    transition: transform 0.4s ease;
}

.product-image-large:hover img {
    transform: scale(1.02);
}

.product-price-large {
    font-size: 32px;
    color: #202223;
    font-weight: 700;
    margin: 24px 0;
    letter-spacing: -1px;
}

.quantity-selector {
    margin: 24px 0 32px;
}

.quantity-selector label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 15px;
    color: #202223;
}

.quantity-selector input {
    width: 100px;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #d3d3d3;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.quantity-selector input:focus {
    outline: none;
    border-color: #006aff;
}

.out-of-stock {
    color: #e63946;
    font-weight: 600;
    font-size: 16px;
}

/* Cart */
.cart-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin: 40px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.cart-table th, .cart-table td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.cart-table th {
    background-color: #f9f9f9;
    color: #202223;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-product img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.cart-product h4 {
    font-size: 16px;
    font-weight: 600;
    color: #202223;
    margin-bottom: 4px;
}

.quantity-input {
    width: 80px;
    padding: 10px 12px;
    border: 1px solid #d3d3d3;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.quantity-input:focus {
    outline: none;
    border-color: #006aff;
}

.cart-summary {
    background: white;
    padding: 32px;
    border-radius: 12px;
    text-align: right;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    margin-top: 24px;
}

.cart-summary h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #202223;
}

.empty-cart {
    text-align: center;
    padding: 120px 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    margin: 40px 0;
}

.empty-cart p {
    font-size: 18px;
    color: #616161;
    margin-bottom: 24px;
}

/* Checkout */
.checkout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin: 40px 0 80px;
}

.checkout-form, .checkout-summary {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.checkout-form h2, .checkout-summary h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #202223;
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #202223;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d3d3d3;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #006aff;
}

.order-items {
    margin: 24px 0;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    color: #616161;
}

.order-total {
    display: flex;
    justify-content: space-between;
    padding: 20px 0 0;
    font-size: 24px;
    border-top: 2px solid #202223;
    margin-top: 16px;
    font-weight: 700;
    color: #202223;
}

/* Orders */
.order-search-form {
    max-width: 600px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.order-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.order-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.order-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-shipped {
    background-color: #e2d9f3;
    color: #6c2eb9;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.order-info p {
    margin: 12px 0;
    font-size: 15px;
    color: #616161;
}

.order-actions {
    margin-top: 20px;
}

.order-detail {
    background: white;
    padding: 40px;
    border-radius: 12px;
    margin: 40px 0 80px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.order-info-section {
    margin-bottom: 40px;
}

.order-info-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #202223;
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.order-items-table th, .order-items-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.order-items-table th {
    background-color: #f9f9f9;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #202223;
}

/* Admin */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.stat-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #006aff;
    margin-bottom: 8px;
}

.admin-menu {
    display: flex;
    gap: 12px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.admin-actions {
    margin: 40px 0;
}

.admin-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin: 40px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.admin-table th, .admin-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table th {
    background-color: #f9f9f9;
    color: #202223;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-form {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.status-update {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.status-update select {
    padding: 12px 16px;
    border: 1px solid #d3d3d3;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.status-update select:focus {
    outline: none;
    border-color: #006aff;
}

/* Footer */
footer {
    background-color: #f9f9f9;
    color: #616161;
    text-align: center;
    padding: 40px 0;
    margin-top: 120px;
    border-top: 1px solid #f0f0f0;
}

footer p {
    font-size: 14px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #616161;
}

main h1, main h2 {
    color: #202223;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
}

main h1 {
    font-size: 36px;
}

main h2 {
    font-size: 28px;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: 12px;
    margin: 40px 0 80px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.error-page h1 {
    margin-bottom: 16px;
}

.error-page p {
    color: #616161;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 32px;
    }
    
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .cart-table th, .cart-table td {
        padding: 12px;
        font-size: 14px;
    }
    
    .cart-product img {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0 80px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .product-detail {
        padding: 24px;
    }
    
    .checkout-form, .checkout-summary {
        padding: 24px;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }
}
