/*
Theme Name: Lumina Split Theme
Theme URI: https://example.com/
Author: Custom WordPress Theme
Version: 3.2.0
Description: 包含左侧栏拟真海洋沙滩背景、海上拟真日月切换、3D巴哥狗交互及双栏响应式主题。
*/

/* 1. 变量定义与昼夜模式 */
:root {
    --bg-main: #f4f5f7;
    --bg-card: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #64748b;
    --border-color: #edf2f7;
    --accent-color: #3182ce;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent-color: #60a5fa;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

.site-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* 2. 左侧固定栏 */
.sidebar-left {
    width: 30%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    color: #ffffff;
    padding: 30px 20px 80px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    z-index: 100;
    overflow: hidden;
}

/* 现代拟真高画质海洋与沙滩背景 */
.beach-ocean-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* 日间：深蓝天空 -> 玻璃海 -> 浅滩折射 -> 金色细沙 */
    background: linear-gradient(180deg, 
        #1e3c72 0%, 
        #2a5298 30%, 
        #0083b0 55%, 
        #00b4db 68%, 
        #76e2d5 72%, 
        #e6c594 75%, 
        #d4a373 100%);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* 拟真海浪与沙滩过渡效果 */
.beach-ocean-bg::before {
    content: '';
    position: absolute;
    top: 66%;
    left: -50%;
    width: 200%;
    height: 30px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 45%;
    filter: blur(4px);
    animation: waveMotion 8s infinite linear;
}

.beach-ocean-bg::after {
    content: '';
    position: absolute;
    top: 68%;
    left: -50%;
    width: 200%;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 40%;
    filter: blur(8px);
    animation: waveMotion 12s infinite linear reverse;
}

@keyframes waveMotion {
    0% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(180deg) translateY(-8px); }
    100% { transform: rotate(360deg) translateY(0); }
}

/* 深色夜间模式：深邃月光夜海 */
[data-theme="dark"] .beach-ocean-bg {
    background: linear-gradient(180deg, 
        #030712 0%, 
        #0b1528 35%, 
        #0d233a 58%, 
        #133854 68%, 
        #1d4e6d 72%, 
        #182836 75%, 
        #0f172a 100%);
}

[data-theme="dark"] .beach-ocean-bg::before {
    background: rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .beach-ocean-bg::after {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-main-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    z-index: 2;
}

.avatar-wrapper img, .default-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.95);
    object-fit: cover;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.default-avatar {
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.site-title a {
    color: #ffffff;
    text-decoration: none;
}

/* 修改：站点简介单行延伸至侧边栏边缘才换行 */
.bio {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
    width: 100%;
    max-width: 100%;             /* 取消原本 90% 的宽度限制，允许一直延伸到最右侧 */
    margin: 0 auto 20px auto;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    white-space: nowrap;         /* 强制单行显示，禁止中间折行 */
    overflow: hidden;            /* 防止内容超出容器溢出 */
    text-overflow: ellipsis;     /* 如果文本极长超过侧边栏，末尾自动显示省略号（可选） */
    display: block;
}

.sidebar-bottom-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.sidebar-nav ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, 0.92) !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255,255,255,0.8);
}

/* 3. 海上角落位置拟真太阳/月亮 (稍微上移至 38%) */
.sea-corner-toggle-wrapper {
    position: absolute;
    top: 38%;
    right: 20px;
    z-index: 10;
}

.theme-toggle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.15) rotate(10deg);
}

/* 拟真光芒太阳 */
.sun-celestial {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, #fff7d6 0%, #ffb703 70%, #fb8500 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px #ffb703, 0 0 40px #fb8500;
    position: relative;
    transition: all 0.5s ease;
}

[data-theme="dark"] .sun-celestial {
    display: none;
}

/* 拟真纹理月球 */
.moon-celestial {
    display: none;
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #dcdcdc 50%, #999999 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), inset -3px -3px 8px rgba(0,0,0,0.4);
    position: relative;
}

[data-theme="dark"] .moon-celestial {
    display: block;
}

.moon-crater {
    position: absolute;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.3);
}

.crater1 { width: 8px; height: 8px; top: 6px; left: 8px; }
.crater2 { width: 6px; height: 6px; bottom: 8px; right: 8px; }
.crater3 { width: 4px; height: 4px; top: 16px; right: 12px; }

/* 4. 左侧 3D 桌面宠物 */
.sidebar-pet {
    position: absolute;
    bottom: 25px;
    left: 20px;
    width: 150px;
    height: 150px;
    cursor: pointer;
    user-select: none;
    z-index: 101;
    transition: left 0.8s cubic-bezier(0.25, 1, 0.5, 1), top 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.pet-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pet-canvas-3d {
    width: 150px;
    height: 150px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.pet-dialog {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.pet-dialog::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.85) transparent;
}

.sidebar-pet:hover .pet-dialog,
.sidebar-pet.show-dialog .pet-dialog {
    opacity: 1;
}

/* 下滑提示按钮默认在桌面端隐藏 */
.scroll-down-hint {
    display: none;
}

/* 5. 右侧内容主体区域 */
.content-right {
    width: 70%;
    margin-left: 30%;
    padding: 40px;
    min-width: 0;
    box-sizing: border-box;
}

.main-posts-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
}

.main-posts-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.post-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.excerpt {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.single-post-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.single-post-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.single-post-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    width: 100%;
    overflow-x: auto;
}

.entry-content p {
    margin-bottom: 1.5em;
}

.entry-content img, 
.entry-content video, 
.entry-content iframe {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
}

.entry-content pre, 
.entry-content code {
    max-width: 100%;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--bg-main);
    padding: 4px 8px;
    border-radius: 4px;
}

/* 分页 */
.pagination-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    margin: 0 4px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.pagination-wrapper .page-numbers:hover,
.pagination-wrapper .page-numbers.current {
    background: var(--accent-color);
    color: #ffffff;
}

/* 右侧吸顶固定小工具栏 */
.widget-sidebar-area {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 40px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.widget-sidebar-area .widget {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.widget-sidebar-area .widget-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.widget-sidebar-area p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 多国问候语漂浮特效 */
.click-greeting-text {
    position: fixed;
    z-index: 999999;
    font-weight: 600;
    font-size: 15px;
    pointer-events: none;
    user-select: none;
    animation: greetingFloatUp 1.2s ease-out forwards;
}

@keyframes greetingFloatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, 0) scale(0.9);
    }
    50% {
        opacity: 0.9;
        transform: translate(-50%, -25px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50px) scale(1);
    }
}

/* 6. 移动端/手机端响应式彻底修正 */
@media (max-width: 768px) {
    .site-wrapper {
        flex-direction: column;
    }

    /* 移动端首页左侧栏进站独占首屏全屏 (100vh) */
    body.home .sidebar-left,
    body.front-page .sidebar-left {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        position: relative;
        padding: 40px 20px 80px 20px;
    }

    /* 手机端首页下滑提示按钮 */
    body.home .scroll-down-hint,
    body.front-page .scroll-down-hint {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.95);
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        z-index: 102;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
        animation: hintBounce 2s infinite;
    }

    .scroll-arrow {
        width: 10px;
        height: 10px;
        border-right: 2px solid #ffffff;
        border-bottom: 2px solid #ffffff;
        transform: rotate(45deg);
        margin-top: 5px;
    }

    @keyframes hintBounce {
        0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
        40% { transform: translate(-50%, -8px); }
        60% { transform: translate(-50%, -4px); }
    }

    /* 进入文章或者页面时，移动端自动隐藏左侧栏，不再重复进入 */
    body.single .sidebar-left,
    body.page:not(.home) .sidebar-left {
        display: none !important;
    }

    body.single .content-right,
    body.page:not(.home) .content-right {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 20px 15px;
    }

    .sidebar-pet {
        width: 110px;
        height: 110px;
    }

    #pet-canvas-3d {
        width: 110px;
        height: 110px;
    }

    .content-right {
        width: 100%;
        margin-left: 0;
        padding: 20px 15px;
    }

    .main-posts-container {
        flex-direction: column;
    }

    .widget-sidebar-area {
        width: 100%;
        position: static;
        max-height: none;
    }

    .single-post-container {
        padding: 20px 16px;
    }
    
    .single-post-title {
        font-size: 22px;
    }
}