﻿.md-preview img{
    width: 100% !important;
}

.layui-container {
    margin-top: 120px;
}

.news-main-card {
    margin: 0 auto;
    max-width: 1200px;
}

/* 水平排列容器 */
.horizontal-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.tags-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}



.dark .news-title h1 {
    display: inline-block;
    margin: 0 10px;
    font-size: 36px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark-text);
}

.light .news-title h1 {
    display: inline-block;
    margin: 0 10px;
    font-size: 36px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--light-text);
}

.dark .md-preview h2{
    text-align: center;
}

.light .md-preview h2{
    text-align: center;
}

.dark .news-content p {
    font-size: 16px !important;
    font-weight: 200;
    margin: 10px auto;
    line-height: 1.8;
    max-width: 1000px;
    vertical-align: middle;
}

.light .news-content p {
    font-size: 16px !important;
    font-weight: 300;
    margin: 10px auto;
    line-height: 1.8;
    max-width: 1000px;
    vertical-align: middle;
}

.image-caption {
    color: #aaa;
    font-size: 14px;
    margin-top: 8px;
}

/* 分享区域样式 */
.share-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid #8b8b8b;
}

.dark .share-text {
    color: #8b8b8b;
    font-size: 16px;
}

.light .share-text {
    color: var(--light-text);
    font-size: 16px;
}

.share-buttons {
    display: flex;
    margin-right: 30px;
}

.dark .share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #2D2D2D;
    color: #aaa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 10px;
    /* 按钮间距 */
    cursor: pointer;
}

.light .share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #eee;
    color: #aaa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 10px;
    /* 按钮间距 */
    cursor: pointer;
}

.light .share-btn i{
    color: #222;
}

.share-btn:hover {
    background-color: #FF0000;
    color: #fff;
    transform: translateY(-2px);
}

.light .share-btn:hover i{
    color: #fff;
}

.related-content {
    text-align: center;
}

.dark .related-title {
    position: relative;
    font-size: 28px;
    font-weight: 600;
    color: var(--dark-text);
    padding-bottom: 10px;
    margin: 30px 0 20px;
}

.light .related-title {
    position: relative;
    font-size: 28px;
    font-weight: 600;
    color: var(--light-text);
    padding-bottom: 10px;
    margin: 30px 0 20px;
}

.related-title:after {
    background-color: #c7000b;
    bottom: 0;
    content: "";
    height: 2px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 35px;
    position: absolute;
    width: 5%;
}

.news-item {
    height: 100%;
    background-color: var(--card-dark-bg);
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.related-title-text {
    font-size: 18px;
    color: #F5F5F5;
    white-space: nowrap; /* 防止文本换行 */
    overflow: hidden; /* 隐藏溢出的内容 */
    text-overflow: ellipsis; /* 显示省略号来代表被修剪的文本 */
}

.related-date {
    color: #aaa;
}

.related-img {
    width: 100%;
    object-fit: cover;
}


.dark .tag {
    background-color: #331A1A;
    color: #FF0000;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    border: 1px solid #502020;
}

.light .tag {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--light-text);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    /* border: 1px solid #502020; */
}

/* 卡片样式 */
.dark .news-cards {
    text-align: center;
    /* background-color: var(--card-dark-bg); */
    /* border-radius: 8px; */
    padding: 10px;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
}

.light .news-cards {
    text-align: center;
    /* background-color: var(--card-light-bg); */
    /* border-radius: 8px; */
    padding: 10px;
    /* box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4); */
}

.dark .news-all-btn {
    display: block;
    margin: 30px auto;
    text-align: center;
    line-height: 40px;
    width: 120px;
    height: 40px;
    border: 1px solid #f8f9fa;
}

.light .news-all-btn {
    display: block;
    margin: 30px auto;
    text-align: center;
    line-height: 40px;
    width: 120px;
    height: 40px;
    border: 1px solid var(--light-text);
}

.news-all-btn:hover {
    border: 1px solid var(--Enterprise-text);
    background-color: var(--Enterprise-text);
}

.dark .news-all-btn span {
    color: #f8f9fa;
}

.light .news-all-btn span {
    color: var(--light-text);
}

.light .news-all-btn:hover span {
    color: var(--dark-text);
}

/* MD新闻内容样式 */
.dark .layui-card{
    background-color: var(--card-dark-bg);
}

.light .layui-card{
    background-color: var(--card-light-bg);
}

.mermaid{
    text-align: center;
}

.layui-card-body, 
.layui-card-header{
    position: relative;
    padding: 5px 5px;
}

.dark .md-preview {
    line-height: 1.8;
    font-size: 14px;
    color: var(--dark-text);
    padding: 10px;
    text-align: center;
}

.light .md-preview {
    line-height: 1.8;
    font-size: 14px;
    color: #7e7e7e;
    padding: 10px;
    text-align: center;
}

.md-preview a{
    color: var(--Enterprise-text);
}

.dark .md-preview h1 {
    color: var(--dark-text);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin: 20px 0;
}

.light .md-preview h1 {
    color: var(--light-text);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin: 20px 0;
}

.dark .md-preview h2 {
    font-size: 16px;
    margin: 18px 0;
    color: var(--dark-text);
    font-weight: 200;
}

.light .md-preview h2 {
    font-size: 16px;
    margin: 18px 0;
    color: #393D49;
    font-weight: 200;
}

.dark .md-preview blockquote {
    border-left: 4px solid var(--Enterprise-text);
    padding: 10px 15px;
    background: var(--dark-bg);
    margin: 10px 0;
}

.light .md-preview blockquote {
    border-left: 4px solid var(--Enterprise-text);
    padding: 10px 15px;
    background: #eee;
    margin: 10px 0;
}


/* 代码高亮样式（防止Layui覆盖） */
.dark .md-preview pre {
    background: #1e1e1e !important; /* 适配dark主题的代码背景 */
}

.light .md-preview pre {
    background: #f5f5f5 !important; /* 适配light主题的代码背景 */
}

.dark .mermaid .grid .tick text{
    fill: var(--dark-text) !important;
}

.light .mermaid .grid .tick text{
    fill: var(--light-text) !important;
}

.dark .mermaid tspan{
    fill: var(--dark-text);
}

.light .mermaid tspan{
    fill: var(--light-text);
}

.dark .mermaid .titleText{
    fill: var(--dark-text) !important;
}

.light .mermaid .titleText{
    fill: var(--light-text) !important;
}

.md-preview pre code.hljs {
    color: inherit !important; /* 继承highlight的语法色 */
    background: transparent !important;
}

.md-preview .hljs-keyword {
    color: #214fa3 !important;
    font-weight: bold !important;
}

.md-preview .hljs-string {
    color: #d37904 !important;
}

.md-preview .hljs-comment {
    color: #6a9955 !important;
    font-style: italic !important;
}

.md-preview .hljs-function {
    color: rgb(118, 183, 236)!important;
}

.md-preview .hljs-variable {
    color: #e90;
}

/* 表格样式 */
.md-preview {
    overflow-x: hidden;
    /* 防止整体溢出 */
}

.md-preview p img{
    width: 100%;;
}

.md-preview table {
    border-collapse: collapse;
    table-layout: fixed;
    /* 固定表格布局，避免列宽错乱 */
    width: 100%;
    margin: 20px 0;
}

.dark .md-preview table th,
.dark .md-preview table td {
    border: 1px solid var(--dark-bg);
    padding: 12px 15px;
    text-align: left;
    word-break: break-all;
}

.light .md-preview table th,
.light .md-preview table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    word-break: break-all;
}

.dark .md-preview table th {
    background: var(--dark-bg);
    font-weight: 600;
}

.light .md-preview table th {
    background: #f8f9fa;
    font-weight: 600;
}

.dark .md-preview table tr:nth-child(odd) {
    background: #222;
}

.dark .md-preview table tr:nth-child(even) {
    background: var(--dark-bg);
}

.light .md-preview table tr:nth-child(even) {
    background: #f8f9fa;
}

.md-preview .table-responsive {
    width: 100%;
    overflow-x: auto;
    /* 移动端横向滚动 */
    -webkit-overflow-scrolling: touch;
    /* 优化iOS滚动体验 */
    margin: 1rem 0;
}

.dark .edgePaths .flowchart-link{
    stroke: var(--dark-text) !important;
}

.light .edgePaths .flowchart-link{
    stroke: var(--light-text) !important;
}

.dark .md-preview strong{
    color: #e6740a;
    text-align: center;
    font-size: 20px;
}

.light .md-preview strong{
    color: #e6740a;
    text-align: center;
    font-size: 20px;
}

.dark .md-preview p{
    font-size: 18px;
}

.light .md-preview p{
    font-size: 18px;
}

/* Mermaid容器样式 */
.mermaid {
    margin: 20px 0;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-image,
.related-img {
    transition: transform 0.3s ease;
}

@media (max-width: 990px) {
    .layui-container {
        margin-top: 120px;
    }

    .dark .news-title h1 {
        display: inline-block;
        margin: 10px 10px;
        font-size: 28px;
    }

    .light .news-title h1 {
        display: inline-block;
        margin: 10px 10px;
        font-size: 28px;
    }

    .news-content p {
        font-size: 14px;
        font-weight: 200;
        margin: 5px auto;
        line-height: 2;
    }

    .dark .md-preview p{
        font-size: 14px;
    }
    
    .light .md-preview p{
        font-size: 14px;
    }

}

@media (max-width: 768px) {
    .layui-container {
        margin-top: 120px;
    }

    .dark .news-title h1 {
        display: inline-block;
        margin: 10px 10px;
        font-size: 28px;
    }

    .light .news-title h1 {
        display: inline-block;
        margin: 10px 10px;
        font-size: 28px;
    }

    .news-content p {
        font-size: 14px;
        font-weight: 200;
        margin: 5px auto;
        line-height: 2;
    }

    .dark .md-preview p{
        font-size: 14px;
    }
    
    .light .md-preview p{
        font-size: 14px;
    }
}