:root {
    --color-16: #7ADFFF;
    --color-20: #FFB347;
    --color-heart: #FF6B6B;
    --text-main: #FFFFFF;
    --text-sub: #E0E0E0;
    --bg-card: rgba(10, 10, 25, 0.9);
}

body {
    margin: 0;
    padding: 0;
    background-color: #030308;
    color: var(--text-main);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    width: 100vw;
}

/* --- 顶部标题：恢复覆盖在星图上方，不额外占高度 --- */
.main-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 60px 0 20px;
    z-index: 100;
    pointer-events: none;
}

.main-header h1 {
    font-size: 2.8rem;
    margin: 0;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(122, 223, 255, 0.7);
    letter-spacing: 2px;
}

.en-title {
    font-size: 1.2rem;
    display: block;
    font-weight: 300;
    opacity: 0.8;
    margin-top: 8px;
    font-style: italic;
    letter-spacing: 1px;
}

/* --- 星图 Canvas：恢复足够高度，避免被压扁 --- */
#stars-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

#stars-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

#meteor-message {
    /* 确保背景足够朦胧 */
    background: rgba(10, 14, 30, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 249, 227, 0.2); /* 淡金边框 */
    color: #FFFDF5;
    box-shadow: 0 0 40px rgba(255, 249, 227, 0.1);
    /* 稍微调慢消失动画 */
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* --- 恢复紧凑横向播放器样式 --- */
.music-player-container {
    position: relative;
    width: 100%;
    padding: 40px 0; /* 保持缩短后的组件间距 */
    display: flex;
    justify-content: center;
    background: #030308;
    z-index: 60;
}

.music-player {
    width: auto; /* 宽度随内容自适应 */
    min-width: 300px; /* 保证最小宽度 */
    max-width: 500px;
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(122, 223, 255, 0.2);
    border-radius: 50px;
    padding: 10px 25px;
    
    /* 核心修改：强制所有元素在同一行并居中对齐 */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 15px; /* 元素之间的间距 */
}

/* 让歌曲信息不再换行，并保持间距 */
.song-info {
    color: var(--text-sub);
    font-size: 14px;
    white-space: nowrap; /* 禁止歌名换行 */
    flex-grow: 1;
    text-align: left;
    /* --- 核心修复：拉开防误触距离，并增加一条微光分割线 --- */
    margin-left: 15px;
    padding-left: 18px;
    border-left: 1px solid rgba(122, 223, 255, 0.2);
    /* 恢复鼠标手势和点击交互 */
    cursor: pointer;
    pointer-events: auto;
    transition: color 0.3s;
}

.song-info:hover {
    color: #FFFFFF;
}

.music-player button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    display: flex;
    align-items: center;
}

.play-icon {
    color: var(--color-heart);
    font-size: 20px;
    text-shadow: 0 0 5px var(--color-heart);
}

/* --- 信息卡片：保持不动 --- */
.info-card {
    position: absolute; /* 核心修复：从 fixed 改为 absolute */
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid var(--color-heart);
    border-radius: 15px;
    backdrop-filter: blur(15px);
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.4);
    min-width: 320px;
    box-sizing: border-box;
}

.info-card.hidden {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
}

.astro-img-container {
    width: 90px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 18px;
    flex-shrink: 0;
}

.astro-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-text-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.info-card p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-main);
}

.info-card .mode-text {
    color: var(--text-sub);
}

.info-card .level-text {
    font-weight: bold;
    font-size: 16px;
    margin: 6px 0 !important;
}

.info-card .name-text {
    font-size: 18px;
    font-weight: bold;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* ============================================================
   底部信件区：紧凑提亮版
   ============================================================ */

.letter-footer {
    position: relative;
    width: 100%;
    padding: 0px 0 80px; /* 底部留白 */
    margin-top: 0;
    display: flex;
    justify-content: center;
    background: #030308;
    z-index: 50;
}

.letter-content {
    position: relative;
    overflow: hidden; /* 必须保留，否则背景图会溢出 */
    max-width: 800px;
    width: 92%;
    padding: 40px 35px;
    
    background: rgba(15, 15, 30, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(122, 223, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6; /* 建议保持1.6，防止文字太挤 */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 背景图片层：提亮至 0.6 */
.letter-content::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("letter_background.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6; /* 提高不透明度，让图片更亮更清晰 */
}

/* 提高文字可读性的遮罩层：稍微调淡，配合背景提亮 */
.letter-content::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(8, 10, 24, 0.5); /* 调淡遮罩，让底图透出来 */
}

/* 让正文内容浮到最上层 */
.letter-content > * {
    position: relative;
    z-index: 2;
}

.letter-content h2 {
    text-align: center;
    color: var(--text-main);
    margin-bottom: 30px; /* 缩小标题下方间距 */
    font-size: 1.8rem;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.35);
}

/* 段间距：极致压缩 */
.letter-section {
    width: 100%;
    margin-bottom: 10px; /* 极小的段间距 */
    text-align: center;
}

.letter-section p {
    margin-bottom: 10px;  /* 句子之间几乎紧贴 */
    text-align: center;
}

/* 分隔线间距 */
.letter-divider {
    text-align: center;
    color: rgba(122, 223, 255, 0.3);
    margin: 2px 0;      /* 缩小分隔线占位高度 */
    font-weight: 200;
}

/* --- 感谢信视觉效果深度优化版 --- */

/* 1. 蓝色高亮 (16级)：提高对比度，去掉模糊的发光，改用清晰的深天蓝 */
.highlight-soft {
    color: #00EBFF; /* 极高饱和度的荧光蓝，确保在亮底上清晰 */
    font-weight: 700;
    /* 去掉大面积模糊，改为紧凑的边缘描边感，提升锐度 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    padding: 0 2px;
}

/* 2. 金色高亮 (20级)：保持核心地位，增加文字力量感 */
.highlight-gold {
    color: #FFB347;
    font-weight: 800;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.03em;
}

/* 3. 红色金句：使用淡淡的红色胶囊底色，与爱心颜色呼应 */
.highlight-white {
    /* 将文字颜色也微调为极淡的红，使其更和谐 */
    color: #FFF0F0;
    font-weight: 600;
    /* 核心修改：使用淡淡的半透明红色背景 */
    background: rgba(255, 107, 107, 0.2); /* 使用淡化的爱心红 */
    padding: 2px 8px; /* 稍微增加一点内边距，让胶囊更好看 */
    border-radius: 6px; /* 稍微圆润一点 */
    border-bottom: none;
    /* 调整阴影颜色，配合红色主题 */
    text-shadow: 1px 1px 2px rgba(139, 0, 0, 0.3);
    display: inline-block;
    line-height: 1.3;      /* 配合 padding 微调 */
    margin: 0 2px; /* 增加一点左右外边距，防止文字拥挤 */
}

/* 落款区 */
.letter-footer-sign {
    margin-top: 30px;     /* 缩小落款与正文的距离 */
    width: 100%;
    text-align: center;
}

.signature {
    font-size: 1.5rem;
    color: #FFFFFF;
    margin-bottom: 2px !important;
    text-align: center;
}

.date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* --- 3. 移动端同步缩短 --- */
@media (max-width: 768px) {
    .music-player-container {
        padding: 30px 0; /* 手机端再紧凑一点 */
    }
    .letter-footer {
        padding-bottom: 50px;
    }
}

/* ============================================================
   隐藏式玻璃态歌单面板 (优化：悬停显示版)
   ============================================================ */

/* 1. 为播放器容器增加悬停检测和定位基准 */
.music-player-container {
    /* ... 保持原有样式 ... */
    position: relative; /* 确保歌单以此为基准定位 */
}

/* 2. 歌单面板基础样式 */
.playlist-panel {
    position: absolute;
    bottom: 75px; /* 悬浮在播放器正上方，留一点间距 */
    left: 50%;
    transform: translateX(-50%) translateY(10px); /* 默认向下偏移 10px，用于丝滑过渡 */
    width: 280px; /* 稍微加宽一点，视觉更舒展 */
    max-height: 280px; /* 限制高度，超出可滚动 */
    
    /* 玻璃态效果 */
    background: rgba(10, 10, 25, 0.75); /* 稍微加深一点背景，对比更清晰 */
    backdrop-filter: blur(25px); /* 增加模糊度 */
    border: 1px solid rgba(122, 223, 255, 0.25);
    border-radius: 18px; /* 稍微圆润一点 */
    
    overflow-y: auto;
    z-index: 100;
    
    /* === 核心修改：状态与过渡 === */
    opacity: 0; /* 默认完全透明 */
    pointer-events: none; /* 默认不可交互，防止挡住星星 */
    transition: opacity 0.4s ease, transform 0.4s ease; /* 增加更优雅的过渡效果 */
    
    padding: 12px 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
}

/* --- 核心修复：改由 JS 精准控制的显示状态 --- */
.playlist-panel.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* 列表样式优化 */
.playlist-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.playlist-panel li {
    padding: 12px 25px; /* 增加左右内边距 */
    color: rgba(255, 255, 255, 0.75); /* 文字默认稍微淡一点 */
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    white-space: nowrap; /* 禁止歌名换行 */
    overflow: hidden; /* 超出隐藏 */
    text-overflow: ellipsis; /* 显示省略号 */
}

.playlist-panel li:hover {
    background: rgba(122, 223, 255, 0.15);
    color: #fff;
}

/* 当前正在播放的歌曲高亮为爱心红 */
.playlist-panel li.active {
    color: var(--color-heart);
    font-weight: bold;
    background: rgba(255, 107, 107, 0.1);
}

/* 优化的半透明滚动条 */
.playlist-panel::-webkit-scrollbar {
    width: 4px;
}
.playlist-panel::-webkit-scrollbar-thumb {
    background: rgba(122, 223, 255, 0.4);
    border-radius: 4px;
}
