/**
 * OfferKuai 下载页面专用样式
 * 提供下载卡片、安装指南、FAQ等组件样式
 */

/* ============================================
   下载区域
   ============================================ */

.download-section {
    margin-top: var(--space-4xl);
    margin-bottom: var(--space-4xl);
}

/* 下载标签切换 */
.download-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.download-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 160px;
    text-align: center;
}

.download-tab i {
    font-size: 1.5rem;
}

.download-tab:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.download-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

/* 下载内容区域 */
.download-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.download-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 下载卡片 */
.download-card {
    width: 100%;
    padding: var(--space-2xl);
    background: var(--bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 单个下载卡片（Windows） */
.download-card-single {
    max-width: 600px;
    margin: 0 auto;
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
}

.download-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    max-width: 900px;
    margin: 0 auto;
}

/* 下载卡片头部 */
.download-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.download-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    border-radius: 12px;
    color: var(--brand);
    font-size: 2rem;
}

.download-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.download-version {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.download-size {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* 系统要求 */
.download-requirements {
    margin-bottom: var(--space-xl);
}

.download-requirements h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-md);
}

.download-requirements ul {
    list-style: none;
    padding: 0;
}

.download-requirements li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.download-requirements li i {
    color: var(--success);
}

/* 下载按钮 */
.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: var(--space-md);
}

.btn-download i {
    font-size: 1.125rem;
}

.download-note {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   安装指南
   ============================================ */

.install-guide {
    margin-bottom: var(--space-4xl);
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: var(--space-2xl);
}

/* 指南标签 */
.guide-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.guide-tab {
    padding: var(--space-sm) var(--space-lg);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.guide-tab:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.guide-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

/* 指南内容 */
.guide-content {
    display: none;
    max-width: 800px;
    margin: 0 auto;
}

.guide-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* 指南步骤 */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.guide-step {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
}

.step-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

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

/* ============================================
   常见问题
   ============================================ */

.download-faq {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin-bottom: var(--space-md);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-soft);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg);
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: var(--bg-subtle);
}

.faq-question span {
    flex: 1;
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-subtle);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    animation: slideDown 0.3s ease;
}

.faq-item.active .faq-answer {
    display: block;
}

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

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 768px) {
    .download-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .download-tab {
        justify-content: center;
        width: 100%;
    }
    
    .download-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .download-card {
        padding: var(--space-lg);
    }
    
    .download-card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .download-icon {
        margin: 0 auto;
    }
    
    .guide-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .faq-question {
        padding: var(--space-md) var(--space-lg);
    }
    
    .faq-answer {
        padding: var(--space-md) var(--space-lg);
    }
}

/* ============================================
   下载暂停通知弹窗
   ============================================ */

.download-pause-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.download-pause-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.download-pause-modal {
    background: white;
    border-radius: 24px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.download-pause-modal-overlay.active .download-pause-modal {
    transform: translateY(0) scale(1);
}

.download-pause-modal-header {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    padding: 1.5rem 2rem;
    border-radius: 24px 24px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.download-pause-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.download-pause-modal-title i {
    font-size: 1.5rem;
}

.download-pause-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.download-pause-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.download-pause-modal-body {
    padding: 2rem;
}

.download-pause-modal-body p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.download-pause-modal-body p:last-child {
    margin-bottom: 0;
}

.download-pause-modal-body strong {
    color: var(--text);
    font-weight: 600;
}

.download-pause-modal-note {
    text-align: center;
    color: #6B6B6B;
    font-size: 0.95rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* 暂停服务标签 */
.download-pause-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #DC2626;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.download-pause-badge i {
    font-size: 0.75rem;
}

/* 暂停状态下载按钮 */
.btn-download.paused {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    pointer-events: auto;
}

.btn-download.paused:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
    transform: none;
    box-shadow: none;
}

.btn-download.paused i {
    color: var(--text-muted);
}

/* ============================================
   下载暂停通知弹窗 - 移动端适配
   修复问题 2.1: 弹窗在移动端展示优化
   修复问题 2.2: 防止页面被撑开额外宽度
   ============================================ */

@media (max-width: 768px) {
    .download-pause-modal-overlay {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .download-pause-modal {
        max-width: 100%;
        width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        margin: 0;
    }

    .download-pause-modal-overlay.active .download-pause-modal {
        transform: translateY(0);
    }

    .download-pause-modal-header {
        padding: 1.25rem 1.5rem;
        border-radius: 20px 20px 0 0;
    }

    .download-pause-modal-title {
        font-size: 1.1rem;
        gap: 0.5rem;
    }

    .download-pause-modal-title i {
        font-size: 1.25rem;
    }

    .download-pause-modal-close {
        width: 32px;
        height: 32px;
    }

    .download-pause-modal-body {
        padding: 1.5rem;
    }

    .download-pause-modal-body p {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .download-pause-modal-note {
        font-size: 0.85rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }
}

@media (max-width: 480px) {
    .download-pause-modal-overlay {
        padding: 0;
    }

    .download-pause-modal {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }

    .download-pause-modal-header {
        padding: 1rem 1.25rem;
        border-radius: 16px 16px 0 0;
    }

    .download-pause-modal-title {
        font-size: 1rem;
    }

    .download-pause-modal-body {
        padding: 1.25rem;
    }

    .download-pause-modal-body p {
        font-size: 0.85rem;
    }
}

/* 修复问题 2.2: 防止页面被撑开额外宽度 */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 768px) {
    .download-section,
    .install-guide,
    .download-faq {
        max-width: 100%;
        overflow-x: hidden;
    }

    .download-card,
    .download-cards-grid {
        max-width: 100%;
        overflow-x: hidden;
    }

    .guide-steps {
        max-width: 100%;
        overflow-x: hidden;
    }
}
