/* 引入字体 */
@import url('https://fonts.googleapis.com/css2?family=Cherry+Bomb+One&display=swap');

/* 主题变量：默认模式（浅色） */
:root {
    --bg: #fbeff9;
    --text: #4a4a4a;
    --card-bg: #ffffffcc;
    --link-bg: #dcbef9;
    --link-hover: #b891d1;
    --border: #dcbef9;
}

/* 暗色模式变量 */
body.dark {
    background: linear-gradient(-45deg, #1a1a2e, #2e2e42, #3e3e5a, #1a1a2e);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    --bg: #1a1a2e;
    --text: #e0e0e0;
    --card-bg: #2e2e42cc;
    --link-bg: #8b6fa3;
    --link-hover: #a88ec4;
    --border: #8b6fa3;
}

/* 全局背景和字体 */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: 'Cherry Bomb One', cursive;
    color: var(--text);
    transition: background-color 0.4s ease;
}

body {
    background: linear-gradient(-45deg, #fbeff9, #e3f2fd, #f5e0f5, #e0f7fa);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* 主卡片样式 */
.container {
    padding: 3rem 1.5rem;
    max-width: 600px;
    width: 90%;
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(255, 174, 200, 0.3);
    text-align: center;
    transition: transform 0.3s ease, background-color 0.4s ease;
}

/* 横屏优化布局 */
.flex-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.right-content {
    text-align: center;
}

@media (max-width: 900px) and (orientation: landscape) {
    .flex-layout {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
    }

    .container {
        padding: 1rem 1.5rem;
        margin: 2vh auto;
        width: 95%;
        max-width: 720px;
        max-height: 96vh;
        overflow-y: auto;
        border-radius: 16px;
    }

    .avatar {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
    }

    .right-content {
        /* flex: 1; */
        text-align: left;
        padding: 0.5rem 1rem;
    }

    .right-content h1 {
        font-size: 2rem;
        margin-top: 0;
    }

    .right-content .content {
        font-size: 1rem;
    }

    .right-content .links {
        margin-top: 1rem;
    }
}

/* 标题 */
h1 {
    color: #c48ecf;
    font-size: 3rem;
    margin-top: 0;
}

/* 正文内容 */
.content {
    margin-top: 1rem;
    font-size: 1.2rem;
    line-height: 1.6;
}

/* 链接按钮区域 */
.links a {
    display: inline-block;
    margin: 1rem 0.5rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--link-bg);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.links a:hover {
    background-color: var(--link-hover);
    transform: scale(1.05);
}

/* 头像样式 */
.avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--border);
    margin-bottom: 1rem;
    box-shadow: 0 0 8px rgba(255, 182, 193, 0.6);
    transition: border-color 0.3s ease;
}

/* 滚动进入时的淡入动画 */
.fadeIn-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fadeIn-on-scroll.visible {
    opacity: 1;
    transform: none;
}

/* 淡入动画 class（保留旧样式） */
.fadeIn {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
    animation-delay: 0.5s;
}

/* 动画关键帧 */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.dark-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: linear-gradient(135deg, #dcbef9, #c48ecf);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.4s ease;
}

.dark-toggle:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #b891d1, #9c6cc3);
}

body.dark .dark-toggle {
    background: linear-gradient(135deg, #8b6fa3, #a88ec4);
}

body.dark .dark-toggle:hover {
    background: linear-gradient(135deg, #7a5f91, #9677b4);
}

.dark-toggle span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.8rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dark-toggle.spin {
    animation: rotateIcon 0.6s ease;
}

@keyframes rotateIcon {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(180deg);
    }
}

.icon-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.icon-hide {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

/* 手机竖屏适配 */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .content {
        font-size: 1rem;
    }

    .links a {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .container {
        padding: 2rem 1rem;
    }
}