/* ===== Layout / 全局通用 ===== */
:root {
    --c-primary: #1976d2;
    --c-primary-2: #42a5f5;
    --c-accent: #f57c00;
    --c-text: #1a3a5c;
    --c-text-soft: rgba(26, 58, 92, 0.65);
    --c-text-mute: rgba(26, 58, 92, 0.5);
    --c-border: rgba(100, 160, 220, 0.4);
    --c-surface: rgba(255, 255, 255, 0.92);
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 8px 28px rgba(25, 118, 210, 0.15);
}

body {
    background: linear-gradient(180deg, #d4e8f7 0%, #e8f4fd 40%, #c8dcec 100%);
    color: var(--c-text);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(100, 180, 255, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 30%, rgba(150, 200, 255, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(80, 160, 240, 0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* KV 头图 */
.kv-header {
    position: relative;
    width: 100%;
    overflow: hidden;
    z-index: 1;
    line-height: 0;
}

.kv-header img {
    width: 100%;
    height: auto;
}

.kv-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    background: linear-gradient(180deg, transparent 0%, #d4e8f7 100%);
    pointer-events: none;
}

/* 导航 */
.nav-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 248, 255, 0.96) 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(100, 160, 220, 0.3);
    box-shadow: 0 2px 20px rgba(25, 118, 210, 0.08);
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px;
}

.nav-tab {
    flex: 1;
    max-width: 220px;
    padding: 14px 20px;
    color: rgba(26, 58, 92, 0.65);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.nav-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.08), rgba(66, 165, 245, 0.08));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.nav-tab:hover::before {
    opacity: 1;
}

.nav-tab:hover {
    color: #1565c0;
}

.nav-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-2) 100%);
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.35);
}

.nav-tab.active::before {
    opacity: 0;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--c-primary-2), #ffd700);
    border-radius: 2px;
}

/* 内容容器 */
.content-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.module-content {
    display: none;
    animation: fadeIn 0.45s ease;
}

.module-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-title {
    font-size: 30px;
    color: var(--c-text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.module-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 30px;
    background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
    border-radius: 2px;
    flex-shrink: 0;
}

.module-desc {
    color: var(--c-text-soft);
    font-size: 15px;
    margin-bottom: 28px;
    padding-left: 18px;
}

/* 子标签 */
.sub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    padding-left: 18px;
}

.sub-tab {
    padding: 8px 22px;
    border: 1px solid rgba(25, 118, 210, 0.3);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 26px;
    font-size: 14px;
    color: rgba(26, 58, 92, 0.7);
    transition: all 0.3s ease;
}

.sub-tab:hover {
    background: rgba(25, 118, 210, 0.08);
    color: #1565c0;
}

.sub-tab.active {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
    color: #fff;
    border-color: transparent;
}

.sub-content {
    display: none;
}

.sub-content.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

@media (min-width: 769px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
    transform: translateX(-100%);
    transition: transform 0.35s ease;
}

.card:hover {
    background: #fff;
    border-color: rgba(25, 118, 210, 0.5);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.card:hover::before {
    transform: translateX(0);
}

.card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #c8dcec, #e8f4fd);
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-tag {
    display: inline-block;
    padding: 3px 11px;
    background: rgba(25, 118, 210, 0.1);
    border: 1px solid rgba(25, 118, 210, 0.3);
    border-radius: 20px;
    font-size: 12px;
    color: #1565c0;
    margin-bottom: 10px;
    font-weight: 500;
}

.card-tag.live {
    background: rgba(220, 0, 0, 0.1);
    border-color: rgba(220, 0, 0, 0.3);
    color: #d32f2f;
}

.card-tag.upcoming {
    background: rgba(255, 165, 0, 0.12);
    border-color: rgba(255, 165, 0, 0.35);
    color: var(--c-accent);
}

.card-title {
    font-size: 17px;
    color: var(--c-text);
    margin-bottom: 10px;
    line-height: 1.55;
    font-weight: 600;
}

.card-meta {
    display: flex;
    gap: 16px;
    color: rgba(26, 58, 92, 0.55);
    font-size: 13px;
    flex-wrap: wrap;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 科普卡片 */
.science-card .sci-line1 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(26, 58, 92, 0.75);
    margin-bottom: 6px;
    font-weight: 500;
}

.science-card .sci-line2 {
    font-size: 13px;
    color: rgba(26, 58, 92, 0.5);
    margin-bottom: 12px;
}

/* 文献列表 */
.literature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.literature-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.literature-item:hover {
    background: #fff;
    border-color: rgba(25, 118, 210, 0.5);
    transform: translateX(6px);
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.12);
}

.literature-title {
    font-size: 15px;
    color: var(--c-text);
    margin-bottom: 10px;
    line-height: 1.5;
    font-weight: 500;
}

.literature-abstract {
    font-size: 13.5px;
    color: rgba(26, 58, 92, 0.6);
    line-height: 1.7;
    margin-bottom: 10px;
}

.literature-time {
    font-size: 13px;
    color: var(--c-text-mute);
}

/* 病例卡片 */
.case-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.case-card:hover {
    background: #fff;
    border-color: rgba(25, 118, 210, 0.5);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.case-status {
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.case-status.discussing {
    background: rgba(255, 165, 0, 0.12);
    color: var(--c-accent);
}

.case-status.resolved {
    background: rgba(0, 150, 0, 0.1);
    color: #2e7d32;
}

.case-footer {
    display: flex;
    gap: 16px;
    color: var(--c-text-mute);
    font-size: 13px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(100, 160, 220, 0.25);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 7px 14px;
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-size: 14px;
    color: rgba(26, 58, 92, 0.7);
    transition: all 0.25s ease;
}

.page-btn:hover:not(:disabled) {
    background: rgba(25, 118, 210, 0.08);
    color: #1565c0;
}

.page-btn.active {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
    color: #fff;
    border-color: transparent;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 详情页 */
.detail-page {
    display: none;
    animation: fadeIn 0.45s ease;
}

.detail-page.active {
    display: block;
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--c-border);
    border-radius: 20px;
    font-size: 14px;
    color: rgba(26, 58, 92, 0.7);
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.detail-back:hover:not(:disabled) {
    background: rgba(25, 118, 210, 0.08);
    color: #1565c0;
}

.detail-back:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.detail-video-area {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 100%);
}

.detail-video-area video,
.detail-video-area iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.detail-cover {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, #c8dcec, #e8f4fd);
}

.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-video-title {
    font-size: 22px;
    color: var(--c-text);
    margin-bottom: 12px;
    font-weight: 600;
}

.detail-video-meta {
    display: flex;
    gap: 16px;
    color: rgba(26, 58, 92, 0.55);
    font-size: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.detail-video-desc {
    background: var(--c-surface);
    border: 1px solid rgba(100, 160, 220, 0.35);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    color: rgba(26, 58, 92, 0.7);
    font-size: 14.5px;
    line-height: 1.85;
}

.detail-video-desc img {
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: 8px;
}

.detail-action {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

/* 文献详情 */
.detail-lit-title {
    font-size: 24px;
    color: var(--c-text);
    margin-bottom: 14px;
    line-height: 1.5;
    font-weight: 600;
}

.detail-lit-meta {
    display: flex;
    gap: 18px;
    color: rgba(26, 58, 92, 0.55);
    font-size: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(100, 160, 220, 0.25);
}

.detail-lit-abstract {
    background: var(--c-surface);
    border: 1px solid rgba(100, 160, 220, 0.35);
    border-radius: var(--radius-md);
    padding: 24px;
    color: rgba(26, 58, 92, 0.7);
    font-size: 15px;
    line-height: 1.9;
}

.detail-lit-abstract h3 {
    font-size: 17px;
    color: var(--c-text);
    margin-bottom: 12px;
}

.detail-lit-abstract img {
    max-width: 100%;
    height: auto;
    margin: 12px auto;
    border-radius: 8px;
}

/* 加载与空状态 */
.state-loading,
.state-empty,
.state-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-soft);
    font-size: 15px;
    background: var(--c-surface);
    border: 1px dashed var(--c-border);
    border-radius: var(--radius-md);
}

.state-error {
    color: #d32f2f;
}

/* 列表分页时的"无闪烁"加载态：保留旧内容，浮一层半透明 + 顶部进度条 */
.is-loading {
    position: relative;
    pointer-events: none;
}

.is-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    z-index: 2;
    border-radius: var(--radius-md);
}

.is-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--c-primary), transparent);
    background-size: 200% 100%;
    animation: loading-bar 1.1s linear infinite;
    z-index: 3;
}

@keyframes loading-bar {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(25, 118, 210, 0.2);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* footer */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 30px 20px;
    color: var(--c-text-mute);
    font-size: 13px;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        padding: 6px 8px;
        gap: 4px;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tab {
        flex: 0 0 auto;
        min-width: 100px;
        max-width: none;
        padding: 12px 14px;
        font-size: 14px;
    }

    .nav-tab.active::after {
        width: 32px;
        bottom: -7px;
    }

    .content-container {
        padding: 24px 16px;
    }

    .module-title {
        font-size: 24px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 18px;
    }

    .sub-tabs {
        padding-left: 0;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        gap: 6px;
    }

    .sub-tabs::-webkit-scrollbar {
        display: none;
    }

    .sub-tab {
        flex: 0 0 auto;
        padding: 9px 24px;
        white-space: nowrap;
    }

    .detail-video-title {
        font-size: 18px;
    }

    .detail-lit-title {
        font-size: 20px;
    }
}