/* 自定义分类页面样式 */

.article-list, .fiction-list {
  margin-top: 2rem;
}

.post-preview {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.post-preview h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
}

.post-preview h3 a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-preview h3 a:hover {
  color: var(--theme-color);
}

.post-meta {
  color: var(--font-color);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-meta i {
  margin-right: 0.3rem;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: var(--theme-color);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.post-excerpt {
  color: var(--font-color);
  line-height: 1.6;
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--font-color);
  font-style: italic;
}

.empty-state p {
  font-size: 1.1rem;
  margin: 0;
}

/* 深色模式适配 */
[data-theme="dark"] .post-preview {
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .post-preview:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .post-preview {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* =========================================
   Aplayer 风格适配优化
   ========================================= */

/* 1. 全局容器优化：使用你的卡片背景和阴影 */
.aplayer {
    background: var(--card-bg) !important; /* 强制覆盖默认白色背景 */
    font-family: inherit; /* 继承博客字体 */
    color: var(--text-color);
    border-radius: 8px !important; /* 保持圆角一致 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important; /* 统一阴影 */
    transition: all 0.3s ease;
    border: none !important; /* 去除默认边框 */
}

/* 2. 歌词区域颜色适配 */
.aplayer .aplayer-lrc {
    text-shadow: none !important; /* 去除默认的文字描边，更扁平化 */
}

/* 歌词未播放状态颜色 */
.aplayer .aplayer-lrc p {
    color: var(--font-color) !important; 
    opacity: 0.7;
}

/* 歌词高亮状态：使用你的主题色 */
.aplayer .aplayer-lrc p.aplayer-lrc-current {
    color: var(--theme-color) !important;
    opacity: 1;
    font-weight: bold;
}

/* 3. 播放列表（右侧或弹出菜单）适配 */
.aplayer .aplayer-list {
    background: var(--card-bg) !important;
    border-color: transparent !important;
}

.aplayer .aplayer-list ol li {
    border-top: 1px solid rgba(128, 128, 128, 0.1) !important;
}

.aplayer .aplayer-list ol li:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* 列表正在播放的歌曲文字颜色 */
.aplayer .aplayer-list ol li.aplayer-list-light {
    background: rgba(0, 0, 0, 0.02) !important;
}

.aplayer .aplayer-list ol li.aplayer-list-light .aplayer-list-title {
    color: var(--theme-color) !important;
}

/* 4. 进度条与按钮：使用主题色 */
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {
    background: var(--theme-color) !important; /* 进度条颜色 */
}

.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {
    background: var(--theme-color) !important; /* 拖动球颜色 */
    border: 2px solid #fff; /* 增加一点白色边框增加层次感 */
}

@media (min-width: 769px) {
    /* 1. 播放器主体位置 */
    .aplayer.aplayer-fixed {
        max-width: 320px !important;
        width: auto !important;
        left: 20px !important;
        bottom: 20px !important; /* 播放器悬浮高度 */
        z-index: 99999 !important;
        background: transparent !important; /* 自身透明，背景色给 body */
        box-shadow: none !important; /* 阴影也给 body */
    }

    /* 2. 播放器本体外观 (解决进度条溢出) */
    .aplayer.aplayer-fixed .aplayer-body {
        background: var(--card-bg) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
        /* 【关键】隐藏溢出：切掉凸出来的进度条 */
        overflow: hidden !important; 
        position: relative;
        z-index: 2; /* 保证本体在歌单之上 */
    }

    /* 3. 歌单位置修正 (解决被挡住) */
    .aplayer.aplayer-fixed .aplayer-list {
        /* 【关键】底部距离 = 播放器Bottom(20px) + 播放器高度(66px) + 间距(10px) */
        bottom: 96px !important; 
        left: 0 !important;
        width: 320px !important; /* 宽度与播放器对其 */
        border-radius: 10px !important;
        background: var(--card-bg) !important;
        border: 1px solid rgba(128,128,128,0.1);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
        z-index: 1; /* 放在播放器下层，但位置被抬高了，所以不会被挡 */
        margin-bottom: 0 !important; /* 清除默认边距干扰 */
    }

    /* 4. 进度条微调 (防止左右贴边太紧) */
    .aplayer.aplayer-fixed .aplayer-info {
        border-bottom: none !important;
        padding: 10px 15px 10px 10px !important; /* 增加右侧内边距 */
    }
    
    /* 隐藏歌词 */
    .aplayer.aplayer-fixed .aplayer-lrc {
        display: none !important;
    }
}

/* 移动端适配优化 */
@media (max-width: 768px) {
    /* 基础排版优化 */
    body {
        font-size: 16px; /* 提高移动端可读性 */
    }

    /* 防止 APlayer 遮挡底部内容 */
    #body-wrap {
        padding-bottom: 66px; 
    }

    /* 标题大小调整 */
    h1 { font-size: 1.8rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.3rem !important; }

    /* 文章卡片优化 */
    .post-preview {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* APlayer 移动端优化 */
    .aplayer.aplayer-fixed {
        bottom: 0 !important;
        left: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 0 !important; /* 移动端全宽不需要圆角 */
    }

    /* 修复歌单位置 */
    .aplayer.aplayer-fixed .aplayer-list {
        bottom: 66px !important; /* 位于播放器上方 */
        left: 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* 隐藏歌词以节省空间 */
    .aplayer.aplayer-fixed .aplayer-lrc {
        display: none !important;
    }
}