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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
}

.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 50px;
}

.nav a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 16px;
    padding: 8px 0;
    white-space: nowrap;
}

.nav a:hover {
    color: #667eea;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    opacity: 0.9;
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin: 50px 0 30px;
    color: #333;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 20px;
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.no-image {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.product-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-desc {
    color: #999;
    font-size: 13px;
    margin-bottom: 10px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 8px;
}

.product-stock {
    color: #999;
    font-size: 12px;
    margin-bottom: 12px;
}

.btn-buy {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    transition: background 0.3s;
    text-align: center;
}

.btn-buy:hover {
    background: #5a67d8;
}

.footer {
    background: #2d3748;
    color: #a0aec0;
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    margin: 0 10px;
    display: inline-block;
}

.footer-links a:hover {
    color: #fff;
}

.copyright {
    font-size: 14px;
}

.breadcrumb {
    padding: 20px 0;
    color: #999;
    font-size: 14px;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.page-title {
    font-size: 28px;
    margin-bottom: 30px;
}

.product-detail {
    padding: 40px 0;
}

.detail-container {
    display: flex;
    gap: 50px;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detail-image {
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.detail-info h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.detail-price {
    font-size: 32px;
    font-weight: bold;
    color: #e74c3c;
    margin: 20px 0 10px;
}

.detail-stock {
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.detail-desc {
    color: #666;
    line-height: 1.8;
    margin-bottom: 30px;
    word-wrap: break-word;
    word-break: break-word;
}

.btn-buy-now {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-buy-now:hover {
    background: #5a67d8;
}

.order-query {
    padding: 40px 0;
}

.order-notice {
    background: #fff3cd;
    color: #856404;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.query-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    color: #666;
}

.tab-btn.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

.query-form {
    max-width: 500px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-group input {
    flex: 1;
}

.captcha-code {
    background: #f0f0f0;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 4px;
}

.refresh-captcha {
    background: #e0e0e0;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-query {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.articles-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

.articles-sidebar h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.category-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin: 0;
    padding: 0;
}

.category-list a {
    color: #666;
    text-decoration: none;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 14px;
    transition: all 0.3s;
}

.category-list a:hover,
.category-list a.active {
    background: #667eea;
    color: #fff;
}

.article-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.article-item h3 {
    margin-bottom: 10px;
}

.article-item h3 a {
    color: #333;
    text-decoration: none;
}

.article-item h3 a:hover {
    color: #667eea;
}

.article-meta {
    color: #999;
    font-size: 12px;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.article-detail h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

.article-content {
    margin: 30px 0;
    line-height: 1.8;
}

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

.btn-back {
    display: inline-block;
    background: #e0e0e0;
    color: #333;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination a {
    display: inline-block;
    padding: 8px 14px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
}

.pagination a.active {
    background: #667eea;
    color: #fff;
}

.footer-links-mobile {
    display: none;
}

.footer-links-desktop {
    display: block;
}

@media (max-width: 992px) {
    .nav {
        gap: 30px;
    }
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .nav {
        display: none;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 24px;
        margin: 30px 0 20px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-card a {
        padding: 12px;
    }
    
    .product-card h3 {
        font-size: 14px;
        white-space: normal;
        line-height: 1.4;
        min-height: 38px;
    }
    
    .product-desc {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .product-stock {
        font-size: 11px;
    }
    
    .btn-buy {
        padding: 6px 12px;
        font-size: 12px;
        display: block;
        text-align: center;
    }
    
    .detail-container {
        flex-direction: column;
        padding: 20px;
        gap: 25px;
    }
    
    .detail-image {
        max-width: 280px;
        margin: 0 auto;
        width: 100%;
    }
    
    .detail-info h1 {
        font-size: 22px;
    }
    
    .detail-price {
        font-size: 26px;
    }
    
    .detail-desc {
        font-size: 14px;
        word-break: break-all;
    }
    
    .btn-buy-now {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .articles-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-list {
        gap: 8px;
    }
    
    .category-list a {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .footer-links-desktop {
        display: none;
    }
    
    .footer-links-mobile {
        display: block;
    }
    
    .footer-row {
        margin-bottom: 12px;
    }
    
    .footer-row:last-child {
        margin-bottom: 0;
    }
    
    .footer-links a {
        margin: 0 5px;
        padding: 6px 8px;
        display: inline-block;
    }
}

@supports (-webkit-touch-callout: none) {
    .detail-container {
        display: block;
        text-align: center;
    }
    
    .detail-image {
        margin: 0 auto 25px auto;
    }
    
    .detail-info {
        text-align: left;
        padding: 0 10px;
    }
    
    @media (max-width: 768px) {
        .detail-info {
            padding: 0 5px;
        }
    }
}