/* ==================== 移动端响应式适配 ==================== */

/* 平板端 (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .title-large {
        font-size: clamp(4rem, 15vw, 8rem);
    }

    .works-title-large {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    .contact-title-large {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    .topbar-center {
        gap: 1rem;
    }

    .nav-link {
        font-size: 12px;
    }
}

/* 手机端 (小于768px) */
@media screen and (max-width: 768px) {

    /* 导航栏 - 简化 */
    .topbar {
        height: 60px;
        padding: 0 4vw;
    }

    .topbar-left .logo img {
        height: 60px;
    }

    .topbar-center {
        display: none;
        /* 隐藏导航链接 */
    }

    .topbar-right {
        gap: 1rem;
    }

    .date-display {
        display: none;
        /* 隐藏日期 */
    }

    /* 滚动指示器 - 移到底部 */
    .scroll-indicator {
        right: 50%;
        top: auto;
        bottom: 20px;
        transform: translateX(50%);
        flex-direction: row;
        gap: 8px;
    }

    .scroll-dot {
        width: 8px;
        height: 8px;
    }

    /* 首页 Section - 整体标题区域 */
    .home-title-block {
        position: absolute;
        top: 12vh;
        left: 5vw;
        z-index: 10;
    }

    .home-title-block .page-title {
        position: static;
        display: flex;
        flex-direction: column;
    }

    .title-small {
        font-size: 1rem;
    }

    .title-large {
        font-size: clamp(2.5rem, 15vw, 4rem);
        line-height: 1;
    }

    .home-title-block .title-line-section {
        position: static;
        margin-top: 1rem;
    }

    .title-line {
        width: 60vw;
    }

    /* 隐藏装饰元素 */
    .code-panel {
        display: none;
    }

    .right-code-panel {
        display: none;
    }

    .section-label {
        font-size: 0.6rem;
    }

    .section-number {
        font-size: 3rem;
    }

    /* 樱花树画布 - 移动端缩小 */
    #tree-canvas {
        opacity: 0.6;
    }

    /* 一言 */
    .hitokoto-container {
        left: 5vw;
        right: 5vw;
        bottom: 15vh;
        width: auto;
    }

    .hitokoto-text {
        font-size: 0.9rem;
    }

    /* About Section */
    .about-section {
        flex-direction: column;
        padding: 100px 5vw 60px;
    }

    .about-left {
        width: 100%;
        padding-right: 0;
        padding-bottom: 2rem;
    }

    .about-right {
        width: 100%;
    }

    .about-title-small {
        font-size: 2rem;
    }

    .about-title-large {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .about-subtitle {
        font-size: 0.9rem;
    }

    .about-intro h3 {
        font-size: 1.2rem;
    }

    .about-intro p {
        font-size: 0.95rem;
    }

    /* 隐藏About页面所有装饰元素 */
    .skill-marquee-wrapper {
        display: none !important;
    }

    .ghost-text-layer {
        display: none !important;
    }

    .ghost-text-scroll {
        display: none !important;
    }

    .identity-labels {
        font-size: clamp(2rem, 10vw, 3rem) !important;
    }

    .identity-label {
        font-size: clamp(2rem, 10vw, 3rem) !important;
    }

    .grid-code-display {
        display: none !important;
    }

    .about-slogan-en {
        font-size: clamp(1.2rem, 5vw, 2rem);
        text-align: left;
    }

    .about-decoration {
        display: none !important;
    }

    .about-outline-text {
        display: none !important;
    }

    .swiss-lines {
        display: none !important;
    }

    .about-section-footer {
        bottom: 10px;
        left: 5vw;
    }

    /* 隐藏3D网格 */
    #three-container {
        display: none !important;
    }

    /* About容器调整 */
    .about-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding-top: 80px;
    }

    .about-left {
        width: 100%;
        padding: 20px 5vw;
    }

    .about-right {
        width: 100%;
        padding: 20px 5vw;
        align-items: flex-start;
    }

    .identity-section {
        padding: 0;
    }

    .bio-text {
        font-size: 0.9rem;
    }

    .tech-tags {
        margin-top: 0.5rem;
    }

    .tech-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }

    /* Works Section */
    #works {
        padding-top: 80px;
    }

    .works-header {
        padding: 0 5vw;
        margin-bottom: 2rem;
    }

    .works-title-small {
        font-size: 1rem;
    }

    .works-title-large {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .works-subtitle {
        font-size: 0.9rem;
    }

    .works-grid-container {
        padding: 0 5vw;
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .work-card {
        padding: 1.5rem;
    }

    .work-title {
        font-size: 1.1rem;
    }

    .work-desc {
        font-size: 0.9rem;
    }

    .works-footer {
        bottom: 10px;
        left: 5vw;
    }

    /* 隐藏3D网格背景 */
    #three-container {
        opacity: 0.3;
    }

    /* Contact Section */
    #contact {
        padding-top: 80px;
    }

    .contact-content {
        padding: 0 5vw;
        flex-direction: column;
    }

    .contact-left {
        width: 100%;
        margin-bottom: 2rem;
    }

    .contact-right {
        width: 100%;
    }

    .contact-title-small {
        font-size: 1rem;
    }

    .contact-title-large {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .contact-subtitle {
        font-size: 0.9rem;
    }

    .contact-list {
        gap: 1.5rem;
    }

    .contact-item {
        flex-direction: column;
        gap: 0.3rem;
    }

    .contact-label {
        font-size: 0.8rem;
    }

    .contact-value {
        font-size: 1rem;
    }

    .contact-footer {
        position: static;
        margin-top: 3rem;
    }

    .contact-section-footer {
        bottom: 10px;
        left: 5vw;
    }
}

/* 小屏手机 (小于480px) */
@media screen and (max-width: 480px) {
    .title-large {
        font-size: clamp(2.5rem, 20vw, 4rem);
    }

    .about-title-large,
    .works-title-large,
    .contact-title-large {
        font-size: clamp(2rem, 15vw, 3rem);
    }

    .scroll-indicator {
        bottom: 15px;
    }

    .scroll-dot {
        width: 6px;
        height: 6px;
    }

    .section-number {
        font-size: 2rem;
    }

    .work-card {
        padding: 1.2rem;
    }

    .work-tag {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}