/* 首页专用样式 */

/* 课程标题区域 */
.course-header {
    text-align: center;
    margin-bottom: 40px;
}

.title-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 30px;
    color: white;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.title-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: float 20s infinite linear;
}

.course-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.course-subtitle {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.title-decoration {
    font-size: 24px;
    position: relative;
    z-index: 1;
}

.pixel-art {
    display: inline-block;
    letter-spacing: 3px;
    animation: pulse 2s infinite;
}

/* 学习目标区域 */
.learning-objectives {
    margin-bottom: 40px;
}

.objectives-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.objectives-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.objective-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.objective-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.objective-icon {
    font-size: 48px;
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

.objective-text {
    flex: 1;
}

.objective-text h4 {
    color: #667eea;
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

.objective-text > p {
    font-size: 17px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.objective-example {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid #2196f3;
    margin-top: 10px;
}

.example-tag {
    display: inline-block;
    background: #2196f3;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.objective-example p {
    font-size: 15px;
    color: #333;
    margin: 8px 0 0 0;
    line-height: 1.6;
}

/* 趣味导入区域 */
.introduction {
    margin-bottom: 40px;
}

.intro-card {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.intro-description {
    text-align: center;
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.7;
}

.intro-description strong {
    color: #667eea;
}

/* 三栏布局 */
.demo-three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 30px 0;
}

.demo-column {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.demo-column:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.column-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.demo-column h4 {
    color: #667eea;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: bold;
}

/* 第一栏：说明文字 */
.demo-explain p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.explain-points {
    text-align: left;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.point {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 15px;
    color: #333;
}

.point-dot {
    color: #667eea;
    font-size: 20px;
}

/* 第二栏：二进制编码 */
.demo-binary {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.binary-display {
    background: #2c3e50;
    padding: 15px;
    border-radius: 10px;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.3);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin: 0 auto;
    max-width: 180px;
}

.binary-digit {
    color: #2ecc71;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    padding: 8px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 5px;
    transition: all 0.3s ease;
    text-align: center;
}

.arrow-down {
    text-align: center;
    color: #667eea;
    margin: 15px 0;
}

.arrow-down span {
    font-size: 32px;
    font-weight: bold;
    display: block;
}

.arrow-down p {
    font-size: 14px;
    margin-top: 5px;
    font-weight: bold;
}

/* 第三栏：黑白图案 */
.demo-pattern {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pattern-display {
    display: grid;
    grid-template-columns: repeat(4, 40px);
    gap: 3px;
    background: #34495e;
    padding: 8px;
    border-radius: 10px;
    margin: 0 auto;
    width: fit-content;
}

.pattern-cell {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pattern-cell.white {
    background: white;
}

.pattern-cell.black {
    background: #2c3e50;
}

.pattern-name {
    margin-top: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    text-align: center;
}

/* 按钮区域 */
.demo-action {
    text-align: center;
    margin-top: 30px;
}

.magic-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.magic-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.magic-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 开始学习区域 */
.start-learning {
    margin-bottom: 40px;
}

.start-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 50px;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.start-card h3 {
    font-size: 24px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.start-btn {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    color: white;
    text-decoration: none;
    padding: 20px 40px;
    border-radius: 35px;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.start-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
    filter: brightness(1.1);
}

.btn-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.start-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* 动画 */
@keyframes float {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes binaryGlow {
    0%, 100% {
        text-shadow: 0 0 5px #2ecc71;
    }
    50% {
        text-shadow: 0 0 20px #2ecc71, 0 0 30px #2ecc71;
    }
}

.binary-glow {
    animation: binaryGlow 2s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .course-title {
        font-size: 36px;
    }
    
    .course-subtitle {
        font-size: 24px;
    }
    
    .demo-three-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .demo-column {
        padding: 20px;
    }
    
    .column-icon {
        font-size: 40px;
    }
    
    .binary-display {
        max-width: 160px;
    }
    
    .binary-digit {
        font-size: 16px;
        padding: 6px;
    }
    
    .pattern-display {
        grid-template-columns: repeat(4, 35px);
    }
    
    .pattern-cell {
        width: 35px;
        height: 35px;
    }
    
    .arrow-down span {
        font-size: 28px;
    }
    
    .objectives-content {
        gap: 20px;
    }
    
    .objective-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    

}

@media (max-width: 480px) {
    .course-title {
        font-size: 28px;
    }
    
    .course-subtitle {
        font-size: 20px;
    }
    
    .title-section,
    .objectives-card,
    .intro-card,
    .game-card,
    .start-card {
        padding: 25px;
    }
    
    .objective-item p,
    .intro-text p {
        font-size: 16px;
    }
    
    .pixel-cell {
        width: 30px;
        height: 30px;
    }
    
    .binary-digit {
        font-size: 18px;
        margin: 0 2px;
        padding: 3px 5px;
    }
    
    .start-btn {
        padding: 15px 30px;
        font-size: 18px;
    }
} 


/* 图案消息动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pattern-message {
    animation: slideIn 0.5s ease;
}


@media (max-width: 480px) {
    .intro-description {
        font-size: 16px;
    }
    
    .demo-column {
        padding: 15px;
    }
    
    .column-icon {
        font-size: 36px;
    }
    
    .demo-column h4 {
        font-size: 18px;
    }
    
    .binary-display {
        max-width: 140px;
    }
    
    .binary-digit {
        font-size: 14px;
        padding: 5px;
    }
    
    .pattern-display {
        grid-template-columns: repeat(4, 30px);
    }
    
    .pattern-cell {
        width: 30px;
        height: 30px;
    }
    
    .pattern-name {
        font-size: 16px;
    }
    
    .magic-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

/* ===== 配图与课前导入视频（后加） ===== */

/* 标题区主视觉：文字 + 主角吉祥物并排 */
.title-hero-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.hero-mascot {
    width: 130px;
    height: auto;
    flex-shrink: 0;
}

/* 标题行：小节标题 + 小装饰图并排（紧跟文字，不推到最右） */
.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.title-row .section-title {
    margin-bottom: 0;
}

.title-deco {
    height: 75px;
    width: auto;
    flex-shrink: 0;
}

/* 课前导入视频区域 */
.intro-video {
    margin-bottom: 40px;
}

.intro-video-card {
    background: linear-gradient(135deg, #d4f1f4 0%, #e8dff5 100%);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* 视频与要点回顾左右并排 */
.video-review-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.video-box {
    flex: 0 0 460px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: #2c3e50;
}

.video-box video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.review-box {
    flex: 1;
    min-width: 240px;
    background: rgba(255,255,255,0.92);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    text-align: left;
}

.review-box h4 {
    color: #6a4c9c;
    font-size: 19px;
    margin-bottom: 12px;
    font-weight: bold;
    text-align: left;
}

.review-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.review-list li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 12px;
    font-size: 16px;
    color: #3a3a5a;
    line-height: 1.7;
    text-align: left;
}

.review-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: #7ad0c3;
}

@media (max-width: 768px) {
    .hero-mascot {
        width: 100px;
    }

    .title-deco {
        height: 60px;
    }

    .video-review-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .video-box {
        flex: none;
        width: 100%;
    }

    .intro-video-card {
        padding: 25px;
    }
}
