/* ==========================================================================
   nhjs（办公室）子站首页专属样式（nhjs-index.css）
   第一行：大轮播（左）+ 通知公告（右）
   第二行：规章制度 / 办事流程 / 下载专区（三列）
   加载顺序：bootstrap → common.css → nhjs.css → nhjs-index.css
   ========================================================================== */

/* ==================== 容器 ==================== */
.nhjs-main {
    width: 100%;
    max-width: 1100px;
    margin: 15px auto 30px;
}

/* ==================== 第一行：轮播 + 通知公告 ==================== */
.nhjs-top-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
    height: 300px;
}

#nhjsSlide {
    flex: 1;
    min-width: 0;
}

#nhjsCarousel {
    border: 1px solid #ddd;
    overflow: hidden;
    height: 100%;
}

#nhjsCarousel .carousel-inner {
    height: 100%;
}

#nhjsCarousel .carousel-item {
    height: 100%;
}

#nhjsCarousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#nhjsCarousel .carousel-caption {
    right: 0;
    left: 0;
    bottom: 0;
    padding: 10px 20px 28px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    text-align: center;
    text-shadow: none;
}

#nhjsCarousel .carousel-caption p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

#nhjsCarousel .carousel-caption a {
    color: #fff;
    font-size: 16px;
}

#nhjsCarousel .carousel-caption a:hover {
    color: #7fe0bb;
}

#nhjsCarousel .carousel-indicators {
    margin-bottom: 6px;
}

/* 第一行右侧部门简介卡片（高度与轮播对齐，正文截取填充） */
.nhjs-top-row .nhjs-intro-card {
    flex: 1;
    min-width: 0;
    margin: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.nhjs-intro-body {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 12px 16px 20px;
    color: #444;
    font-size: 14px;
    line-height: 1.9;
    word-break: break-word;
}

.nhjs-intro-body p,
.nhjs-intro-body div {
    margin: 0 0 8px;
}

.nhjs-intro-body img {
    max-width: 100%;
    height: auto;
}

/* 底部渐隐，提示还有更多内容 */
.nhjs-intro-body::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px;
    background: linear-gradient(rgba(255, 255, 255, 0), #fff);
    pointer-events: none;
}

.nhjs-intro-body.nhjs-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.nhjs-intro-body.nhjs-empty::after {
    display: none;
}

/* ==================== 第二行：三列 ==================== */
.nhjs-bottom-row {
    display: flex;
    gap: 20px;
}

.nhjs-bottom-row .nhjs-card {
    flex: 1;
    min-width: 0;
}

/* ==================== 卡片通用 ==================== */
.nhjs-card {
    background: #fff;
    border: 1px solid #e6e6e6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

/* ==================== 卡片标题栏 ==================== */
.nhjs-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.nhjs-card-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    padding-left: 10px;
    border-left: 4px solid #006D4C;
    line-height: 20px;
}

.nhjs-card-head h2 a {
    text-decoration: none;
    color: #006D4C;
}

.nhjs-card-head h2 a:hover {
    color: #2a9d6e;
}

.nhjs-more {
    font-size: 13px;
    color: #999;
    text-decoration: none;
}

/* 四色主题 */
.color-1 .nhjs-card-head h2 { border-left-color: #006D4C; }
.color-1 .nhjs-card-head h2 a { color: #006D4C; }
.color-1 .nhjs-card-head h2 a:hover,
.color-1 .nhjs-more:hover { color: #2a9d6e; }

.color-2 .nhjs-card-head h2 { border-left-color: #2a9d6e; }
.color-2 .nhjs-card-head h2 a { color: #2a9d6e; }
.color-2 .nhjs-card-head h2 a:hover,
.color-2 .nhjs-more:hover { color: #1f7d56; }

.color-3 .nhjs-card-head h2 { border-left-color: #2a7a9d; }
.color-3 .nhjs-card-head h2 a { color: #2a7a9d; }
.color-3 .nhjs-card-head h2 a:hover,
.color-3 .nhjs-more:hover { color: #1d5c78; }

.color-4 .nhjs-card-head h2 { border-left-color: #b7791f; }
.color-4 .nhjs-card-head h2 a { color: #b7791f; }
.color-4 .nhjs-card-head h2 a:hover,
.color-4 .nhjs-more:hover { color: #96620f; }

/* ==================== 卡片列表 ==================== */
.nhjs-card-list {
    list-style: none;
    margin: 0;
    padding: 8px 16px 12px;
    flex: 1;
}

.nhjs-card-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 14px;
}

.nhjs-card-list li:last-child {
    border-bottom: none;
}

.nhjs-card-list li a {
    flex: 1;
    min-width: 0;
    color: #444;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' viewBox='0 0 6 6'%3E%3Crect width='6' height='6' fill='%23006D4C'/%3E%3C/svg%3E") left center no-repeat;
}

.nhjs-card-list li a:hover {
    color: #006D4C;
}

.nhjs-date {
    flex-shrink: 0;
    margin-left: 12px;
    color: #999;
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
}

.nhjs-empty {
    justify-content: center;
    color: #999;
    padding: 24px 0;
    background: none;
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 767px) {
    .nhjs-main {
        margin: 10px auto 20px;
        padding: 0 10px;
    }

    .nhjs-top-row {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
        height: auto;
    }

    /* 移动端部门简介限制高度，避免过长 */
    .nhjs-intro-body {
        max-height: 220px;
    }

    #nhjsCarousel .carousel-item img {
        min-height: 200px;
        height: 200px;
    }

    #nhjsCarousel .carousel-caption p,
    #nhjsCarousel .carousel-caption a {
        font-size: 13px;
    }

    .nhjs-bottom-row {
        flex-direction: column;
        gap: 12px;
    }

    .nhjs-card-head h2 {
        font-size: 16px;
    }

    .nhjs-card-list li {
        font-size: 13px;
    }
}
