/* style.css - 二次元导航模板样式 */

/* ===== 全局重置 & 字体 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: linear-gradient(145deg, #fff4f9 0%, #e7f0ff 100%);
    color: #2d2d4a;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 点缀小星星 (二次元氛围) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 30% 40%, rgba(255, 230, 240, 0.5) 0%, transparent 20%),
                      radial-gradient(circle at 80% 70%, rgba(200, 220, 255, 0.6) 0%, transparent 25%),
                      radial-gradient(circle at 10% 80%, #ffe6f0 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
}

/* ===== 头部 ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 1.7rem;
    font-weight: 600;
    color: #ff7b9c;
    text-shadow: 2px 2px 0 #ffe0e8;
    letter-spacing: 1px;
}

.logo i {
    margin-right: 8px;
    color: #aa7bc7;
    font-size: 2rem;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #4a4a6a;
    font-weight: 500;
    transition: 0.3s;
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
}

.nav-links a i {
    margin-right: 5px;
    font-size: 0.9rem;
    color: #aa7bc7;
}

.nav-links a:hover {
    color: #ff7b9c;
    border-bottom-color: #ff9eb5;
}

/* header右侧区域：头像和播放器图标 */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right .avatar-link {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(255,180,200,0.4);
    transition: transform 0.2s;
}

.header-right .avatar-link:hover {
    transform: scale(1.1);
}

.header-right .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 英雄区 ===== */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.8rem;
    background: linear-gradient(135deg, #b983ff, #ff7b9c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.2rem;
    color: #5a5a7a;
    margin-bottom: 2.2rem;
    opacity: 0.9;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 60px;
    padding: 0.2rem 0.2rem 0.2rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(255, 190, 200, 0.3);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 0.5rem;
    font-size: 1rem;
    outline: none;
    color: #333;
}

.search-input::placeholder {
    color: #aaaac0;
    font-style: italic;
}

.search-btn {
    background: linear-gradient(145deg, #ff9eb5, #ff7b9c);
    border: none;
    color: white;
    padding: 0.8rem 2.2rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px #ffb6c1;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.search-btn:hover {
    transform: scale(1.03);
    background: linear-gradient(145deg, #ff86ad, #ff6990);
}

.random-quote {
    margin-top: 1.8rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    display: inline-block;
    color: #4f4f7a;
    font-size: 1rem;
    border: 1px dashed #ffb8d0;
    max-width: 90%;
}

.random-quote i {
    color: #ff9eb5;
    margin: 0 8px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===== 分类通用 ===== */
.category {
    max-width: 1300px;
    margin: 3rem auto;
    padding: 0 5%;
}

.category-title {
    font-size: 1.8rem;
    margin-bottom: 1.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #4d3b6e;
    border-left: 6px solid #ff9eb5;
    padding-left: 1rem;
    text-shadow: 2px 2px 4px rgba(255, 220, 240, 0.7);
}

.category-title i {
    color: #b27bc7;
    font-size: 2rem;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.8rem;
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 1.8rem 1.2rem 1.2rem;
    text-align: center;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 15px 30px -8px rgba(210, 160, 200, 0.25);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 40px -6px #ffb8c9;
    border-color: #fff2f5;
}

.card-icon {
    font-size: 3.2rem;
    margin-bottom: 0.8rem;
    color: #b67ac9;
    transition: 0.3s;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(3deg);
    color: #ff7b9c;
}

.card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #3d2d52;
}

.card p {
    color: #5f5f82;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(210, 180, 220, 0.3);
    padding-top: 1rem;
    margin-top: 0.2rem;
}

.card-link {
    text-decoration: none;
    color: #ff7b9c;
    font-weight: 600;
    font-size: 1rem;
    background: rgba(255, 230, 240, 0.7);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-link i {
    font-size: 0.8rem;
}

.card-link:hover {
    background: #ff7b9c;
    color: white;
}

.tag {
    background: #e0d0ff;
    color: #553b7a;
    padding: 0.2rem 0.9rem;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== 底部 ===== */
.footer {
    background: rgba(245, 235, 250, 0.7);
    backdrop-filter: blur(8px);
    margin-top: 3rem;
    padding: 2.5rem 5% 1.5rem;
    border-top: 2px solid rgba(255, 215, 230, 0.8);
    text-align: center;
}

.footer-quote {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem 2rem;
    border-radius: 60px;
    display: inline-block;
}

.quote-label {
    font-weight: 600;
    color: #9b6eb0;
    margin-right: 15px;
}

#anime-quote-footer {
    color: #4e3b64;
    font-style: italic;
}

.footer-copyright p {
    color: #5a4d70;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.footer-links a {
    text-decoration: none;
    color: #9b6eb0;
    margin: 0 8px;
    transition: 0.2s;
}

.footer-links a:hover {
    color: #ff7b9c;
    text-decoration: underline wavy #ffb6c1;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1000px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .hero h1 {
        font-size: 2.4rem;
    }
}

@media (max-width: 700px) {
    .header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        padding: 0.8rem 3%;
    }
    .nav-links {
        gap: 1.2rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .search-container {
        flex-wrap: wrap;
        background: none;
        backdrop-filter: none;
        padding: 0;
        box-shadow: none;
        gap: 10px;
    }
    .search-input {
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(4px);
        border-radius: 60px;
        padding: 1rem 1.5rem;
        width: 100%;
        border: 1px solid white;
    }
    .search-btn {
        width: 100%;
        padding: 1rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .category-title {
        font-size: 1.6rem;
    }
    .footer-quote {
        font-size: 1rem;
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 400px) {
    .logo {
        font-size: 1.4rem;
    }
    .logo i {
        font-size: 1.6rem;
    }
}

/* ===== 左侧悬浮侧边栏 ===== */
.sidebar {
    position: fixed;
    top: 80px;                /* 避开顶部header的高度，根据实际调整 */
    left: 0;
    width: 200px;
    height: calc(100vh - 80px);
    background: rgba(255, 240, 250, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 200, 220, 0.6);
    box-shadow: 4px 0 20px rgba(255, 180, 200, 0.2);
    z-index: 5;               /* 低于header的10，但无重叠 */
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0 20px 20px 0;  /* 右侧圆角柔和 */
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.2rem;
    margin: 0.2rem 0.5rem;
    color: #4a3f5c;
    text-decoration: none;
    border-radius: 40px;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    font-weight: 500;
    border: 1px solid transparent;
}

.sidebar-item i {
    font-size: 1.3rem;
    min-width: 1.8rem;
    text-align: center;
    color: #b87cc9;
    transition: color 0.2s;
}

.sidebar-item span {
    transition: opacity 0.2s;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: #ffc1d0;
    color: #ff7b9c;
}

.sidebar-item:hover i {
    color: #ff7b9c;
}

/* 收起按钮特殊样式 */
.toggle-btn {
    margin-top: 1.5rem;
    border-top: 1px dashed #ffbfd5;
    padding-top: 1rem;
    cursor: pointer;
    border-radius: 0;
    justify-content: flex-start;
}

.toggle-btn:hover {
    background: transparent;
    border-color: #ff7b9c;
}

/* 收起状态 (通过JS添加类) */
.sidebar.collapsed {
    width: 70px;              /* 收起后宽度只够显示图标 */
}

.sidebar.collapsed .sidebar-item span {
    display: none;            /* 隐藏文字 */
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 0.8rem 0;
}

.sidebar.collapsed .sidebar-item i {
    margin-right: 0;
    font-size: 1.5rem;
}

/* 为了让主体内容避开侧边栏，通过JS动态设置body的左内边距 */
body {
    transition: padding-left 0.3s ease;
    padding-left: 200px;      /* 默认与侧边栏展开宽度一致 */
}

/* 响应式调整：小屏幕下强制收起或调整间距 */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;          /* 移动端默认收起 */
    }
    .sidebar .sidebar-item span {
        display: none;        /* 默认隐藏文字 */
    }
    .sidebar .sidebar-item {
        justify-content: center;
    }
    .sidebar .sidebar-item i {
        margin-right: 0;
    }
    body {
        padding-left: 70px;   /* 与收起宽度一致 */
    }
    /* 但保留JS切换能力，覆盖媒体需要更具体 */
    .sidebar:not(.collapsed) {
        width: 200px;         /* 如果手动展开，覆盖媒体 */
    }
    .sidebar:not(.collapsed) .sidebar-item span {
        display: inline-block;
    }
    .sidebar:not(.collapsed) .sidebar-item {
        justify-content: flex-start;
        padding: 0.8rem 1.2rem;
    }
}

/* ===== 右上角音乐播放器图标 ===== */
.player-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffd9e6;
    border-radius: 50%;
    margin-left: 0;
    cursor: pointer;
    color: #b87cc9;
    font-size: 1.3rem;
    transition: all 0.2s;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(255,180,200,0.4);
}

.player-icon:hover {
    background: #ffb6c1;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px #ff9eb5;
}

/* ===== 悬浮播放器面板 ===== */
.music-player {
    position: absolute;
    top: 75px;              /* 根据header高度微调 */
    right: 20px;
    width: 280px;
    background: rgba(255, 240, 250, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 30px;
    padding: 1.2rem 1rem 1rem;
    box-shadow: 0 15px 35px rgba(255, 150, 180, 0.25);
    border: 1px solid rgba(255, 220, 240, 0.8);
    z-index: 20;            /* 高于header */
    transition: opacity 0.2s, visibility 0.2s;
    opacity: 1;
    visibility: visible;
}

.music-player.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 播放器头部 */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed #ffbfd5;
}

.player-title {
    font-weight: 600;
    color: #b27bc7;
    font-size: 1.1rem;
}

.player-title i {
    margin-right: 5px;
    color: #ff7b9c;
}

.close-player {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #b4a0c0;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s;
}

.close-player:hover {
    color: #ff7b9c;
}

/* 歌曲信息 */
.song-info {
    text-align: center;
    margin-bottom: 1rem;
}

.song-name {
    font-weight: 600;
    color: #4a3f5c;
    background: rgba(255, 220, 240, 0.6);
    padding: 0.3rem 1rem;
    border-radius: 40px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 进度条区域 */
.progress-container {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 5px;
    border-radius: 10px;
    background: #ffd0dd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #ff7b9c;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px #ff9eb5;
    transition: 0.1s;
}

.progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #ff5f8a;
}

.time {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #a070a0;
    margin-top: 5px;
}

/* 控制按钮 */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin-top: 0.8rem;
}

.player-controls button {
    background: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: #b87cc9;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(255, 150, 170, 0.3);
    transition: 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-controls button:hover {
    background: #ffb6c1;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 8px 18px #ff9eb5;
}

#playPauseBtn {
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
    background: #ff9eb5;
    color: white;
}

#playPauseBtn:hover {
    background: #ff7b9c;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .music-player {
        width: 240px;
        right: 10px;
        top: 70px;
    }
    .player-controls button {
        width: 38px;
        height: 38px;
    }
    #playPauseBtn {
        width: 48px;
        height: 48px;
    }
}