/* --- 字体定义 --- */
@font-face {
  font-family: 'CustomFont'; /* 简体中文/默认字体 */
  src: url('../fonts/ZCOOLXiaoWei-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'JapaneseFont'; /* 日语字体 */
  src: url('../fonts/NotoSerifJP-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'RussianFont'; /* 俄语字体 */
  src: url('../fonts/PlayfairDisplay-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
/* ★★★ 新增：繁體中文字体定义 ★★★ */
@font-face {
  font-family: 'TraditionalChineseFont';
  src: url('../fonts/NotoSerifHK-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}


/* --- 变量定义 --- */
:root {
    --bg-color: #f4f4f4;
    --text-color: #333;
    --card-bg-color: #fff;
    --header-bg-color: #333;
    --header-text-color: #fff;
    --link-color: #337ab7;
    --footer-text-color: #888;
    --shadow-color: rgba(0,0,0,0.1);
    --btn-bg-color: #e0e0e0;
    --btn-text-color: #333;
    --btn-border-color: #ccc;
}
body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg-color: #1e1e1e;
    --header-bg-color: #1e1e1e;
    --header-text-color: #e0e0e0;
    --link-color: #58a6ff;
    --footer-text-color: #aaa;
    --shadow-color: rgba(255,255,255,0.1);
    --btn-bg-color: #333;
    --btn-text-color: #e0e0e0;
    --btn-border-color: #555;
}

/* --- 通用样式 --- */
body {
    font-family: 'CustomFont', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--bg-color) url('../img/wallpaper.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}
body.no-scroll {
    overflow: hidden;
}

/* --- 特定语言字体应用 --- */
html[lang="ja"] body {
    font-family: 'JapaneseFont', 'CustomFont', sans-serif;
}
html[lang="ru"] body {
    font-family: 'RussianFont', 'CustomFont', serif;
}
/* ★★★ 新增：为繁體中文模式应用特定字体 ★★★ */
html[lang="zh-TW"] body {
    font-family: 'TraditionalChineseFont', 'CustomFont', serif;
}

.container {
    width: 90%;
    max-width: 960px;
    margin: auto;
    padding: 20px 0;
}
.main-content.container {
    padding-top: 40px;
}

/* --- Header --- */
header {
    background: var(--header-bg-color);
    color: var(--header-text-color);
    padding: 1rem 0;
    transition: background 0.3s;
}
header .container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 50px;
    padding-right: 50px;
    box-sizing: border-box;
}
header h1 {
    margin: 0;
    font-size: 1.5em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'JapaneseFont', sans-serif;
}

/* --- 主要内容区域 --- */
.main { padding: 20px; background: var(--card-bg-color); border-radius: 8px; box-shadow: 0 0 10px var(--shadow-color); transition: background 0.3s; }
.profile-image { display: block; margin: 20px auto; max-width: 100%; width: 250px; height: auto; border-radius: 15px; }
.about, .social-media { margin-bottom: 20px; }
.about h2, .social-media h2 { color: var(--text-color); text-align: center; }
.about p { text-align: center; }
.social-media ul { list-style: none; padding: 0; text-align: center; }
.social-media li { display: inline-block; margin: 0 15px; }
.social-media a { text-decoration: none; color: var(--link-color); font-size: 1.1em; transition: color 0.3s; }
.social-media a:hover { text-decoration: underline; }
footer { text-align: center; padding: 20px; margin-top: 30px; color: var(--footer-text-color); transition: color 0.3s; }

/*
================================
移动端: 导航栏和侧边栏样式
================================
*/
.menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
}
.menu-toggle svg { stroke: var(--header-text-color); }
#main-nav {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100dvh;
    background: var(--card-bg-color);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    padding: 60px 20px 20px 20px;
    box-sizing: border-box; 
    overflow-y: auto;
}
#main-nav.open { transform: translateX(0); }
.close-menu {
    display: block;
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
}
.nav-links { list-style: none; padding: 0; margin: 0; }
.nav-links a { text-decoration: none; color: var(--text-color); font-size: 1.2em; padding: 10px 0; display: block; }
.nav-links a:hover { color: var(--link-color); }
.controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--btn-border-color);
}
.control-btn {
    padding: 8px 12px;
    border: 1px solid var(--btn-border-color);
    background-color: var(--btn-bg-color);
    color: var(--btn-text-color);
    border-radius: 5px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 1000;
}
.overlay.active { display: block; }

/*
================================
桌面端样式 (屏幕宽度 > 768px)
================================
*/
@media (min-width: 768px) {
    header .container {
        justify-content: space-between;
        padding-left: 0;
        padding-right: 0;
    }
    header h1 {
        white-space: normal;
        overflow: visible;
    }
    .menu-toggle, .close-menu {
        display: none;
    }
    #main-nav {
        display: flex;
        position: static;
        width: auto;
        height: auto;
        background: none;
        transform: none;
        padding: 0;
        flex-direction: row;
        align-items: center;
        gap: 25px;
        z-index: auto;
        overflow-y: visible;
    }
    /* 横向排列 nav-links */
    .nav-links {
        display: flex;
        flex-direction: row;
        gap: 15px;
        align-items: center;
    }
    .nav-links li {
        display: block;
        margin: 0;
    }
    .nav-links a {
        padding: 0;
        color: var(--header-text-color);
        font-size: 1em;
    }
    .nav-links a:hover {
        text-decoration: underline;
    }
    .controls {
        flex-direction: row;
        gap: 10px;
        padding-top: 0;
        border-top: none;
        width: auto;
    }
    .control-btn {
        background-color: transparent;
        border-color: var(--header-text-color);
        color: var(--header-text-color);
        width: auto;
    }
}
/* ===============================
   最新视频模块样式
================================ */

/* 模块整体间距 */
.latest-video {
    margin-top: 40px;
    text-align: center;
}

/* 标题样式 */
.latest-video h2 {
    margin-bottom: 20px;
}

/* 视频自适应容器 */
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;      /* 最大宽度限制 */
    margin: 0 auto;
    padding-bottom: 56.25%; /* 16:9 比例 (9/16=0.5625) */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 0 12px var(--shadow-color);
}

/* 让 iframe 填满容器 */
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
/* ===============================
   推荐音乐模块样式
================================ */

.recommended-music {
    margin-top: 50px;
    text-align: center;
}

.recommended-music h2 {
    margin-bottom: 20px;
}

.music-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 12px var(--shadow-color);
}

/*修正音乐与视频居中问题*/

.latest-video, .recommended-music {
    max-width: 800px;
    margin: 40px auto 0 auto; /* 居中优化，建议顶部margin与原先一致 */
    text-align: center;
}
.latest-video { margin-top: 40px; }
.recommended-music { margin-top: 50px; }
.latest-video h2, .recommended-music h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.starlight {
    position: fixed;
    pointer-events: none;
    left: 0; top: 0;
    width: 16px; height: 16px;
    z-index: 9999;
    opacity: 0.9;
    /* 粒子动画：弹出到目标点 & 旋转 & 缩放 & 消失 */
    animation: starlight-fly 0.7s cubic-bezier(.2,1,.6,1) forwards;
    will-change: transform, opacity;
    transform: translate(-50%, -50%) scale(1) rotate(var(--star-rotate));
}
.starlight::before {
    content: '';
    display: block;
    width: 100%; height: 100%;
    background: none;
    /* 五角星，SVG mask；渐变色更可爱 */
    mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 50 50" width="16" height="16" xmlns="http://www.w3.org/2000/svg"><polygon fill="white" points="25,2 32,18 49,18 36,29 40,46 25,36 10,46 14,29 1,18 18,18"/></svg>') center/contain no-repeat;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 50 50" width="16" height="16" xmlns="http://www.w3.org/2000/svg"><polygon fill="white" points="25,2 32,18 49,18 36,29 40,46 25,36 10,46 14,29 1,18 18,18"/></svg>') center/contain no-repeat;
    background: radial-gradient(ellipse at 60% 30%, white 65%, var(--star-color, #ffe) 100%);
    box-shadow: 0 0 8px 2px #fff8;
}

/* 飞出动画 */
@keyframes starlight-fly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5) rotate(var(--star-rotate));
        filter: blur(0);
    }
    60% {
        opacity: 1;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
                    scale(1.1) rotate(var(--star-rotate));
        filter: blur(0.5px);
    }
    85% {
        opacity: 0.8;
        filter: blur(1px);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
                    scale(0.4) rotate(calc(var(--star-rotate) + 30deg));
        filter: blur(2px);
    }
}

header {
    position: sticky;      /* 关键属性 */
    top: 0;                /* 吸附于页面顶端 */
    z-index: 2000;         /* 确保在其他层之上 */
    background: var(--header-bg-color);
    color: var(--header-text-color);
    padding: 1rem 0;
    transition: background 0.3s;
    width: 100%;           /* 保证全宽 */
}