/* ====================
   全局基础样式
==================== */
/* ====================
   全局基础样式
==================== */
:root {
    --primary-color: #3b82f6;
    /* 主色调 - 蓝 */
    --primary-light: #dbeafe;
    --primary-dark: #1e40af;

    --secondary-bg: #fdfcfb;
    /* 导航栏背景 */
    --card-bg: #fff;
    /* 卡片背景 */
    --border-color: #e0e5ec;
    /* 边框颜色 */
    --hover-bg: #e0e5ec;
    /* 悬停/激活背景 */
    --text-color: #333;
    /* 默认文字颜色 */
    --light-gray: #f7f9fb;
    /* 页面背景 */
    --footer-bg: #f1f3f5;
    --footer-text: #555;
    --meta-bg: rgba(255, 255, 255, 0.2);
    --meta-radius: 20px;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", sans-serif;
    color: var(--text-color);
}

li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ====================
   导航栏样式（.nav）
==================== */
.nav {
    background-color: #fdfcfb;
    /* 浅米白 */
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.ul {
    display: flex;
    padding: 0;
    margin: 0;
    flex-direction: row;
    height: 100%;
    width: 100%;
    list-style: none;
    background-color: #fdfcfb;
}

.nav-li {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 0 auto;
    min-width: 80px;
    white-space: nowrap;
    color: #3a3a3a;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 0 10px;
}

.nav-li:hover,
.active {
    background-color: #e0e5ec;
    /* 灰蓝色悬停和激活状态 */
    color: #3a3a3a;
    transform: translateY(-2px);
}

.active {
    font-weight: bold;
}


/* ====================
   主要内容区域（.main）
==================== */
.main {
    height: auto;
    width: auto;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    background-color: #f7f9fb;
    /* 米灰背景 */
}

.main-one,
.main-two {
    height: 100%;
    background-color: #f7f9fb;
}

.main-one {
    width: 55%;
    text-align: center;
}

.main-two {
    width: 25%;
    /* display: none; */
}

.main-title,
.hot-title {
    margin: 0px 5px;
    background-color: #4a5568;
    /* 深灰蓝 */
    color: white;
    border-radius: 5px;
}

.main-title h2,
.hot-title h2 {
    display: inline-block;
    margin-left: 10px;
}

/* ====================
   文章列表样式（.content）
==================== */
.content-ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px;
    overflow-y: visible;
    /* 改为 visible 或直接删除 */
    height: auto;
    /* 不设固定高度，随内容自适应 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee5f0;
    border-radius: 10px;
}

.content {
    height: 200px;
    width: 100%;
    display: flex;
    margin-left: -20px;
    background-color: #fff;
    align-items: center;
    border: 1px solid #e0e5ec;
    border-radius: 6px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content:hover {
    cursor: pointer;
    transform: scale(1.01);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.content-img-a {
    display: flex;
    align-items: center;
    height: 100%;
    width: 35%;
}

.content-img {
    height: 80%;
    width: 100%;
    margin-right: 5px;
    border-radius: 4px;
    background-color: #dbe1e8;
    object-fit: cover;
    /* 浅灰蓝 */
}

.content-div {
    display: flex;
    height: 80%;
    width: 65%;
    flex-direction: column;
    margin-left: 20px;
    background-color: #fff;
    padding: 10px;
}

.content-intro {
    height: 50%;
    width: 100%;
    background-color: transparent;
    color: #666;
    font-size: 0.95em;
}

.content-classify {
    display: flex;
    gap: 20px;
    font-size: 0.85em;
    color: #777777;
}

a {
    margin: 0;
    padding: 0;
    font-size: 25px;
    color: #333;
    text-decoration: none;
}

/* 标题：单行超出省略 */
.content-div h2 {
    margin: 0;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 简介：最多显示两行，超出隐藏 */
.content-intro {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 控制最多显示几行 */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* 分类标签：单行超出隐藏 */
.content-classify span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    /* 可选：限制最大宽度 */
}

.content-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    cursor: pointer;
}

/* ====================
   热门文章区域（.hot）
==================== */
.hot-ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px;
    height: auto;
    overflow-y: visible;
    border-radius: 5px;
    border: 1px solid #dee5f0;
    border-radius: 10px;
}

.hot {
    height: 80px;
    width: 100%;
    background: #dfe2e6;
    /* 浅灰蓝 */
    color: #333;
    margin-left: -25px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    border-radius: 4px;
}

.hot:hover {
    cursor: pointer;
    transform: scale(1.01);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.hot-img-a {
    display: flex;
    align-items: center;
    height: 100%;
    width: 30%;
}

.hot-img {
    height: 80%;
    width: 100%;
    margin-right: 5px;
    border-radius: 4px;
    background-color: #dbe1e8;
    object-fit: cover;
    /* 浅灰蓝 */
}

.hot-div {
    height: auto;
    width: 70%;
    display: flex;
    flex-direction: column;
    margin-left: 20px;
    background-color: #dbe1e8;
}

.hot-div a {
    color: #333;
    font-size: 18px;
    text-overflow: ellipsis;
    overflow: hidden;
    /* 单行超出隐藏 */
    margin: 0;
    white-space: nowrap;
}



/* ====================
   页脚样式（.footer）
==================== */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 20px;
    text-align: center;
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
}

.footer-div {
    display: flex;
    width: 80%;
    justify-content: space-between;
    background: #f1f3f5;
    font-size: 0.9em;
}


/* ====================
   页面切换相关
==================== */
.page {
    display: none;
    /* padding: 10px; */
}

.page.active {
    display: flex;
}


/* ====================
   响应式导航栏（移动端适配）
==================== */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 20px;
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 20;
}



/* ====================
   分页样式（.pagination）
==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    /* 支持移动端换行 */
    padding: 10px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background-color: #f1f3f5;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background-color: #dbeafe;
    color: #1e40af;
}

.pagination-btn.active {
    background-color: #3b82f6;
    color: white;
    font-weight: bold;
    border-color: #3b82f6;
}

/* 跳转输入框 */
.pagination-input {
    width: 60px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.pagination-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* .pagination-ellipsis {
    padding: 8px 10px;
    font-size: 14px;
    color: #666;
    user-select: none;
} */

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 8px 10px;
    color: #666;
    user-select: none;
}

.pagination-btn.active {
    background-color: #3b82f6;
    color: white;
    font-weight: bold;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .ul {
        flex-direction: column;
        position: absolute;
        top: 50px;
        left: -200px;
        width: auto;
        height: calc(100vh - 50px);
        background-color: #f8f9fa;
        z-index: 10;
        display: flex;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    }

    .ul.active {
        left: 0;
    }

    .nav-li {
        height: 45px;
        border-radius: 0;
    }

    .nav-li:hover,
    .nav-li.active {
        background-color: #e0e5ec;
        color: #000;
    }

    main,
    footer {
        transition: transform 0.3s ease;
    }

    .ul.active~main,
    .ul.active~footer {
        transform: translateX(200px);
    }

    /* ========== 新增：移动端隐藏热门文章并扩展主内容宽度 ========== */
    .main-two {
        display: none !important;
        /* 隐藏热门文章区域 */
    }

    .main-one {
        width: 100% !important;
        /* 主内容占满全屏 */
        margin: 0 10px;
        /* 可选：增加一些边距 */
    }

    .content {
        height: 125px;
        width: 100%;
        display: flex;
        margin-left: -20px;
        background-color: #fff;
        align-items: center;
        border: 1px solid #e0e5ec;
        border-radius: 6px;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
}

#search-input {
    width: 60%;
    padding: 10px 15px;
    font-size: 1em;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 20px 0;
    /* transition: all 0.2s ease; */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#search-input:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.pagination-btn {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    border: 1px solid var(--border-color);
}

.pagination-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.pagination-btn.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border-color: var(--primary-color);
}

/* ====================
   音乐页面样式（.music）
==================== */
.music-div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 垂直居中 */
    text-align: center;
    width: 80%;
    margin: 0 auto;
    /* 可选：让容器整体居中 */
    padding-bottom: 30px;
}

.music-title {
    display: flex;
    font-size: 1.5em;
}

.music-ul {
    display: flex;
    flex-wrap: wrap;
    /* width: 100%; */
    justify-content: space-around;
    text-align: center;
    gap: 20px;
    background-color: #f7f9fb;
    padding: 20px;
    border-radius: 10px;
}


.music-li {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background-color: #e0e5ec;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.music-li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.music-div-span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2px 6px;
    font-size: 0.6em;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    text-align: center;
    border-radius: 0 0 10px 10px;
    /* 多行省略样式 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 最多显示两行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* text-overflow: ellipsis; */
}

.music-div-span:hover {
    background: rgba(0, 0, 0, 0.7);
}

.music-li:hover {
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 0 10px 4px rgba(224, 239, 255, 0.4),
        0 0 8px 1px rgba(59, 130, 246, 0.3);
    background: #ffffff10;
    border-radius: 12px;
    animation: glowPulse 1.5s infinite;
}


.upload-music {
    margin: 20px;
    padding: 20px;
    border: 2px dashed #dbeafe;
    border-radius: 12px;
    background-color: #f7f9fb;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-music:hover {
    background-color: #e0e5ec;
    border-color: #3b82f6;
}

.upload-music input[type="file"] {
    display: none;
}

.upload-music label {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3b82f6;
    color: white;
    font-size: 0.9em;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-music label:hover {
    background-color: #1e40af;
}

#coverPreview {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

#coverPreview img {
    display: flex;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

#coverPreview img:hover {
    transform: scale(1.1);
}

.audio-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    height: 80px;
    background: #f7f9fb;
    border-radius: 10px;
}

#currentCover {
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.music-li:hover #currentCover {
    transform: scale(1.1);
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background-color: #f1f3f5;
    border-radius: 10px;
}

.player-left,
.player-center,
.player-right {
    display: flex;
    align-items: center;
}

.player-center {
    flex: 1;
    gap: 15px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.fas.fa-pause {
    display: none;
}

.controls button {
    background: none;
    border: none;
    color: #333;
    font-size: 1.2em;
    cursor: pointer;
    transition: color 0.3s ease;
}

.controls button:hover {
    color: #ff4d4d;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

#currentTime,
#duration {
    color: #aaa;
    font-size: 0.9em;
}

#progressBar {
    width: 100%;
    height: 4px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
}

#progressBar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: #ff4d4d;
    border-radius: 50%;
    cursor: pointer;
}

.player-right button {
    background: none;
    border: none;
    color: #333;
    font-size: 1.2em;
    cursor: pointer;
    transition: color 0.3s ease;
}

.player-right button:hover {
    color: #ff4d4d;
}

.volume-container {
    padding: 10px;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.volume-slider-wrapper {
    position: absolute;
    bottom: 30px;
    /* 调整位置 */
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 8px;
    display: none;
    justify-content: center;
    align-items: center;
}

.volume-slider-wrapper input[type="range"] {
    -webkit-appearance: slider-vertical;
    /* 垂直方向 */
    appearance: slider-vertical;
    width: 6px;
    height: 100px;
    margin: auto;
    background: transparent;
    writing-mode: bt-lr;
    /* IE */
    -webkit-writing-mode: horizontal-tb;
    -webkit-appearance: slider-vertical;
}

/* 鼠标悬停时显示音量条 */
.volume-container:hover .volume-slider-wrapper {
    display: flex;
}