/**
 * 音频资源库样式
 * 
 * 设计理念:
 * - 现代卡片式布局
 * - 清晰的视觉层次
 * - 流畅的交互动画
 * - 响应式设计
 * 
 * @package ActivationCodes
 * @since 0.2.0
 */

/* ==================== 容器样式 ==================== */
.ac-audio-library {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ==================== 页面头部 ==================== */
.ac-library-header {
    text-align: center;
    margin-bottom: 40px;
}

.ac-library-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.ac-library-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ==================== 工具栏 ==================== */
.ac-library-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

/* 筛选按钮组 */
.ac-filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ac-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: #fff;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ac-filter-btn:hover {
    border-color: #4CAF50;
    color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

.ac-filter-btn.active {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    border-color: #4CAF50;
    color: #fff;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.filter-icon {
    font-size: 16px;
}

/* 搜索框 */
.ac-search-box {
    position: relative;
    min-width: 280px;
}

.ac-search-input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ac-search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.ac-search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

/* ==================== 用户状态栏 ==================== */
.ac-status-bar {
    padding: 15px 25px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2E7D32;
    font-size: 15px;
}

.status-icon {
    font-size: 20px;
}

/* ==================== 图书网格 ==================== */
.ac-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* ==================== 图书卡片 ==================== */
.ac-book-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ac-book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.book-card-inner {
    position: relative;
}

/* 图书封面 */
.book-cover {
    position: relative;
    width: 100%;
    height: 360px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ac-book-card:hover .book-cover img {
    transform: scale(1.05);
}

/* 图书徽章 */
.book-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.free-badge {
    background: rgba(255, 152, 0, 0.9);
}

.activated-badge {
    background: rgba(76, 175, 80, 0.9);
    top: 48px;
}

/* 图书信息 */
.book-info {
    padding: 20px;
}

.book-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-category {
    font-size: 13px;
    color: #4CAF50;
    margin: 0 0 12px 0;
    font-weight: 500;
}

/* 图书统计 */
.book-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.stat-icon {
    font-size: 16px;
}

/* 操作按钮 */
.book-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.book-action-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-icon {
    font-size: 18px;
}

/* ==================== 空状态 ==================== */
.ac-empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.empty-text {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ==================== 加载状态 ==================== */
.ac-loading-wrapper {
    text-align: center;
    padding: 80px 20px;
}

.ac-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f0f0f0;
    border-top-color: #4CAF50;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ac-loading-text {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ==================== 模态框 ==================== */
.ac-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ac-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.ac-modal-container {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 模态框头部 */
.ac-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-book-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* 模态框内容 */
.ac-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
}

.modal-audio-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 音频列表项 */
.audio-list-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.audio-list-item:hover {
    background: #f0f0f0;
    transform: translateX(4px);
}

.audio-list-item.locked {
    opacity: 0.6;
}

.audio-item-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.audio-item-content {
    flex: 1;
}

.audio-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.audio-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
}

.audio-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.audio-badge.free {
    background: #FFF3E0;
    color: #F57C00;
}

.audio-badge.locked {
    background: #FFEBEE;
    color: #C62828;
}

.audio-item-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.audio-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.audio-duration {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

/* 播放按钮 */
.audio-play-btn,
.audio-locked-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-play-btn {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: #fff;
}

.audio-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.audio-locked-btn {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* 模态框底部 */
.ac-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 20px 20px;
}

.modal-footer-text {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    color: #666;
    text-align: center;
    justify-content: center;
}

.footer-icon {
    font-size: 18px;
}

/* ==================== 迷你播放器 ==================== */
.ac-mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9998;
}

.mini-player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.mini-player-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.mini-player-cover {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cover-icon {
    font-size: 24px;
}

.mini-player-text {
    flex: 1;
    min-width: 0;
}

.mini-player-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-book {
    font-size: 13px;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-controls {
    display: flex;
    gap: 12px;
}

.mini-control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-control-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.control-icon {
    font-size: 18px;
}

.mini-player-progress {
    height: 3px;
    background: #e0e0e0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    transition: width 0.3s ease;
}

/* ==================== 抖音横幅 ==================== */
.ac-douyin-banner-bottom {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.3);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.banner-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
    color: #fff;
}

.banner-text h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.banner-text p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.ac-btn-douyin-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #fff;
    color: #FF6B6B;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ac-btn-douyin-banner:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.douyin-icon {
    font-size: 18px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .ac-audio-library {
        padding: 20px 16px;
    }

    .ac-library-title {
        font-size: 24px;
    }

    .ac-library-subtitle {
        font-size: 14px;
    }

    .ac-library-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ac-filter-group {
        justify-content: center;
    }

    .ac-search-box {
        min-width: auto;
    }

    .ac-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .ac-modal-container {
        width: 95%;
        max-height: 90vh;
    }

    .ac-modal-header,
    .ac-modal-body,
    .ac-modal-footer {
        padding: 16px 20px;
    }

    .banner-content {
        flex-direction: column;
        text-align: center;
    }

    .banner-icon {
        font-size: 40px;
    }

    .mini-player-content {
        flex-wrap: wrap;
        gap: 12px;
    }
}

