/* CSS变量定义 - 浅色主题 */
:root {
    --bg-color: #fffbf0;
    --text-color: #333333;
    --card-bg: #fff8e7;
    --border-color: #f0e68c;
    --primary-color: #ff6b35;
    --secondary-color: #ffd23f;
    --button-bg: #007bff;
    --button-hover: #0056b3;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --modal-bg: rgba(0, 0, 0, 0.5);
    --disabled-color: #6c757d;
}

/* 系统深色模式偏好检测 - 仅在没有手动设置时生效 */
@media (prefers-color-scheme: dark) {
    body.system-theme {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2d2d2d;
        --border-color: #404040;
        --primary-color: #ff8c69;
        --secondary-color: #ffd700;
        --button-bg: #4a90e2;
        --button-hover: #357abd;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        --modal-bg: rgba(0, 0, 0, 0.7);
        --disabled-color: #888888;
    }
}

/* 手动深色主题 - 优先级更高 */
body.dark-theme {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --primary-color: #ff8c69;
    --secondary-color: #ffd700;
    --button-bg: #4a90e2;
    --button-hover: #357abd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --modal-bg: rgba(0, 0, 0, 0.7);
    --disabled-color: #888888;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 90px 20px 20px 20px;
}

/* 顶部区域 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.title-section {
    flex: 1;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.header-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin: 0;
}

.member-code-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow);
}

.member-code-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 主要内容区域自动扩展 */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    margin: 10px 0; /* 减少上下边距 */
}

/* 下载区域 */
.download-section {
    text-align: center;
    margin: 10px 0; /* 减少上下边距 */
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 手机端轮播默认隐藏 */
.mobile-carousel {
    display: none;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    width: 300%;
}

.carousel-slide {
    width: 33.333%;
    flex-shrink: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.mobile-card-image {
    width: 100%;
    max-width: 280px;
    height: 280px;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 auto 20px auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.mobile-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-card-description {
    padding: 18px;
    font-size: 1.05rem;
    text-align: center;
    color: var(--text-color);
    line-height: 1.4;
    font-weight: 500;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.indicator.active {
    background-color: var(--primary-color);
}

.feature-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--border-color);
}

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

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

.card-description {
    font-size: 1.1rem;
    text-align: center;
    color: var(--text-color);
    line-height: 1.5;
    font-weight: 500;
}

/* 下载区域 */
.download-section {
    text-align: center;
    margin: 20px 0; /* 减少边距以优化页面高度 */
}

.download-description {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-color);
    opacity: 0.9;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.download-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.ios-btn {
    background-color: var(--disabled-color);
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

.android-btn {
    background-color: var(--button-bg);
    color: white;
}

.android-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* 底部区域 */
.footer {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 12px 0 0 0;
    margin: 0;
    margin-top: auto;
}

.footer-left {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px; /* 为桌面端按钮下方增加间距 */
}

.footer-center {
    text-align: center;
}

.footer-right {
    text-align: right;
}

.copyright-text {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin: 0;
    line-height: 1.4;
}

.theme-toggle-btn,
.language-toggle-btn,
.about-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.theme-toggle-btn:hover,
.language-toggle-btn:hover,
.about-btn:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.copyright {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-color);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.wechat-info {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 16px;
    border: 2px dashed var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.wechat-id {
    font-weight: bold;
    color: var(--text-color);
    font-size: 1.1rem;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 50px;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: #28a745;
}

/* 复制成功提示 */
.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.copy-toast.show {
    opacity: 1;
}

/* 测试版弹窗样式 */
.test-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.test-warning ul {
    margin: 12px 0;
    padding-left: 20px;
}

.test-warning li {
    margin: 6px 0;
    color: var(--text-color);
}

.download-countdown {
    text-align: center;
    margin-top: 20px;
}

.countdown-download-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    cursor: not-allowed;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 140px;
}

.countdown-download-btn:not(:disabled) {
    background: var(--primary-color);
    cursor: pointer;
}

.countdown-download-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* 底部链接样式 */
.bottom-links {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1000;
    text-align: center;
}

.bottom-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* 会员按钮样式 */
.membership-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: 2px solid transparent;
    padding: 14px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.membership-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(255, 107, 53, 0.4);
    border-color: var(--primary-color);
}

.membership-btn .crown-icon {
    font-size: 18px;
}

/* 会员计划弹窗样式 */
.membership-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.membership-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.membership-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 隐藏 WebKit 浏览器的滚动条 */
.membership-content::-webkit-scrollbar {
    display: none;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.membership-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.membership-close:hover {
    opacity: 1;
}

.membership-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.comparison-table {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table-header {
    background: transparent;
    color: var(--text-color);
    padding: 16px;
    display: flex;
    border-bottom: 2px solid var(--border-color);
}

.table-header .column {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

.table-header .column.premium-header {
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: shimmer 2s ease-in-out infinite alternate;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.table-body {
    padding: 20px;
}

.feature-comparison {
    display: flex;
    gap: 20px;
}

.feature-column {
    flex: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.feature-item .check-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

.feature-item.basic .check-icon {
    background: #9CA3AF;
}

.feature-item.premium .check-icon {
    background: var(--primary-color);
}

.feature-item.premium.highlight {
    color: var(--primary-color);
    font-weight: bold;
}

.plan-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.plan-button {
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: var(--card-bg);
}

.plan-button.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.plan-button:hover:not(.selected) {
    border-color: var(--primary-hover);
}

.plan-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.plan-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.plan-button.selected .plan-subtitle {
    opacity: 0.9;
}

.discount-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FF4444;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

/* 深色模式适配 */
/* 深色模式下的会员弹窗背景 */
[data-theme="dark"] .membership-modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

[data-theme="dark"] .membership-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.footer-link:hover {
    opacity: 1;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}

.about-content .about-section {
    margin-bottom: 24px;
}

.about-content h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.about-content p {
    line-height: 1.6;
    color: var(--text-color);
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .title-section {
        text-align: center;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .header-buttons {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .membership-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .member-code-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    /* 会员弹窗表格宽度增加 */
    .membership-content {
        width: 95%;
        max-width: 420px;
        padding: 24px 16px;
    }
    
    .feature-comparison {
        gap: 16px;
    }
    
    .feature-item {
        font-size: 13px;
        gap: 6px;
    }
    
    .feature-item .check-icon {
        width: 14px;
        height: 14px;
        font-size: 9px;
        flex-shrink: 0;
    }
    
    /* 会员弹窗价格字号增大 */
    .plan-title {
        font-size: 22px;
        font-weight: 600;
    }
    
    .plan-subtitle {
        font-size: 15px;
    }
    
    /* 底部链接重新布局为两行 */
    .footer {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        text-align: center;
    }
    
    .footer-left {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin-bottom: 0; /* 移动端重置margin-bottom */
    }
    
    /* 让按钮在第一行 */
    .footer-left button {
        margin: 0 8px;
    }
    
    /* 在最后一个按钮后插入换行 */
    .footer-left button:last-of-type::after {
        content: "";
        flex-basis: 100%;
        height: 0;
    }
    
    /* 让链接在第二行同一行展示，并确保它们在同一行 */
    .footer-left .footer-link {
        margin: 8px 20px 0 20px;
        white-space: nowrap; /* 防止链接文字换行 */
        flex-shrink: 0; /* 防止链接被压缩 */
    }
    
    .footer-right {
        order: 2;
        margin-bottom: 8px; /* 为copyright增加下边距 */
    }
    
    .container {
        padding: 20px 16px; /* 移除大的上边距，因为头部不再固定 */
        min-height: 100vh;
    }

    .header {
        position: static; /* 移除固定定位 */
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 24px;
        border-bottom: none; /* 移除底部边框 */
        backdrop-filter: none; /* 移除模糊效果 */
        -webkit-backdrop-filter: none;
    }

    .main-content {
        margin: 0px 0 24px 0; /* 缩小上方间距 */
    }

    .download-section {
        margin: 24px 0;
    }

    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    /* 隐藏桌面端卡片，显示手机端轮播 */
    .desktop-cards {
        display: none;
    }

    .mobile-carousel {
        display: block;
        margin-top: 10px; /* 缩小轮播卡片的上方间距 */
        max-width: 280px;
    }
    
    .mobile-card-image {
        max-width: 280px;
        height: 360px; /* 增加高度，使其更接近正方形 */
    }

    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .download-btn {
        width: 100%;
        max-width: 280px;
    }

    .footer {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        text-align: center;
        gap: 12px;
    }

    .footer-left {
        justify-content: center;
        order: 1;
    }

    .footer-right {
        order: 2;
        text-align: center;
        align-items: center;
    }

    .modal-content {
        margin: 20px;
        padding: 24px;
    }
    
    .wechat-info {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }
    
    .wechat-id {
        font-size: 1rem;
    }
    
    .copy-btn {
        width: 100%;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }

    .member-code-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .feature-card {
        padding: 16px;
    }

    .card-description {
        font-size: 1rem;
    }

    .container {
        padding: 20px 12px; /* 移除大的上边距，因为头部不再固定 */
        min-height: 100vh;
    }

    .header {
        margin-bottom: 20px;
    }

    .main-content {
        margin: 15px 0 20px 0; /* 缩小上方间距 */
    }

    .download-section {
        margin: 20px 0;
    }

    .feature-cards {
        padding: 0 10px;
    }
}

/* 平板设备适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
    }

    .feature-cards .feature-card:last-child {
        grid-column: 1 / -1;
        max-width: 280px;
        margin: 0 auto;
    }
}