/* ============================================
   全新重构的现代化首页样式
   保持所有更新工具类名不变
   ============================================ */

:root {
    color-scheme: light dark;
    /* 主色调 */
    --app-bg: #0f0f0f;
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    
    /* 玻璃态效果 */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-hover: rgba(255, 255, 255, 0.15);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(30, 144, 255, 0.3));
    
    /* 内容区域 */
    --content-bg: rgba(255, 255, 255, 0.05);
    --content-text: #ffffff;
    
    /* 更新卡片 */
    --update-card-bg: rgba(255, 255, 255, 0.06);
    --update-title-bg: rgba(255, 255, 255, 0.08);
    --update-text-color: rgba(255, 255, 255, 0.9);
    --tag-bg: rgba(255, 255, 255, 0.12);
    --tag-text: #fff;
    
    /* 画廊 */
    --gallery-overlay: rgba(0, 0, 0, 0.5);
    --gallery-hover: rgba(255, 255, 255, 0.2);
    --gallery-hover-text: #fff;
    
    /* 模态窗口 */
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --modal-bg: rgba(20, 20, 20, 0.98);
    --modal-text: #ffffff;
    --modal-border: rgba(255, 255, 255, 0.15);
    
    /* 图片标题 */
    --image-title-bg: rgba(0, 0, 0, 0.7);
    --image-title-hover-bg: rgba(255, 255, 255, 0.25);
    --image-title-hover-text: #fff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --app-bg: #0a0a0a;
        --text-color: #f0f0f0;
        --text-secondary: rgba(240, 240, 240, 0.6);
        --glass-bg: rgba(255, 255, 255, 0.05);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-hover: rgba(255, 255, 255, 0.12);
        --content-bg: rgba(15, 15, 15, 0.4);
        --update-card-bg: rgba(10, 10, 10, 0.5);
    }
}

/* ============================================
   基础样式
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--app-bg);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden-scrollbar {
    overflow: hidden;
}

.hidden-scrollbar::-webkit-scrollbar {
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   背景轮播
   ============================================ */

.background-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.background-slideshow img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    filter: brightness(0.3) blur(1px);
    user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.background-slideshow img.active {
    opacity: 1;
}

/* ============================================
   顶部导航栏 - 全新设计
   ============================================ */

header.banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 32px;
    box-shadow: var(--shadow-md);
}

.banner-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 24px;
}

header.banner h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

header.banner h1:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.banner-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* 导航菜单 - 水平布局 */
nav.sidebar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* 移动端完全隐藏桌面端导航栏 */
@media (max-width: 768px) {
    nav.sidebar {
        display: none !important;
    }
}

nav.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 4px;
}

nav.sidebar ul li {
    margin: 0;
}

nav.sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    color: var(--text-secondary);
    white-space: nowrap;
}

nav.sidebar ul li a::before {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

nav.sidebar ul li a:hover {
    color: var(--text-color);
    background: var(--glass-hover);
}

nav.sidebar ul li a:hover::before {
    width: calc(100% - 40px);
}

/* 移动端菜单按钮 */
.toggle-sidebar {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    padding: 8px 6px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
    margin-left: auto;
}

.toggle-sidebar:hover {
    background: var(--glass-hover);
    border-color: rgba(255, 255, 255, 0.3);
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.toggle-sidebar.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.toggle-sidebar.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.toggle-sidebar.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}


/* ============================================
   内容区域
   ============================================ */

.content-wrapper {
    margin: 0;
    padding-top: 90px;
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 40px;
    overflow-y: auto;
    height: 100vh;
    transition: all 0.3s ease;
}

.content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.content-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

main.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    /* 确保默认状态是可见的 */
    opacity: 1;
    transform: translateX(0);
}

/* 页面切换动画 */
main.content.slide-in {
    animation: slideInFromRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

main.content section {
    margin-bottom: 48px;
}

/* 内容元素浮现动画 */
.content-fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main.content h2 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 32px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--glass-border);
    position: relative;
    letter-spacing: -0.5px;
}

main.content h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* ============================================
   更新卡片 - 保持类名不变
   ============================================ */

.update-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    justify-content: center;
}

.update-item {
    display: flex;
    flex-direction: column;
    background: var(--update-card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    height: auto;
    min-height: 400px;
    opacity: 0;
    transform: translateY(20px);
}

.update-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.2);
}

.update-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    flex-shrink: 0;
}

.update-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-item:hover .update-image img {
    transform: scale(1.1);
}

.gallery-item:hover .update-image img {
    transform: scale(1.1);
}

.update-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

.image-title {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: var(--image-title-bg);
    color: var(--text-color);
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 12px;
    text-align: center;
    display: none;
    z-index: 10;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
}

.image-title:hover {
    background: var(--image-title-hover-bg);
    color: var(--image-title-hover-text);
}

.update-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px;
    gap: 12px;
}

.update-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    letter-spacing: -0.3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.update-main {
    flex: 1;
    color: var(--update-text-color);
    opacity: 0.85;
    line-height: 1.6;
}

.update-main p {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.5;
}

.update-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: auto;
    align-self: flex-start;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   画廊 - 保持类名不变
   ============================================ */

.gallery-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 0;
    justify-content: center;
}

.gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--update-card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    height: auto;
    min-height: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.2);
}


.gallery-item p {
    display: none;
}

.gallery-item-content {
    display: none;
}

/* ============================================
   日志条目
   ============================================ */

.legacy-journal {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--glass-border);
}

.journal-entry {
    background: var(--update-card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(20px);
}

.journal-entry:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.2);
}

.journal-entry h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.journal-entry p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   关于页面
   ============================================ */

#about {
    max-width: 800px;
    margin: 0 auto;
}

#about strong {
    display: block;
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 20px 0;
    color: var(--text-color);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--glass-border);
    position: relative;
}

#about strong:first-child {
    margin-top: 0;
}

#about strong::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

#about ul {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
}

#about ul li {
    background: var(--update-card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#about ul li:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.2);
}

#about ul li a {
    color: var(--text-color);
    font-weight: 500;
    transition: opacity 0.3s;
}

#about ul li a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ============================================
   模态窗口
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--modal-bg);
    color: var(--modal-text);
    margin: 10% auto;
    padding: 40px;
    border: 1px solid var(--modal-border);
    width: 90%;
    max-width: 600px;
    max-height: 75%;
    overflow-y: auto;
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   懒加载
   ============================================ */

.lazy {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy.loaded {
    opacity: 1;
}

.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable:active {
    transform: scale(0.98);
}

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

@media (max-width: 1024px) {
    .update-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .gallery-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    header.banner {
        height: 60px;
        padding: 0 20px;
        justify-content: center;
    }

    .banner-content {
        justify-content: center;
        flex: 1;
    }

    header.banner h1 {
        font-size: 18px;
        text-align: center;
    }

    .banner-subtitle {
        display: none;
    }

    .toggle-sidebar {
        display: none !important;
    }

    .content-wrapper {
        padding-top: 80px;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 100px; /* 为底部导航栏留出空间 */
    }

    main.content h2 {
        font-size: 28px;
    }

    .update-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .update-item {
        min-height: auto;
    }

    .gallery-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* 移动端隐藏图片上方的标题 */
    .image-title {
        display: none !important;
    }
    
    /* 底部导航栏 - iOS 风格胶囊设计 */
    .bottom-nav {
        display: flex;
    }
}

@media (max-width: 440px) {
    header.banner {
        padding: 0 16px;
    }

    .toggle-sidebar {
        margin-left: auto;
        margin-right: 0;
    }

    nav.sidebar {
        left: 16px;
        right: 16px;
        padding: 16px;
    }

    .content-wrapper {
        padding-left: 16px;
        padding-right: 16px;
    }

    .update-content {
        padding: 20px;
    }

    main.content h2 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    /* 移动端隐藏图片上方的标题 */
    .image-title {
        display: none !important;
    }
}

/* ============================================
   底部导航栏 - iOS 风格胶囊设计
   ============================================ */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
}

.bottom-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 30px;
    pointer-events: none;
    z-index: -1;
}

.bottom-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
}

.bottom-nav ul li {
    margin: 0;
}

.bottom-nav ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    min-width: 60px;
    position: relative;
}

.bottom-nav ul li a.active {
    color: var(--text-color);
    background: var(--glass-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bottom-nav ul li a:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        background: rgba(20, 20, 20, 0.7);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
    }
}
