/**
 * PPT学习站 - 首页专用样式
 * 文件路径: css/home.css
 */

/* ==================== 1. Hero 区域 ==================== */
.hero {
    padding: var(--space-xl) 0 var(--space-3xl);
    position: relative;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: var(--space-3xl);
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 107, 53, 0);
    }
}

.hero-title {
    font-size: 42px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.5px;
}

.hero-highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-xl);
    max-width: 520px;
}

/* Hero 按钮组 */
.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

/* Hero 统计数据 */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 0;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 var(--space-lg);
}

.hero-stat-num {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.hero-stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.hero-stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border-color);
}

/* ==================== 2. Hero 插画卡片 ==================== */
.hero-illustration {
    flex-shrink: 0;
    width: 380px;
    height: 380px;
    position: relative;
}

.hero-card {
    position: absolute;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    cursor: default;
    white-space: nowrap;
}

.hero-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.hero-card-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.hero-card-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.hero-card-1 {
    top: 20px;
    left: 40px;
    animation: floatCard 6s ease-in-out infinite;
}

.hero-card-2 {
    top: 100px;
    right: 10px;
    animation: floatCard 6s ease-in-out 1.5s infinite;
}

.hero-card-3 {
    bottom: 100px;
    left: 10px;
    animation: floatCard 6s ease-in-out 3s infinite;
}

.hero-card-4 {
    bottom: 20px;
    right: 40px;
    animation: floatCard 6s ease-in-out 4.5s infinite;
}

@keyframes floatCard {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* ==================== 3. 学习进度概览 ==================== */
.progress-overview {
    margin-bottom: var(--space-2xl);
}

.progress-overview .card {
    background: linear-gradient(135deg, var(--bg-card), var(--primary-light));
    border: 1px solid var(--border-light);
}

.progress-overview .progress-bar {
    margin-bottom: var(--space-md);
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.progress-detail-item {
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.progress-detail-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.progress-detail-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--primary);
}

/* ==================== 4. 通用 Section 头部 ==================== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

.section-desc {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin: 0;
}

/* ==================== 5. 课程模块卡片 ==================== */
.module-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-3xl);
}

.module-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.module-card:hover {
    box-shadow: var(--shadow-md);
}

/* 模块头部 */
.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
    border-left: 4px solid var(--module-color);
}

.module-header:hover {
    background: var(--bg-card-hover);
}

.module-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--primary-light);
    flex-shrink: 0;
}

.module-info {
    min-width: 0;
}

.module-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.module-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.module-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.module-progress-text {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 12px;
    background: var(--bg-code);
    border-radius: var(--radius-full);
}

.module-toggle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    width: 24px;
    text-align: center;
}

/* 模块章节列表 */
.module-chapters {
    padding: 0 var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.module-chapters.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* ==================== 6. 章节卡片 ==================== */
.chapter-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

/* 可学习状态 */
.chapter-card.chapter-available {
    background: var(--bg-card);
    border-color: var(--primary);
    border-left: 3px solid var(--primary);
}

.chapter-card.chapter-available:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

/* 已完成状态 */
.chapter-card.chapter-completed {
    background: var(--success-light);
    border-color: var(--success);
    border-left: 3px solid var(--success);
}

.chapter-card.chapter-completed:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

/* 锁定状态 */
.chapter-card.chapter-locked {
    background: var(--bg-code);
    border-color: var(--border-light);
    opacity: 0.7;
    cursor: not-allowed;
}

.chapter-card.chapter-locked:hover {
    opacity: 0.8;
}

/* 未开放状态 */
.chapter-card.chapter-closed {
    background: var(--bg-code);
    border-color: var(--border-light);
    opacity: 0.5;
    cursor: not-allowed;
}

/* 需要登录 */
.chapter-card.chapter-login-required {
    background: var(--bg-card);
    border-color: var(--border-color);
    cursor: pointer;
}

.chapter-card.chapter-login-required:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* 章节序号 */
.chapter-number {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
    background: var(--bg-code);
    color: var(--text-secondary);
}

.chapter-available .chapter-number {
    background: var(--primary);
    color: white;
}

.chapter-completed .chapter-number {
    background: var(--success);
    color: white;
}

/* 章节信息 */
.chapter-info {
    flex: 1;
    min-width: 0;
}

.chapter-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.chapter-score {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* 章节状态 */
.chapter-status {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.chapter-status-icon {
    font-size: 16px;
}

.chapter-status-text {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.chapter-available .chapter-status-text {
    color: var(--primary);
}

.chapter-completed .chapter-status-text {
    color: var(--success);
}

/* ==================== 7. 课程特色区 ==================== */
.features-section {
    padding: var(--space-3xl) 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all var(--transition-base);
    cursor: default;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    display: inline-block;
}

.feature-card:hover .feature-icon {
    animation: featureIconBounce 0.5s ease;
}

@keyframes featureIconBounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.feature-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.feature-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ==================== 8. 登录提示区 ==================== */
.login-prompt {
    margin-bottom: var(--space-2xl);
}

/* ==================== 9. 响应式 ==================== */

/* 大屏幕 */
@media (min-width: 1280px) {
    .hero-title {
        font-size: 48px;
    }
}

/* 平板 */
@media (max-width: 1024px) {
    .hero-content {
        gap: var(--space-xl);
    }

    .hero-illustration {
        width: 300px;
        height: 300px;
    }

    .hero-title {
        font-size: 34px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 小平板 / 大手机 */
@media (max-width: 768px) {
    .hero {
        padding: var(--space-md) 0 var(--space-xl);
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-illustration {
        width: 280px;
        height: 250px;
        order: -1;
    }

    .hero-card-1 {
        top: 10px;
        left: 10px;
    }

    .hero-card-2 {
        top: 60px;
        right: 0;
    }

    .hero-card-3 {
        bottom: 60px;
        left: 0;
    }

    .hero-card-4 {
        bottom: 10px;
        right: 10px;
    }

    .hero-card {
        padding: var(--space-sm) var(--space-md);
    }

    .hero-card-icon {
        font-size: 20px;
    }

    .hero-card-label {
        font-size: var(--text-xs);
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-desc {
        font-size: var(--text-base);
        max-width: 100%;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .progress-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .module-header {
        padding: var(--space-md) var(--space-lg);
    }

    .module-chapters {
        padding: 0 var(--space-lg) var(--space-md);
    }

    .module-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .module-title {
        font-size: var(--text-base);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .feature-card {
        padding: var(--space-lg);
    }
}

/* 手机 */
@media (max-width: 480px) {
    .hero-illustration {
        width: 240px;
        height: 220px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-badge {
        font-size: var(--text-xs);
        padding: 4px 12px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .hero-stat-divider {
        display: none;
    }

    .hero-stat-item {
        padding: 0 var(--space-md);
    }

    .progress-details {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .progress-detail-item {
        padding: var(--space-sm);
    }

    .progress-detail-value {
        font-size: var(--text-lg);
    }

    .module-header {
        padding: var(--space-md);
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .module-header-left {
        flex: 1;
        min-width: 0;
    }

    .module-chapters {
        padding: 0 var(--space-md) var(--space-md);
    }

    .chapter-card {
        padding: var(--space-sm) var(--space-md);
    }

    .chapter-number {
        width: 30px;
        height: 30px;
        font-size: var(--text-xs);
    }

    .chapter-title {
        font-size: var(--text-sm);
    }

    .section-title {
        font-size: var(--text-2xl);
    }
}

/* ==================== 10. 深色模式微调 ==================== */
[data-theme="dark"] .hero-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .module-card {
    border-color: var(--border-color);
}

[data-theme="dark"] .chapter-card.chapter-available {
    background: rgba(255, 107, 53, 0.05);
}

[data-theme="dark"] .chapter-card.chapter-completed {
    background: rgba(34, 197, 94, 0.05);
}

[data-theme="dark"] .chapter-card.chapter-locked,
[data-theme="dark"] .chapter-card.chapter-closed {
    background: var(--bg-card);
}

[data-theme="dark"] .progress-overview .card {
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 107, 53, 0.05));
}

[data-theme="dark"] .progress-detail-item {
    background: var(--bg-body);
    border-color: var(--border-color);
}

[data-theme="dark"] .feature-card {
    border-color: var(--border-color);
}

[data-theme="dark"] .feature-card:hover {
    border-color: var(--primary);
}

/* ==================== 11. 滚动动画 ==================== */
.module-card,
.feature-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.module-card:nth-child(1) {
    animation-delay: 0.05s;
}

.module-card:nth-child(2) {
    animation-delay: 0.1s;
}

.module-card:nth-child(3) {
    animation-delay: 0.15s;
}

.module-card:nth-child(4) {
    animation-delay: 0.2s;
}

.module-card:nth-child(5) {
    animation-delay: 0.25s;
}

.module-card:nth-child(6) {
    animation-delay: 0.3s;
}

.module-card:nth-child(7) {
    animation-delay: 0.35s;
}

.module-card:nth-child(8) {
    animation-delay: 0.4s;
}

.module-card:nth-child(9) {
    animation-delay: 0.45s;
}

.feature-card:nth-child(1) {
    animation-delay: 0.05s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.15s;
}

.feature-card:nth-child(4) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(5) {
    animation-delay: 0.25s;
}

.feature-card:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}