/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: #f5f6fa;
    color: #333;
    min-height: 100vh;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
}

.search-box {
    margin-left: auto;
    position: relative;
    max-width: 280px;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    outline: none;
    transition: background 0.2s;
}
.search-box input::placeholder { color: rgba(255,255,255,0.6); }
.search-box input:focus { background: rgba(255,255,255,0.35); }
.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.7;
}

/* ===== Layout ===== */
.layout {
    display: flex;
    padding-top: 56px;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
    overflow-y: auto;
    transition: transform 0.3s;
}

.nav-section {
    border-bottom: 1px solid #f0f0f0;
}

.nav-section-title {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    transition: background 0.15s;
    user-select: none;
}
.nav-section-title:hover { background: #f5f5f5; }
.nav-section-title .arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    color: #999;
}
.nav-section-title.active .arrow { transform: rotate(90deg); }

.nav-sub {
    display: none;
    list-style: none;
}
.nav-sub.open { display: block; }

.nav-sub a {
    display: block;
    padding: 8px 16px 8px 32px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.nav-sub a:hover {
    background: #e8f0fe;
    color: #1a73e8;
}
.nav-sub a.active {
    background: #e8f0fe;
    color: #1a73e8;
    border-left-color: #1a73e8;
    font-weight: 500;
}

/* ===== Content ===== */
.content {
    flex: 1;
    padding: 32px 40px;
    max-width: 860px;
}

/* Welcome Page */
.welcome h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: #1a73e8;
}
.welcome p {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 8px;
}
.welcome-modules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 24px;
}
.welcome-module {
    display: block;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.welcome-module:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 12px rgba(26,115,232,0.1);
    transform: translateY(-2px);
}

/* ===== Page Content ===== */
.page-content h2 {
    font-size: 24px;
    color: #1a73e8;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8f0fe;
}
.page-content .sub-section {
    margin-bottom: 28px;
}
.page-content .sub-section h3 {
    font-size: 17px;
    color: #333;
    margin-bottom: 10px;
    padding: 6px 12px;
    background: #f8f9fc;
    border-radius: 4px;
    border-left: 3px solid #1a73e8;
}
.page-content .sub-section .text {
    font-size: 14px;
    line-height: 1.9;
    color: #444;
    padding: 0 12px;
}
.page-content ul {
    list-style: none;
    padding: 0;
}
.page-content li {
    position: relative;
    padding: 4px 0 4px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: #444;
}
.page-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1a73e8;
    font-weight: bold;
}
.page-content p {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 4px;
}
.page-content strong {
    color: #333;
}

/* ===== Search Highlight ===== */
.highlight {
    background: #fff176;
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== Overlay ===== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 50;
}
.overlay.show { display: block; }

/* ===== Scrollbar ===== */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        height: calc(100vh - 56px);
        z-index: 99;
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open { transform: translateX(0); }
    
    .content { padding: 20px 16px; }
    .content { max-width: 100%; }
    
    .header-title { font-size: 15px; }
    .search-box { max-width: 160px; }
    
    .welcome-modules {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
