* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #334155);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    font-family: "Microsoft YaHei", sans-serif;
    overflow: hidden;
    position: relative;
    color: #e2e8f0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.mouse-cursor {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
}

.book-container {
    position: relative;
    z-index: 2;
    width: min(1000px, 92vw);
    height: 500px;
    perspective: 1800px;
    margin: 0 auto;
    transition: all 0.3s ease;
    display: flex;
}

@media (max-width: 768px) {
    body {
        justify-content: flex-start;
        padding: 10px 0 80px;
        min-height: 100vh;
        height: -webkit-fill-available;
    }

    .book-container {
        margin: 20px auto;
        width: 92vw;
        height: auto;
        min-height: auto;
        perspective: none;
        display: flex;
    }
    
    .book {
        transform: none !important;
        animation: none !important;
        backdrop-filter: none;
        min-height: auto;
        flex-direction: column;
        height: auto;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    .welcome-text {
        font-size: 1.5em;
        margin: 15px 0;
        padding: 0;
        line-height: 1.4;
    }

    .page {
        padding: 20px;
        flex: none;
        min-height: 180px;
        height: auto;
    }

    .page.right {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding-top: 0;
    }

    .page.left {
        padding-bottom: 10px;
    }

    .button {
        padding: 12px 20px;
        font-size: 1em;
        min-width: 140px;
        margin: 5px 0;
    }

    .button-container {
        gap: 12px;
        margin: 0;
        padding: 10px 0;
        width: 100%;
    }

    .footer-section {
        position: relative;
        height: auto;
        margin-top: 30px;
        padding: 15px 0;
        background: rgba(13, 25, 42, 0.9);
    }

    .footer {
        flex-direction: column;
        gap: 8px;
        padding: 0 10px;
        width: 100%;
    }

    .footer-item {
        font-size: 0.8em;
        padding: 8px 15px;
        width: 100%;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .footer-item:not(:last-child)::after {
        display: none;
    }

    .page.left::after {
        display: none;
    }

    .mouse-cursor {
        display: none;
    }
}

/* iPhone 12/13/14 Pro Max 特定优化 */
@media screen and (device-width: 428px) and (device-height: 926px),
       screen and (device-width: 390px) and (device-height: 844px),
       screen and (device-width: 430px) and (device-height: 932px) {
    body {
        padding: 20px 0 100px;
    }

    .book-container {
        margin: 30px auto;
        height: auto;
        min-height: 500px;
    }

    .book {
        min-height: 500px;
    }

    .welcome-text {
        font-size: 1.6em;
        margin: 30px 0;
    }

    .button-container {
        margin: 15px 0;
        gap: 20px;
    }
    
    .page {
        padding: 25px;
        height: 50%;
    }

    .button {
        padding: 15px 30px;
        min-width: 180px;
        margin: 10px 0;
    }
}

/* 较小屏幕的 iPhone */
@media (max-width: 380px) {
    .book-container {
        min-height: 350px;
    }

    .book {
        min-height: 350px;
    }

    .welcome-text {
        font-size: 1.3em;
    }

    .button {
        padding: 8px 15px;
        min-width: 120px;
    }
}

.book {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(20deg) rotateY(-10deg);
    display: flex;
    flex-direction: row;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        -10px 10px 30px rgba(64, 192, 255, 0.2),
        10px 10px 30px rgba(128, 0, 255, 0.2);
    animation: float 3s ease-in-out infinite;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
    position: relative;
    will-change: transform;
    background-image: 
        linear-gradient(125deg, 
            rgba(56, 189, 248, 0.1) 0%,
            rgba(59, 130, 246, 0.1) 50%,
            rgba(99, 102, 241, 0.1) 100%
        );
}

.book::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

@keyframes float {
    0%, 100% { transform: rotateX(10deg) translateY(0); }
    50% { transform: rotateX(10deg) translateY(-20px); }
}

.book:hover {
    transform: rotateX(10deg) translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.page {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.page.left {
    border-right: 2px solid rgba(64, 192, 255, 0.3);
    position: relative;
}

.page.left::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 15%;
    height: 70%;
    width: 2px;
    background: linear-gradient(
        to bottom,
        rgba(64, 192, 255, 0),
        rgba(64, 192, 255, 0.5) 20%,
        rgba(100, 255, 218, 0.5) 50%,
        rgba(64, 192, 255, 0.5) 80%,
        rgba(64, 192, 255, 0)
    );
    box-shadow: 0 0 15px rgba(64, 192, 255, 0.5);
}

.welcome-text {
    font-size: 2.5em;
    color: #e2e8f0;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
    text-shadow: 
        0 0 20px rgba(56, 189, 248, 0.3),
        0 0 40px rgba(59, 130, 246, 0.2),
        0 0 80px rgba(99, 102, 241, 0.1);
    font-weight: 700;
    letter-spacing: 2px;
    background-image: linear-gradient(
        45deg,
        #f8fafc 0%,
        #60a5fa 50%,
        #38bdf8 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: titleGlow 8s ease-in-out infinite;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.button {
    padding: 12px 30px;
    font-size: 1.2em;
    text-decoration: none;
    color: #38bdf8;
    border: 2px solid #38bdf8;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(56, 189, 248, 0.1);
    min-width: 150px;
    text-align: center;
    position: relative;
    box-shadow: 
        0 4px 15px rgba(56, 189, 248, 0.2),
        0 0 30px rgba(59, 130, 246, 0.1);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    animation: buttonPulse 3s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(64, 192, 255, 0.2), 0 0 30px rgba(100, 255, 218, 0.1); }
    50% { box-shadow: 0 4px 25px rgba(64, 192, 255, 0.3), 0 0 50px rgba(100, 255, 218, 0.2); }
}

@keyframes titleGlow {
    0%, 100% { opacity: 1; text-shadow: 0 0 20px rgba(100, 255, 218, 0.3), 0 0 40px rgba(64, 192, 255, 0.2); }
    50% { opacity: 0.8; text-shadow: 0 0 30px rgba(100, 255, 218, 0.4), 0 0 60px rgba(64, 192, 255, 0.3); }
}

.button::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 27px;
    background: linear-gradient(45deg, 
        #40c0ff,
        #64ffda,
        #40c0ff
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.button:hover {
    color: #40c0ff;
    transform: translateY(-3px);
    background: rgba(64, 192, 255, 0.15);
    box-shadow: 0 8px 25px rgba(64, 192, 255, 0.25);
    border-color: rgba(64, 192, 255, 0.8);
    text-shadow: 0 0 10px rgba(64, 192, 255, 0.5);
}

.button:hover::before {
    opacity: 0.3;
}

.button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(64, 192, 255, 0.2);
}

.footer-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(13, 25, 42, 0) 0%, rgba(13, 25, 42, 0.8) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.footer {
    display: flex;
    gap: 20px;
}

.footer-item {
    padding: 12px 25px;
    font-size: 0.85em;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.footer-item a {
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.beian-icon {
    height: 16px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-item:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.9);
}

.footer-item:hover a {
    color: #60a5fa;
}

.footer-item:hover .beian-icon {
    opacity: 1;
}
