/* ===== 导入优雅字体 ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: #f0f2f5;
    background-image: radial-gradient(circle at 10% 30%, rgba(102, 126, 234, 0.05) 0%, transparent 60%),
                      radial-gradient(circle at 90% 70%, rgba(118, 75, 162, 0.05) 0%, transparent 60%);
    min-height: 100vh;
    color: #1e1e2f;
    line-height: 1.6;
}

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

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

/* ===== 头部（毛玻璃效果） ===== */
header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: #334155;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s, transform 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
}

.nav-links a:hover {
    color: #4f46e5;
}
.nav-links a:hover::after {
    width: 100%;
}

.cart-icon {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(102, 126, 234, 0.12);
    padding: 6px 14px 6px 10px;
    border-radius: 40px;
    transition: background 0.2s;
}

.cart-icon:hover {
    background: rgba(102, 126, 234, 0.22);
}

.cart-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* 移动菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.menu-toggle span {
    width: 28px;
    height: 2.5px;
    background: #334155;
    border-radius: 4px;
    transition: 0.3s;
}

/* ===== 主区域 ===== */
main {
    padding: 32px 0;
    min-height: 70vh;
}

/* ===== 闪存消息 ===== */
.flash-message {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.flash-success {
    background: rgba(34, 197, 94, 0.15);
    border-left: 5px solid #22c55e;
    color: #166534;
}
.flash-error {
    background: rgba(239, 68, 68, 0.12);
    border-left: 5px solid #ef4444;
    color: #991b1b;
}

/* ===== 卡片 ===== */
.card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.3s;
}
.card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 10px 28px;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    background: #f1f5f9;
    color: #1e293b;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.btn-primary:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #fff;
}
.btn-success:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #fff;
}
.btn-danger:hover {
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.30);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #cbd5e1;
    color: #475569;
}
.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #1e293b;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(4px);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}
textarea.form-control { resize: vertical; min-height: 90px; }

/* ===== 商品网格 ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
    margin-top: 24px;
}

.product-card {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: #667eea;
}

.product-img-container {
    height: 200px;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.product-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.product-card:hover .product-img-container img {
    transform: scale(1.04);
}

.product-info {
    padding: 18px 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.price-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 8px 0 14px;
}
.price-original {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: 0.9rem;
}
.price-final {
    font-size: 1.3rem;
    font-weight: 700;
    color: #4f46e5;
}
.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}
.product-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* ===== 购物车 ===== */
.cart-item {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 18px;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.3);
    transition: box-shadow 0.2s;
}
.cart-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    background: #f1f5f9;
}
.cart-item-details { flex: 1; }
.cart-item-name { font-weight: 600; }
.cart-item-price { color: #4f46e5; font-weight: 700; }
.cart-item-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== 结账/订单 ===== */
.order-summary {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border-radius: 16px;
    padding: 20px;
}
.order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.order-total {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: right;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #cbd5e1;
    color: #4f46e5;
}

/* ===== 通用工具 ===== */
.text-center { text-align: center; }
.text-muted { color: #64748b; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ===== 页脚 ===== */
footer {
    background: #1e1e2f;
    color: #e2e8f0;
    padding: 48px 20px 24px;
    margin-top: 48px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
    margin-bottom: 32px;
}
.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: #f1f5f9;
    font-weight: 600;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
    color: #94a3b8;
    transition: color 0.2s;
}
.footer-col ul li a:hover { color: #a78bfa; }
.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #64748b;
}
.footer-bottom-links a {
    margin-left: 20px;
    color: #94a3b8;
}
.footer-bottom-links a:hover { color: #a78bfa; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(12px);
        padding: 20px;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    }
    .main-nav.active { display: block; }
    .nav-links {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
    }
    .nav-links a {
        padding: 8px 0;
        border-bottom: 1px solid #f1f5f9;
    }
    .cart-icon { justify-content: space-between; }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .cart-item { flex-wrap: wrap; }
    .footer-container { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; align-items: center; gap: 10px; }
}