/* 导入字体 */
@import url("https://cdn-font.hyperos.mi.com/font/css?family=MiSans_Latin_VF:VF:Latin&display=swap");
@import url("https://cdn-font.hyperos.mi.com/font/css?family=MiSans_VF:VF:Chinese_Simplify,Latin&display=swap");
@import url("https://cdn-font.hyperos.mi.com/font/css?family=MiSans:100,200,300,400,450,500,600,650,700,900:Chinese_Simplify,Latin&display=swap");
@import url("https://cdn-font.hyperos.mi.com/font/css?family=Misans_TC_VF:VF:Chinese_Traditional_TW&display=swap");

:root {
    --primary-color:#9e94d8;
    --secondary-color:#333333;
    --background-color:#f2eefc;
    --card-bg:#FAFAFA;
    --text-color:#444444;
    --online-color:#00BFA6;
    --nav-bg:rgba(109, 91, 154, 0.8);
    --nav-bg-scroll:rgba(44, 62, 80, 1);
    --button-hover:#b6ade6;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'MiSans VF', sans-serif;
}

body {
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 移动端不加载动态背景 */
@media (max-width: 846px) {
    body::before, body::after {
         content: none; /*阻止渲染 */
    }
}

a {
    text-decoration: none;
}




/* 导航栏样式 */
nav {
    display: flex;
    align-items: center;
    /* justify-content: space-between; */
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    position: fixed;
    width: 100%;
    z-index: 100;
    top: 0;
}

nav.scrolled {
    background: var(--nav-bg-scroll);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

nav a {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s;
}

.menu-button {
    display: none;
    position: absolute;
    right: 20px;
    top: 19.4px;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

.nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--nav-bg-scroll);
}

.nav-links.responsive {
    display: flex;
}

.nav-links a {
    display: block;
    margin: 10px;
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--button-hover);
}

.logo-container {
    display: flex;
    align-items: center;
    margin-left: 20px;
    flex-grow: 1; 
}
nav > a, nav > .dropdown {
    /* 将“主页”和“服务器规则”放在 logo-container 之后 */
    order: 1; 
    /* 调整间距以靠近 logo */
    margin: 0 10px; 
}
nav > a:first-of-type, nav > .dropdown:first-of-type {
    /* 减小“主页”与 logo 的间距 */
    margin-right: 80%;
}
.logo-container img {
    height: 35px;
    width: 35px;
}



/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: block;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    margin: 10px;
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s;
    cursor: pointer;
}

.dropdown-menu {
    position: static;
    width: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    text-align: right;
}

.item-icon {
    width: 16px;
    height: 16px;
    margin-left: 10px;
    fill: currentColor;
    transition: transform 0.3s;
}

.dropdown-item:hover .item-icon {
    transform: translateX(-3px);
}

.logo-and-text {
    display: flex;
    align-items: center;
}

/* 移动端样式 */
@media (max-width: 846px) {
    /* 显示汉堡菜单按钮 */
    .menu-button {
        display: block;
    }
    
    /* 移动端主题切换按钮 - 放在汉堡菜单左边 */
    .nav-theme-toggle {
        position: absolute;
        right: 70px; /* 汉堡菜单右边20px + 按钮宽度40px + 间距10px */
        top: 19.4px;
        z-index: 102;
    }
    
    .nav-theme-toggle .theme-toggle-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    /* 隐藏导航链接 */
    .nav-links {
        display: none;
    }

    /* 点击汉堡菜单后显示导航链接 */
    .nav-links.responsive {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--nav-bg-scroll);
    }

    /* 调整导航链接样式 */
    .nav-links.responsive .dropdown {
        display: block;
        width: 100%;
    }

    .nav-links.responsive .dropdown-toggle {
        display: block;
        width: 100%;
        padding: 15px 20px;
    }

    .nav-links.responsive .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: transparent;
    }

    .nav-links.responsive .dropdown-item {
        padding: 10px 20px;
    }

    /* 隐藏桌面版导航链接 */
    nav a:not(.logo-and-text) {
        display: none;
    }
}

.LuminolMC {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s;
}

.LuminolMC:hover {
    color: var(--button-hover);
}

.right-align {
    margin-left: 0;
}





.news-markdown h1 { font-size: 1.5em; color: var(--secondary-color); }
.news-markdown ul { padding-left: 20px; }
.news-markdown strong { color: var(--primary-color); }


    @media (max-width: 846px) {

    .news-detail-section {
        padding: 25px 20px;
        max-width: 95%;
        min-width: unset;
        margin: 60px auto 15px auto;
    }

    .news-detail-section h2 {
        font-size: 26px;
        line-height: 1.2;
    }

    /* 移动端标题样式调整 */
    .news-content h1, .news-detail-section h1 {
        font-size: 1.8em;
        margin: 1.2em 0 0.6em 0;
    }

    .news-content h2, .news-detail-section h2 {
        font-size: 1.6em;
        margin: 1em 0 0.5em 0;
    }

    .news-content h3, .news-detail-section h3 {
        font-size: 1.4em;
        margin: 0.8em 0 0.4em 0;
    }

    .news-content h4, .news-detail-section h4 {
        font-size: 1.2em;
        margin: 0.6em 0 0.3em 0;
    }

    .news-detail-section .news-img {
        height: 200px;
        width: 100%;
    }

    /* 无图详情：移动端隐藏图片容器，避免空白 */
    .no-image .news-img {
        display: none;
    }

    .news-detail-section p {
        font-size: 1.05em;
        line-height: 1.8;
        
    }

    /* 移动端列表样式 */
    .news-content ul, .news-content ol {
        padding-left: 1.5em;
        margin: 0.8em 0;
    }

    .news-content li {
        margin-bottom: 0.4em;
        font-size: 1.05em;
    }

    /* 移动端代码块样式 */
    .news-content pre {
        padding: 1em;
        margin: 1em 0;
        font-size: 1em; /* 增大移动端字体大小 */
        overflow-x: auto;
        line-height: 1.6;
    }
    
    /* 移动端 Prism.js 代码块字体大小调整 */
    .news-content pre[class*="language-"] {
        font-size: 1em !important;
        line-height: 1.6 !important;
        background: #f6f8fa !important;
        border: 1px solid #e1e4e8 !important;
        border-radius: 6px !important;
        color: #24292e !important;
    }
    
    .news-content pre[class*="language-"] code {
        font-size: 1em !important;
        line-height: 1.6 !important;
        color: #24292e !important;
    }
    
    /* 移动端代码块工具栏 */
    .code-block-toolbar {
        top: 8px !important;
        right: 8px !important;
        gap: 6px !important;
    }
    
    .code-block-btn {
        padding: 3px 6px !important;
        font-size: 11px !important;
    }

    .news-content p code,
    .news-content li code {
        padding: 2px 6px;
        font-size: 0.85em;
    }

    /* 移动端表格样式 */
    .news-content table {
        font-size: 0.9em;
        margin: 1em 0;
    }

    .news-content th,
    .news-content td {
        padding: 8px 12px;
    }

    /* 移动端 Markdown 图片样式 */
    .news-content img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
        margin: 1em auto;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* 移动端图片居中 */
    .news-content p img {
        max-width: 100% !important;
        height: auto !important;
        margin: 1em auto;
        display: block;
    }

    .back-to-news {
        padding: 8px 16px;
        font-size: 0.9em;
    }

    .pinned-icon {
        display: inline-block;
        font-size: 1.2em;
        color: var(--pinned-border);
        margin-right: 5px;
        vertical-align: middle;
    }
    .gallery-section {
        padding: 15px;
        max-width: 100%;
    }
    .gallery-section h3 {
        font-size: 1.3em;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .gallery-item img {
        height: auto;
        max-height: 200px;
        width: 100%;
        object-fit: cover;
    }
    .lightbox-image {
        max-width: 95%;
        max-height: 85%;
        object-fit: contain;
    }
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5em;
    }
    #three-canvas-container {
        height: 100vh; /* 确保移动端适配 */
    }
}

/* 系统深色主题自动应用 */
@media (prefers-color-scheme: dark) {
    :root:not(.dark-theme) {
        --primary-color: #a78bfa;
        --secondary-color: #f1f5f9;
        --background-color: #0f172a;
        --card-bg: #1e293b;
        --text-color: #e2e8f0;
        --nav-bg: rgba(15, 23, 42, 0.8);
        --nav-bg-scroll: #1e293b;
    }
    
    :root:not(.dark-theme) body {
        background: var(--background-color) !important;
        color: var(--text-color) !important;
    }
    
    :root:not(.dark-theme) nav {
        background-color: var(--nav-bg) !important;
    }
    
    :root:not(.dark-theme) footer {
        background: linear-gradient(135deg, #0a0f1c 0%, #1a1f2e 100%) !important;
        border-top: 1px solid rgba(71, 85, 105, 0.3) !important;
    }
    
    :root:not(.dark-theme) .footer-column h3 {
        color: #c4b5fd !important;
    }
    
    :root:not(.dark-theme) .footer-column a {
        color: #cbd5e1 !important;
    }
    
    :root:not(.dark-theme) .footer-column a:hover {
        color: #c4b5fd !important;
    }
    
    :root:not(.dark-theme) .copyright-info {
        border-top: 1px solid rgba(71, 85, 105, 0.3) !important;
        color: #94a3b8 !important;
    }
    
    /* 新闻详情页深色主题 */
    :root:not(.dark-theme) .news-detail-section {
        background: rgba(30, 41, 59, 0.85) !important;
        border: 1px solid rgba(71, 85, 105, 0.45) !important;
    }
    
    :root:not(.dark-theme) .news-content h1,
    :root:not(.dark-theme) .news-content h2,
    :root:not(.dark-theme) .news-content h3,
    :root:not(.dark-theme) .news-content h4,
    :root:not(.dark-theme) .news-content h5,
    :root:not(.dark-theme) .news-content h6 {
        color: #e2e8f0 !important;
    }
    
    :root:not(.dark-theme) .news-content p {
        color: #cbd5e1 !important;
    }
    
    :root:not(.dark-theme) .news-content ul,
    :root:not(.dark-theme) .news-content ol {
        color: #cbd5e1 !important;
    }
    
    :root:not(.dark-theme) .news-content blockquote {
        background: rgba(71, 85, 105, 0.2) !important;
        border-left: 4px solid #a78bfa !important;
        color: #cbd5e1 !important;
    }
    
    :root:not(.dark-theme) .news-content table {
        background: rgba(30, 41, 59, 0.5) !important;
        border: 1px solid rgba(71, 85, 105, 0.3) !important;
    }
    
    :root:not(.dark-theme) .news-content th,
    :root:not(.dark-theme) .news-content td {
        border: 1px solid rgba(71, 85, 105, 0.3) !important;
        color: #cbd5e1 !important;
    }
    
    :root:not(.dark-theme) .news-content th {
        background: rgba(71, 85, 105, 0.3) !important;
    }
    
    :root:not(.dark-theme) .news-content code {
        background: rgba(71, 85, 105, 0.3) !important;
        color: #cbd5e1 !important;
    }
    
    :root:not(.dark-theme) .news-content a {
        color: #a78bfa !important;
    }
    
    :root:not(.dark-theme) .news-content a:hover {
        color: #c4b5fd !important;
    }
    
    :root:not(.dark-theme) .news-content a.external-link {
        color: #60a5fa !important;
    }
    
    :root:not(.dark-theme) .news-content a.external-link:hover {
        color: #93c5fd !important;
    }
    
    /* 图片画廊深色主题 */
    :root:not(.dark-theme) .gallery-section {
        background: rgba(30, 41, 59, 0.5) !important;
        border: 1px solid rgba(71, 85, 105, 0.3) !important;
    }
    
    :root:not(.dark-theme) .lightbox {
        background: rgba(0, 0, 0, 0.9) !important;
    }
    
    :root:not(.dark-theme) .lightbox-controls button {
        background: rgba(71, 85, 105, 0.8) !important;
        color: #e2e8f0 !important;
    }
    
    :root:not(.dark-theme) .lightbox-controls button:hover {
        background: rgba(71, 85, 105, 1) !important;
    }
    
    /* 代码块深色主题 */
    :root:not(.dark-theme) .news-content pre[class*="language-"] {
        background: #1e293b !important;
        border: 1px solid rgba(71, 85, 105, 0.3) !important;
    }
    
    :root:not(.dark-theme) .news-content pre[class*="language-"] code {
        color: #e2e8f0 !important;
    }
    
    :root:not(.dark-theme) .news-content .token.tag {
        background: none !important;
        color: #79b8ff !important;
    }
    
    /* 系统深色主题下主题切换按钮适配 */
    :root:not(.dark-theme) .theme-toggle-btn {
        background: rgba(71, 85, 105, 0.3) !important;
        border: 1px solid rgba(71, 85, 105, 0.5) !important;
        color: #e2e8f0 !important;
    }
    
    :root:not(.dark-theme) .theme-toggle-btn:hover {
        background: rgba(71, 85, 105, 0.5) !important;
    }
}