/* 全站共享导航样式：左侧树形导航 + 右侧内容区布局
   配色主题：深蓝渐变侧栏 + 琥珀金点缀 + 白色卡片内容区 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #eef2f8;
    color: #2c3e50;
}

/* ===== 左侧导航：深蓝渐变 ===== */
#site-nav {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1f3a63 0%, #2c5588 60%, #35699f 100%);
    overflow-y: auto;
    padding: 14px 0 24px;
    box-shadow: 2px 0 12px rgba(31, 58, 99, 0.18);
}

/* 侧栏滚动条 */
#site-nav::-webkit-scrollbar {
    width: 8px;
}
#site-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 4px;
}
#site-nav::-webkit-scrollbar-track {
    background: transparent;
}

/* 树 */
.nav-list {
    list-style: none;
    padding-left: 0;
}

.nav-list .nav-list {
    padding-left: 16px;
}

/* 有子节点的分组标题 */
.node-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 8px;
    margin: 1px 8px;
    transition: background 0.15s, color 0.15s;
}

.node-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

/* 展开/折叠箭头 */
.node-toggle::before {
    content: "▾";
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    transition: transform 0.15s;
}

li.collapsed > .node-toggle::before {
    transform: rotate(-90deg);
}

li.collapsed > .nav-list {
    display: none;
}

/* 叶子节点 */
.node-leaf {
    display: block;
    padding: 7px 16px 7px 38px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    border-radius: 8px;
    margin: 1px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s, transform 0.15s;
}

.node-leaf:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    transform: translateX(2px);
}

/* 当前页高亮：琥珀金 */
.node-leaf.active {
    background: linear-gradient(90deg, #ffc93c, #ffb52e);
    color: #1f3a63;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 197, 60, 0.35);
}

/* ===== 右侧内容区 ===== */
main {
    flex: 1;
    min-width: 0;
    padding: 36px 44px;
    overflow-y: auto;
    background:
        radial-gradient(1200px 400px at 90% -10%, rgba(255, 197, 60, 0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(53, 105, 159, 0.10), transparent 55%),
        #eef2f8;
}

/* 内容标题：装饰线 */
main h1 {
    font-size: 24px;
    color: #1f3a63;
    padding-bottom: 14px;
    margin-bottom: 26px;
    position: relative;
    letter-spacing: 1px;
}

main h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #2c5588, #ffc93c);
}

/* 内容卡片 */
main .content-placeholder {
    margin-top: 4px;
    min-height: 58vh;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e3eaf3;
    box-shadow: 0 6px 24px rgba(31, 58, 99, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #8fa0b4;
    font-size: 15px;
}

main .content-placeholder::before {
    content: "📖";
    font-size: 42px;
    filter: grayscale(0.2);
}

/* ===== 目录页 ===== */
.catalog-book {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e3eaf3;
    box-shadow: 0 6px 24px rgba(31, 58, 99, 0.08);
    padding: 26px 32px 32px;
}

.book-title {
    font-size: 20px;
    color: #1f3a63;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eef2f8;
}

.catalog-book + .catalog-book {
    margin-top: 22px;
}

.catalog-unit + .catalog-unit {
    margin-top: 18px;
}

.unit-title {
    font-size: 15px;
    color: #2c5588;
    margin-bottom: 10px;
    padding-left: 12px;
    position: relative;
}

.unit-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, #2c5588, #ffc93c);
}

.lesson-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lesson-link {
    display: block;
    padding: 9px 18px;
    border-radius: 10px;
    background: #f4f8fd;
    border: 1px solid #e3eaf3;
    color: #2c5588;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.lesson-link:hover {
    background: #e8f2fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 85, 136, 0.14);
}

.lesson-link.pending {
    color: #a9b8c9;
    cursor: not-allowed;
}

.lesson-link.pending:hover {
    background: #f4f8fd;
    transform: none;
    box-shadow: none;
}
