/* ============================================================
   黑猫工坊 · 公共自定义样式
   说明：在线工具页面共享的左侧固定栏样式，请勿在 HTML 中重复定义。
   ============================================================ */

:root {
    --sidebar-width: 200px;
    --accent: #c00;
    --accent-soft: #ffe5e5;
    --border-soft: #e9ecef;
}

/* ===== 固定左侧栏 ===== */
.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--border-soft);
    padding: 20px 14px;
    overflow-y: auto;
    z-index: 1030;
    box-shadow: 1px 0 4px rgba(0, 0, 0, .04);
}

.side-nav .brand {
    font-weight: 600;
    color: var(--accent);
    font-size: 1.05rem;
    margin-bottom: 18px;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 12px;
}

.side-nav .brand a {
    color: var(--accent);
    text-decoration: none;
}

.side-nav .nav-section-title {
    font-size: .82rem;
    color: #6c757d;
    margin: 12px 0 8px;
    font-weight: 500;
    letter-spacing: .5px;
}

.side-nav .nav-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.side-nav .nav-list li {
    margin-bottom: 4px;
}

.side-nav .nav-list a {
    display: block;
    padding: 8px 10px;
    border-radius: 5px;
    color: #495057;
    text-decoration: none;
    font-size: .92rem;
    transition: background-color .15s, color .15s;
}

.side-nav .nav-list a:hover {
    background-color: #f1f3f5;
    color: var(--accent);
}

.side-nav .nav-list a.active {
    background-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.side-nav .year-row {
    display: flex;
    gap: 6px;
}

.side-nav .year-row a {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
}

.side-nav .back-link {
    display: block;
    margin-top: 16px;
    font-size: .85rem;
    color: #6c757d;
    text-decoration: none;
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}

.side-nav .back-link:hover {
    color: var(--accent);
}

/* 主内容区让出侧边栏宽度 */
.main-wrap {
    margin-left: var(--sidebar-width);
}

/* 移动端：侧边栏可折叠 */
.side-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1040;
}

@media (max-width: 767.98px) {
    :root {
        --sidebar-width: 0px;
    }

    .side-nav {
        transform: translateX(-100%);
        transition: transform .25s;
        width: 220px;
    }

    .side-nav.show {
        transform: translateX(0);
    }

    .main-wrap {
        margin-left: 0;
    }

    .side-toggle {
        display: inline-flex;
    }
}

.side-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .3);
    z-index: 1025;
}

.side-backdrop.show {
    display: block;
}
