/* ===== 全局通用样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}
body {
    color: #333;
    background-color: #fff;
    line-height: 1.6;
}
a {
    text-decoration: none;
    color: inherit;
}
ul {
    list-style: none;
}
button {
    cursor: pointer;
    border: none;
    background: transparent;
}
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Header 顶部导航 ===== */
.header {
    border-bottom: 1px solid #eee;
    position: sticky;
    top:0;
    background:#fff;
    z-index:99;
}
.header-top {
    background:#222;
    color:#fff;
    padding:8px 0;
    font-size:14px;
}
.header-top .container {
    display:flex;
    justify-content: space-between;
}
.header-main {
    padding:16px 0;
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap:20px;
}
.nav-menu {
    display:flex;
    gap:24px;
}
.nav-menu a:hover {
    color:#0066cc;
}
.search-wrap {
    flex:1;
    max-width:400px;
    position:relative;
}
.search-wrap input {
    width:100%;
    border:1px solid #ddd;
    padding:10px 16px;
    border-radius:24px;
    outline:none;
}
.search-wrap button {
    position:absolute;
    right:12px;
    top:50%;
    transform:translateY(-50%);
    color:#666;
}
.header-icons {
    display:flex;
    gap:20px;
    font-size:20px;
}
.header-icons > div {
    cursor:pointer;
    position:relative;
}
.badge {
    position:absolute;
    top:-6px;
    right:-8px;
    background:#f44336;
    color:#fff;
    font-size:10px;
    width:16px;
    height:16px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
}

/* ===== 轮播组件 ===== */
.banner-swiper {
    width:100%;
    height:420px;
    overflow:hidden;
    position:relative;
}
.swiper-slide {
    position:absolute;
    width:100%;
    height:100%;
    opacity:0;
    transition:opacity 0.6s;
}
.swiper-slide.active {
    opacity:1;
}
.swiper-slide img {
    width:100%;
    height:100%;
    object-fit:cover;
}
.swiper-dots {
    position:absolute;
    bottom:20px;
    left:50%;
    transform:translateX(-50%);
    display:flex;
    gap:8px;
}
.swiper-dots span {
    width:10px;
    height:10px;
    border-radius:50%;
    background:#ffffff80;
    cursor:pointer;
}
.swiper-dots span.active {
    background:#fff;
}

/* ===== 产品卡片通用 ===== */
.product-card {
    border:1px solid #eee;
    border-radius:8px;
    overflow:hidden;
    transition:0.3s;
}
.product-card:hover {
    box-shadow:0 4px 12px #00000015;
}
.product-img {
    width:100%;
    height:260px;
    overflow:hidden;
}
.product-img img {
    width:100%;
    height:100%;
    object-fit:cover;
}
.product-info {
    padding:12px;
}
.product-title {
    font-size:15px;
    margin-bottom:8px;
}
.product-price {
    color:#f44336;
    font-weight:bold;
    font-size:18px;
}
.product-actions {
    display:flex;
    gap:8px;
    margin-top:10px;
}
.product-actions button {
    flex:1;
    padding:8px;
    border-radius:4px;
    border:1px solid #0066cc;
}
.btn-cart {
    background:#0066cc;
    color:#fff;
}
.btn-fav {
    color:#0066cc;
}

/* ===== 首页区块 ===== */
.section {
    padding:60px 0;
}
.section-title {
    text-align:center;
    font-size:28px;
    margin-bottom:32px;
}
.grid-4 {
    display:grid;
    grid-template-columns: repeat(4,1fr);
    gap:24px;
}
.grid-3 {
    display:grid;
    grid-template-columns: repeat(3,1fr);
    gap:24px;
}
.grid-2 {
    display:grid;
    grid-template-columns: repeat(2,1fr);
    gap:24px;
}

/* ===== 产品列表页筛选栏 ===== */
.filter-bar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:20px;
    background:#f8f8f8;
    border-radius:8px;
    margin-bottom:24px;
}
.filter-group {
    display:flex;
    gap:16px;
    align-items:center;
}
.view-switch span {
    font-size:22px;
    cursor:pointer;
    margin:0 4px;
}
.pagination {
    display:flex;
    gap:8px;
    justify-content:center;
    margin-top:40px;
}
.pagination button {
    padding:8px 14px;
    border:1px solid #ddd;
    border-radius:4px;
}
.pagination button.active {
    background:#0066cc;
    color:#fff;
    border-color:#0066cc;
}

/* ===== 侧滑弹窗（购物车 / 收藏） ===== */
.overlay {
    position:fixed;
    inset:0;
    background:#00000060;
    z-index:100;
    opacity:0;
    visibility:hidden;
    transition:0.3s;
}
.overlay.show {
    opacity:1;
    visibility:visible;
}
.side-drawer {
    position:fixed;
    top:0;
    right:-420px;
    width:400px;
    height:100vh;
    background:#fff;
    z-index:101;
    transition:right 0.3s;
    padding:24px;
    overflow-y:auto;
}
.side-drawer.show {
    right:0;
}
.drawer-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
    font-size:20px;
}
.drawer-item {
    display:flex;
    gap:12px;
    padding:12px 0;
    border-bottom:1px solid #eee;
}
.drawer-item img {
    width:70px;
    height:70px;
    object-fit:cover;
}

/* ===== 历史浏览 ===== */
.history-wrap {
    margin-top:30px;
}
.history-list {
    display:flex;
    gap:16px;
    overflow-x:auto;
    padding:8px 0;
}
.history-item {
    width:160px;
    flex-shrink:0;
}

/* ===== 评论卡片 ===== */
.review-card {
    background:#f8f8f8;
    padding:20px;
    border-radius:8px;
}
.review-name {
    font-weight:bold;
    margin-bottom:6px;
}
.stars {
    color:#ffa500;
    margin-bottom:8px;
}

/* ===== Footer 底部 ===== */
.footer {
    background:#222;
    color:#fff;
    padding:50px 0 20px;
    margin-top:60px;
}
.footer-grid {
    display:grid;
    grid-template-columns: repeat(4,1fr);
    gap:30px;
    margin-bottom:40px;
}
.footer-col h4 {
    margin-bottom:16px;
    font-size:18px;
}
.footer-col li {
    margin-bottom:8px;
}
.footer-col a:hover {
    color:#0099ff;
}
.payment-img {
    margin-top:12px;
    max-width:240px;
}
.copyright {
    text-align:center;
    padding-top:20px;
    border-top:1px solid #444;
    font-size:14px;
}

/* ===== 产品详情页 ===== */
.detail-wrap {
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:40px;
}
.detail-img {
    width:100%;
}
.detail-info h1 {
    font-size:26px;
    margin-bottom:12px;
}
.detail-price {
    font-size:26px;
    color:#f44336;
    font-weight:bold;
    margin-bottom:16px;
}
.detail-desc {
    margin:20px 0;
    line-height:1.8;
}
.quantity {
    display:flex;
    align-items:center;
    gap:10px;
    margin:20px 0;
}
.quantity button {
    width:32px;
    height:32px;
    border:1px solid #ddd;
}
.quantity input {
    width:50px;
    text-align:center;
    border:1px solid #ddd;
    padding:4px;
}

/* ===== 政策页面通用 ===== */
.page-content {
    max-width:900px;
    margin:40px auto;
}
.page-content h1 {
    margin-bottom:24px;
}
.page-content p {
    margin-bottom:16px;
}

/* ===== 响应式简单适配 ===== */
@media(max-width:992px){
    .grid-4 {grid-template-columns: repeat(2,1fr);}
    .grid-3 {grid-template-columns: repeat(2,1fr);}
    .footer-grid {grid-template-columns: repeat(2,1fr);}
    .detail-wrap {grid-template-columns: 1fr;}
}
@media(max-width:768px){
    .grid-4,.grid-3,.grid-2 {grid-template-columns: 1fr;}
    .header-main {flex-wrap:wrap;}
    .side-drawer {width:100%;right:-100%;}
}

.tracking-form {
    margin:30px 0;
}
.input-group {
    display:flex;
    gap:12px;
}
#orderTrackInput {
    flex:1;
    padding:14px 16px;
    border:1px solid #ddd;
    border-radius:6px;
    font-size:16px;
}
#trackSubmitBtn {
    padding:14px 24px;
    background:#222;
    color:#fff;
    border:none;
    border-radius:6px;
    cursor:pointer;
}
#trackSubmitBtn:hover {
    background:#444;
}
.order-info-card {
    background:#f8f8f8;
    padding:20px;
    border-radius:8px;
    margin-bottom:30px;
}
.timeline-block {
    margin-bottom:30px;
}
.timeline {
    position:relative;
    padding-left:30px;
    border-left:2px solid #ddd;
}
.timeline-item {
    position:relative;
    padding:12px 0;
}
.timeline-item::before {
    content:"";
    position:absolute;
    left:-36px;
    top:14px;
    width:14px;
    height:14px;
    border-radius:50%;
    background:#ddd;
}
.timeline-item.active::before {
    background:#222;
}
.timeline-time {
    font-size:14px;
    color:#666;
    margin-bottom:4px;
}
.tracking-note {
    margin-top:30px;
    padding-top:20px;
    border-top:1px solid #eee;
}
.text-warning {
    color:#c53030;
}
