/* Template 4 Styles - Independent */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.template4-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    position: relative;
}

/* PC端居中显示 - 固定手机屏幕宽度 */
.template4-body.mobile-preview {
    background-color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.template4-body.mobile-preview::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #f0f0f0;
    z-index: -1;
}

.template4-body.mobile-preview::after {
    content: '';
    display: block;
    width: 414px;
    min-height: 100vh;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    z-index: -1;
    pointer-events: none;
}

.template4-body.mobile-preview>* {
    width: 414px;
    max-width: 414px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* Footer在移动预览模式下保持正常文档流 */
.template4-body.mobile-preview>.template4-footer {
    position: relative;
}

/* 固定定位的元素需要特殊处理 - 在PC预览模式下也限制宽度 */
.template4-body.mobile-preview .template4-side-menu {
    left: 50%;
    margin-left: -207px;
    width: 414px;
    max-width: 414px;
    position: fixed !important;
    z-index: 1000 !important;
}

/* PC预览模式下侧边菜单内容区域确保可以点击 */
.template4-body.mobile-preview .template4-side-menu-content {
    pointer-events: auto !important;
    z-index: 1001 !important;
}

/* PC预览模式下导航项确保可以点击 */
.template4-body.mobile-preview .template4-side-menu-content .template4-nav-item {
    pointer-events: auto !important;
    cursor: pointer;
}

.template4-body.mobile-preview .template4-search-modal {
    left: 50%;
    margin-left: -207px;
    width: 414px;
    max-width: 414px;
    position: fixed !important;
    z-index: 2000 !important;
    top: 0 !important;
    height: 100vh !important;
}

.template4-body.mobile-preview .template4-side-menu-overlay,
.template4-body.mobile-preview .template4-search-modal-overlay {
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
}

/* Footer在PC预览模式下也需要特殊处理 */
.template4-body.mobile-preview .template4-footer {
    width: 414px;
    max-width: 414px;
    margin-left: auto;
    margin-right: auto;
}

/* Detail page footer in PC preview mode */
.template4-body.mobile-preview.detail-page .template4-footer {
    width: 414px;
    max-width: 414px;
    margin-left: auto;
    margin-right: auto;
}

/* Detail page search modal in PC preview mode */
.template4-body.mobile-preview.detail-page .template4-search-modal {
    left: 50%;
    margin-left: -207px;
    width: 414px;
    max-width: 414px;
    position: fixed !important;
    z-index: 2000 !important;
    top: 0 !important;
    height: 100vh !important;
}

/* Header Styles */
.template4-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #DEDEDE;
    z-index: 100;
    padding: 0;
    display: flex;
    align-items: center;
}

.template4-header-content {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.template4-logo-text {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.template4-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.template4-search-btn {
    text-decoration: none;
}

.template4-search-btn,
.template4-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.template4-search-btn svg,
.template4-menu-btn svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.template4-main {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background-color: #ffffff;
    min-height: calc(100vh - 60px - 80px);
}

/* News List */
.template4-news-list {
    padding: 0;
    background-color: #F4F9F8;
}

.template4-news-thumbnail {
    width: 100%;
    padding: 0;
    margin: 0;
    aspect-ratio: 345 / 172;
    overflow: hidden;
    border-radius: 0;
    background-color: #f0f0f0;
    box-sizing: border-box;
    display: block;
    padding-left: 15px;
    padding-right: 15px;
}

.template4-news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template4-news-content {
    padding: 15px 15px 20px 15px;
}

.template4-news-title {
    font-family: Poppins, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: 0px;
    color: #222222;
    margin: 0;
}

/* Footer */
.template4-footer {
    width: 100%;
    background-color: #000000;
    padding: 30px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template4-footer-content {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
}

.template4-footer-copyright {
    color: #FFFFFF;
    font-size: 12px;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template4-footer-links {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.template4-footer-link {
    color: #FFFFFF;
    font-size: 12px;
    text-decoration: underline;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template4-footer-link:hover {
    opacity: 0.8;
}

.template4-footer-contact {
    color: #FFFFFF;
    font-size: 12px;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template4-footer-email {
    color: #FFFFFF;
    text-decoration: underline;
}

.template4-footer-email:hover {
    opacity: 0.8;
}

/* Side Menu */
.template4-side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.template4-side-menu.active {
    display: block;
}

.template4-side-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s;
}

.template4-side-menu.active .template4-side-menu-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

.template4-side-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 70%;
    max-width: 320px;
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.template4-side-menu.active .template4-side-menu-content {
    transform: translateX(0);
}

.template4-side-menu-header {
    background-color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}

.template4-side-menu-title {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.template4-close-btn {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0f0f0;
    transition: opacity 0.2s;
}

.template4-close-btn:hover {
    opacity: 0.7;
}

.template4-side-menu-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.template4-nav-item {
    display: block;
    padding: 15px 20px;
    color: #000;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

.template4-nav-item:hover {
    background-color: #f5f5f5;
}

.template4-nav-item.active {
    border-left: 3px solid #B12460;
}

.template4-nav-item-search {
    display: flex;
    align-items: center;
}

.template4-nav-item-search svg {
    width: 24px;
    height: 24px;
    color: #666;
}

.template4-side-menu-search {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

.template4-side-menu-search-btn {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    font-size: 14px;
    transition: background-color 0.2s;
}

.template4-side-menu-search-btn:hover {
    background-color: #f5f5f5;
}

/* Search Modal */
.template4-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.template4-search-modal.active {
    display: block;
}

.template4-search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: template4-fadeIn 0.3s;
}

.template4-search-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F4F9F8;
    display: flex;
    flex-direction: column;
    animation: template4-slideDown 0.3s;
}

@keyframes template4-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes template4-slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

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

.template4-search-header {
    padding: 10px 15px;
    background-color: #F4F9F8;
    border-bottom: 1px solid #DEDEDE;
    display: flex;
    align-items: center;
    gap: 15px;
}

.template4-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.template4-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #DEDEDE;
    border-radius: 20px;
    font-size: 14px;
    background-color: #fff;
    outline: none;
}

.template4-search-input:focus {
    border-color: #1a73e8;
}

.template4-search-clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: none;
    align-items: center;
    justify-content: center;
}

.template4-search-clear-btn.active {
    display: flex;
}

.template4-search-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template4-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #F4F9F8;
}

.template4-search-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.template4-search-placeholder p {
    margin-top: 15px;
    font-size: 14px;
}

/* Search Page Styles */
.template4-search-page-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    background-color: #F4F9F8;
    margin-top: 10px;
}

.template4-search-page-content .template4-search-header {
    padding: 10px 15px;
    background-color: #F4F9F8;
    border-bottom: 1px solid #DEDEDE;
    position: sticky;
    top: 60px;
    z-index: 10;
}

.template4-search-page-content .template4-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #F4F9F8;
}

/* Loading State */
.template4-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* Ad Slot */
.ad-slot {
    width: 100%;
    margin: 20px 0;
    padding: 0;
    background-color: #F4F9F8;
    text-align: center;
    box-sizing: border-box;
}

.ad-slot-placeholder {
    background-color: #FAFAFA;
    padding: 20px 16px;
    border: 1px dashed #DEDEDE;
    border-radius: 6px;
    min-height: 60px;
}

.ad-slot-content {
    font-size: 14px;
    color: #999;
    font-weight: 500;
}

.ad-slot-content.ad-loading {
    color: #CCC;
    font-style: italic;
}

/* 广告位内的标签和横幅样式 */
.ad-slot .ad-label {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.ad-slot .ad-banner {
    width: 100%;
    height: 210px;
    overflow: hidden;
}

.ad-slot .ad-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Detail Page */
.detail-page {
    background-color: #FFFFFF;
    margin: 0;
    padding: 0;
    position: relative;
}

.detail-main {
    padding: 0 16px 20px 16px;
    background-color: #FFFFFF;
    min-height: calc(100vh - 60px - 80px);
}

/* Detail page header should use template4-header styles */
.detail-page .template4-header {
    position: sticky;
    top: 0;
    background-color: #FFFFFF;
}

.detail-page .template4-header-content {
    justify-content: space-between;
}

.back-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.back-icon {
    font-size: 20px;
    color: #1a73e8;
}

.article-detail {
    background-color: #FFFFFF;
    padding: 16px;
}

.article-title {
    font-size: 20px;
    font-weight: bold;
    color: #1c1c1c;
    line-height: 1.4;
    margin-bottom: 12px;
}

.article-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tag-pill {
    padding: 4px 10px;
    border-radius: 12px;
    background-color: #e8f4ff;
    color: #0a7aff;
    font-size: 12px;
}

.article-subtitle {
    font-size: 14px;
    color: #555;
    margin-bottom: 16px;
}

.article-hero {
    width: 100%;
    height: 210px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

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

.article-body {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
	font-size: 14px;
    color: #555;
    line-height: 1.6;
    height: 272px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.detail-more-button {
    border-radius: 10px;
    color: #144c92;
    font-size: 16px;
    margin: 8px auto 0;
    text-align: center;
    width: 120px;
    border: 1px solid #e5e5e5;
    padding: 10px;
}

.article-body p {
    margin-bottom: 12px;
}

.article-list {
    list-style: none;
    padding-left: 0;
    margin: 8px 0 16px;
}

.article-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
}

.article-list li::before {
    content: '■';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 10px;
    color: #1a73e8;
}

.more-news-section {
    margin-top: 16px;
    box-sizing: border-box;
    border: 1px solid #D9D9D9;
}

.more-news-title {
    font-family: Afacad;
    font-size: 20px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0em;
    font-feature-settings: "kern" on;
    color: #212529;
    margin: 11px 0 24px 12px;
    padding: 0;
}

.more-news-list {
    background-color: #FFFFFF;
    box-sizing: border-box;
}

.more-news-list .template4-news-item {
    box-sizing: border-box;
    border: 1px solid #D9D9D9;
    background-color: transparent;
}

.more-news-list .template4-news-item.type-large {
    background-color: transparent;
}

.more-news-list .template4-news-item.type-small {
    background-color: transparent;
}

/* Discover区域item水平对齐 */
.more-news-list .news-item.type-2 {
    align-items: center;
}

/* Template 4 Specific Overrides */

/* Header brand area overrides for Template 4 */
.template4-header-content {
    justify-content: space-between;
}

.template4-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.template4-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.template4-logo-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.template4-logo-text-main,
.template4-logo-text-sub {
    font-family: 'Afacad', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0;
    font-variation-settings: "opsz" auto;
    font-feature-settings: "kern" on;
}

.template4-logo-text-main {
    color: #000000;
}

.template4-logo-text-sub {
    color: #05A5E9;
}

/* Template 4 Side Menu - Full Screen */
.template4-side-menu-content {
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
}

.template4-side-menu-content {
    position: relative;
    padding: 0;
}

/* Hide the header section in template4 */
.template4-side-menu-header {
    display: none;
}

.template4-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #000;
}

.template4-close-btn svg {
    width: 24px;
    height: 24px;
}

.template4-side-menu-nav {
    padding: 60px 20px 20px 20px;
    margin-top: 0;
}

/* Remove border from nav items in template4 */
.template4-side-menu-nav .template4-nav-item {
    border-left: none;
}

/* Template 4 side menu item typography */
.template4-side-menu-nav .template4-nav-item {
    font-family: 'Afacad', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0;
    font-variation-settings: "opsz" auto;
    font-feature-settings: "kern" on;
    color: #000C23;
}

/* Template 4 Homepage Header - Bottom border divider (only for homepage, not detail page) */
.template4-body:not(.detail-page) .template4-header {
    border-bottom: 1px solid #DEDEDE;
}

/* Template 4 Homepage Main Content - Top padding (only for homepage, not detail page) */
.template4-body:not(.detail-page) .template4-main {
    padding-top: 25px;
}

/* Template 4 News List Styles */
.template4-news-list {
    padding: 0;
    background-color: #ffffff;
}

/* Template 4 News Item - Base Styles */
.template4-news-item {
    margin-bottom: 10px;
    background-color: #ffffff;
    padding: 0;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: none;
}

/* Type no-image: No image, Title only */
.template4-news-item.type-no-image {
    margin: 0 15px 10px 15px;
    padding: 0;
    background-color: #ffffff;
}

.template4-news-item.type-no-image .template4-news-content {
    padding: 15px 15px 20px 15px;
}

/* Type 1: Large Image + Title (Full Width Image) */
.template4-news-item.type-large {
    margin: 0 15px 10px 15px;
    padding: 0;
    background-color: #ffffff;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
}

.template4-news-item.type-large .template4-news-thumbnail-large {
    width: 100%;
    padding: 0;
    margin: 0;
    aspect-ratio: 350 / 244;
    /* 宽高比 350:244 */
    overflow: hidden;
    border-radius: 15px 15px 0 0;
    /* 圆角 15px 顶部，底部0 */
    background-color: #f0f0f0;
    box-sizing: border-box;
    display: block;
}

.template4-news-item.type-large .template4-news-thumbnail-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 15px 15px 0 0;
}

.template4-news-item.type-large .template4-news-content {
    padding: 15px 15px 20px 15px;
    background-color: #ffffff;
}

.template4-news-item.type-large .template4-news-title {
    font-family: Afacad;
    font-size: 20px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0px;
    font-variation-settings: "opsz" auto;
    font-feature-settings: "kern" on;
    color: #222222;
    margin: 0;
}

/* Type 2: Small Card - Left Image, Right Title, Bottom Description */
.template4-news-list .template4-news-item.type-small {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    margin-left: 15px !important;
    margin-right: 15px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #E7F2F3;
    border-radius: 15px;
    margin-bottom: 10px;
}

.template4-news-item.type-small .template4-news-main {
    display: flex;
    gap: 12px;
    align-items: center;
}

.template4-news-item.type-small .template4-news-thumbnail-small {
    width: 126px;
    min-width: 126px;
    height: 126px;
    border-radius: 15px;
    overflow: hidden;
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.template4-news-item.type-small .template4-news-thumbnail-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 15px;
}

.template4-news-item.type-small .template4-news-content-small {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.template4-news-item.type-small .template4-news-title-small {
    font-family: Afacad;
    font-size: 20px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0em;
    font-feature-settings: "kern" on;
    color: #1E1F24;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template4-news-item.type-small .template4-news-description {
    font-family: 'Afacad', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: 0;
    font-feature-settings: "kern" on;
    color: #1E1F24;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* PC preview mode adjustments for template4 */
.template4-body.mobile-preview .template4-side-menu-content {
    width: 414px !important;
    max-width: 414px !important;
}
.lazy-img {
  max-width: 100%;
  height: auto;
  display: block;
}