/* --- 基础与字体 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* 建议使用 Inter 或系统默认字体，阅读感更高级 */
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc; /* 更干净的底色 */
    color: #334155;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* --- 侧边栏：灰白扁平化 --- */
.sidebar {
    width: 280px; /* 略微加宽，呼吸感更好 */
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    padding: 0 24px 20px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 15px;
    text-align: left; /* 改为左对齐，更有设计感 */
}

.nav-category h3 {
    padding: 12px 24px 6px;
    font-size: 12px;
    color: #94a3b8; /* 浅灰色分类名 */
    text-transform: uppercase; /* 英文分类自动大写，更有范 */
}

.nav-list {
    list-style: none;
    padding: 0 12px;
}

.nav-list li a {
    display: block;
    padding: 8px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 2px;
}

/* 链接状态优化 */
.nav-list li a:hover {
    background: #f1f5f9;
    color: #2563eb;
}

/* 重点：增加 JS 匹配的高亮类 */
.nav-list li a.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* --- 主内容区 --- */
.main {
    flex: 1;
    margin-left: 280px;
    padding: 40px 60px;
    /* 检查：如果内容太挤，可以去掉下面这行 */
    max-width: 1300px; 
}

/* 搜索框优化 */
.search-box {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 30px;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-box:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 卡片设计 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0; /* 用边框代替阴影更耐看 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.card h1, .card h2 {
    color: #0f172a;
    margin-bottom: 16px;
}

/* 检查点：你的隐藏逻辑，已完美保留并优化 */
.main .card:nth-of-type(2) {
    display: none !important;
}

/* 代码块：灰白风格专用 */
pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    font-family: monospace;
    overflow-x: auto;
    margin: 15px 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    .main {
        margin-left: 0;
        padding: 20px;
    }
}
/* 强制大陆地区链接始终为红色 */
.nav-list li a[href*="mainland-use.html"] {
    color: #dc2626 !important;    /* 醒目的红色文字 */
    font-weight: 700 !important;   /* 极粗字体 */
    background-color: #fef2f2;     /* 极浅的红色背景，增加存在感 */
    border: 1px solid #fee2e2;     /* 细微的红色边框 */
}

/* 鼠标悬停时的效果，让它更有交互感 */
.nav-list li a[href*="mainland-use.html"]:hover {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;     /* 悬停时颜色加深 */
    text-decoration: underline;
}