/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏 - 移动端优先 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-search {
    flex: 1;
    min-width: 200px;
    order: 3;
    width: 100%;
}

.nav-search form {
    display: flex;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-search input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    font-size: 0.875rem;
    outline: none;
    min-width: 0;
}

.nav-search button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-search button:hover {
    background: #ff5252;
}

.nav-menu {
    display: flex;
    gap: 15px;
    order: 2;
}

.nav-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.875rem;
    transition: opacity 0.15s ease;
    position: relative;
    padding: 5px;
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-link:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.nav-link span {
    display: none;
}

.cart-link {
    position: relative;
}

.cart-link i {
    transition: transform 0.3s ease;
}

.cart-link i.bounce {
    animation: cartBounceIcon 0.5s ease;
}

@keyframes cartBounceIcon {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-10deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b6b;
    color: white;
    font-size: 0.625rem;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.cart-count.updated {
    animation: countPop 0.3s ease;
}

@keyframes countPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 分类导航 - 移动端 */
.category-nav {
    background: white;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.category-nav .container {
    display: flex;
    gap: 10px;
    padding: 0 15px;
}

.category-link {
    color: #666;
    text-decoration: none;
    font-size: 0.8125rem;
    padding: 6px 12px;
    border-radius: 15px;
    white-space: nowrap;
    background: #f5f5f5;
    border: 1px solid transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.category-link:hover,
.category-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.category-link:active {
    transform: scale(0.95);
}

/* 横幅区域 - 移动端 */
.hero-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 0;
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.hero-content h1 {
    font-size: 1.75rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-content p {
    font-size: 0.9375rem;
    margin-bottom: 20px;
    opacity: 0.9;
    padding: 0 20px;
}

/* 按钮样式 - 移动端 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    min-height: 44px;
    touch-action: manipulation;
}

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

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,107,0.3);
}

.btn-secondary {
    background: #667eea;
    color: white;
}

.btn-secondary:hover {
    background: #5a6fd6;
}

.btn-add-cart {
    background: #667eea;
    color: white;
    padding: 8px 12px;
    font-size: 0.75rem;
    width: 100%;
    min-height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-add-cart:hover {
    background: #5a6fd6;
    transform: translateY(-1px);
}

.btn-add-cart:active {
    transform: scale(0.96);
}

.btn-add-cart.added {
    background: #4caf50;
    animation: addSuccess 0.3s ease;
}

@keyframes addSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-add-cart.added i {
    animation: cartBounce 0.4s ease;
}

@keyframes cartBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.btn-add-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 商品展示区域 - 移动端 */
.products-section {
    padding: 20px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 15px;
    padding: 0 15px;
}

.section-header h2 {
    font-size: 1.375rem;
    color: #333;
    margin-bottom: 5px;
}

.section-header p {
    display: none;
}

/* 商品网格 - 移动端两列 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.products-section {
    padding: 0 10px;
}

/* 商品卡片 - 移动端 */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

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

.product-image {
    position: relative;
    height: 120px;
    overflow: hidden;
}

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

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

.product-info {
    padding: 10px;
}

.product-name {
    font-size: 0.8125rem;
    color: #333;
    margin: 0 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 1.2em;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 0.9375rem;
    color: #ff6b6b;
    font-weight: bold;
}

.original-price {
    font-size: 0.75rem;
    color: #999;
    text-decoration: line-through;
}

/* 特色服务 - 移动端 */
.features-section {
    background: white;
    padding: 30px 0;
    margin-top: 30px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    text-align: center;
    padding: 0 15px;
}

.feature-item i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.feature-item h3 {
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 5px;
}

.feature-item p {
    color: #666;
    font-size: 0.75rem;
}

/* 底部快捷购物车 */
.quick-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    animation: slideUp 0.3s ease;
}

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

.quick-cart-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.quick-cart-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-cart-info i {
    font-size: 1.25rem;
    color: #667eea;
}

.quick-cart-count {
    background: #ff6b6b;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.quick-cart-total {
    font-size: 1rem;
    color: #ff6b6b;
    font-weight: bold;
}

.quick-cart-actions {
    display: flex;
    gap: 10px;
}

.btn-view-cart,
.btn-go-cart {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-view-cart {
    background: #f0f0f0;
    color: #666;
    border: none;
}

.btn-go-cart {
    background: #667eea;
    color: white;
    text-decoration: none;
}

/* 快捷购物车面板 */
.quick-cart-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
    z-index: 1001;
    max-height: 70vh;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.quick-cart-panel.active {
    transform: translateY(0);
}

.quick-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.quick-cart-header h3 {
    font-size: 1rem;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-cart-header h3 i {
    color: #667eea;
}

.btn-close-panel {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

.quick-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
    max-height: 50vh;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* 自定义滚动条样式 */
.quick-cart-items::-webkit-scrollbar {
    width: 4px;
}

.quick-cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.quick-cart-items::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.quick-cart-items::-webkit-scrollbar-thumb:hover {
    background: #999;
}

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

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

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

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

.quick-cart-item-name {
    font-size: 0.875rem;
    color: #333;
    margin: 0 0 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quick-cart-item-price {
    font-size: 0.875rem;
    color: #ff6b6b;
    font-weight: bold;
}

.quick-cart-item-qty {
    font-size: 0.75rem;
    color: #999;
}

.quick-cart-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
}

.quick-cart-item-remove:hover {
    color: #ff6b6b;
}

.quick-cart-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    border-radius: 0 0 20px 20px;
}

.quick-cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: #666;
}

.quick-cart-total-price {
    font-size: 1rem;
    color: #333;
}

.quick-cart-total-price strong {
    color: #ff6b6b;
    font-size: 1.125rem;
}

.btn-checkout-quick {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

/* 遮罩层 */
.quick-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.quick-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 结算模态框 */
.checkout-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1002;
    width: 90%;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.checkout-modal.active {
    opacity: 1;
    visibility: visible;
}

.checkout-modal .modal-content {
    display: flex;
    flex-direction: column;
}

.checkout-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.checkout-modal .modal-header h3 {
    font-size: 1.125rem;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-modal .modal-header h3 i {
    color: #667eea;
}

.checkout-modal .btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

.checkout-modal .modal-body {
    padding: 20px;
}

.checkout-modal .form-group {
    margin-bottom: 15px;
}

.checkout-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: #333;
    font-weight: 500;
}

.checkout-modal .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.checkout-modal .form-group input:focus {
    border-color: #667eea;
}

.checkout-modal .form-tip {
    font-size: 0.75rem;
    color: #999;
    margin: 10px 0 0 0;
    text-align: center;
}

.checkout-modal .modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.checkout-modal .btn-cancel {
    flex: 1;
    padding: 12px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background 0.3s;
}

.checkout-modal .btn-cancel:hover {
    background: #e0e0e0;
}

.checkout-modal .btn-submit {
    flex: 1;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background 0.3s;
}

.checkout-modal .btn-submit:hover {
    background: #5a6fd6;
}

.checkout-modal .btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 空购物车提示 */
.quick-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.quick-cart-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

.quick-cart-empty p {
    font-size: 0.875rem;
}

/* 购物车页面 - 移动端 */
.cart-section {
    padding: 20px 0;
    min-height: calc(100vh - 200px);
    margin-top: 20px;
}

.cart-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-items {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: visible;
}

.cart-header {
    display: none;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

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

.cart-item .product-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0;
}

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

.cart-item .product-details h4 {
    font-size: 0.875rem;
    color: #333;
    line-height: 1.3;
}

.cart-item .price {
    font-size: 0.8125rem;
    color: #666;
}

.cart-item .item-total {
    font-size: 1rem;
    color: #ff6b6b;
    font-weight: bold;
}

/* 购物车数量选择器 - 新样式 */
.cart-item .quantity-selector {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 3px;
    border: 1px solid #e0e0e0;
}

.cart-item .qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #667eea;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cart-item .qty-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.cart-item .qty-btn:active {
    transform: scale(0.95);
}

.cart-item .qty-input {
    width: 35px;
    height: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    outline: none;
    -moz-appearance: textfield;
}

.cart-item .qty-input::-webkit-outer-spin-button,
.cart-item .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item .btn-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.125rem;
    transition: color 0.3s;
    padding: 5px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item .btn-remove:hover {
    color: #ff6b6b;
}

/* 购物车摘要 - 移动端 */
.cart-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    border-top: 1px solid #eee;
    animation: slideUp 0.3s ease;
}

.cart-content {
    padding-bottom: 280px;
}

.summary-card {
    background: white;
    border-radius: 0;
    padding: 15px 20px;
    box-shadow: none;
}

.summary-card h3 {
    font-size: 1.125rem;
    margin-bottom: 15px;
    color: #333;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #666;
    font-size: 0.875rem;
}

.summary-row.total {
    font-size: 1.125rem;
    font-weight: bold;
    color: #333;
    border-top: 2px solid #eee;
    padding-top: 12px;
    margin-top: 12px;
}

.btn-checkout {
    width: 100%;
    background: #ff6b6b;
    color: white;
    justify-content: center;
    margin: 15px 0 10px;
    min-height: 48px;
    font-size: 1rem;
}

.btn-checkout:hover {
    background: #ff5252;
}

.btn-continue {
    width: 100%;
    background: #f5f5f5;
    color: #666;
    justify-content: center;
}

.btn-continue:hover {
    background: #e0e0e0;
}

/* 空购物车 - 移动端 */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 15px;
}

.empty-cart h3 {
    font-size: 1.25rem;
    color: #333;
    margin-bottom: 8px;
}

.empty-cart p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

/* 无商品提示 - 移动端 */
.no-products {
    text-align: center;
    padding: 40px 20px;
}

.no-products i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

.no-products p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
}

/* 提示消息 - 移动端 */
#toast-container {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 9999;
}

.toast {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid #4caf50;
}

.toast-success i {
    color: #4caf50;
}

.toast-error {
    border-left: 4px solid #f44336;
}

.toast-error i {
    color: #f44336;
}

.toast-warning {
    border-left: 4px solid #ff9800;
}

.toast-warning i {
    color: #ff9800;
}

.toast-info {
    border-left: 4px solid #2196f3;
}

.toast-info i {
    color: #2196f3;
}

/* 页脚 - 移动端 */
.footer {
    background: #333;
    color: white;
    padding: 30px 0 15px;
    margin-top: 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 20px;
    padding: 0 15px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 12px;
    color: white;
    font-size: 1rem;
}

.footer-section p {
    color: #aaa;
    margin-bottom: 8px;
    font-size: 0.8125rem;
}

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

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

.footer-section ul li a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.8125rem;
}

.footer-section ul li a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.social-links a {
    color: #aaa;
    font-size: 1.25rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #444;
    color: #aaa;
    font-size: 0.75rem;
}

/* 动画效果 */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.bounce {
    animation: bounce 0.5s ease;
}

/* ==================== 平板适配 (768px以上) ==================== */
@media (min-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .navbar {
        padding: 15px 0;
    }
    
    .category-nav {
        top: 65px;
    }
    
    .hero-banner {
        margin-top: 125px;
    }
    
    .navbar .container {
        flex-wrap: nowrap;
        gap: 0;
    }
    
    .nav-brand a {
        font-size: 1.5rem;
    }
    
    .nav-brand i {
        font-size: 1.75rem;
    }
    
    .nav-search {
        order: 0;
        margin: 0 30px;
        max-width: 500px;
    }
    
    .nav-search input {
        padding: 12px 20px;
        font-size: 0.875rem;
    }
    
    .nav-search button {
        padding: 12px 20px;
    }
    
    .nav-menu {
        order: 0;
        gap: 25px;
    }
    
    .nav-link {
        font-size: 0.9375rem;
        gap: 8px;
    }
    
    .nav-link span {
        display: inline;
    }
    
    .cart-count {
        top: -8px;
        right: -12px;
        font-size: 0.75rem;
        padding: 2px 6px;
        min-width: 18px;
    }
    
    .category-nav {
        padding: 15px 0;
        margin-bottom: 30px;
    }
    
    .category-nav .container {
        gap: 20px;
        padding: 0 20px;
    }
    
    .category-link {
        font-size: 0.875rem;
        padding: 8px 16px;
        border-radius: 20px;
    }
    
    .hero-banner {
        padding: 60px 0;
        margin-bottom: 40px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .hero-content p {
        font-size: 1.125rem;
        margin-bottom: 25px;
    }
    
    .btn {
        padding: 12px 30px;
        font-size: 1rem;
        border-radius: 25px;
    }
    
    .btn-add-cart {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
    
    .products-section {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 35px;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
        margin-bottom: 10px;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 0;
    }
    
    .product-image {
        height: 180px;
    }
    
    .discount-badge {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-name {
        font-size: 1rem;
        margin: 8px 0;
    }
    
    .product-description {
        display: block;
        color: #666;
        font-size: 0.8125rem;
        margin-bottom: 12px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .current-price {
        font-size: 1.125rem;
    }
    
    .original-price {
        font-size: 0.875rem;
    }
    
    .features-section {
        padding: 50px 0;
        margin-top: 40px;
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
    
    .feature-item i {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .feature-item h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .feature-item p {
        font-size: 0.875rem;
    }
    
    .cart-section {
        padding: 20px 0 40px;
    }
    
    .cart-content {
        display: grid;
        grid-template-columns: 1fr 350px;
        gap: 25px;
    }
    
    .cart-header {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1fr 60px;
        padding: 15px 20px;
        background: #f8f9fa;
        font-weight: 600;
        color: #666;
        font-size: 0.875rem;
    }
    
    .cart-item {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1fr 60px;
        padding: 15px 20px;
        align-items: center;
    }
    
    .cart-item:last-child {
        padding-bottom: 35px;
    }
    
    .cart-item .product-info {
        flex-direction: row;
        gap: 15px;
    }
    
    .cart-item .product-info img {
        width: 80px;
        height: 80px;
    }
    
    .cart-summary {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .summary-card {
        padding: 25px;
    }
    
    .summary-card h3 {
        font-size: 1.25rem;
        margin-bottom: 20px;
    }
    
    .summary-row {
        font-size: 0.9375rem;
        margin-bottom: 15px;
    }
    
    .summary-row.total {
        font-size: 1.25rem;
        padding-top: 15px;
        margin-top: 15px;
    }
    
    .btn-checkout {
        margin: 20px 0 10px;
    }
    
    .empty-cart {
        padding: 80px 20px;
    }
    
    .empty-cart i {
        font-size: 5rem;
    }
    
    .empty-cart h3 {
        font-size: 1.5rem;
    }
    
    #toast-container {
        top: 20px;
        right: 20px;
        left: auto;
        width: auto;
    }
    
    .toast {
        padding: 15px 25px;
        font-size: 0.9375rem;
    }
    
    .footer {
        padding: 50px 0 20px;
        margin-top: 50px;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 40px;
    }
    
    .footer-section h3,
    .footer-section h4 {
        font-size: 1.125rem;
        margin-bottom: 20px;
    }
    
    .footer-section p,
    .footer-section ul li a {
        font-size: 0.875rem;
    }
}

/* ==================== 桌面端适配 (1024px以上) ==================== */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
}

/* ==================== 横屏手机适配 ==================== */
@media (max-width: 767px) and (orientation: landscape) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-image {
        height: 120px;
    }
    
    .navbar .container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .nav-search {
        order: 3;
        width: 100%;
    }
}

/* ==================== 小屏手机适配 (320px-375px) ==================== */
@media (max-width: 375px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 8px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 0.8125rem;
    }
    
    .current-price {
        font-size: 0.9375rem;
    }
    
    .btn-add-cart {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 0.875rem;
    }
}

/* ==================== 触摸设备优化 ==================== */
@media (hover: none) {
    .btn:hover,
    .btn-add-cart:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
        box-shadow: none;
    }
    
    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .cart-item .qty-btn:hover {
        background: white;
        color: #667eea;
    }
    
    .cart-item .qty-btn:active {
        background: #667eea;
        color: white;
    }
}

/* ==================== 安全区域适配 (iPhone X+) ==================== */
@supports (padding: max(0px)) {
    .navbar {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}

/* ==================== 图片预览 ==================== */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-preview-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-preview-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .image-preview-container img {
        max-height: 80vh;
    }
    
    .image-preview-close {
        top: -50px;
        right: 50%;
        transform: translateX(50%);
    }
    
    /* 移动端隐藏特色服务和页脚 */
    .features-section {
        display: none;
    }
    
    .footer {
        display: none;
    }
    
    /* 商品区域底部留出快捷购物车的高度 */
    .products-section {
        padding-bottom: 80px;
    }
    
    .products-grid {
        padding-bottom: 10px;
    }
}

/* 滚动到底部提示 */
.scroll-bottom-tip {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 999;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.scroll-bottom-tip i {
    font-size: 16px;
    animation: heartbeat 1s ease infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* 禁止移动端下拉/上拉橡皮筋效果 */
html, body {
    overscroll-behavior: none;
    overflow-x: hidden;
}