body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    /* 核心改动 1: 设置 body 为 Flex 容器，实现垂直居中 */
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: center;    /* 垂直居中 */
    min-height: 100vh;      /* 确保高度占满整个视口 */
    /* ------------------------------------- */

    overflow-y: auto; /* 允许垂直滚动，以防内容溢出 */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    background: url('https://r2.219921.xyz/images/10c828ee400617c10aaae4edd96457833093457e.jpg') no-repeat center center/cover;
    background-attachment: fixed;
}

.background-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.4), rgba(28, 28, 28, 0.6));
    z-index: -1;
    animation: fadeIn 1.5s ease-in-out;
}

/* --- V2 布局容器 --- */
.page-container {
    display: flex;
    gap: 40px;

    /* 居中和宽度限制 */
    width: 90%;
    max-width: 1400px;
    /* 移除 margin: 0 auto; 和 padding: 5vh 0;
       因为我们通过 body 的 flex 属性来控制居中 */

    box-sizing: border-box;
    /* 避免内容溢出 body */
    margin: 40px 0;
    padding: 20px 0;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.left-column {
    flex-basis: 320px;
    flex-shrink: 0;
}

.right-column {
    flex: 1;
    min-width: 0;
}

/* --- V2 样式微调 --- */
.glass {
    background: rgba(20, 20, 30, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.2);
    transition: background 0.4s ease;
}

.glass:hover {
    background: rgba(30, 30, 40, 0.5);
}

.logo-widget {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    color: #fff;
    font-size: 2.2rem;
    font-weight: 600;
}

.logo-widget img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.intro-widget {
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.social-widget {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    padding: 0 10px;
}

.social-icon {
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

.quote-widget {
    padding: 20px;
}

.time-weather-widget {
    padding: 20px;
}

.nav-widget {
    padding: 20px;
}
.nav-widget h3 {
    margin: 0 0 20px 5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#clock {
    font-size: 3.5rem;
    font-weight: 400;
    margin-bottom: 0;
}

#date {
    font-size: 1.1rem;
    color: #e0e0e0;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 10px;
}

#weather {
    font-size: 1rem;
    margin-top: 10px;
    color: #ddd;
}

#quote {
    font-size: 1.1rem;
    margin: 0;
    min-height: 20px;
}

/* --- 导航卡片 (Grid) --- */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.card i {
    font-size: 1.5rem;
    opacity: 0.8;
}

.card:hover {
    background-color: rgba(40, 40, 50, 0.5);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ------------------------------------------- */
/* --- 核心改动 2: 响应式设计 (手机屏幕) --- */
/* ------------------------------------------- */
@media screen and (max-width: 768px) {

    /* 手机模式下，body 不再需要居中，让内容从顶部开始 */
    body {
        align-items: flex-start;
    }

    /* 容器不再左右分栏，改为上下堆叠 */
    .page-container {
        flex-direction: column; /* 左右分栏改为上下堆叠 */
        gap: 30px; /* 元素间距增大 */
        padding: 30px 20px; /* 手机边缘内边距 */
        width: 100%; /* 占满手机宽度 */
        margin: 0; /* 清除居中留下的外边距 */
    }

    /* 左侧栏不再固定宽度，占满父容器 */
    .left-column {
        flex-basis: auto;
        flex-shrink: 1;
        width: 100%;
    }

    /* 社交图标左对齐，并占用更多空间 */
    .social-widget {
        justify-content: space-between;
        padding: 0;
        gap: 10px;
        flex-wrap: wrap; /* 允许图标换行 */
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }

    /* 导航卡片改为 2 列 */
    .nav-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* 时钟字体缩小 */
    #clock {
        font-size: 3rem;
    }

    /* 隐藏浮动音乐按钮，因为播放器本身可能挡住内容 */
    #floating-music-btn {
        display: none !important;
    }

/* 音乐播放器在手机上改为底部抽屉式，方便操作 */
    #music-player {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0; /* 确保从左到右占满 */
        width: 100%;

        /* 核心改动：移除 height: 100% */
        /* height: 100%; */

        /* 设置一个最大高度，例如 85% 视口高度 */
        max-height: 80vh;

        /* 优化样式：添加顶部圆角，使其更像抽屉 */
        border-radius: 12px 12px 0 0;

        overflow-y: auto; /* 当内容（特别是播放列表）过多时允许滚动 */
        box-sizing: border-box; /* 确保 padding 不会撑开宽度 */
    }
}


/* ---- Music Player (保持不变) ---- */

#music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    z-index: 100;
    color: #fff;
    padding: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.player-header {
    text-align: right;
}

#minimize-player {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    margin-left: 8px;
    cursor: pointer;
}

.player-body {
    text-align: center;
}

#album-art {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 10px auto;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

#song-title {
    font-size: 1.2rem;
    margin: 8px 0 3px;
}

#artist-name {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 10px;
}

.progress-container {
    width: 100%;
    margin-bottom: 10px;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    height: 6px;
}

#progress {
    background: #fff;
    border-radius: 5px;
    height: 100%;
    width: 0%;
}

.time-stamps {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 15px 0;
}

.controls button {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

#play-pause-btn {
    font-size: 28px;
}

.playlist-container {
    margin-top: 10px;
    max-height: 120px;
    overflow-y: auto;
}

#playlist {
    list-style: none;
    padding: 0;
    text-align: left;
}

#playlist li {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
}

#playlist li:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#playlist li.active {
    background-color: rgba(138, 43, 226, 0.5);
}

#floating-music-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    line-height: 55px;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 99;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

#floating-music-btn:hover {
    transform: scale(1.1);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.playing #floating-music-btn {
    animation: rotate 4s linear infinite;
}

/* 播放模式按钮 tooltip */
.mode-btn {
    position: relative;
}

.mode-btn .tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.65);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.mode-btn:hover .tooltip {
    opacity: 1;
}

.mode-btn i {
    font-size: 22px;
}
.controls button i {
    font-size: 24px;
}

.progress-bar {
    cursor: pointer;
    position: relative;
}

/* 黑胶旋转动画 */
@keyframes spin-vinyl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.playing #album-art {
    animation: spin-vinyl 6s linear infinite;
}

#album-art {
    transition: animation 0.3s ease;
}

#album-art {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#album-art:hover {
    transform: scale(1.10); /* 放大 */
    box-shadow: 0 0 20px rgba(255,255,255,0.4); /* 发光边缘 */
}
/* ===== TAB 样式 ===== */
.tab-header{
    display:flex;
    justify-content:space-around;
    margin-bottom:10px;
}
.tab-btn{
    padding:6px 10px;
    cursor:pointer;
    border-radius:6px;
}
.tab-btn.active{
    background:#ff4da6;
}

/* 每首歌布局改成左右排列 */
#playlist li{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:6px;
}

/* 歌名过长自动省略不会挤压 ❤️ */
#playlist li span.title{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    flex:1;
}

/* ❤️ 按钮固定不伸缩 */
#playlist li .like-btn{
    flex-shrink:0;
    font-size: 16px;
    margin-left:8px;
}
