/* 统一前端样式 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    text-align: center;
}

header h1 {
    font-size: 36px;
    margin-bottom: 5px;
}

header p {
    font-size: 16px;
    color: #ecf0f1;
}

/* 导航栏样式 */
nav {
    background-color: #34495e;
    padding: 10px 0;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 20px;
    font-size: 16px;
    transition: color 0.3s;
}

nav a:hover {
    color: #27ae60;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题样式 */
.section-title {
    font-size: 28px;
    color: #2c3e50;
    margin: 30px 0 20px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #27ae60;
    margin: 10px auto 0;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* 产品卡片 */
.product-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.product-card h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.product-card p {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

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

.product-price-section {
    margin-bottom: 15px;
    min-height: 60px;
}

.discount-info-badge {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.discount-price {
    font-size: 26px;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 5px;
}

.original-price {
    font-size: 16px;
    color: #95a5a6;
    text-decoration: line-through;
    margin-bottom: 10px;
}

/* 文章网格 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* 文章卡片 */
.article-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.article-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.article-card h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.article-card p {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #219a52;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #27ae60;
    color: #27ae60;
}

.btn-outline:hover {
    background-color: #27ae60;
    color: white;
}

.btn-primary {
    background-color: #27ae60;
    color: white;
}

.btn-primary:hover {
    background-color: #219a52;
}

/* 英雄区 */
.hero-section {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

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

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #27ae60;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #34495e;
}

/* 购物车样式 */
.cart-container {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.cart-header {
    text-align: center;
    margin-bottom: 30px;
}

.cart-header h1 {
    font-size: 28px;
    color: #2c3e50;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.cart-item-info p {
    color: #7f8c8d;
    font-size: 14px;
}

.cart-item-price {
    font-size: 20px;
    color: #e74c3c;
    font-weight: bold;
    margin-right: 20px;
}

.cart-item-price .discount-price {
    font-size: 22px;
    color: #e74c3c;
    font-weight: bold;
    display: block;
}

.cart-item-price .original-price {
    font-size: 16px;
    color: #95a5a6;
    text-decoration: line-through;
    display: block;
}

.cart-item-price .discount-info-badge-mini {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 5px;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 2px solid #27ae60;
    background-color: white;
    color: #27ae60;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background-color: #27ae60;
    color: white;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    padding: 5px;
    font-size: 16px;
}

.remove-btn {
    padding: 8px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.remove-btn:hover {
    background-color: #c0392b;
}

.cart-total {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: right;
}

.cart-total h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.cart-total .total-price {
    font-size: 32px;
    color: #e74c3c;
    font-weight: bold;
}

.cart-total .discount-info {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 10px 15px;
    margin-bottom: 15px;
    text-align: right;
}

.cart-total .discount-info p {
    color: #856404;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

.cart-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart h2 {
    font-size: 28px;
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* 订单样式 */
.orders-container {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.orders-header {
    text-align: center;
    margin-bottom: 30px;
}

.orders-header h1 {
    font-size: 28px;
    color: #2c3e50;
}

.order-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #ecf0f1;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.order-id {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.order-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.order-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.order-status.paid {
    background-color: #d1ecf1;
    color: #0c5460;
}

.order-status.shipped {
    background-color: #d4edda;
    color: #155724;
}

.order-status.completed {
    background-color: #e3f2fd;
    color: #1565c0;
}

.order-items {
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
}

.order-item-info {
    flex: 1;
}

.order-item-info h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.order-item-price {
    font-size: 16px;
    color: #e74c3c;
    font-weight: bold;
    margin-right: 15px;
}

.order-total {
    text-align: right;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.order-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

/* 用户信息样式 */
.profile-container {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-header h1 {
    font-size: 28px;
    color: #2c3e50;
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.profile-info-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.profile-info-item h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.profile-info-item p {
    color: #7f8c8d;
    font-size: 14px;
}

.profile-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* 联系我们样式 */
.feedback-container {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.feedback-header {
    text-align: center;
    margin-bottom: 30px;
}

.feedback-header h1 {
    font-size: 28px;
    color: #2c3e50;
}

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

.feedback-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.feedback-form input,
.feedback-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Microsoft YaHei', sans-serif;
    transition: border-color 0.3s;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
    outline: none;
    border-color: #27ae60;
}

.feedback-form textarea {
    resize: vertical;
    min-height: 150px;
}

/* 消息提示 */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
}

.flash-message {
    background-color: #27ae60;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 28px;
    }
    
    nav a {
        margin: 0 10px;
        font-size: 14px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-image {
        width: 100%;
        height: 150px;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-item-image {
        width: 100%;
        height: 100px;
        margin-right: 0;
    }
    
    .cart-actions,
    .order-actions {
        flex-direction: column;
    }
    
    .cart-actions .btn,
    .order-actions .btn {
        width: 100%;
        text-align: center;
    }
}