/* ===== 全局样式 ===== */
/* 平滑滚动效果 */
html {
    scroll-behavior: smooth;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {/* 背景图片 */
            background-image: url('../../public/images/daytime-girl.png');  
            /* 让背景覆盖整个页面，不变形 */
            background-size: cover;  
            /* 背景不重复平铺 */
            background-repeat: no-repeat;  
            /* 背景居中显示 */
            background-position: center;  
            /* 让背景填满整个视口高度 */
            min-height: 100vh;  
            /* 可选：背景固定，滚动时不动 */
            background-attachment: fixed;
}

/* 点缀小星星 (二次元氛围) */
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;
}

/*状态球样式*/
.site-header {
  position: sticky;
  top: 0;
  z-index: 21;
}

.status-ball {
  position: absolute;
  top: 300px;          /* 右上偏下位置 */
  right: 20px;
  background: linear-gradient(145deg, #ffd1dc, #fff0f5, #e6c8ff);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 7px;
  color: #4a2e4a;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  z-index: 1001;
  overflow: hidden;
}

.status-ball-content {
  padding: 7px 10px;
  min-width: 100px;
  text-align: left;
}

.status-ball-mini {
  display: none;
  padding: 4px 6px;
  text-align: center;
  min-width: 40px;
}

.status-ball.collapsed {
  min-width: 40px;
  height: 24px;
}

.status-ball.collapsed .status-ball-content {
  display: none;
}

.status-ball.collapsed .status-ball-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.status-days {
  font-weight: 600;
  font-size: 6px;
}

/* 隐藏状态窗 */
.status-ball.hidden {
  display: none;
}

.status-item {
  margin-bottom: 8px;
  white-space: nowrap;  /* 大屏幕不换行 */
}

.status-item:last-of-type {
  margin-bottom: 12px;
}

.toggle-btn {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(160, 120, 200, 0.5);
  color: #5a3e5a;
  padding: 5px 9px;
  border-radius: 18px;
  font-size: 8px;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(2px);
  white-space: nowrap;
}

.toggle-btn.mini {
  padding: 3px 6px;
  font-size: 6px;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* 响应式：手机及小屏幕 */
@media (max-width: 600px) {
  .status-ball {
    top: 300px;
    right: 10px;
    padding: 6px;
    min-width: 80px;
    font-size: 6px;
  }
  .status-item {
    white-space: normal;  /* 允许换行 */
  }
  .close-btn {
    padding: 5px 10px;
    font-size: 6px;
  }
}

.menu-toggle {
    display: none;  /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    color: #b87cc9;
    cursor: pointer;
    /* 可选：模仿右侧按钮的圆角背景 */
    background: #ffd9e6;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(255,180,200,0.4);
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: #ffb6c1;
    color: white;
    transform: scale(1.1);
}

.mobile-nav {
    display: none;  /* 默认隐藏 */
    position: absolute;
    top: 60px;      /* 与头部高度一致，稍后会定义 */
    left: 0;
    width: 100%;
    background: rgba(255, 240, 250, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 200, 220, 0.6);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 9;
    flex-direction: column;
    padding: 0.5rem 0;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav a {
    padding: 0.8rem 1.5rem;
    color: #4a4a6a;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-nav a i {
    width: 1.5rem;
    color: #b87cc9;
}

.mobile-nav a:last-child {
    border-bottom: none;
}

.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #ff7b9c;
}

/* ===== 英雄区 ===== */
.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;
}

 /* ===== 卡片区域优化（已按需求修改：8列，卡片尺寸减半） ===== */
        .category { max-width: 1400px; margin: 2.5rem auto; padding: 0 4%; }  /* 略微调整外边距 */
        
        /* 分类头部样式 */
        .category-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .category-title { 
            font-size: 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); 
            margin: 0;
        }
        .category-title i { color: #b27bc7; font-size: 2rem; }
        
        /* 折叠/展开按钮样式 */
        .toggle-cards-btn {
            background: rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(255, 158, 181, 0.5);
            border-radius: 20px;
            padding: 0.4rem 0.8rem;
            font-size: 0.8rem;
            color: #ff7b9c;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.3rem;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        
        .toggle-cards-btn:hover {
            background: rgba(255, 158, 181, 0.2);
            border-color: #ff7b9c;
            transform: translateY(-1px);
        }
        
        .toggle-cards-btn i {
            transition: transform 0.3s ease;
        }
        
        /* 折叠状态下的卡片样式 - 悬浮小窗口 */
        .card-grid.collapsed {
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 0.4rem;
            max-height: 200px;
            overflow-y: auto;
            overflow-x: hidden;
            transition: max-height 0.3s ease;
            /* 悬浮小窗口效果 */
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border-radius: 16px;
            border: 1px solid rgba(255, 200, 220, 0.6);
            box-shadow: 0 8px 32px rgba(255, 180, 200, 0.3);
            padding: 0.8rem;
            margin-top: 0.5rem;
            /* 隐藏滚动条 */
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        
        /* 隐藏折叠区域的滚动条 */
        .card-grid.collapsed::-webkit-scrollbar {
            display: none;
        }
        
        .card-grid:not(.collapsed) {
            max-height: none;
        }
        
        .card-grid.collapsed .card {
            padding: 0.3rem 0.4rem;
            border-radius: 8px;
            min-height: auto;
            height: 2.8rem;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            gap: 0.4rem;
            overflow: hidden;
        }
        
        .card-grid.collapsed .card-icon {
            font-size: 0.9rem;
            margin-bottom: 0;
            margin-right: 0;
            min-width: 1rem;
            text-align: center;
        }
        
        .card-grid.collapsed .card h3 {
            font-size: 0.65rem;
            margin-bottom: 0;
            line-height: 1.1;
            flex: 1;
            text-align: left;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
        }
        
        .card-grid.collapsed .card p,
        .card-grid.collapsed .card-footer {
            display: none !important;
        }
        
        .card-grid.collapsed .card:hover {
            transform: none;
            background: rgba(255, 255, 255, 0.9);
        }
        
        /* 响应式优化：折叠状态 */
        @media (max-width: 1400px) {
            .card-grid.collapsed {
                grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
            }
        }
        
        @media (max-width: 1200px) {
            .card-grid.collapsed {
                grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            }
            
            .card-grid.collapsed .card {
                height: 2.6rem;
                padding: 0.25rem 0.3rem;
            }
            
            .card-grid.collapsed .card h3 {
                font-size: 0.6rem;
            }
        }
        
        @media (max-width: 768px) {
            .card-grid.collapsed {
                grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
                gap: 0.3rem;
                max-height: 180px;
            }
            
            .card-grid.collapsed .card {
                height: 2.4rem;
                padding: 0.2rem 0.25rem;
                gap: 0.3rem;
            }
            
            .card-grid.collapsed .card-icon {
                font-size: 0.8rem;
            }
            
            .card-grid.collapsed .card h3 {
                font-size: 0.55rem;
            }
            
            .category-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.8rem;
            }
            
            .toggle-cards-btn {
                align-self: flex-start;
            }
        }
        
        @media (max-width: 480px) {
            .card-grid.collapsed {
                grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
                max-height: 160px;
            }
            
            .card-grid.collapsed .card {
                height: 2.2rem;
                padding: 0.15rem 0.2rem;
            }
            
            .card-grid.collapsed .card h3 {
                font-size: 0.5rem;
            }
        }

        /* 网格：8列，间隙缩小 */
        .card-grid {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            gap: 0.8rem;          /* 原1.2rem，适当缩小 */
        }

        /* 卡片：内边距全面缩小至原来一半左右，字体调小 */
        .card {
            background: rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: 16px;    /* 原24px，减半 */
            padding: 0.6rem 0.4rem 0.4rem;  /* 原1.2rem 0.8rem 0.8rem，约减半 */
            text-align: center;
            transition: all 0.25s ease;
            border: 1px solid rgba(255, 255, 255, 0.5);
            box-shadow: 0 8px 16px -6px rgba(210, 160, 200, 0.15);
            display: block;
            text-decoration: none;
            color: inherit;
            flex-direction: column;
        }
        .card:hover {
            transform: translateY(-3px);
            background: rgba(255, 255, 255, 0.5);
            box-shadow: 0 12px 20px -4px rgba(255, 184, 201, 0.3);
            border-color: rgba(255, 242, 245, 0.8);
        }

        /* 图标缩小 */
        .card-icon {
            font-size: 1.4rem;       /* 原2.4rem，约减半 */
            margin-bottom: 0.3rem;
            color: #b67ac9;
            transition: 0.3s;
        }
        .card:hover .card-icon {
            transform: scale(1.05) rotate(2deg);
            color: #ff7b9c;
        }

        /* 标题缩小 */
        .card h3 {
            font-size: 0.8rem;       /* 原1.2rem，减半为0.6但保持可读取0.8 */
            font-weight: 600;
            margin-bottom: 0.1rem;
            color: #3d2d52;
            line-height: 1.2;
        }

        /* 描述文字缩小，行距紧凑 */
        .card p {
            color: #5f5f82;
            font-size: 0.65rem;       /* 原0.8rem，适当缩小 */
            margin-bottom: 0.4rem;    /* 原0.6rem */
            flex-grow: 1;
            line-height: 1.3;
        }

        /* footer 分割线更细，内边距减小 */
        .card-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid rgba(210, 180, 220, 0.3);
            padding-top: 0.25rem;      /* 原0.5rem */
            margin-top: 0.1rem;
        }

        /* 链接按钮紧凑 */
        .card-link {
            text-decoration: none;
            color: #ff7b9c;
            font-weight: 600;
            font-size: 0.6rem;       /* 原0.85rem，减半约0.43但取0.6保持可点 */
            background: rgba(255, 230, 240, 0.7);
            padding: 0.1rem 0.4rem;    /* 原0.2rem 0.7rem */
            border-radius: 20px;
            transition: 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 2px;
        }
        .card-link i { font-size: 0.5rem; }
        .card-link:hover { background: #ff7b9c; color: white; }

        /* 标签缩小 */
        .tag {
            background: #e0d0ff;
            color: #553b7a;
            padding: 0.1rem 0.4rem;   /* 原0.15rem 0.6rem */
            border-radius: 30px;
            font-size: 0.5rem;        /* 原0.65rem，减半约0.33但取0.5 */
            font-weight: 600;
            letter-spacing: 0.2px;
        }

/* ===== 底部 ===== */
.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;
}

/* ===== 左侧悬浮侧边栏 ===== */
.sidebar {
    position: fixed;
    top: 80px;                /* 紧贴顶栏下方 */
    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;
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 隐藏Webkit浏览器的滚动条 */
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-links::-webkit-scrollbar {
    display: none;
}

.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;
}

/* ===== 重构侧边栏 ===== */
.sidebar {
    top: 80px;                    /* 从顶部导航下方开始 */
    height: calc(100vh - 80px);   /* 减去导航条高度 */
    display: flex;
    flex-direction: column;
    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;
    transition: width 0.3s ease;
    overflow: hidden;             /* 隐藏溢出，内部滚动 */
}

.sidebar-links {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scrollbar-color: #ffb6c1 #ffe6f0;
}

.sidebar-links::-webkit-scrollbar {
    width: 5px;
}
.sidebar-links::-webkit-scrollbar-thumb {
    background: #ffb6c1;
    border-radius: 10px;
}
.sidebar-links::-webkit-scrollbar-track {
    background: #ffe6f0;
}

.sidebar-bottom {
    flex-shrink: 0;
    border-top: 1px dashed rgba(255, 191, 213, 0.6);
    padding: 0.8rem 0.5rem;
    background: inherit;           /* 保持半透明背景 */
}

/* 侧边栏折叠按钮样式 */
.sidebar-bottom .toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.8rem 1rem;
    margin: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 200, 220, 0.8);
    border-radius: 40px;
    color: #5a3e5a;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-bottom .toggle-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #ff7b9c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 123, 156, 0.3);
}

.sidebar-bottom .toggle-btn i {
    font-size: 1.1rem;
    color: #b87cc9;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-bottom .toggle-btn i {
    transform: rotate(180deg);
}

/* ===== 主内容左外边距（跟随侧边栏宽度） ===== */
main, footer {
    margin-left: 200px;            /* 默认展开宽度 */
    transition: margin-left 0.3s ease;
}

/* 侧边栏收起时主内容左外边距 */
body.sidebar-collapsed main,
body.sidebar-collapsed footer {
    margin-left: 70px;             /* 收起宽度 */
}

/* 头部导航条固定不动，无需偏移 */
.header {
    /* 确保不被侧边栏覆盖（z-index 已高于侧边栏） */
    z-index: 10;
}

/* 移除 body 原有的内边距 */
body {
    padding-left: 0 !important;
    transition: none !important;
}

/* ===== 右上角音乐播放器图标 ===== */
.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: fixed;           
    top: 80px;                  
    right: 20px;                
    width: 200px;               
    background: rgba(255, 240, 250, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;        
    padding: 0.5rem 0.3rem 0.5rem; 
    box-shadow: 0 15px 35px rgba(255, 150, 180, 0.25);
    border: 1px solid rgba(255, 220, 240, 0.8);
    z-index: 1000;              
    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: 0.8rem;      
    padding-bottom: 0.4rem;
    border-bottom: 2px dashed #ffbfd5;
}

.player-title {
    font-weight: 600;
    color: #b27bc7;
    font-size: 1rem;            
}

.player-title i {
    margin-right: 5px;
    color: #ff7b9c;
}

.close-player {
    background: none;
    border: none;
    font-size: 1.1rem;          
    color: #b4a0c0;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.close-player:hover {
    color: #ff7b9c;
}

/* 歌曲信息 */
.song-info {
    text-align: center;
    margin-bottom: 0.8rem;       
}

.song-name {
    font-weight: 600;
    color: #4a3f5c;
    background: rgba(255, 220, 240, 0.6);
    padding: 0.2rem 0.8rem;      
    border-radius: 30px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;          
}

/* 进度条区域 */
.progress-container {
    margin: 0.8rem 0;            
}

.progress-bar {
    width: 100%;
    height: 4px;                 
    border-radius: 10px;
    background: #ffd0dd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;                 
    height: 12px;
    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.75rem;         
    color: #a070a0;
    margin-top: 4px;
}

/* 控制按钮容器 */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 0.6rem;
}

/* 所有控制按钮通用样式 */
.player-controls button {
    background: white;
    border: none;
    width: 42px;                
    height: 42px;               
    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;    
    line-height: 1;             
}

/* 播放/暂停按钮 */
#playPauseBtn {
    width: 50px;                
    height: 50px;
    font-size: 1.5rem;
    background: #ff9eb5;
    color: white;
}

/* 悬停效果不变 */
.player-controls button:hover {
    background: #ffb6c1;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 8px 18px #ff9eb5;
}

#playPauseBtn:hover {
    background: #ff7b9c;
}

/* 小屏幕适配（保持圆形） */
@media (max-width: 600px) {
    .player-controls button {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    #playPauseBtn {
        width: 46px;
        height: 46px;
        font-size: 1.4rem;
    }
}

/* 暗色模式：夜间背景图 */
body.dark {
    background-image: url('../../public/images/night-girl.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* 取消原有亮色光晕，或改为暗色光晕 */
body.dark::before {
    opacity: 0.2;  /* 减弱星星光晕 */
    background-image: radial-gradient(circle at 30% 40%, rgba(80, 60, 100, 0.3) 0%, transparent 20%),
                      radial-gradient(circle at 80% 70%, rgba(40, 30, 70, 0.4) 0%, transparent 25%);
}

body.dark .header,
body.dark .sidebar,
body.dark .card,
body.dark .footer,
body.dark .music-player,
body.dark .random-quote,
body.dark .search-container,
body.dark .player-icon,
body.dark .theme-toggle {
    background: rgba(20, 20, 35, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: #444 !important;
    color: #f0f0f0;
}

/* 文字颜色修正 */
body.dark,
body.dark .logo,
body.dark .nav-links a,
body.dark .sidebar-item,
body.dark .category-title,
body.dark .card h3,
body.dark .card p,
body.dark .footer,
body.dark .footer-quote,
body.dark .random-quote {
    color: #e0e0e0 !important;
}

/* 链接与图标颜色 */
body.dark .nav-links a i,
body.dark .sidebar-item i,
body.dark .card-icon,
body.dark .category-title i,
body.dark .logo i {
    color: #c0a0ff !important;   /* 浅紫色保留二次元感 */
}

body.dark .card-link {
    background: rgba(255, 255, 255, 0.15);
    color: #ffb6c1;
}

body.dark .tag {
    background: #4a2f6e;
    color: #e0c0ff;
}

body.dark .search-input {
    color: #e0e0e0;
}

body.dark .search-input::placeholder {
    color: #aaa;
}

body.dark .search-btn {
    background: #b2809f;
    color: #fff;
    box-shadow: none;
}

body.dark .search-btn:hover {
    background: #d09ec0;
}

/* 状态球夜间模式适配 */
body.dark .status-ball {
    background: linear-gradient(145deg, #2a1a35, #1a0f25, #3a2a45);
    color: #e0e0e0;
    border: 1px solid #444;
}

body.dark .toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid #666;
    color: #d0b0e0;
}

body.dark .toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

body.dark .status-days {
    color: #f0f0f0;
}

/* 夜间模式搜索结果样式 */
body.dark .search-results {
    background: rgba(30, 30, 45, 0.95);
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .search-result-item {
    border-bottom: 1px solid #444;
    color: #e0e0e0;
}

body.dark .search-result-item:hover {
    background: rgba(50, 50, 70, 0.8);
}

body.dark .search-result-item h4 {
    color: #f0f0f0;
}

body.dark .search-result-item p {
    color: #b0b0b0;
}

body.dark .search-result-item small {
    color: #888;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffd9e6;           /* 亮色默认，深色模式下会被覆盖 */
    border-radius: 50%;
    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);
}

.theme-toggle:hover {
    background: #ffb6c1;
    color: white;
    transform: scale(1.1);
}

/* 深色模式下的切换按钮样式已由上面的 .body.dark .theme-toggle 统一覆盖 */

body.dark .progress-bar {
    background: #4a3a5a;
}

body.dark .player-controls button {
    background: #3a2e4a;
    color: #d0b0e0;
    border-color: #5a4a6a;
}

body.dark .player-controls button:hover {
    background: #6b4f8a;
}

/* 登录按钮 */
.mock-login-btn {
    background: #24292e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    border: 1px solid #3d444d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.mock-login-btn i {
    font-size: 1.2rem;
}
.mock-login-btn:hover {
    background: #2f363d;
    transform: scale(1.02);
}

/* 用户信息区域（已登录） */
.mock-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    padding: 4px 12px 4px 4px;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid rgba(255,255,255,0.3);
}
.mock-user-info:hover {
    background: rgba(255, 255, 255, 0.3);
}
.mock-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
}
#mockUserName {
    color: #333;
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 暗色模式适配（如果已有 body.dark 类） */
body.dark .mock-login-btn {
    background: #0d1117;
    border-color: #3b434b;
}
body.dark .mock-user-info {
    background: rgba(30, 30, 50, 0.7);
}
body.dark #mockUserName {
    color: #e0e0e0;
}

/* ===== 模态框样式 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 240, 250, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 1.5rem;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(255, 150, 180, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed #ffbfd5;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #b27bc7;
}

.modal-title i {
    margin-right: 8px;
    color: #ff7b9c;
}

.modal-close {
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #b4a0c0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ff7b9c;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body p {
    color: #5a4d70;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.modal-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #ffd0dd;
    border-radius: 40px;
    font-size: 1rem;
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    transition: 0.2s;
    color: #333;
}

.modal-input:focus {
    border-color: #ff7b9c;
    box-shadow: 0 0 0 3px rgba(255, 123, 156, 0.2);
}

.modal-error {
    color: #e5505a;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.95rem;
}

.modal-btn.cancel {
    background: rgba(200, 200, 210, 0.3);
    color: #6a5a7a;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.modal-btn.cancel:hover {
    background: rgba(180, 170, 190, 0.4);
}

.modal-btn.confirm {
    background: #ff9eb5;
    color: white;
    border: 1px solid #ffc0cb;
    box-shadow: 0 4px 10px rgba(255, 150, 170, 0.3);
}

.modal-btn.confirm:hover {
    background: #ff7b9c;
    transform: scale(1.02);
}

.modal-btn.confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 暗色模式适配（如果存在 body.dark） */
body.dark .modal-content {
    background: rgba(30, 25, 45, 0.95);
    border-color: #4a3f60;
}

body.dark .modal-title {
    color: #c0a0f0;
}

body.dark .modal-body p {
    color: #c0b0d0;
}

body.dark .modal-input {
    background: rgba(20, 15, 30, 0.8);
    border-color: #5a4f7a;
    color: #f0e0ff;
}

body.dark .modal-close {
    color: #a090b0;
}

body.dark .modal-close:hover {
    color: #ffa0c0;
}

body.dark .modal-btn.cancel {
    background: #3a2e4a;
    color: #d0c0e0;
}

body.dark .menu-toggle {
    background: rgba(30, 30, 50, 0.8);
    color: #c0a0ff;
    border-color: #444;
}

body.dark .mobile-nav {
    background: rgba(20, 20, 35, 0.95);
}

body.dark .mobile-nav a {
    color: #e0e0e0;
    border-bottom-color: #444;
}

body.dark .mobile-nav a i {
    color: #c0a0ff;
}

/*搜索结果预览样式*/
.search-results {
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: none;          
  border-radius: 8px;
  margin-top: 10px;
  padding: 0px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}
.search-result-item {
  padding: 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.search-result-item:hover {
  background: #f0f0f0;
}
.search-result-item h4 {
  margin: 0 0 4px;
}
.search-result-item p {
  margin: 0;
  font-size: 0.9em;
  color: #555;
}

.highlight {
  animation: highlight-pulse 1.5s ease-out;
}
@keyframes highlight-pulse {
  0% { background-color: transparent; }
  30% { background-color: rgba(255, 255, 0, 0.3); }
  100% { background-color: transparent; }
}

/* 响应式调整：移动端默认收起 */
@media (max-width: 768px) {
    .sidebar {
        width: 70px !important;    /* 强制收起宽度 */
    }
    .sidebar .sidebar-item span {
        display: none;             /* 隐藏文字 */
    }
    .sidebar .sidebar-item {
        justify-content: center;
    }
    body.sidebar-collapsed main,
    body.sidebar-collapsed footer,
    main, footer {
        margin-left: 70px;         /* 移动端统一使用收起宽度 */
    }
    /* 允许手动展开（通过JS切换类） */
    .sidebar:not(.collapsed) {
        width: 200px !important;
    }
    .sidebar:not(.collapsed) .sidebar-item span {
        display: inline-block;
    }
}

/* 响应式调整：小屏幕下强制收起或调整间距 */
@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;
    }
}

/* 响应式调整 */
@media (max-width: 600px) {
    .music-player {
        width: 240px;
        right: 10px;
        top: 70px;
    }
    .player-controls button {
        width: 38px;
        height: 38px;
    }
    #playPauseBtn {
        width: 48px;
        height: 48px;
    }
}

/* ===== 优化后的响应式代码 ===== */
/* 平板及以下逐步减少列数，保证卡片可读 */
@media (max-width: 1300px) {
    .card-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1100px) {
    .card-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 手机 (≤700px) 一行两列，同时调整卡片内部尺寸略微增大便于触摸 */
@media (max-width: 700px) {
    /* 头部固定高度，内部垂直居中 */
    .header {
        height: 60px;
        padding: 0 3%;
        gap: 0.3rem;
        align-items: center;
    }

    /* 显示汉堡菜单按钮 */
    .menu-toggle {
        display: flex;
    }

    /* 隐藏原始导航链接 */
    .nav-links {
        display: none;
    }

    /* logo 弹性占据空间，防止换行 */
    .logo {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;               /* 填充剩余宽度 */
        margin-left: 5px;      /* 与汉堡按钮留一点间距 */
        font-size: 1.2rem;     /* 适当缩小 */
    }
    .logo i {
        font-size: 1.3rem;
    }

    /* 右侧按钮组禁止压缩 */
    .header-right {
        flex-shrink: 0;
        gap: 5px;
    }

    /* 圆形按钮统一缩小（可选，若之前已缩小则保留） */
    .header-right .avatar-link,
    .header-right .player-icon,
    .header-right .theme-toggle {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    /* 侧边栏顶部与头部对齐 */
    .sidebar {
        top: 60px !important;
        height: calc(100vh - 60px) !important;
    }
    /* 头像图片适应 */
    .header-right .avatar-img {
        width: 100%;
        height: 100%;
    }

    /* 搜索框调整（保持原样） */
    .search-container {
        flex-wrap: nowrap !important;
        padding: 0.1rem 0.1rem 0.1rem 1rem;
        margin: 0;
    }
    .search-input {
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }
    .search-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }

    /* ----- 侧边栏紧贴头部下方 ----- */
    .sidebar {
        top: 60px !important;                /* 与头部高度一致 */
        height: calc(100vh - 60px) !important; /* 减去头部高度 */
    }

    /* 移动端默认收起侧边栏（仅图标） */
    .sidebar {
        width: 70px !important;
    }
    .sidebar .sidebar-item span {
        display: none;
    }
    .sidebar .sidebar-item {
        justify-content: center;
        padding: 0.8rem 0;
    }
    .sidebar .sidebar-item i {
        margin-right: 0;
        font-size: 1.5rem;
    }

    /* 主内容外边距同步为收起宽度 */
    main, footer,
    body.sidebar-collapsed main,
    body.sidebar-collapsed footer {
        margin-left: 70px !important;
    }

    /* 手动展开侧边栏（通过JS切换类） */
    .sidebar:not(.collapsed) {
        width: 200px !important;
    }
    .sidebar:not(.collapsed) .sidebar-item span {
        display: inline-block;
    }
    .sidebar:not(.collapsed) .sidebar-item {
        justify-content: flex-start;
        padding: 0.8rem 1.2rem;
    }

    /* 英雄区调整 */
    .hero h1 { font-size: 2rem; }
    .random-quote { font-size: 0.9rem; }

    /* 卡片网格：一行两列，并稍微调大卡片内边距和字体便于触屏 */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    .card {
        padding: 0.8rem 0.5rem 0.5rem;
    }
    .card-icon {
        font-size: 1.6rem;
    }
    .card h3 {
        font-size: 0.9rem;
    }
    .card p {
        font-size: 0.7rem;
    }
    .card-link {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    .tag {
        font-size: 0.6rem;
        padding: 0.15rem 0.5rem;
    }

    /* 底部 */
    .footer-quote { font-size: 1rem; padding: 0.8rem 1rem; }
}

/* 小屏手机 (≤400px) 仍保持两列，但进一步微调 */
@media (max-width: 400px) {
    .logo { font-size: 1.1rem; }
    .logo i { font-size: 1.3rem; }
    .nav-links a { font-size: 0.8rem; }
    .search-btn { padding: 0.5rem 1rem; }
    .card-grid { grid-template-columns: repeat(2, 1fr); } /* 保持两列 */
    .card { padding: 0.6rem 0.3rem 0.3rem; }
    .card-icon { font-size: 1.4rem; }
    .card h3 { font-size: 0.8rem; }
    .card p { font-size: 0.65rem; }
}