/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px 0;
}

.header-left h1 {
    color: #ff6600;
    font-size: 24px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-right a {
    margin-left: 0;
    padding: 8px 16px;
    background-color: #ff6600;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
    text-align: center;
}

.header-right a:hover {
    background-color: #ff8533;
}

/* 公告样式 */
.notice {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 0;
    margin: 20px 0;
}

/* 活动样式 */
.activity {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.activity h2 {
    color: #ff6600;
    margin-bottom: 20px;
    font-size: 20px;
}

/* 商品列表样式 */
.products {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.products h2 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.product-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-image {
    text-align: center;
    margin-bottom: 15px;
}

.product-image img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.product-info h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: #ff6600;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-stock {
    margin-bottom: 15px;
    font-size: 14px;
}

.stock-low {
    color: #ff0000;
}

.stock-enough {
    color: #00cc00;
}

.buy-btn {
    display: block;
    background-color: #ff6600;
    color: #fff;
    text-align: center;
    padding: 8px 0;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.buy-btn:hover {
    background-color: #ff8533;
}

/* 购买页面样式 */
.buy {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-detail {
    display: flex;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.product-detail .product-image {
    margin-right: 30px;
    margin-bottom: 0;
}

.product-detail .product-image img {
    width: 200px;
    height: 200px;
}

.product-detail .product-info h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.product-detail .product-price {
    font-size: 28px;
    margin-bottom: 15px;
}

.product-detail .product-desc {
    margin-top: 20px;
    color: #666;
    line-height: 1.6;
}

/* 表单样式 */
.buy-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-item {
    margin-bottom: 20px;
}

.form-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-item input[type="text"],
.form-item input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
}

.form-item input:focus {
    outline: none;
    border-color: #ff6600;
}

.required {
    color: #ff0000;
}

.tip {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* 数量控制样式 */
.quantity-control {
    display: flex;
    align-items: center;
    width: 200px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
}

.quantity-control input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-left: none;
    border-right: none;
    font-size: 16px;
}

/* 支付方式样式 */
.pay-type {
    display: flex;
    gap: 20px;
}

.pay-type label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.pay-type input[type="radio"] {
    margin-right: 8px;
}

/* 总价样式 */
.total-price {
    font-size: 24px;
    color: #ff6600;
    font-weight: bold;
}

/* 购买按钮样式 */
.buy-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    background-color: #ff6600;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.buy-btn:hover {
    background-color: #ff8533;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
}

/* 成功页面样式 */
.success {
    background-color: #fff;
    padding: 40px;
    margin: 50px auto;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.success h2 {
    color: #00cc00;
    margin-bottom: 20px;
}

.success p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.card-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: left;
}

.card-item {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* 查询页面样式 */
.query {
    background-color: #fff;
    padding: 40px;
    margin: 50px auto;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.query h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* 查询按钮样式 */
.query-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    background-color: #ff6600;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.query-btn:hover {
    background-color: #ff8533;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        width: 100%;
    }
    
    .product-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-detail {
        flex-direction: column;
    }
    
    .product-detail .product-image {
        margin-right: 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .product-list {
        grid-template-columns: 1fr;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-right {
        display: flex;
        gap: 10px;
    }
    
    .header-right a {
        margin-left: 0;
    }
}
