@import url('common.css');

/* 全宽轮播区域 */
.carousel-section {
    width: 100%;
    overflow: hidden;
    position: relative;
    margin-top: 0;
}

.carousel-container {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.carousel {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 600px;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slide-content {
    position: relative;
    z-index: 5;
    max-width: 1200px;
    padding: 0 20px;
    color: white;
    text-align: left;
}

.slide-content h2 {
    font-size: 48px;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.slide-content p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 600px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 3;
}

/* 幻灯片背景 */
.slide-1 .slide-image {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

.slide-2 .slide-image {
    background: linear-gradient(135deg, #00695c 0%, #00796b 100%);
}

.slide-3 .slide-image {
    background: linear-gradient(135deg, #8e24aa 0%, #7b1fa2 100%);
}

.slide-4 .slide-image {
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
}

/* 轮播控制按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 30px;
}

.next-btn {
    right: 30px;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.indicator.active {
    background: var(--secondary-color);
    transform: scale(1.2);
}

/* 轮播导航按钮 */
.carousel-nav {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4B8BBE 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 42px;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--dark-color);
}

.btn-primary:hover {
    background-color: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    border-color: white;
    transform: translateY(-2px);
}

/* 功能区域 */
.features {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 32px;
    color: var(--dark-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-title p {
    color: var(--gray-color);
    max-width: 700px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    background-color: rgba(48, 105, 152, 0.1);
    color: var(--primary-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--gray-color);
    margin-bottom: 20px;
}

.feature-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.feature-link:hover {
    text-decoration: underline;
}

/* Python扩展库区域 */
.extensions {
    background-color: #f8f9fa;
    padding: 80px 0;
}

.extensions-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-btn {
    background: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-btn:hover:not(.active) {
    background-color: #e9ecef;
}

.tab-content {
    display: none;
}

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

.extensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.extension-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.extension-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.extension-header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.extension-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.extension-header h3 {
    font-size: 20px;
    flex-grow: 1;
}

.extension-badge {
    background-color: var(--secondary-color);
    color: var(--dark-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.extension-body {
    padding: 20px;
}

.extension-body p {
    color: var(--gray-color);
    margin-bottom: 15px;
    font-size: 14px;
}

.extension-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.extension-tag {
    background-color: #e9ecef;
    color: var(--dark-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.extension-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.extension-link:hover {
    text-decoration: underline;
}

/* 扩展统计 */
.extensions-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--gray-color);
    font-size: 14px;
}

/* 快速访问 */
.quick-access {
    padding: 80px 0;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.category {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.category h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 20px;
}

.category ul {
    list-style: none;
}

.category li {
    margin-bottom: 12px;
}

.category a {
    color: var(--dark-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.category a:hover {
    color: var(--primary-color);
}

.category a i {
    color: var(--primary-color);
}

/* 代码示例 */
.code-example {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.code-container {
    background-color: var(--dark-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

.code-header {
    background-color: #2d3748;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.code-header button {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.code-header button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

pre {
    padding: 25px;
    overflow-x: auto;
    margin: 0;
    color: #e2e8f0;
}

code {
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

.keyword {
    color: #ff6b8b;
}

.function {
    color: #82aaff;
}

.string {
    color: #9ae6b4;
}

.comment {
    color: #a0aec0;
}

.number {
    color: #fbb6ce;
}

/* 页脚 */
footer {
    padding: 60px 0 20px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero h2 {
        font-size: 36px;
    }

    .carousel {
        height: 500px;
    }

    .slide-content h2 {
        font-size: 36px;
    }

    .slide-content p {
        font-size: 18px;
    }

    nav ul {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    .hero h2 {
        font-size: 30px;
    }

    .hero p {
        font-size: 16px;
    }

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

    .btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-box {
        width: 100%;
        max-width: 400px;
    }

    .extensions-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .carousel {
        height: 450px;
    }

    .slide-content h2 {
        font-size: 28px;
    }

    .slide-content p {
        font-size: 16px;
    }

    .carousel-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .prev-btn {
        left: 15px;
    }

    .next-btn {
        right: 15px;
    }

    .carousel-indicators {
        bottom: 20px;
    }

    .carousel-nav {
        bottom: 20px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0;
    }

    .features,
    .extensions,
    .quick-access,
    .code-example {
        padding: 60px 0;
    }

    .section-title h2 {
        font-size: 28px;
    }

    .extensions-grid {
        grid-template-columns: 1fr;
    }

    .carousel {
        height: 400px;
    }

    .slide-content h2 {
        font-size: 24px;
    }

    .slide-content p {
        font-size: 14px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}