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

:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #ff8c5a;
    --secondary: #f7931e;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #eeeeee;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(255,107,53,0.15);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== 顶部导航栏 ===== */
.topbar {
    background: #2c2c2c;
    color: #999;
    font-size: 0.85em;
    padding: 8px 0;
}

.topbar .topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar a { color: #ccc; margin: 0 8px; transition: color 0.3s; }
.topbar a:hover { color: var(--primary); }

/* ===== 主导航 ===== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 70px;
    gap: 30px;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 25px;
    flex: 1;
}

.nav-links a {
    font-size: 1.05em;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    background: #fff5f0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    border: 2px solid var(--primary);
    border-radius: 25px;
    overflow: hidden;
    width: 200px;
    transition: width 0.3s;
}

.search-box:focus-within { width: 280px; }

.search-box input {
    border: none;
    outline: none;
    padding: 8px 15px;
    flex: 1;
    font-size: 0.9em;
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    font-size: 0.9em;
}

.cart-btn {
    position: relative;
    font-size: 1.3em;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s;
}

.cart-btn:hover { transform: scale(1.1); }

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: white;
    font-size: 0.6em;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

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

/* ===== 横幅 ===== */
.hero-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 60px 40px;
    border-radius: var(--radius);
    margin: 20px 0 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-banner h1 {
    font-size: 2.8em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-banner p {
    font-size: 1.3em;
    opacity: 0.95;
    margin-bottom: 10px;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.hero-tag {
    background: rgba(255,255,255,0.25);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1em;
    backdrop-filter: blur(4px);
}

/* ===== 分类导航 ===== */
.category-nav {
    display: flex;
    gap: 12px;
    margin: 25px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.cat-chip {
    background: white;
    padding: 10px 22px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--border);
    font-size: 0.95em;
    font-weight: 500;
}

.cat-chip:hover, .cat-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===== 板块标题 ===== */
.section-title {
    text-align: center;
    margin: 40px 0 25px;
    position: relative;
}

.section-title h2 {
    font-size: 2em;
    color: var(--text);
    display: inline-block;
    padding-bottom: 10px;
    position: relative;
}

.section-title h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.section-title p {
    color: var(--text-light);
    margin-top: 8px;
}

/* ===== 商品网格 ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.product-card .img-wrap {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f9f9f9;
    position: relative;
}

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

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

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.badge.new { background: #e74c3c; }

.product-card .info {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .info h3 {
    font-size: 1.05em;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .info .desc {
    font-size: 0.85em;
    color: var(--text-light);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-card .price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.product-card .price {
    font-size: 1.5em;
    color: var(--primary);
    font-weight: bold;
}

.product-card .price-old {
    font-size: 0.9em;
    color: #999;
    text-decoration: line-through;
}

.product-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.product-card .tag {
    background: #f5f5f5;
    color: #666;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.78em;
}

.product-card .buy-btn {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 10px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s;
}

.product-card .buy-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(255,107,53,0.4);
}

/* ===== 优势板块 ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    text-align: center;
    background: white;
    padding: 30px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-item .icon { font-size: 2.5em; margin-bottom: 12px; }
.feature-item h3 { color: var(--primary); font-size: 1.2em; margin-bottom: 8px; }
.feature-item p { color: var(--text-light); font-size: 0.9em; }

/* ===== 页脚 ===== */
.footer {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: white;
    padding: 50px 20px 30px;
    margin-top: 50px;
}

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

.footer-col h4 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--primary-light);
}

.footer-col p, .footer-col a {
    color: #bbb;
    font-size: 0.9em;
    line-height: 2;
    display: block;
}

.footer-col a:hover { color: white; }

.footer-bottom {
    max-width: 1200px;
    margin: 30px auto 0;
    padding-top: 20px;
    border-top: 1px solid #444;
    text-align: center;
    color: #888;
    font-size: 0.85em;
}

/* ===== 商品详情页 ===== */
.detail-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 30px 0;
}

.detail-img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.detail-info h1 {
    font-size: 1.8em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.detail-price {
    background: #fff5f0;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.detail-price .now {
    font-size: 2.5em;
    color: var(--primary);
    font-weight: bold;
}

.detail-price .old {
    font-size: 1.1em;
    color: #999;
    text-decoration: line-through;
    margin-left: 15px;
}

.detail-desc {
    color: var(--text-light);
    line-height: 1.8;
    margin: 20px 0;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.detail-tag {
    background: #f0f0f0;
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.9em;
    color: #555;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
}

.qty-selector label { font-size: 1em; }

.qty-selector .qty-control {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.qty-selector button {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    font-size: 1.2em;
    cursor: pointer;
    transition: background 0.3s;
}

.qty-selector button:hover { background: #e0e0e0; }

.qty-selector input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 2px solid var(--border);
    border-right: 2px solid var(--border);
    font-size: 1.1em;
    outline: none;
}

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

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,53,0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

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

/* ===== 关于页 ===== */
.about-section {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    margin: 25px 0;
    box-shadow: var(--shadow);
}

.about-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.6em;
}

.about-section p {
    color: var(--text-light);
    line-height: 2;
    margin-bottom: 15px;
}

/* ===== 购物车浮窗 ===== */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90%;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: right 0.3s;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open { right: 0; }

.cart-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    display: none;
}

.cart-overlay.show { display: block; }

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 { font-size: 1.3em; }

.cart-close { font-size: 1.5em; cursor: pointer; color: #999; }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 0.9em; margin-bottom: 4px; }
.cart-item-info .price { color: var(--primary); font-weight: bold; font-size: 1em; }
.cart-item-info .qty { font-size: 0.85em; color: #999; }

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.cart-total .amount { color: var(--primary); font-weight: bold; font-size: 1.4em; }

.cart-checkout {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.cart-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,107,53,0.4);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar-inner { flex-wrap: wrap; height: auto; padding: 12px 15px; gap: 10px; }
    .nav-links { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; gap: 5px; }
    .nav-links a { font-size: 0.95em; padding: 6px 10px; }
    .search-box { width: 150px; }
    .search-box:focus-within { width: 200px; }
    .hero-banner { padding: 40px 20px; }
    .hero-banner h1 { font-size: 2em; }
    .hero-banner p { font-size: 1.1em; }
    .detail-wrap { grid-template-columns: 1fr; gap: 20px; }
    .container { padding: 15px; }
    .section-title h2 { font-size: 1.6em; }
}
