/* ==================== Hero 区域 ==================== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    padding: 120px 24px 80px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 60px;
    min-height: calc(100vh - 80px);
}

.hero-content {
    flex: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 24px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
}

.title-line {
    display: block;
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 32px;
}

.title-name {
    display: block;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
}

.typing-text {
    color: var(--accent-primary);
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    font-weight: 700;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent-primary);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 48px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Hero 代码窗口 */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* 代码轮播 */
.code-carousel {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 380px;
    padding-bottom: 40px;
}

.code-carousel .code-window {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.code-carousel .code-window.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-dots {
    display: none;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.carousel-dots .dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.carousel-dots .dot.active {
    background: var(--accent-primary);
    transform: scale(1.2);
}

.carousel-dots .dot.active::after {
    border-color: rgba(99, 102, 241, 0.3);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
}

.carousel-dots .dot:hover {
    background: rgba(99, 102, 241, 0.6);
    transform: scale(1.15);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.prev-btn {
    left: -60px;
}

.next-btn {
    right: -60px;
}

/* 白天模式 */
body.light-mode .carousel-dots .dot {
    background: rgba(99, 102, 241, 0.3);
}

body.light-mode .carousel-dots .dot.active {
    background: var(--accent-primary);
}

body.light-mode .carousel-dots .dot.active::after {
    border-color: rgba(99, 102, 241, 0.2);
}

body.light-mode .carousel-btn {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

body.light-mode .carousel-btn:hover {
    background: var(--accent-primary);
    color: white;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 24px 60px;
        gap: 40px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .title-line {
        font-size: 1.5rem;
    }
    
    .hero-description {
        margin: 0 auto 32px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-visual {
        max-width: 100%;
    }
    
    .code-carousel {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 90px 16px 40px;
        min-height: auto;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .title-line {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        gap: 24px;
        margin-top: 32px;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .code-carousel {
        height: 280px;
    }
    
    .code-content {
        padding: 16px;
    }
    
    .code-content code {
        font-size: 0.7rem;
        line-height: 1.6;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
    }
    
    .prev-btn {
        left: -12px;
    }
    
    .next-btn {
        right: -12px;
    }
    
    .carousel-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
    }
    
    .carousel-dots .dot {
        width: 8px;
        height: 8px;
    }
}

/* 首页隐藏页脚 */
.home-footer {
    display: none;
}

/* ==================== 白天模式 ==================== */
body.light-mode .hero-badge {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

body.light-mode .code-window {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

body.light-mode .window-header {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: var(--border-color);
}

body.light-mode .keyword { color: #7c3aed; }
body.light-mode .property { color: #4f46e5; }
body.light-mode .variable { color: #d97706; }
body.light-mode .string { color: #059669; }
body.light-mode .comment { color: #6b7280; }

/* 手机端轮播按钮 */
@media (max-width: 480px) {
    .hero {
        padding: 80px 12px 32px;
        gap: 24px;
    }
    
    .hero-badge {
        font-size: 0.7rem;
        padding: 5px 10px;
        margin-bottom: 16px;
    }
    
    .hero-title {
        font-size: 1.85rem;
        margin-bottom: 12px;
    }
    
    .title-line {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .hero-description {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }
    
    .hero-buttons {
        margin-bottom: 24px;
    }
    
    .hero-stats {
        gap: 16px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .code-carousel {
        height: 240px;
    }
    
    .window-header {
        padding: 10px 12px;
    }
    
    .window-dots {
        gap: 4px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
    
    .window-title {
        font-size: 0.75rem;
    }
    
    .code-content {
        padding: 12px;
    }
    
    .code-content code {
        font-size: 0.65rem;
        line-height: 1.5;
    }
    
    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .prev-btn {
        left: -8px;
    }
    
    .next-btn {
        right: -8px;
    }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        flex-direction: row;
        padding: 70px 16px 20px;
        gap: 20px;
    }
    
    .hero-content {
        text-align: left;
    }
    
    .hero-buttons {
        flex-direction: row;
    }
    
    .hero-stats {
        justify-content: flex-start;
    }
    
    .code-carousel {
        height: 220px;
    }
}
