/* ==========================================================================
   养育资源页（resources.html）专属样式
   通过 .channel-resources 作用域限定，确保不影响其他频道
   ========================================================================== */

/* 频道基础颜色覆盖 (深蓝色主题) */
.channel-resources {
    --res-primary: #3b82f6;
    --res-primary-dark: #1e3a8a;
    --res-primary-light: #eff6ff;
    
    /* 强力覆盖全局变量 */
    --primary-color: #3b82f6 !important;
    --bs-primary: #3b82f6 !important;
}

/* 恢复面包屑的白色，防止在蓝色 Banner 上看不清 */
.channel-resources .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8) !important;
}
.channel-resources .breadcrumb-item a:hover {
    color: #ffffff !important;
}

/* 引导语与卡片蓝色适配 */
.channel-resources .intro-badge {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}
.channel-resources .intro-box {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid #dbeafe;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.08);
}
.channel-resources .resource-card::before {
    background: linear-gradient(90deg, #60a5fa, #3b82f6, #1e3a8a);
}
.channel-resources .resource-icon {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.28);
}
.channel-resources .resource-card .tag {
    color: #1e40af;
    background: #eff6ff;
}
.channel-resources .resource-card .read-more {
    color: #1e40af;
}
.channel-resources .section-title::before {
    background: linear-gradient(180deg, #60a5fa, #1e3a8a);
}
.channel-resources .related-link:hover {
    box-shadow: 0 10px 22px rgba(30, 64, 175, 0.1);
    border-color: #bfdbfe;
}
.channel-resources .related-icon {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
}
.channel-resources .related-link:hover .related-icon {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

/* ========== 页面容器 ========== */
.resources-intro {
    position: relative;
    background: #ffffff;
    padding: 56px 0 90px;
    overflow: hidden;
}
.resources-intro::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -80px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(76, 207, 168, 0.18) 0%, rgba(76, 207, 168, 0) 70%);
    pointer-events: none;
}
.resources-intro::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(34, 177, 140, 0.12) 0%, rgba(34, 177, 140, 0) 70%);
    pointer-events: none;
}
.resources-intro > .container {
    position: relative;
    z-index: 1;
}

/* ========== 引导语 ========== */
.intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 177, 140, 0.1);
    color: #17876a;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 99px;
    margin-bottom: 18px;
}
.intro-box {
    position: relative;
    background: linear-gradient(135deg, #f4fbf8 0%, #ffffff 100%);
    border: 1px solid #dcefe6;
    border-left: 4px solid #22b18c;
    border-radius: 18px;
    padding: 28px 30px;
    box-shadow: 0 10px 30px rgba(23, 135, 106, 0.08);
    margin-bottom: 8px;
}
.intro-box::before {
    content: "\201D";
    position: absolute;
    top: 4px;
    right: 20px;
    font-size: 3.2rem;
    line-height: 1;
    color: rgba(34, 177, 140, 0.18);
    font-family: Georgia, serif;
}
.resources-intro .lead {
    color: #4a5a55;
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* ========== 资源卡片 ========== */
.resource-card {
    position: relative;
    height: 100%;
    border: 1px solid #e8efe9;
    border-radius: 20px;
    background: #fff;
    padding: 30px 26px 26px;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.resource-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4ccfa8, #22b18c, #17876a);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.resource-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(23, 135, 106, 0.14), 0 4px 12px rgba(23, 135, 106, 0.06);
    border-color: #bfe3d6;
}
.resource-card:hover::before { opacity: 1; }

.resource-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    background: linear-gradient(135deg, #4ccfa8 0%, #22b18c 100%);
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 8px 18px rgba(34, 177, 140, 0.28);
    transition: transform 0.3s ease;
}
.resource-card:hover .resource-icon { transform: scale(1.06) rotate(-3deg); }

.resource-card h3 {
    font-size: 1.22rem;
    font-weight: 700;
    color: #1f2d28;
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}
.resource-card p {
    color: #66706c;
    font-size: 0.94rem;
    line-height: 1.75;
    margin-bottom: 20px;
    flex: 1 1 auto;
}
.resource-card .tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #17876a;
    background: #eef8f5;
    border-radius: 99px;
    padding: 4px 12px;
    margin-bottom: 16px;
}
.resource-card .read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #17876a;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: gap 0.25s ease;
}
.resource-card:hover .read-more { gap: 10px; }
.resource-card .read-more i { font-size: 0.8rem; }

/* ========== 分区标题 ========== */
.section-title {
    position: relative;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2d28;
    padding-left: 14px;
    margin-bottom: 22px;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(180deg, #4ccfa8, #17876a);
}

/* ========== 延伸内容 ========== */
.related-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 18px 18px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eef1ef;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
}
.related-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(23, 135, 106, 0.1);
    border-color: #bfe3d6;
}
.related-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #eef8f5, #dff3eb);
    color: #17876a;
    margin-right: 14px;
    transition: background 0.25s ease, color 0.25s ease;
}
.related-link:hover .related-icon {
    background: linear-gradient(135deg, #4ccfa8, #22b18c);
    color: #fff;
}
.related-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2d28;
    margin-bottom: 2px;
}
.related-desc {
    font-size: 0.82rem;
    color: #7a8581;
    line-height: 1.5;
}

/* ========== 致家长的一封信 专属样式 ========== */
/* 书信正文 */
.letter-box p {
    color: #4a5a55;
    font-size: 1.02rem;
    line-height: 1.9;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

/* 开发中卡片：弱化展示，不可点击 */
.resource-card-soon {
    background: #f7faf9;
    cursor: default;
}
.resource-card-soon:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(23, 135, 106, 0.06);
    border-color: #e8efe9;
}
.resource-card-soon .resource-icon {
    opacity: 0.55;
}
.tag-soon {
    background: #eef2f1;
    color: #7a8581;
}

/* 底部重要提醒 */
.letter-notice {
    background: #fff8ef;
    border: 1px solid #f2e3c8;
    border-left: 4px solid #e8a33d;
    border-radius: 14px;
    padding: 18px 22px;
    color: #6b5a3e;
    line-height: 1.8;
    font-size: 0.95rem;
}

/* 书信开头插图：居中圆角，悬停切换 */
.letter-img-swap {
    position: relative;
    width: min(420px, 100%);
    margin: 0 auto 20px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(23, 135, 106, 0.1);
    cursor: pointer;
}
.letter-img {
    display: block;
    width: 100%;
    border-radius: 16px;
    transition: opacity 0.4s ease;
}
.letter-img-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.letter-img-swap:hover .letter-img-hover {
    opacity: 1;
}
.letter-img-swap:hover .letter-img-default {
    opacity: 0;
}

/* ========== 图片放大模态框 ========== */
@media (max-width: 991.98px) {
    /* 减少页面容器留白，让大图更宽 */
    .resources-intro .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .resources-intro .row > [class*="col-"] {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .intro-box {
        padding: 15px 5px !important;
        border-radius: 12px;
        border-left-width: 3px !important;
    }

    .img-zoomable {
        cursor: zoom-in;
        transition: transform 0.3s ease;
    }
    .img-zoomable:hover {
        transform: scale(1.01);
    }
    
    /* 移动端全屏且无左右留白 */
    .img-fullscreen-modal .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        height: 100%;
    }
    .img-fullscreen-modal .modal-content {
        height: 100%;
        border-radius: 0;
        background: #000;
        border: none;
    }
    .img-fullscreen-modal .modal-body {
        padding: 0 !important;
        height: 100%;
        display: block;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .img-fullscreen-modal .modal-body img {
        border-radius: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        display: block;
        background: transparent !important;
    }
}

.img-fullscreen-modal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
}
.img-fullscreen-modal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
}
.img-fullscreen-modal .modal-body {
    padding: 0;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* 优化 iOS 滚动 */
}
.img-fullscreen-modal .modal-body img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #fff;
}
.img-fullscreen-modal .btn-close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 50%;
    opacity: 0.8;
}
.img-fullscreen-modal .btn-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .img-fullscreen-modal .btn-close {
        top: 15px;
        right: 15px;
    }
}

/* ========== 文字版科普内容 ========== */
.article-content {
    color: #4a5a55;
    line-height: 1.8;
}
.article-content h3 {
    color: #1f2d28;
    font-size: 1.5rem;
}
.article-content .section-title {
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
}
.article-content p {
    margin-bottom: 1.2rem;
}
.article-content .table {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid #e8efe9;
}
.article-content .table thead th {
    background-color: #f4fbf8;
    color: #17876a;
    font-weight: 700;
    border-bottom: 2px solid #dcefe6;
}
.article-content .table td {
    padding: 12px 15px;
    vertical-align: middle;
}
.article-content blockquote {
    border-left: 4px solid #22b18c;
    background: #f4fbf8;
    padding: 15px 20px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 1.5rem;
}
.article-content ul li {
    margin-bottom: 8px;
    position: relative;
}

/* 增强版文字版提示 */
.text-version-hint-box {
    background: linear-gradient(135deg, #fffcf5 0%, #fff8e6 100%);
    border: 1px solid #ffeeba;
    border-left: 5px solid #ffc107;
    padding: 24px 30px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(255, 193, 7, 0.15);
    position: relative;
    overflow: hidden;
    margin-bottom: 40px; /* 增加与下方内容的间距 */
    animation: hintPulse 2s infinite ease-in-out;
}

@keyframes hintPulse {
    0% { transform: scale(1); box-shadow: 0 12px 30px rgba(255, 193, 7, 0.15); }
    50% { transform: scale(1.01); box-shadow: 0 15px 35px rgba(255, 193, 7, 0.25); }
    100% { transform: scale(1); box-shadow: 0 12px 30px rgba(255, 193, 7, 0.15); }
}

.text-version-hint-box::after {
    content: "\f27d"; /* bi-card-text icon code */
    font-family: "bootstrap-icons";
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 8rem;
    color: rgba(255, 193, 7, 0.05);
    transform: rotate(-15deg);
    pointer-events: none;
}
.text-version-hint-title {
    color: #856404;
    font-size: 1.25rem; /* 稍微加大字号 */
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0 !important; /* 提示框内不再有下边距 */
}
.text-version-hint-title i {
    font-size: 1.8rem;
    color: #fff;
    background: #ffc107;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

/* ========== 视觉增强：PK 对比卡片 ========== */
.comparison-card {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e8efe9;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}
.comparison-header {
    display: flex;
    background: #f8fbf9;
    border-bottom: 1px solid #e8efe9;
}
.comparison-header > div {
    flex: 1;
    padding: 15px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}
.vs-normal { color: #4a5a55; }
.vs-adhd { color: #17876a; background: rgba(34, 177, 140, 0.05); }

.comparison-row {
    display: flex;
    border-bottom: 1px solid #f0f4f1;
    transition: background 0.3s ease;
}
.comparison-row:hover { background: #fcfdfc; }
.comparison-row:last-child { border-bottom: none; }
.comparison-cell {
    flex: 1;
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}
.cell-label {
    flex: 0 0 120px;
    background: #fcfdfc;
    border-right: 1px solid #f0f4f1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    color: #7a8581;
    font-size: 0.85rem;
    padding: 10px;
}
.cell-adhd { background: rgba(34, 177, 140, 0.02); }

@media (max-width: 768px) {
    .comparison-row { flex-direction: column; }
    .cell-label { flex: 0 0 auto; border-right: none; border-bottom: 1px solid #f0f4f1; width: 100%; padding: 8px; }
}

/* ========== 核心要点卡片 ========== */
.summary-highlight-card {
    background: linear-gradient(135deg, #22b18c 0%, #17876a 100%);
    border-radius: 20px;
    padding: 30px;
    color: #fff;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(23, 135, 106, 0.2);
}
.summary-highlight-card::before {
    content: "\f479"; /* bi-lightbulb */
    font-family: "bootstrap-icons";
    position: absolute;
    right: -20px;
    top: -20px;
    font-size: 10rem;
    opacity: 0.1;
    transform: rotate(15deg);
}
.summary-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}
.summary-item:last-child { margin-bottom: 0; }
.summary-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

/* ========== 共病分类分组样式 ========== */
.comorbidity-section {
    margin-bottom: 3rem;
}
.comorbidity-group-title {
    font-size: 1rem;
    font-weight: 800;
    color: #7a8581;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.comorbidity-group-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #e8efe9, transparent);
}

.comorbidity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 2.5rem;
}

.comorbidity-item {
    background: #fff;
    border: 1px solid #e8efe9;
    border-radius: 20px; /* 更圆润的角 */
    padding: 24px; /* 增加内边距 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.comorbidity-item:hover {
    transform: translateY(-8px); /* 悬停浮起更高一点 */
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

/* 行为类主题 */
.group-behavior .comorbidity-item { border-left: 4px solid #ff6b6b; }
.group-behavior .comorbidity-name { color: #e63946; }
.group-behavior .comorbidity-item:hover { border-color: #ff6b6b; background: #fffafb; }

/* 情绪类主题 */
.group-emotion .comorbidity-item { border-left: 4px solid #fcc419; }
.group-emotion .comorbidity-name { color: #d9480f; }
.group-emotion .comorbidity-item:hover { border-color: #fcc419; background: #fffcf5; }

/* 发育类主题 */
.group-development .comorbidity-item { border-left: 4px solid #4dabf7; }
.group-development .comorbidity-name { color: #1971c2; }
.group-development .comorbidity-item:hover { border-color: #4dabf7; background: #f8fbff; }

/* 生理感官类主题 */
.group-physical .comorbidity-item { border-left: 4px solid #38d9a9; }
.group-physical .comorbidity-name { color: #087f5b; }
.group-physical .comorbidity-item:hover { border-color: #38d9a9; background: #f6fffb; }

.comorbidity-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.comorbidity-name i {
    width: 36px;
    height: 36px;
    background: #f8fbf9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}
.group-behavior .comorbidity-name i { background: #fff5f5; color: #ff6b6b; }
.group-emotion .comorbidity-name i { background: #fff9db; color: #fcc419; }
.group-development .comorbidity-name i { background: #e7f5ff; color: #4dabf7; }
.group-physical .comorbidity-name i { background: #e6fcf5; color: #38d9a9; }

.comorbidity-item:hover .comorbidity-name i {
    transform: scale(1.1) rotate(-5deg);
}
.comorbidity-desc {
    font-size: 0.9rem;
    color: #5c6b66;
    line-height: 1.7;
}

/* ========== 快速导航栏 ========== */
.quick-toc {
    position: sticky;
    top: 100px;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e8efe9;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02);
}
.toc-title {
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #abb5b1;
    margin-bottom: 15px;
    letter-spacing: 1px;
}
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-list li { margin-bottom: 10px; }
.toc-link {
    color: #4a5a55;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.toc-link:hover { color: #22b18c; padding-left: 5px; }
.toc-link::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #dcefe6;
    border-radius: 50%;
    transition: all 0.2s;
}
.toc-link:hover::before {
    background: #22b18c;
    transform: scale(1.2);
}
