/******************************************************************************
 * @file    adu-learning.css
 * @brief   Adu Network Studio — 学习中心专用样式（提取自内联CSS）
 *
 * @details 本文件整合了 learning/index.php 和 learning/detail.php 的
 *          所有内联样式，消除了硬编码颜色和重复定义。
 *          所有颜色值均引用 CSS 变量，支持明暗双主题。
 *
 * @source  learning/index.php (~240行内联) + learning/detail.php (~530行内联)
 * @version  1.0.0
 ******************************************************************************/

/* ============================================================
   1. Page Layout
   ============================================================ */

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}


/* ============================================================
   2. Hero Section (index.php)
   ============================================================ */

.hero-section {
    background: var(--hero-bg);
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-default);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(var(--border-default) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-default) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.4;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 40%;
    height: 80%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section .hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--accent-muted);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-section .hero-icon i {
    font-size: 1.75rem;
    color: var(--accent-primary);
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.hero-section .hero-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}


/* ============================================================
   3. Search Box & Metrics (index.php)
   ============================================================ */

.search-wrapper {
    max-width: 560px;
    margin: 2rem auto 0;
    position: relative;
    z-index: 1;
}

.hero-metric-strip {
    max-width: 760px;
    margin: 1.5rem auto 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.hero-metric-strip .metric-card {
    text-align: left;
    border-radius: 1rem;
}

.search-box {
    background: var(--card-bg);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 0.375rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 0.375rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-box button:hover {
    background: var(--accent-hover);
}


/* ============================================================
   4. Category Navigation (index.php)
   ============================================================ */

.category-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-default);
    background: var(--bg-base);
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: center;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-pill:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-subtle);
}

.category-pill.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.category-pill i {
    font-size: 0.8125rem;
}


/* ============================================================
   5. Resource Cards (index.php)
   ============================================================ */

.resource-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
    position: relative;
    height: 100%;
}

.resource-card:hover {
    box-shadow: var(--card-hover-shadow);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.resource-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.resource-cover {
    background: var(--accent-muted);
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent-primary);
    position: relative;
    overflow: hidden;
}

.resource-cover::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0.05;
    border-radius: 50%;
}

.resource-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-body {
    padding: 1.25rem;
}

.resource-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.resource-desc {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.resource-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.875rem;
    border-top: 1px solid var(--border-default);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.resource-stats {
    display: flex;
    gap: 1rem;
}

.resource-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.8125rem;
}


/* ============================================================
   6. Featured Badge (index.php)
   ============================================================ */

.featured-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


/* ============================================================
   7. Section Title (shared)
   ============================================================ */

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.section-title small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 1rem;
}


/* ============================================================
   8. Featured Section (index.php)
   ============================================================ */

.featured-section {
    background: var(--bg-subtle);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-default);
}

.featured-section .resource-card {
    background: var(--card-bg);
}

.featured-section .resource-cover {
    height: 120px;
    font-size: 2rem;
}

.featured-section .resource-body {
    padding: 1rem;
}

.featured-section .resource-title {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.featured-section .resource-stats {
    font-size: 0.75rem;
}


/* ============================================================
   9. Empty State (shared)
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px dashed var(--border-default);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 2rem;
}

.empty-state h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 0;
}


/* ============================================================
   10. Pagination (shared)
   ============================================================ */

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.pagination .page-link {
    background: var(--card-bg);
    border-color: var(--border-default);
    color: var(--text-secondary);
    padding: 0.5rem 0.875rem;
    margin: 0 0.125rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.pagination .page-link:hover {
    background: var(--bg-subtle);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pagination .page-item.active .page-link {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.pagination .page-item.disabled .page-link {
    background: var(--bg-muted);
    color: var(--text-subtle);
}


/* ============================================================
   11. Detail — Page Header (detail.php)
   ============================================================ */

.page-header {
    background: var(--bg-subtle);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-default);
}

.breadcrumb-custom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.breadcrumb-custom a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-custom a:hover {
    color: var(--accent-primary);
}

.breadcrumb-custom .separator {
    color: var(--text-subtle);
}

.breadcrumb-custom .current {
    color: var(--text-secondary);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}


/* ============================================================
   12. Detail — Main Card (detail.php)
   ============================================================ */

.main-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.resource-preview {
    background: var(--accent-muted);
    padding: 3rem;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.resource-preview::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 60%;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0.05;
    border-radius: 50%;
}

.file-icon-large {
    font-size: 4rem;
    color: var(--accent-primary);
    position: relative;
    z-index: 1;
}

.resource-preview img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}


/* ============================================================
   13. Detail — Action Buttons (detail.php)
   ============================================================ */

.action-buttons {
    padding: 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-default);
}

.btn-action {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-view {
    background: var(--accent-success);
    color: white;
}

.btn-view:hover {
    background: var(--accent-success-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-download {
    background: var(--accent-primary);
    color: white;
}

.btn-download:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
}


/* ============================================================
   14. Detail — Resource Info Grid
   ============================================================ */

.resource-info {
    padding: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-subtle);
    border-radius: 8px;
    border: 1px solid var(--border-default);
}

.info-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-value a {
    color: var(--accent-primary);
    text-decoration: none;
}

.info-value a:hover {
    color: var(--accent-hover);
}


/* ============================================================
   15. Detail — Description & Tags
   ============================================================ */

.description-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border-default);
}

.section-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-heading i {
    color: var(--accent-primary);
}

.description-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

.tag-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--bg-muted);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
}


/* ============================================================
   16. File Badges (shared — unified)
   ============================================================ */

.file-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.file-badge-pdf,
.file-badge-doc,
.file-badge-docx {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-error);
}

.file-badge-doc,
.file-badge-docx {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
}

.file-badge-video,
.file-badge-mp4 {
    background: rgba(147, 51, 234, 0.1);
    color: var(--accent-purple);
}

.file-badge-zip,
.file-badge-rar {
    background: rgba(234, 179, 8, 0.1);
    color: var(--accent-warning);
}

.file-badge-other {
    background: var(--bg-muted);
    color: var(--text-muted);
}


/* ============================================================
   17. Detail — Sidebar
   ============================================================ */

.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title i {
    color: var(--accent-primary);
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    padding: 0.375rem 0;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.tips-list li i {
    color: var(--accent-success);
    margin-top: 0.125rem;
    font-size: 0.75rem;
}

.btn-copy {
    background: var(--bg-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: var(--bg-emphasis);
    color: var(--text-primary);
}


/* ============================================================
   18. Detail — Related Resources
   ============================================================ */

.related-section {
    padding: 2.5rem 0;
}

.related-section .section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.625rem;
}

.related-section .section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.related-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    height: 100%;
    color: inherit;
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--accent-primary);
    color: inherit;
}

.related-cover {
    background: var(--accent-muted);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent-primary);
}

.related-body {
    padding: 0.875rem;
}

.related-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.related-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
}

.related-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


/* ============================================================
   19. Footer (shared — uses CSS variables)
   ============================================================ */

.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent-primary);
}

.footer .text-muted-theme {
    color: var(--footer-text-muted) !important;
}


/* ============================================================
   20. Responsive
   ============================================================ */

@media (max-width: 768px) {
    /* Hero */
    .hero-section {
        padding: 2.5rem 0 2rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-metric-strip {
        grid-template-columns: 1fr;
    }

    .hero-section .hero-icon {
        width: 56px;
        height: 56px;
        border-radius: 12px;
    }

    .hero-section .hero-icon i {
        font-size: 1.5rem;
    }

    /* Category pills */
    .category-pill {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* Resource cards */
    .resource-cover {
        height: 120px;
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    /* Detail page */
    .page-title {
        font-size: 1.375rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .resource-preview {
        padding: 2rem;
    }

    .file-icon-large {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}
