@import url('../address3/index.css');

/*
 * address3 与 common3 均含 html/body height:100%，会把 body 钉死在视口高度；
 * 新闻详情正文超长时无法撑开文档流，内容会叠在页脚上方。此处用 min-height 保留「至少一屏」，
 * height:auto 允许随内容增高。
 */
html {
    height: auto;
    min-height: 100%;
    min-height: -webkit-fill-available;
}

body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    font-family: "Microsoft YaHei", sans-serif;
    background-color: #f9f9f9;
    background-image: none;
    margin: 0;
    padding: 0;
}

.common3-main-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 300px);
    min-height: calc(100dvh - 300px);
    padding-top: 0;
    padding-bottom: 24px;
    background-color: #ffffff;
    box-sizing: border-box;
}

.news3-main-inner {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .news3-main-inner {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* —— 以下与风格1 news/page.html 对齐，主题色用 common3 变量 —— */

.news-content img,
#editor-text-area img,
#content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px auto;
    border-radius: 0;
    box-shadow: none;
    cursor: zoom-in;
}

.news-content,
#editor-text-area {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
    overflow-x: auto;
    /* 不用 flex:1，避免 wangEditor 在列布局里被拉高后内部溢出叠到页脚 */
    flex: 0 1 auto;
    min-height: 0;
}

.news-content table,
#editor-text-area table {
    max-width: 100% !important;
    table-layout: fixed;
    word-wrap: break-word;
}

.news-content video,
#editor-text-area video {
    max-width: 100% !important;
    height: auto !important;
}

.news-detail-container {
    max-width: 1400px;
    margin: 24px auto 20px;
    background-color: #fff;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: calc(100vh - 23.45rem);
    min-height: calc(100dvh - 23.45rem);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    flex: 0 1 auto;
}

.news-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.return-icon {
    font-size: 24px;
    color: var(--primary-color, #007bff);
    margin-right: 10px;
    cursor: pointer;
    transition: color 0.3s, opacity 0.3s;
}

.return-icon:hover {
    opacity: 0.85;
}

.news-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    text-align: center;
    flex: 1;
}

.news-title-divider {
    border: 0;
    border-top: 1px solid #e8e8e8;
    margin: 14px 0 12px;
    width: 100%;
}

.news-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 40px;
    border-top: 1px solid #f0f0f0;
    gap: 30px;
}

.nav-item {
    flex: 1;
    max-width: 48%;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 0;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color, #007bff);
}

.nav-link:hover .nav-title {
    color: var(--primary-color, #007bff);
}

.nav-link.disabled {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.nav-link.disabled:hover {
    color: #ccc;
}

.nav-link.disabled:hover .nav-title {
    color: #ccc;
}

.prev-news .nav-link {
    text-align: left;
    justify-content: flex-start;
}

.next-news .nav-link {
    text-align: right;
    justify-content: flex-end;
}

.nav-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-label {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.nav-link:hover .nav-label {
    color: var(--primary-color, #007bff);
}

.nav-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s ease;
}

.nav-link i {
    font-size: 16px;
    color: #999;
    margin: 0 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.prev-news .nav-link i {
    margin-right: 12px;
    margin-left: 0;
}

.next-news .nav-link i {
    margin-left: 12px;
    margin-right: 0;
    order: 1;
}

.nav-link:hover i {
    color: var(--primary-color, #007bff);
    transform: translateX(0);
}

.prev-news .nav-link:hover i {
    transform: translateX(-3px);
}

.next-news .nav-link:hover i {
    transform: translateX(3px);
}

.w-e-text-container {
    min-height: 200px !important;
    height: auto !important;
    position: relative !important;
}

.w-e-text {
    padding: 0 !important;
}

.w-e-textarea-container {
    border: none !important;
    padding: 0 !important;
}

.w-e-toolbar {
    display: none !important;
}

.w-e-scroll {
    padding: 0 !important;
    min-height: 200px !important;
}

#editor-text-area {
    min-height: 200px;
}

@media (max-width: 768px) {
    .news-detail-container {
        margin: 0 auto 10px !important;
        border: none;
        padding: 15px;
    }

    .news-title {
        font-size: 24px;
    }

    .news-content,
    #editor-text-area {
        font-size: 14px;
    }

    .news-content img,
    #editor-text-area img,
    #content img {
        margin: 8px auto;
    }

    .news-navigation {
        flex-direction: row;
        gap: 10px;
        padding-top: 30px;
    }

    .nav-item {
        max-width: 48%;
        flex: 1;
    }

    .nav-link {
        padding: 8px 0;
        justify-content: flex-start;
    }

    .next-news .nav-link {
        justify-content: flex-end;
        text-align: right;
    }

    .next-news .nav-link i {
        order: 1;
        margin-left: 8px;
        margin-right: 0;
    }

    .nav-title {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }

    .nav-label {
        font-size: 10px;
    }

    .nav-link i {
        font-size: 12px;
        margin: 0 8px;
    }

    .prev-news .nav-link i {
        margin-right: 8px;
        margin-left: 0;
    }
}

@media (min-width: 1536px) and (max-width: 1900px) {
    .news-detail-container {
        max-width: 1200px;
    }
}

@media (max-width: 1400px) and (min-width: 1024px) {
    .news-detail-container {
        max-width: 1200px;
    }

    .news-title {
        font-size: 28px;
    }
}
