@import url('./root.css');

header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--header-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1000;
}
.theme-toggle {
    position: absolute;
    right: 5px;
    top: 5px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1100;
    order: 0;
}
.nav-container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: relative;
}
.nav-toggle {
    position: absolute;
    left: 5px;
    top: 5px;
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1100;
    order: 0;
}
.nav-left{
    display: flex;
    align-items: center;
    flex: 0;
}
.nav-right {
    display: flex;
    align-items: center;
    flex: 0;
}
.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 60px;
}
.nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}
.nav-favicon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    background: #fff;
}
.nav-list {
    list-style: none;
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    transition: max-height 0.3s;
}
.nav-list-left {
    justify-content: flex-end;
}
.nav-list-right {
    justify-content: flex-start;
}
.nav-list li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.nav-list li a:hover {
    background: var(--link-hover-bg);
    color: var(--link-hover-color);
}
.nav-list.collapsed {
    display: none;
}
.nav-list.expanded {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100vw;
    background: var(--sidebar-bg);
    gap: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.nav-list.expanded li {
    text-align: center;
    border-bottom: 1px solid #444;
}
.nav-list.expanded li:last-child {
    border-bottom: none;
}
/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 240px;
    height: 100vh;
    background: var(--sidebar-bg);
    box-shadow: 2px 0 8px rgba(0,0,0,0.18);
    z-index: 2000;
    transition: left 0.3s;
    display: flex;
    flex-direction: column;
    padding-top: 60px;
}
.sidebar.open {
    left: 0;
}
.sidebar .sidebar-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
}
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar li {
    border-bottom: 1px solid #444;
}
.sidebar li:last-child {
    border-bottom: none;
}
.sidebar a {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    padding: 16px 24px;
    font-size: 1.1rem;
    transition: background 0.2s, color 0.2s;
}
.sidebar a:hover {
    background: var(--link-hover-bg);
    color: var(--link-hover-color);
}
.sidebar a:visited {
    color: var(--text-color);
}
/* 更多菜单 */
.nav-more {
    position: relative;
}
.nav-more-btn {
    color: var(--text-color);
    background: none;
    border: none;
    font-size: 1.1rem;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.nav-more-btn:hover {
    background: var(--link-hover-bg);
    color: var(--link-hover-color);
}
.nav-more-list {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    min-width: 140px;
    background: var(--sidebar-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    border-radius: 8px;
    z-index: 1200;
    flex-direction: column;
}
.nav-more-list.show {
    display: flex;
}
.nav-more-list li {
    border-bottom: 1px solid #444;
    text-align: left;
}
.nav-more-list li:last-child {
    border-bottom: none;
}
.nav-more-list a {
    color: var(--text-color);
    padding: 10px 18px;
    display: block;
    border-radius: 0;
}
.nav-more-list a:hover {
    background: var(--link-hover-bg);
    color: var(--link-hover-color);
}
.nav-more-list a:visited {
    color: var(--text-color);
}

@media (max-width: 900px) {
    .nav-list-left, .nav-list-right {
        display: none !important;
    }
    .nav-toggle {
        display: block;
    }
    .nav-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1200;
    }
    .nav-container {
        justify-content: flex-start;
    }
}
@media (min-width: 901px) {
    .nav-list-left, .nav-list-right {
        display: flex !important;
    }
    .nav-toggle {
        display: none;
    }
    .nav-center {
        position: static;
        transform: none;
    }
    .nav-container {
        justify-content: space-between;
    }
}
@media (max-width: 768px) {
    .nav-container {
        height: 48px;
    }
    .nav-list {
        display: none !important;
    }
    .nav-toggle {
        display: block;
    }
}