/* 布局层：导航 / 容器 / 侧边栏 / 搜索框 / 面包屑 / 页脚（全站引用） */

/* 顶部导航 */
.navbar {
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-size: 1.1rem; font-weight: 600; letter-spacing: .5px; }
.navbar-brand img { height: 28px; }
.navbar-links { display: flex; align-items: center; gap: 20px; font-size: .875rem; }
.navbar-links a { color: var(--nav-text); text-decoration: none; opacity: .85; transition: opacity .2s; }
.navbar-links a:hover { opacity: 1; }

/* 主体布局 */
.container { display: flex; flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; }

/* 侧边栏 */
.sidebar { width: 260px; background: var(--sidebar-bg); border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; padding: 16px 0; }
.sidebar-title { padding: 0 16px 12px; font-size: .8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }

.folder-tree ul { list-style: none; padding-left: 0; }
.folder-tree ul ul { padding-left: 16px; }
.folder-tree li { position: relative; }
.folder-tree li::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.folder-tree li:last-child::before { bottom: 50%; }
.folder-tree a { display: flex; align-items: center; gap: 8px; padding: 6px 16px; color: var(--text); text-decoration: none; font-size: .875rem; border-radius: 4px; margin: 1px 8px; transition: background .15s; }
.folder-tree a:hover { background: var(--hover-bg); }
.folder-tree li.active > a { background: var(--sidebar-active); color: var(--primary); font-weight: 500; }
.folder-tree a svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }

/* 主内容区 */
.content { flex: 1; padding: 24px; min-width: 0; }
.content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.content-header h1 { font-size: 1.25rem; font-weight: 600; color: var(--text); }

/* 搜索框 */
.search-bar { position: relative; width: 400px; }
.search-bar .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-secondary); z-index: 1; }
.search-bar input { width: 100%; padding: 8px 130px 8px 34px; border: 1px solid var(--border); border-radius: 6px; font-size: .875rem; outline: none; background: #fff; transition: border-color .2s, box-shadow .2s; }
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,76,126,.1); }

.search-check { position: absolute; right: 58px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 3px; font-size: .8rem; color: var(--text-secondary); cursor: pointer; user-select: none; white-space: nowrap; z-index: 1; }
.search-check input { display: none; }
.check-box { width: 13px; height: 13px; border: 1.5px solid var(--border); border-radius: 2px; position: relative; flex-shrink: 0; transition: all .15s; }
.search-check input:checked + .check-box { background: var(--primary); border-color: var(--primary); }
.search-check input:checked + .check-box::after { content: ''; position: absolute; top: 0; left: 3px; width: 4px; height: 7px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.search-check input:checked ~ * { color: var(--text); }
.search-check input:focus-visible + .check-box { outline: 2px solid var(--primary); outline-offset: 1px; }

.search-bar .shortcut { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: .65rem; color: var(--text-secondary); background: var(--hover-bg); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--border); pointer-events: none; white-space: nowrap; line-height: 1.4; }

/* 面包屑 */
.breadcrumb { margin-bottom: 16px; font-size: .85rem; color: var(--text-secondary); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* 页脚 */
.site-footer { background: var(--footer-bg); color: var(--footer-text); text-align: center; padding: 16px 24px; font-size: .8rem; }
.site-footer a { color: var(--footer-text); text-decoration: none; }
.site-footer a:hover { color: #cbd5e1; }

/* 桌面端底栏固定在视口底部 */
@media (min-width: 769px) {
    .site-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; }
    body { padding-bottom: 56px; }
}

/* 响应式（布局部分） */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; }
    .navbar-links { display: none; }
    .container { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; overflow-y: auto; }
    .content { padding: 16px; }
    .search-bar { width: 100%; }
    .search-bar input { padding-right: 16px; }
    .search-check, .search-bar .shortcut { display: none; }
    .content-header { flex-direction: column; align-items: stretch; }
}
