/* --- 基础规范 --- */
/* --- 1. 背景与基础层级 --- */
:root {
    --brand: #40B5AD;
    --bg-main: #0f1115;      /* 稍微偏蓝的深灰，比纯黑更有质感 */
    --card-bg: #1a1d23;      /* 提升卡片亮度，拉开与背景的距离 */
    --card-hover: #202121;   /* 悬停时进一步提亮 */
    --border-subtle: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--bg-main);
    /* 增加一个非常淡的径向渐变，模拟环境光 */
    background-image: radial-gradient(circle at 50% -20%, rgba(64, 181, 173, 0.05) 0%, transparent 50%);
    color: #e2e8f0;
}

/* --- 2. 档案馆卡片 (高对比度版) --- */
.archive-card {
    background: #121212;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    content-visibility: auto; /* 性能怪兽 */
    contain-intrinsic-size: 1px 320px;
}

.archive-card:hover {
    background: var(--card-hover);
    border-color: rgba(64, 181, 173, 0.3);
    transform: translateY(-8px);
    /* 悬停时给一个淡淡的品牌色底边发光 */
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6),
    0 0 20px -5px rgba(64, 181, 173, 0.1);
}

/* --- 3. 图片遮罩与亮度 --- */
.archive-card img {
    opacity: 0.85; /* 默认亮度提升 */
    filter: brightness(0.9);
    transition: all 0.5s ease;
}

.archive-card:hover img {
    opacity: 1;
    filter: brightness(1.1); /* 悬停时稍微过曝增加视觉反馈 */
}

/* --- 4. 搜索框提亮 --- */
input {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
}
input:focus {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 15px rgba(64, 181, 173, 0.2);
}

/* --- 5. 增强文字层级 --- */
.card-title {
    color: #ffffff; /* 标题纯白 */
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.card-summary {
    color: #94a3b8; /* 摘要用次级灰，对比更明显 */
}
[v-cloak] { display: none; }


/* 强制细小文字提升 */
.text-\[10px\] { font-size: 0.85rem !important; }
.text-xs { font-size: 0.9rem !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(64,181,173,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); box-shadow: 0 0 10px var(--brand); }

/* --- 文字遮罩 --- */
.text-mask { background: #333; color: transparent; cursor: help; transition: all 0.3s; border-radius: 2px; padding: 0 4px; }
.text-mask:hover { background: transparent; color: var(--brand); text-shadow: 0 0 5px var(--brand); }

/* --- Markdown 全语法支持 --- */
.markdown-body { color: #d1d5db; word-break: break-word; }
.markdown-body h1 { font-size: 1.5rem; color: #fff; border-bottom: 2px solid var(--brand); padding-bottom: 0.3rem; margin: 1.5rem 0 1rem; font-weight: 900; }
.markdown-body h2 { font-size: 1.25rem; color: #fff; border-left: 4px solid var(--brand); padding-left: 0.75rem; margin: 2rem 0 1rem; font-weight: 800; }
.markdown-body h3 { font-size: 1.1rem; color: var(--brand); font-weight: bold; margin: 1.5rem 0 0.5rem; }

/* 表格支持 (GFM) */
.markdown-body table { width: 100%; border-collapse: collapse; margin: 2rem 0; overflow-x: auto; display: block; }
.markdown-body th { background: rgba(64,181,173,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.1); padding: 12px; font-weight: 800; }
.markdown-body td { border: 1px solid rgba(255,255,255,0.05); padding: 10px; }
.markdown-body tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* 代码块 */
.markdown-body pre { background: #151515 !important; padding: 1.5rem !important; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); margin: 1.5rem 0; overflow-x: auto; }
.markdown-body code:not(pre code) { background: rgba(64,181,173,0.15); color: var(--brand); padding: 0.2rem 0.4rem; border-radius: 4px; font-size: 0.9em; }

/* 任务列表 */
.markdown-body ul li input[type="checkbox"] { margin-right: 8px; accent-color: var(--brand); vertical-align: middle; }

/* 图片 */
.img-container { text-align: center; margin: 2.5rem 0; }
.img-container img { border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); display: inline-block; cursor: zoom-in; }
.img-caption { font-size: 0.85rem; color: #555; margin-top: 0.8rem; font-style: italic; }

/* 动画 */
.animate-zoom { animation: zoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes zoomIn { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

@keyframes archiveRead {
    0% { filter: brightness(2) blur(10px); opacity: 0; transform: scale(0.9); }
    100% { filter: brightness(1) blur(0); opacity: 1; transform: scale(1); }
}

.animate-zoom {
    animation: archiveRead 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 增强 Markdown 全语法支持 --- */

/* 1. 引用块 (Blockquote) - 档案感核心 */
.markdown-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    color: #94a3b8; /* 稍微淡一点的颜色 */
    background: rgba(64, 181, 173, 0.05); /* 极淡的品牌色背景 */
    border-left: 4px solid var(--brand);
    border-radius: 4px 12px 12px 4px;
    font-style: italic;
    position: relative;
}

/* 1. 基础容器：确保 list-style 不被重置为 none */
.markdown-body ul { list-style-type: disc !important; }
.markdown-body ol { list-style-type: decimal !important; }

.markdown-body ul,
.markdown-body ol {
    padding-left: 2rem; /* 足够位移，防止符号飞出屏幕 */
    margin: 1rem 0;
}

.markdown-body li {
    display: list-item; /* 强制以列表项渲染，确保 marker 有效 */
    margin: 0.6rem 0;
    line-height: 1.7;
}

/* 2. 嵌套逻辑：处理 1. 下面套 - 的情况 */
.markdown-body li > ul,
.markdown-body li > ol {
    margin: 0.5rem 0 0.8rem 0.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(64, 181, 173, 0.2); /* 品牌色引导线 */
}

/* 自动切换嵌套符号：二级空心圆，三级方块 */
.markdown-body li > ul { list-style-type: circle !important; }
.markdown-body li > ul ul { list-style-type: square !important; }

/* 3. 符号美化 (Marker) */
.markdown-body li::marker {
    color: var(--brand);
    font-weight: bold;
}

/* 4. 任务列表兼容 (针对带 Checkbox 的列表) */
.markdown-body li:has(input[type="checkbox"]) {
    list-style-type: none !important; /* 有复选框时隐藏原点 */
    padding-left: 0;
}

/* 3. 强调与链接 */
.markdown-body strong {
    color: #fff;
    font-weight: 700;
    background: linear-gradient(transparent 70%, rgba(64, 181, 173, 0.2) 0%); /* 给粗体加个淡淡的底色划线 */
}

.markdown-body a {
    color: var(--brand);
    text-decoration: none;
    border-bottom: 1px dashed rgba(64, 181, 173, 0.5);
    transition: all 0.2s;
}

.markdown-body a:hover {
    border-bottom-style: solid;
    filter: brightness(1.2);
}

/* 4. 分割线 */
.markdown-body hr {
    height: 1px;
    border: none;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    margin: 2rem 0;
}

/* 5. 行内代码优化 */
.markdown-body code:not(pre code) {
    background: rgba(64, 181, 173, 0.15);
    color: var(--brand);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; /* 如果有的话 */
    font-size: 0.85em;
    vertical-align: middle;
}
/* 自定义提示容器 - 兼容常见的 Markdown 扩展格式 */
.markdown-body .info, .markdown-body .warning, .markdown-body .danger {
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid;
    background: rgba(255, 255, 255, 0.03);
}

.markdown-body .info { border-color: var(--brand); color: #e2e8f0; }
.markdown-body .warning { border-color: #f59e0b; color: #fbbf24; background: rgba(245, 158, 11, 0.05); }
.markdown-body .danger { border-color: #ef4444; color: #f87171; background: rgba(239, 68, 68, 0.05); }

/* 脚注链接 */
.markdown-body .footnote-ref {
    font-size: 0.75em;
    padding: 0 2px;
    color: var(--brand);
}

/* 页面底部脚注区域 */
.markdown-body .footnotes {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9em;
    color: #94a3b8;
}

.markdown-body blockquote::before {
    content: "NOTE";
    display: block;
    font-size: 0.6rem;
    font-weight: 900;
    color: var(--brand);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.markdown-body a[href^="http"]::after {
    content: " ↗";
    font-size: 0.7em;
    opacity: 0.5;
}
.markdown-body .hljs {
    background: transparent !important;
    padding: 0 !important;
}

.markdown-body pre {
    border-left: 3px solid var(--brand);
}

/* --- 代码块容器增强 --- */
.markdown-body pre {
    position: relative;
    padding-top: 2.8rem !important; /* 给顶部的语言和按钮留出空间 */
    border-radius: 12px;
    overflow: visible; /* 允许按钮稍微溢出或准确定位 */
}

/* 1. 左上角语言标注 */
.markdown-body pre::before {
    content: attr(data-lang);
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 10px;
    font-weight: 800;
    color: var(--brand); /* 使用你的青色变量 */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.5;
}

/* 2. 右上角复制按钮 */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 900;
    color: #64748b;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    z-index: 10;
}

.copy-btn:hover {
    background: rgba(64, 181, 173, 0.1);
    color: var(--brand);
    border-color: rgba(64, 181, 173, 0.4);
}

/* 复制成功后的状态 */
.copy-btn.copied {
    color: #10b981;
    border-color: #10b981;
}

/* 3. 内部 code 调整 */
.markdown-body pre code {
    background: transparent !important;
    padding: 0 !important;
    display: block;
    overflow-x: auto;
}
/* 移除输入框的所有默认外框和背景 */
.page-jump-input {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(64, 181, 173, 0.2); /* 只有一条很淡的底线 */
    outline: none;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
}

/* 聚焦时底线变亮，并去掉浏览器自带的蓝框 */
.page-jump-input:focus {
    border-bottom-color: #40B5AD;
    box-shadow: 0 4px 12px -4px rgba(64, 181, 173, 0.3);
    outline: none;
}

/* 隐藏 Chrome/Safari 等浏览器自带的上下调节小箭头 */
.page-jump-input::-webkit-inner-spin-button,
.page-jump-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- 移动端导航栏专用适配 --- */
@media (max-width: 768px) {
    /* 1. 缩小整体内边距，释放左右空间 */
    nav.fixed .max-w-7xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* 2. Logo 文字瘦身：隐藏 "OpenST"，仅保留 "Wiki" */
    .nav-logo-text span:first-child {
        display: none;
    }
    .nav-logo-text {
        font-size: 1.1rem !important;
        letter-spacing: 0.5px;
    }

    /* 3. 搜索框动态缩放：默认变短，聚焦时拉长 */
    .search-container {
        max-width: 100px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .search-container:focus-within {
        max-width: 140px;
        position: relative;
        z-index: 60;
    }
    .search-container input {
        padding-left: 2rem !important; /* 给搜索图标留位 */
        font-size: 0.85rem !important;
    }

    /* 4. 按钮文字隐藏：仅显示图标 */
    .nav-btn-text {
        display: none;
    }

    .nav-btn {
        padding: 0.6rem !important;
        min-width: 38px;
        justify-content: center;
        border-radius: 12px !important; /* 手机端圆角更柔和 */
    }

    /* 5. 间距微调 */
    .nav-right-zone {
        gap: 0.4rem !important;
    }
}

/* 电脑端恢复间距 */
@media (min-width: 769px) {
    .nav-btn i {
        margin-right: 0.5rem;
    }
}