/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: #f7f7f7;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, li {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

input, button {
    font-family: inherit;
    outline: none;
}

.container {
    width: 1200px;
    max-width: 95%;
    margin: 0 auto;
}

/* ========== 顶部条 ========== */
.top-bar {
    background: #2a2a2a;
    color: #bbb;
    font-size: 13px;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
}

.top-bar a {
    color: #bbb;
    margin-left: 15px;
    transition: color .2s;
}

.top-bar a:hover {
    color: #ff6b35;
}

/* ========== 头部 ========== */
header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 22px;
    font-weight: bold;
    color: #ff6b35;
    letter-spacing: 1px;
}

.logo span {
    color: #333;
}

.search-box {
    display: flex;
    width: 400px;
    border: 2px solid #ff6b35;
    border-radius: 4px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 9px 12px;
    border: none;
    font-size: 14px;
}

.search-box button {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 14px;
}

.header-icons {
    display: flex;
    gap: 25px;
    font-size: 14px;
}

.header-icons a {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    transition: color .2s;
}

.header-icons a:hover {
    color: #ff6b35;
}

.cart-badge {
    background: #ff6b35;
    color: #fff;
    font-size: 11px;
    border-radius: 10px;
    padding: 1px 6px;
    position: absolute;
    top: -8px;
    right: -12px;
    min-width: 18px;
    text-align: center;
}

/* ========== 导航 ========== */
nav {
    background: #ff6b35;
}

nav ul {
    display: flex;
}

nav ul li a {
    display: block;
    color: #fff;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 500;
    transition: background .2s;
}

nav ul li a:hover,
nav ul li a.active {
    background: rgba(255, 255, 255, 0.15);
}

/* ========== Banner ========== */
.banner {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 50%, #ffa87a 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.banner h1 {
    font-size: 42px;
    margin-bottom: 15px;
    font-weight: bold;
}

.banner p {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 25px;
}

.banner .btn {
    background: #fff;
    color: #ff6b35;
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    display: inline-block;
    transition: transform .2s;
}

.banner .btn:hover {
    transform: scale(1.05);
}

/* ========== 分类 ========== */
.categories {
    padding: 40px 0;
}

.section-title {
    text-align: center;
    font-size: 26px;
    margin-bottom: 30px;
    color: #333;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #ff6b35;
    margin: 10px auto 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    background: #fff;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.15);
}

.category-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.category-card h3 {
    font-size: 16px;
    color: #333;
}

/* ========== 商品列表 ========== */
.products {
    padding: 40px 0;
}

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

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform .2s, box-shadow .2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.product-img {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f5f5f5, #eee);
    overflow: hidden;
}

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

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

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    height: 40px;
    overflow: hidden;
    line-height: 1.4;
}

.product-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    height: 18px;
    overflow: hidden;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    color: #ff6b35;
    font-size: 18px;
    font-weight: bold;
}

.product-price small {
    font-size: 12px;
    font-weight: normal;
}

.add-cart-btn {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background .2s;
}

.add-cart-btn:hover {
    background: #e55a28;
}

/* ========== 页脚 ========== */
footer {
    background: #2a2a2a;
    color: #aaa;
    padding: 40px 0 20px;
    margin-top: 50px;
}

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

.footer-col h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 15px;
}

.footer-col p,
.footer-col li {
    font-size: 13px;
    line-height: 1.9;
}

.footer-col li {
    cursor: pointer;
    transition: color .2s;
}

.footer-col li:hover {
    color: #ff6b35;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #888;
}

.footer-bottom a {
    color: #aaa;
    margin: 0 8px;
}

.footer-bottom a:hover {
    color: #ff6b35;
}

/* ========== 面包屑 ========== */
.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a:hover {
    color: #ff6b35;
}

.breadcrumb span {
    margin: 0 8px;
    color: #ccc;
}

/* ========== 商品详情 ========== */
.product-detail {
    padding: 30px 0 50px;
}

.detail-wrap {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detail-img {
    height: 450px;
    background: linear-gradient(135deg, #f5f5f5, #eee);
    border-radius: 8px;
    overflow: hidden;
}

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

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

.detail-info .price-box {
    background: #fff9f5;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.detail-info .price-box .label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.detail-info .price-box .price {
    color: #ff6b35;
    font-size: 32px;
    font-weight: bold;
}

.detail-info .price-box .price small {
    font-size: 16px;
    font-weight: normal;
}

.detail-info .desc-box {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.8;
}

.detail-info .desc-box h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 10px;
}

.quantity-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.quantity-row label {
    font-size: 14px;
    color: #666;
}

.quantity-control {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.quantity-control button {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    color: #666;
}

.quantity-control input {
    width: 50px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 14px;
}

.detail-actions {
    display: flex;
    gap: 15px;
}

.btn-primary,
.btn-secondary {
    padding: 13px 35px;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    border: none;
    font-weight: 500;
    transition: transform .15s;
}

.btn-primary {
    background: #ff6b35;
    color: #fff;
}

.btn-primary:hover {
    background: #e55a28;
}

.btn-secondary {
    background: #fff;
    color: #ff6b35;
    border: 2px solid #ff6b35;
}

.btn-secondary:hover {
    background: #fff3ed;
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
}

/* ========== 购物车 ========== */
.cart-wrap {
    padding: 30px 0 50px;
}

.cart-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.cart-table thead {
    background: #fafafa;
}

.cart-table th {
    padding: 15px;
    text-align: left;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.cart-table td {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f5f5f5, #eee);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-name {
    color: #333;
    font-size: 14px;
}

.cart-item-name:hover {
    color: #ff6b35;
}

.cart-remove {
    color: #999;
    cursor: pointer;
    font-size: 13px;
    background: none;
    border: none;
}

.cart-remove:hover {
    color: #ff6b35;
}

.cart-summary {
    background: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: right;
}

.cart-summary .subtotal,
.cart-summary .shipping {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.cart-summary .total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0 25px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

.cart-summary .total .label {
    font-size: 15px;
    color: #333;
}

.cart-summary .total .value {
    color: #ff6b35;
    font-size: 26px;
    font-weight: bold;
}

.cart-summary .checkout-btn {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 13px 50px;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s;
}

.cart-summary .checkout-btn:hover {
    background: #e55a28;
}

.empty-cart {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 8px;
}

.empty-cart .icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-cart p {
    color: #999;
    font-size: 15px;
    margin-bottom: 20px;
}

/* ========== 结算页 ========== */
.checkout-wrap {
    padding: 30px 0 50px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 25px;
}

.checkout-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.checkout-form h2 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6b35;
    display: inline-block;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color .2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #ff6b35;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.payment-methods {
    margin-top: 25px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .2s;
}

.payment-option:hover {
    border-color: #ff6b35;
}

.payment-option.selected {
    border-color: #ff6b35;
    background: #fff9f5;
}

.payment-option .pay-icon {
    font-size: 24px;
}

.payment-option input {
    accent-color: #ff6b35;
}

.order-summary {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.order-summary h3 {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    color: #666;
    border-bottom: 1px dashed #f0f0f0;
}

.order-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.order-item-name img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.order-total {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #eee;
    font-weight: bold;
}

.order-total .value {
    color: #ff6b35;
    font-size: 20px;
}

.place-order-btn {
    width: 100%;
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 4px;
    font-size: 16px;
    margin-top: 20px;
    cursor: pointer;
    transition: background .2s;
}

.place-order-btn:hover {
    background: #e55a28;
}

.agree-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.agree-row input {
    margin-top: 3px;
    accent-color: #ff6b35;
}

.agree-row a {
    color: #ff6b35;
}

/* ========== 支付成功弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal .check-icon {
    width: 70px;
    height: 70px;
    background: #4caf50;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.modal h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.modal p {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
}

.modal button {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 10px 30px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

/* ========== 协议页面 ========== */
.legal-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: #555;
    line-height: 1.9;
}

.legal-box h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.legal-box .update-date {
    font-size: 13px;
    color: #999;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.legal-box h3 {
    font-size: 16px;
    color: #333;
    margin: 24px 0 8px;
}

.legal-box p {
    margin-bottom: 8px;
}

.legal-box a {
    color: #ff6b35;
}

/* ========== 关于/联系 ========== */
.page-content {
    padding: 30px 0 50px;
}

.about-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    line-height: 1.9;
    font-size: 15px;
    color: #555;
}

.about-box h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6b35;
    display: inline-block;
}

.about-box p {
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.info-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-item .icon {
    font-size: 22px;
}

.info-item .text strong {
    color: #333;
    display: block;
    font-size: 14px;
    margin-bottom: 3px;
}

.info-item .text span {
    font-size: 14px;
    color: #666;
}

/* ========== Toast 提示 ========== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #333;
    color: #fff;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transition: all .3s;
    z-index: 2000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 筛选栏 ========== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    color: #666;
    transition: all .2s;
}

.filter-tab.active {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
}

.filter-tab:hover:not(.active) {
    border-color: #ff6b35;
    color: #ff6b35;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .container {
        width: 95%;
    }
    .category-grid,
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .detail-wrap {
        grid-template-columns: 1fr;
    }
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    header .container {
        flex-wrap: wrap;
        gap: 15px;
    }
    .search-box {
        width: 100%;
        order: 3;
    }
    nav ul {
        flex-wrap: wrap;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
