/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.8;
    color: #4a5568;
    background-color: #f7fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 3rem;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e2e8f0;
}

.nav-logo a {
    font-size: 1.4rem;
    font-weight: 600;
    color: #63b3ed;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: #718096;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.3rem 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: #63b3ed;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: #a0aec0;
    transition: 0.3s;
}

/* 轮播图 */
.carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 55vh;
    min-height: 380px;
    max-height: 550px;
    overflow: hidden;
    background-color: #ebf8ff;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: none;
}

.carousel-slide.active {
    display: block;
}

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

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem;
    background: linear-gradient(to top, rgba(99, 179, 237, 0.6), transparent);
    color: #fff;
    text-align: center;
}

.carousel-caption h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    letter-spacing: 1px;
}

.carousel-caption p {
    font-size: 1rem;
    opacity: 0.95;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.4);
    border: none;
    color: #fff;
    font-size: 1.8rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 4px;
}

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

.carousel-btn.prev {
    left: 1.5rem;
}

.carousel-btn.next {
    right: 1.5rem;
}

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dots .dot.active {
    background: #fff;
    transform: scale(1.2);
}

/* 主要内容区域 */
main {
    flex: 1;
    padding: 4rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* 首页 */
.home-content {
    text-align: center;
    padding-top: 2rem;
}

.typewriter {
    font-size: 2rem;
    color: #4299e1;
    margin-bottom: 0.8rem;
    min-height: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1rem;
    color: #a0aec0;
    margin-bottom: 3rem;
    letter-spacing: 1px;
}

.intro {
    max-width: 580px;
    margin: 0 auto;
    text-align: left;
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.intro p {
    margin-bottom: 1rem;
    color: #718096;
}

.intro p:last-child {
    margin-bottom: 0;
}

/* 页面内容 */
.page-content {
    padding-top: 1rem;
}

.page-content h1 {
    font-size: 1.8rem;
    color: #4299e1;
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.page-intro {
    color: #a0aec0;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.learning-container,
.gallery-container,
.music-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    min-height: 300px;
    color: #718096;
}

/* Bugcat Capoo 彩蛋 */
.capoo-easter-egg {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    z-index: 1000;
    animation: float 4s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
}

.capoo-easter-egg:hover {
    transform: scale(1.15);
    opacity: 1;
}

.capoo-easter-egg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    background: transparent;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 1.5rem;
    background-color: #fff;
    color: #a0aec0;
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
}

.footer p {
    font-size: 0.85rem;
}

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

/* 平板设备 */
@media (max-width: 1024px) {
    .carousel {
        height: 48vh;
        min-height: 320px;
    }

    .carousel-caption h2 {
        font-size: 1.5rem;
    }
}

/* 移动端设备 */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .nav-logo a {
        font-size: 1.2rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        flex-direction: column;
        padding: 1.2rem;
        gap: 1.2rem;
        border-bottom: 1px solid #e2e8f0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .carousel {
        height: 38vh;
        min-height: 260px;
        max-height: 380px;
    }

    .carousel-btn {
        font-size: 1.4rem;
        padding: 0.3rem 0.6rem;
    }

    .carousel-btn.prev {
        left: 0.8rem;
    }

    .carousel-btn.next {
        right: 0.8rem;
    }

    .carousel-caption {
        padding: 1.5rem;
    }

    .carousel-caption h2 {
        font-size: 1.2rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }

    main {
        padding: 2.5rem 1.2rem;
    }

    .typewriter {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .intro,
    .learning-container,
    .gallery-container,
    .music-container {
        padding: 1.8rem 1.5rem;
    }

    .page-content h1 {
        font-size: 1.5rem;
    }

    .capoo-easter-egg {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .navbar {
        padding: 0.8rem 1rem;
    }

    .nav-logo a {
        font-size: 1.1rem;
    }

    .carousel {
        height: 32vh;
        min-height: 220px;
    }

    .carousel-btn {
        font-size: 1.2rem;
        padding: 0.2rem 0.5rem;
    }

    .carousel-caption h2 {
        font-size: 1.05rem;
    }

    .carousel-caption p {
        font-size: 0.85rem;
    }

    .carousel-dots .dot {
        width: 8px;
        height: 8px;
    }

    main {
        padding: 2rem 0.8rem;
    }

    .typewriter {
        font-size: 1.3rem;
    }

    .intro,
    .learning-container,
    .gallery-container,
    .music-container {
        padding: 1.5rem 1.2rem;
        border-radius: 8px;
    }

    .capoo-easter-egg {
        width: 48px;
        height: 48px;
        bottom: 10px;
        right: 10px;
    }

    .footer {
        padding: 1.2rem;
    }

    .footer p {
        font-size: 0.8rem;
    }
}
