/* ========================================
   安全文档库主题 - 完整样式表
   @package Aqdoc
   ======================================== */

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f6f8;
    color: #333;
    line-height: 1.7;
    font-size: 15px;
}
a {
    color: #1e87f0;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
img {
    max-width: 100%;
    height: auto;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.site-main {
    min-height: 60vh;
}

/* ===== 顶部大蓝卡片（所有页面统一） ===== */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e87f0 100%);
    padding: 50px 20px 40px;
    text-align: center;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
}
.hero-logo {
    display: inline-block;
    font-size: 36px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    margin-bottom: 12px;
}
.hero-logo:link,
.hero-logo:visited,
.hero-logo:hover,
.hero-logo:active {
    color: #fff !important;
    text-decoration: none !important;
}
.hero-sub {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 24px;
    color: #fff;
}
.hero-search {
    display: flex;
    max-width: 600px;
    width: 100%;
    margin: 0 auto 16px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    box-sizing: border-box;
}
.hero-search input {
    flex: 1;
    min-width: 0;
    padding: 14px 20px;
    border: none;
    outline: none;
    font-size: 15px;
    box-sizing: border-box;
}
.hero-search button {
    padding: 14px 32px;
    border: none;
    background: #ff7a00;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.hero-search button:hover {
    background: #e66a00;
}
.hero-stats {
    font-size: 13px;
    opacity: 0.85;
    color: #fff;
}
.hero-stats strong {
    color: #ffd700;
    font-size: 15px;
}

/* ===== 面包屑导航 ===== */
.breadcrumb {
    padding: 16px 0;
    font-size: 13px;
    color: #999;
    line-height: 1.6;
}
.breadcrumb a {
    color: #1e87f0;
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb .sep {
    margin: 0 8px;
    color: #ccc;
}
.breadcrumb .current {
    color: #666;
}

/* ===== 首页：分类区块 ===== */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    border-left: 4px solid #1e87f0;
    padding-left: 12px;
    margin: 30px 0 20px;
}
.category-block {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}
.category-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #eaf4ff;
    color: #1e87f0;
    border-radius: 8px;
    flex-shrink: 0;
}
.category-icon svg {
    width: 18px;
    height: 18px;
}
.category-name a {
    color: #1a1a1a;
    text-decoration: none;
    flex: 1;
}
.category-name a:hover {
    color: #1e87f0;
    text-decoration: none;
}
.category-count {
    font-size: 13px;
    color: #999;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: normal;
}

/* ===== 首页：子分类列表行 ===== */
.subcategory-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.subcategory-row {
    display: flex;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px dashed #f0f0f0;
    align-items: flex-start;
}
.subcategory-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.subcategory-row:first-child {
    padding-top: 0;
}
.subcategory-left {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.subcategory-link {
    font-size: 14px;
    font-weight: 600;
    color: #1e87f0;
    text-decoration: none;
    line-height: 1.5;
}
.subcategory-link:hover {
    text-decoration: underline;
}
.subcategory-count {
    font-size: 12px;
    color: #bbb;
}
.subcategory-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.doc-link {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    line-height: 1.6;
    padding: 3px 0 3px 12px;
    border-left: 2px solid #f0f0f0;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-link:hover {
    color: #1e87f0;
    border-left-color: #1e87f0;
    text-decoration: none;
}

/* ===== 文章页：布局 ===== */
.post-layout {
    display: flex;
    gap: 24px;
    margin: 20px 0 40px;
    align-items: flex-start;
}
.post-layout .post {
    flex: 1;
    min-width: 0;
    margin: 0;
}

/* ===== 文章页：正文 ===== */
.post {
    background: #fff;
    border-radius: 10px;
    padding: 40px;
    margin: 30px 0;
}
.post-header {
    margin-bottom: 20px;
}
.post-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 12px;
}
.post-meta {
    font-size: 13px;
    color: #999;
}
.post-meta span {
    margin-right: 16px;
}
.post-fields {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}
.field-item {
    margin-right: 20px;
    display: inline-block;
}
.post-content {
    font-size: 15px;
    line-height: 1.9;
    color: #333;
}
.post-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    color: #1a1a1a;
}
.post-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 22px 0 12px;
    color: #1a1a1a;
}
.post-content h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 18px 0 10px;
    color: #333;
}
.post-content p {
    margin-bottom: 14px;
}
.post-content ul,
.post-content ol {
    margin: 12px 0;
    padding-left: 24px;
}
.post-content li {
    margin-bottom: 6px;
}
.post-content strong {
    color: #1a1a1a;
    font-weight: 600;
}
.post-content hr {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 24px 0;
}
.post-content blockquote {
    border-left: 4px solid #1e87f0;
    background: #f8f9fa;
    padding: 12px 20px;
    margin: 16px 0;
    color: #555;
    border-radius: 0 6px 6px 0;
}

/* 文章内表格 */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    background: #fff;
}
.post-content table th,
.post-content table td {
    border: 1px solid #e5e5e5;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.post-content table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #1a1a1a;
}
.post-content table tr:hover td {
    background: #fafbfc;
}

/* 文章页脚 */
.post-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.post-tags {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
    line-height: 2;
}
.post-tags a {
    display: inline-block;
    padding: 2px 10px;
    background: #f0f7ff;
    color: #1e87f0;
    border-radius: 4px;
    margin-right: 6px;
    text-decoration: none;
    font-size: 12px;
}
.post-tags a:hover {
    background: #1e87f0;
    color: #fff;
    text-decoration: none;
}
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}
.post-nav a {
    color: #1e87f0;
    text-decoration: none;
}
.post-nav a:hover {
    text-decoration: underline;
}

/* ===== 文章目录（TOC） ===== */
.post-toc {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #eee;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.toc-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-list li {
    margin-bottom: 4px;
    line-height: 1.5;
}
.toc-list li a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}
.toc-list li a:hover {
    color: #1e87f0;
    background: #f5f8fc;
    border-left-color: #1e87f0;
    text-decoration: none;
}
.toc-list .toc-level-3 a {
    padding-left: 20px;
    font-size: 12px;
    color: #888;
}

/* ===== 相关文章推荐 ===== */
.related-posts {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}
.related-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    padding-left: 10px;
    border-left: 3px solid #1e87f0;
}
.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.related-list li {
    font-size: 14px;
    line-height: 1.6;
}
.related-list li a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fafbfc;
    transition: all 0.2s;
}
.related-list li a:hover {
    color: #1e87f0;
    background: #f0f7ff;
    text-decoration: none;
}

/* ===== 归档页（分类/标签/搜索） ===== */
.archive-header {
    padding: 20px 0 10px;
}
.archive-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}
.archive-item {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 14px;
    border: 1px solid #eee;
    transition: box-shadow 0.2s;
}
.archive-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.archive-item-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.5;
}
.archive-item-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.archive-item-title a:hover {
    color: #1e87f0;
}
.archive-item-meta {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
}
.archive-item-meta span {
    margin-right: 14px;
}
.archive-item-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
}
.archive-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    color: #999;
}
.archive-empty a {
    display: inline-block;
    margin-top: 12px;
    color: #1e87f0;
    text-decoration: none;
}

/* ===== 分页导航 ===== */
.pagination {
    text-align: center;
    padding: 30px 0;
}
.page-nav {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 0;
}
.page-nav li {
    display: inline-block;
}
.page-nav li a,
.page-nav li span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}
.page-nav li a:hover {
    background: #1e87f0;
    color: #fff;
    border-color: #1e87f0;
    text-decoration: none;
}
.page-nav li.current a,
.page-nav li.current span {
    background: #1e87f0;
    color: #fff;
    border-color: #1e87f0;
}
.page-nav li.disabled span {
    color: #ccc;
    background: #f5f5f5;
    border-color: #eee;
}

/* ===== 独立页面 ===== */
.page-post {
    margin: 20px 0 40px;
}
.page-post .post-header {
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* ===== 页脚 ===== */
.site-footer {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
    font-size: 13px;
}
.footer-links {
    margin-bottom: 12px;
}
.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 10px;
}
.footer-links a:hover {
    color: #fff;
    text-decoration: none;
}
.footer-copy {
    margin-bottom: 8px;
    line-height: 1.8;
}
.footer-icp {
    margin-top: 8px;
    font-size: 12px;
    line-height: 2;
}
.footer-icp a {
    color: #7f8c8d;
    text-decoration: none;
    margin: 0 6px;
}
.footer-icp a:hover {
    color: #fff;
    text-decoration: none;
}
.footer-gongan {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.gongan-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* ===== 阅读进度条 ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #1e87f0, #ff7a00);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ===== 回到顶部按钮 ===== */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1e87f0;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30,135,240,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: #1668c9;
    box-shadow: 0 6px 16px rgba(30,135,240,0.4);
    transform: translateY(-2px);
}
.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ===== 代码高亮 ===== */
.post-content pre {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid #e5e5e5;
}
.post-content pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: transparent;
    padding: 0;
    color: #24292e;
}
.post-content code {
    background: #f0f2f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #d63384;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* ===== 404页面 ===== */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page h1 {
    font-size: 80px;
    color: #1e87f0;
    margin-bottom: 10px;
    font-weight: 700;
}
.error-page p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}
.error-page .back-home {
    display: inline-block;
    padding: 10px 24px;
    background: #1e87f0;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
}
.error-page .back-home:hover {
    background: #1668c9;
    text-decoration: none;
}

/* ========================================
   移动端适配
   ======================================== */
@media (max-width: 900px) {
    .post-layout {
        flex-direction: column;
    }
    .post-toc {
        width: 100%;
        position: static;
        max-height: none;
        order: -1;
        margin-bottom: 0;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 30px 16px 24px;
    }
    .hero-logo {
        font-size: 26px;
    }
    .hero-sub {
        font-size: 13px;
    }
    .hero-search {
        flex-direction: column;
    }
    .hero-search button {
        width: 100%;
    }
    .container {
        padding: 0 12px;
    }
    .post {
        padding: 20px;
    }
    .post-title {
        font-size: 20px;
    }
    .post-content {
        font-size: 14px;
    }
    .post-content h2 {
        font-size: 17px;
    }
    .post-content h3 {
        font-size: 15px;
    }
    .related-list {
        grid-template-columns: 1fr;
    }
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 40px;
        height: 40px;
    }
    .archive-item {
        padding: 16px;
    }
    .archive-item-title {
        font-size: 15px;
    }
    .footer-links a {
        margin: 0 6px;
        display: inline-block;
        margin-bottom: 6px;
    }
    .post-nav {
        flex-direction: column;
        gap: 8px;
    }
    /* 子分类列表行：移动端改为上下布局 */
    .subcategory-row {
        flex-direction: column;
        gap: 8px;
        padding: 12px 0;
    }
    .subcategory-left {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .doc-link {
        white-space: normal;
    }
}
/* 文档列表项：每条文档独立一行，内部元素可换行，间距 6px */
.doc-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

/* 文档标题链接：宽度自适应，不强制拉伸 */
.doc-item .doc-link {
    flex: 0 1 auto;
}

/* 依据/来源标签：小号字体、浅灰蓝背景、圆角、不换行 */
.list-field {
    display: inline-block;
    font-size: 12px;
    line-height: 18px;
    color: #5a6b7b;
    background: #eef3f8;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}