/* 发卡密商城 - 主样式文件 (扁平式设计) */

/* ==================== CSS 变量 ==================== */
:root {
    /* 主色调 - 扁平纯色 */
    --primary-color: #667eea;
    --primary-gradient: #667eea;
    /* 改为纯色 */
    --secondary-color: #764ba2;

    /* 文字颜色 */
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;

    /* 背景颜色 */
    --bg-primary: #f7fafc;
    --bg-secondary: #edf2f7;
    --bg-card: #ffffff;

    /* 边框 - 扁平设计 */
    --border-color: #e2e8f0;
    --border-radius: 4px;
    --border-radius-sm: 4px;
    --flat-border: 1px solid var(--border-color);

    /* 阴影 - 扁平设计移除所有阴影 */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;

    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;

    /* 状态颜色 */
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --info-color: #4299e1;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== 布局 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

/* ==================== 头部 - 扁平设计 ==================== */
.header {
    background: var(--bg-card);
    border-bottom: var(--flat-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo 图标 - 扁平纯色 */
.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
}

/* Logo 文字 - 扁平纯色 */
.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav a:hover,
.nav a.active {
    color: var(--primary-color);
}

/* 导航下划线 - 扁平纯色 */
.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-normal);
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

/* ==================== 按钮 - 扁平设计 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

/* 主按钮 - 扁平纯色 */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: var(--flat-border);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== 卡片 - 扁平设计 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: var(--flat-border);
    overflow: hidden;
    transition: var(--transition-fast);
}

.card:hover {
    border-color: var(--primary-color);
}

.card-header {
    padding: 20px;
    border-bottom: var(--flat-border);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 20px;
    border-top: var(--flat-border);
    background: var(--bg-secondary);
}

/* ==================== 表单 - 扁平设计 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: var(--flat-border);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    background: var(--bg-card);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control::placeholder {
    color: var(--text-light);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ==================== 产品网格 - 扁平设计 ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: var(--flat-border);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    border-color: var(--primary-color);
}

.product-image {
    aspect-ratio: 1 / 1;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 8px;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--error-color);
}

.product-price small {
    font-size: 0.8rem;
    font-weight: normal;
}

.product-stock {
    font-size: 0.75rem;
    color: var(--text-light);
}

.product-stock.low {
    color: var(--warning-color);
}

.product-stock.out {
    color: var(--error-color);
}

/* ==================== 轮播图 ==================== */
.banner-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 1;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-secondary);
    border: var(--flat-border);
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition-fast);
    opacity: 0;
    z-index: 10;
}

.banner-carousel:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn:hover {
    background: white;
    color: var(--primary-color);
}

.carousel-prev {
    left: 16px;
}

.carousel-next {
    right: 16px;
}

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 5px;
}

/* 轮播图响应式 */
@media (max-width: 768px) {
    .banner-carousel {
        aspect-ratio: 2.5 / 1;
        margin-bottom: 20px;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
        opacity: 1;
    }
    
    .carousel-prev {
        left: 8px;
    }
    
    .carousel-next {
        right: 8px;
    }
    
    .carousel-dots {
        bottom: 10px;
    }
    
    .carousel-dot {
        width: 8px;
        height: 8px;
    }
    
    .carousel-dot.active {
        width: 18px;
    }
}

/* ==================== 分类标签 - 扁平设计 ==================== */
.categories {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* 分类标签 - 扁平方形设计 */
.category-tag {
    padding: 10px 20px;
    background: var(--bg-card);
    border: var(--flat-border);
    border-radius: var(--border-radius);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.category-tag:hover,
.category-tag.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.08);
}

/* ==================== 订单页面 - 扁平设计 ==================== */
.order-section {
    max-width: 600px;
    margin: 0 auto;
}

.order-info {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 24px;
    border: var(--flat-border);
}

.order-info h2 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: var(--flat-border);
}

.order-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-secondary);
}

.order-row:last-child {
    border-bottom: none;
}

.order-row .label {
    color: var(--text-secondary);
}

.order-row .value {
    font-weight: 600;
    color: var(--text-primary);
}

/* 订单状态标签 - 扁平设计 */
.order-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
}

.order-status.pending {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.order-status.paid,
.order-status.completed {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.order-status.cancelled {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* ==================== 卡密展示 - 扁平设计 ==================== */
.cards-list {
    margin-top: 20px;
}

.card-item {
    background: var(--bg-secondary);
    border: var(--flat-border);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    word-break: break-all;
    position: relative;
}

.card-item .copy-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    padding: 6px 12px;
    font-size: 0.85rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-fast);
}

.card-item:hover .copy-btn {
    opacity: 1;
}

/* ==================== 加载和提示 - 扁平设计 ==================== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ==================== Toast 提示 - 扁平设计 ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: var(--flat-border);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* ==================== 模态框 - 扁平设计 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: var(--flat-border);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: var(--flat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: var(--flat-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ==================== 产品描述弹窗样式 ==================== */
.product-desc-modal {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-top: 10px;
    border: var(--flat-border);
}

/* ==================== 富文本详情内容样式 ==================== */
.product-detail-content {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: var(--flat-border);
    max-height: 300px;
    overflow-y: auto;
}

.product-detail-content h1,
.product-detail-content h2,
.product-detail-content h3,
.product-detail-content h4,
.product-detail-content h5,
.product-detail-content h6 {
    margin: 16px 0 8px;
    color: var(--text-primary);
}

.product-detail-content h1:first-child,
.product-detail-content h2:first-child,
.product-detail-content h3:first-child {
    margin-top: 0;
}

.product-detail-content p {
    margin: 8px 0;
    line-height: 1.8;
    color: var(--text-secondary);
}

.product-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 12px 0;
}

.product-detail-content ul,
.product-detail-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.product-detail-content li {
    margin: 6px 0;
    line-height: 1.6;
}

.product-detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.product-detail-content th,
.product-detail-content td {
    padding: 8px 12px;
    border: var(--flat-border);
    text-align: left;
}

.product-detail-content th {
    background: var(--bg-primary);
    font-weight: 600;
}

.product-detail-content blockquote {
    margin: 12px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    color: var(--text-secondary);
}

.product-detail-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.9em;
}

.product-detail-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 12px 0;
}

.product-detail-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.product-detail-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.product-detail-content hr {
    border: none;
    border-top: var(--flat-border);
    margin: 16px 0;
}

/* ==================== 底部 - 扁平设计 ==================== */
.footer {
    background: var(--text-primary);
    color: var(--text-light);
    padding: 40px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-light);
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    font-size: 0.9rem;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header-inner {
        height: 60px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .nav {
        display: none;
    }

    .main-content {
        padding: 20px 0;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .categories {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .category-tag {
        flex-shrink: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* ==================== 支付方式选择 - 扁平设计 ==================== */
.payment-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-method {
    flex: 1;
    padding: 16px;
    border: var(--flat-border);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--bg-card);
}

.payment-method:hover {
    border-color: var(--primary-color);
}

.payment-method.active {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.08);
}

.payment-method-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.payment-method-icon svg,
.payment-method-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.payment-method-name {
    font-weight: 600;
}

/* ==================== 数量选择器 - 扁平设计 ==================== */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: var(--flat-border);
    background: var(--bg-card);
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quantity-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.quantity-input {
    width: 60px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ==================== 动画与特效 (扁平化增强) ==================== */

/* 关键帧定义 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 页面入场动画 */
.main-content,
.header,
.footer {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.header {
    animation-delay: 0s;
}

.main-content {
    animation-delay: 0.1s;
}

.footer {
    animation-delay: 0.2s;
}

/* 组件微交互 */

/* 按钮点击按压感 */
.btn:active {
    transform: scale(0.96);
}

/* 产品卡片交互升级 */
.product-card {
    /* 覆盖之前的样式，添加更平滑的过渡 */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease !important;
}

.product-card:hover {
    transform: translateY(-4px);
    /* 轻微上浮 */
    border-color: var(--primary-color);
}

.product-image img {
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
    /* 图片轻微放大 */
}

/* 模态框动画优化 */
.modal-overlay.active .modal {
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 输入框聚焦动画 */
.form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    transform: translateY(-1px);
}

/* 链接下划线动画优化 */
.nav a::after {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 产品列表交错动画基础类 */
.product-card.animate-in {
    opacity: 0;
    /* 初始隐藏，由动画控制显示 */
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ==================== 客服悬浮按钮 ==================== */
.cs-float-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid white;
}

.cs-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.cs-float-btn svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.cs-tooltip {
    position: absolute;
    right: 70px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 1;
    /* 改为 1，常驻显示 */
    transform: translateX(0);
    /* 改为 0 */
    transition: all 0.3s ease;
    /* 移除 pointer-events: none; 以支持可能的交互 */
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

/* 移除 :hover 触发样式，因为已经默认显示了 */
/* .cs-float-btn:hover .cs-tooltip { ... } */

/* 客服二维码悬浮卡片 */
.cs-qrcode-card {
    position: absolute;
    bottom: 0;
    right: 80px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 1000;
    text-align: center;
    width: 240px;
}

.cs-float-btn:hover .cs-qrcode-card {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.cs-qrcode-card img {
    width: 200px;
    height: 200px;
    display: block;
    border-radius: 12px;
    margin: 0 auto 15px auto;
}

.cs-qrcode-card .qr-tip {
    font-size: 15px;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
}

/* ==================== 用户认证相关样式 ==================== */

/* 用户区域 */
.user-area {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.user-guest {
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-guest a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.user-guest a:hover {
    color: var(--primary-color);
}

.user-guest .divider {
    color: var(--text-light);
}

/* 已登录用户 */
.user-logged {
    position: relative;
    display: flex;
    align-items: center;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}

.user-dropdown:hover {
    background: var(--bg-secondary);
}

.user-vip-badge {
    font-size: 16px;
}

.user-name {
    font-size: 14px;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 140px;
    display: none;
    z-index: 100;
    overflow: hidden;
}

.user-menu.show {
    display: block;
}

.user-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.user-menu a:hover {
    background: var(--bg-secondary);
}

.user-menu a.active {
    color: var(--primary-color);
}

/* 登录/注册弹窗 */
.auth-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.auth-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
}

.auth-close:hover {
    color: var(--text-primary);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    color: var(--text-primary);
}

.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.auth-btn:hover {
    opacity: 0.9;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ==================== 用户中心页面 ==================== */

.user-center {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.profile-vip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-vip .vip-badge {
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
    font-size: 13px;
}

.profile-vip .vip-expire {
    color: var(--text-secondary);
    font-size: 13px;
}

/* 订单列表 */
.orders-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.order-no {
    font-size: 14px;
    color: var(--text-secondary);
}

.order-status {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 20px;
}

.order-status.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.order-status.status-paid {
    background: #d1fae5;
    color: #059669;
}

.order-status.status-completed {
    background: #dbeafe;
    color: #2563eb;
}

.order-status.status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.order-body {
    padding: 20px;
}

.order-product {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.order-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.order-discount {
    color: var(--success-color);
}

.order-time {
    font-size: 13px;
    color: var(--text-light);
}

.order-cards {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.cards-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.card-content {
    background: white;
    padding: 10px 14px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    margin-bottom: 6px;
    word-break: break-all;
}

.card-content:last-child {
    margin-bottom: 0;
}

/* 空订单状态 */
.empty-orders {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.empty-orders .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-orders p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.empty-orders .go-shopping {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
}

/* 分页 */
.orders-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* VIP 价格显示 */
.product-vip-prices {
    margin-top: 8px;
}

.vip-price-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 6px;
    margin-bottom: 4px;
}

.vip-price-tag .vip-icon {
    font-size: 14px;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 13px;
    margin-left: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .user-profile-card {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-vip {
        justify-content: center;
    }
    
    .order-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
}