/* 站点外壳（顶栏 / 内容区 / 页脚）的全局样式，原内联在 templates/layout.html。
   由 layout.html 在 {% block common_head %} 之后引入——必须排在 Vditor 等页面级 CSS 之后，
   才能让 #vditor 的排版覆盖规则生效。 */

:root {
    --allinmove-bg: #f5f7fb;
    --allinmove-surface: #ffffff;
    --allinmove-surface-soft: #f9fafb;
    --allinmove-border: #e5e7eb;
    --allinmove-border-strong: #d8dde6;
    --allinmove-text: #1f2937;
    --allinmove-muted: #6b7280;
    --allinmove-primary: #2563eb;
    --allinmove-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: var(--allinmove-text);
    background: var(--allinmove-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

[v-cloak] {
    display: none;
}

.holder {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--allinmove-bg);
}

.el-header.header {
    height: 60px !important;
    flex-shrink: 0;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--allinmove-border);
    box-shadow: var(--allinmove-shadow);
    z-index: 10;
}

.custom-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    gap: 16px;
}

.menu_items {
    flex: 0 1 auto;
    min-width: 0;
    border-bottom: none !important;
    background: transparent;
}

.menu_items.el-menu--horizontal {
    display: flex;
    flex-wrap: nowrap;
}

.menu_items.el-menu--horizontal > .el-menu-item {
    flex: 0 0 auto;
    height: 60px;
    line-height: 60px;
    color: #374151;
    font-weight: 500;
    border-bottom-width: 2px;
}

.menu_items.el-menu--horizontal > .el-menu-item:hover,
.menu_items.el-menu--horizontal > .el-menu-item:focus {
    color: var(--allinmove-primary);
    background: transparent;
}

.el-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.allinmove_content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    padding: 20px;
    background: var(--allinmove-bg);
}

.el-footer {
    flex-shrink: 0;
    padding: 0;
    background: var(--allinmove-surface);
    border-top: 1px solid var(--allinmove-border);
    height: auto;
}

.allinmove_footer {
    padding: 8px 12px;
    line-height: 1.5;
}

.allinmove_filing {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #909399;
    text-align: center;
}

.filing_gx,
.filing_ga {
    color: #909399;
    text-decoration: none;
}

.filing_gx:hover,
.filing_ga:hover {
    color: var(--allinmove-primary);
}

.filing_ga {
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.filing_ga_img {
    width: 14px;
    height: 14px;
}

@media (max-width: 900px) {
    .el-header.header {
        height: auto !important;
        min-height: 60px;
        padding: 10px 12px;
    }

    .custom-menu {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .menu_items {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .allinmove_content {
        padding: 12px;
    }
}

/* 手机档：整页滚动取代「固定外壳 + 内层滚动」。只有站级顶栏吸顶，
   二级横条与页脚随内容滚走（见 ADR-0004）。 */
@media (max-width: 640px) {
    html,
    body {
        height: auto;
        overflow: visible;
    }

    .holder {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .el-header.header {
        position: sticky;
        top: 0;
        min-height: 48px;
        padding: 4px 12px;
        /* 吸顶后需不透明，避免正文从半透明背景透出 */
        background: var(--allinmove-surface);
    }

    .menu_items.el-menu--horizontal > .el-menu-item {
        height: 44px;
        line-height: 44px;
    }

    .el-main,
    .allinmove_content {
        overflow: visible;
    }
}

/* 内容树节点（content / edit 共用） */
.custom-tree-node {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
}

.tree_left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.tree_left span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree_left i[class*="el-icon"] {
    margin-right: 6px;
    color: #409eff;
    font-size: 15px;
    flex-shrink: 0;
}

/* Vditor 正文排版（content / me 共用；edit 编辑器不受影响） */
#vditor.vditor-reset {
    font-size: 16px;
    line-height: 1.85;
    color: #1f2937;
}

#vditor.vditor-reset h1 {
    font-size: 30px;
    margin-top: 0;
}

#vditor.vditor-reset h2 {
    padding-bottom: 8px;
    border-bottom: 1px solid #eef1f5;
}

#vditor.vditor-reset pre,
#vditor .vditor-reset pre {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
}

/* 手机档：正文里的宽表格与代码块只在自身容器内横向滚动，不撑破整页（content / me 共用） */
@media (max-width: 640px) {
    #vditor.vditor-reset table,
    #vditor .vditor-reset table,
    #vditor.vditor-reset pre,
    #vditor .vditor-reset pre {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}
