/* --- 颜色变量定义 (深夜星空配色方案) --- */
:root {
    /* 背景色 */
    --background-dark: #0B1226; /* 深邃的藏蓝夜空 */
    --background-overlay-start: rgba(11, 18, 38, 1);
    --background-overlay-end: rgba(11, 18, 38, 0.5);
    --background-interactive-hover: #19214D; /* 交互悬停时的深靛蓝 */

    /* 文字颜色 */
    --text-primary: #EAEFFB; /* 柔和的星光白，避免刺眼 */
    --text-secondary: #8A95B5; /* 冷却的灰色，用于次要信息 */
    --text-title: #A2A8E2; /* 标题使用淡雅的薰衣草紫 */

    /* 主要强调色 (青色/紫色系) */
    --accent-primary: #68D8D6; /* 明亮的星云青色，用于按钮和边框 */
    --accent-primary-rgb: 104, 216, 214; /* 用于 rgba 透明色 */
    --accent-secondary: #F9EFAF; /* 遥远星辰的淡黄色，用于悬停效果 */
    --accent-highlight: #A2A8E2; /* 柔和的辉光紫 */
    --accent-highlight-gradient: rgba(162, 168, 226, 0.25);
}

@font-face {
    font-family: 'LXGWWenKai';
    src: url('../fonts/LXGWWenKai-Light.woff2');
    font-display: swap;
}

@font-face {
    font-family: 'minzhao';
    src: url('../fonts/MS明朝.woff2');
    font-display: swap;
}

/* --- GLOBAL & PAGE SETUP --- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    color: var(--text-primary);
    font-family: 'LXGWWenKai', sans-serif;
}

body.home-page {
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.background {
    background-image: linear-gradient(var(--background-overlay-start), var(--background-overlay-end)), url('../media/3_hoshi.jpg');
    background-color: var(--background-dark);
    background-size: cover;
    background-position: center center;
    position: fixed;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    z-index: -1;
    transition: transform 0.2s ease-out;
}

/* --- NAVIGATION BAR --- */
nav {
    width: 100%;
    background-color: rgba(var(--accent-primary-rgb), 0.1);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(var(--accent-primary-rgb), 0.4);
    position: relative; /* 保持 relative，为绝对定位的子元素提供基准 */
    z-index: 100;
    display: flex;
    justify-content: center; /* 改为 center */
    align-items: center;
    padding: 7px 20px;
    box-sizing: border-box;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav li {
    flex: 0 0 15%;
    text-align: center;
    white-space: nowrap; /* 添加这一行 */
}

nav li a {
    display: block;
    color: var(--text-primary);
    text-align: center;
    padding: 16px 18px;
    text-decoration: none;
    font-size: 1.2em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-secondary);
}

/* --- Language Switcher Dropdown --- */
.language-switcher {
    position: absolute; /* 改为绝对定位 */
    right: 20px; /* 定位到右边，20px与nav的padding一致 */
    top: 50%; /* 垂直居中 */
    transform: translateY(-50%); /* 精准垂直居中 */
}

.language-button {
    background-color: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 1.5em; /* 调整图标大小 */
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.language-button:hover {
    border-color: var(--accent-primary);
    background-color: var(--background-interactive-hover);
}

.language-options {
    display: none; /* 默认隐藏 */
    position: absolute;
    top: 120%; /* 定位在按钮下方，留出一些间隙 */
    right: 0;
    background-color: var(--background-dark);
    border: 1px solid var(--accent-primary);
    border-radius: 5px;
    overflow: hidden; /* 确保内部元素的圆角效果 */
    min-width: 100px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 110;
}

.language-options.show {
    display: block; /* 用于JS控制显示 */
}

.language-options a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

.language-options a:hover {
    background-color: var(--background-interactive-hover);
    color: var(--accent-secondary);
}

/* --- MAIN CONTENT & COLUMNS --- */
.main-content {
    flex-grow: 1;
    display: flex;
    width: 100%;
}

.content-column {
    flex: 1;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: background-color 0.5s ease;
}

.column-content {
    opacity: 0.5;
    transition: opacity 0.5s ease;
}

.content-column:hover .column-content {
    opacity: 1;
}

.content-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-highlight-gradient) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 0;
}

.content-column:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.column-content > * {
    position: relative;
    z-index: 1;
}

/* --- LIVE2D STYLES (SIMPLIFIED) --- */
.live2d-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 300px;
    height: 400px;
    z-index: 1000;
    pointer-events: none; 
}

#live2d {
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: transparent;
    z-index: 1000;
    object-fit: contain;
}

/* --- TEXT AND BUTTON STYLES --- */
h2 {
    font-family: 'LXGWWenKai', sans-serif;
    color: var(--text-title);
    font-size: 3vw;
    margin: 0 0 15px 0;
}

p {
    font-size: 1.1em;
    line-height: 1.5;
    max-width: 80%;
    margin: 0 auto 20px auto;
    color: var(--text-secondary);
}

.pxiao {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.menu-button {
    display: block;
    width: 80%;
    max-width: 250px;
    margin: 10px auto;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    font-size: 1em;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

.menu-button:hover {
    background: var(--accent-primary);
    border-color: var(--accent-secondary);
    color: var(--background-dark);
    transform: scale(1.05);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
}

.social-links a {
    display: block;
    transition: transform 0.2s ease;
}

.social-links img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.social-links a:hover {
    transform: scale(1.15);
}

/* --- 'MY WORKS' PAGE SPECIFIC STYLES --- */
body.works-page {
    overflow-y: auto;
}

.works-container {
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.works-header {
    text-align: center;
    margin-bottom: 40px;
}

.works-header h1 {
    font-family: 'minzhao', sans-serif;
    font-size: 60px;
    color: var(--text-primary);
}

.back-button {
    display: inline-block;
    margin-top: 20px;
}

.project-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
    justify-content: center;
}

.project {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    border: 2px solid var(--accent-highlight);
    transition: transform 0.3s ease;
}

.project:hover {
    transform: scale(1.03);
}

.project::before {
    content: attr(data-text);
    position: absolute;
    color: var(--text-primary);
    font-size: 24px;
    bottom: 0;
    left: 0;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    width: 100%;
    box-sizing: border-box;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease-in-out;
}

.project-overlay iframe,
.project-overlay blockquote {
    width: 95%;
    height: 95%;
}

.project:hover .project-overlay {
    opacity: 1;
}

.roundbutton {
    background: transparent;
    color: var(--text-primary);
    padding: 10px 25px;
    border: 2px solid var(--text-primary);
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.roundbutton:hover {
    background-color: var(--background-interactive-hover);
    border-color: var(--accent-secondary);
}

.visitors-container{
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: flex-end;   /* 垂直方向上，对齐到末端（底部） */
    padding: 20px;
}
/* --- RESPONSIVE DESIGN --- */
@media screen and (max-width: 768px) {
    .main-content {
        flex-direction: column;
        overflow-y: auto;
        height: calc(100vh - 50px);
    }

    body.home-page {
        overflow: visible;
    }

    nav ul {
        height: 50px;
    }

    nav li a {
        padding: 15px 5px;
        font-size: 14px;
    }
    
    .content-column {
        min-height: 50vh;
        padding: 40px 10px;
    }

    .content-column .column-content,
    .content-column:hover .column-content {
        opacity: 1;
    }

    .content-column::before {
        display: none;
    }
    
    h2 {
        font-size: 6vw;
    }

    .menu-button {
        padding: 15px 25px; 
        font-size: 1.1em;
    }

    .works-header h1 {
        font-size: 36px;
    }

    .project-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
	
    .live2d-container {
        width: 150px;
        height: 200px;
    }
}