/**
 * 主题切换和导航栏效果
 * 从 layout/main.php 中提取
 */

/* ===== 主题变量 ===== */
:root {
    /* 浅色主题 */
    --coral: #FF6B4A;
    --coral-dark: #E55A3A;
    --teal: #00BCD4;
    --teal-dark: #00ACC1;
    --text: #212121;
    --text-light: #757575;
    --bg: #F8F9FA;
    --card-bg: #FFFFFF;
    --border: #E0E0E0;
    --shadow: rgba(0, 0, 0, 0.08);
    --font-display: 'Noto Sans SC', sans-serif;
}

[data-theme="dark"] {
    /* 深色主题 */
    --coral: #FF8A65;
    --coral-dark: #FF6B4A;
    --teal: #4DD0E1;
    --teal-dark: #00BCD4;
    --text: #E0E0E0;
    --text-light: #9E9E9E;
    --bg: #121212;
    --card-bg: #1E1E1E;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* ===== 主题切换按钮 ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px var(--shadow);
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s;
    background: transparent;
}

.navbar.scrolled {
    background: var(--card-bg);
    box-shadow: 0 4px 20px var(--shadow);
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--coral);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 74, 0.3);
    transition: all 0.3s;
}

.back-to-top.visible {
    display: flex;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 107, 74, 0.4);
}

/* ===== 滚动淡入动画 ===== */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
