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

body {
    background: #f1ede5;
    font-family: 'Segoe UI', 'Roboto', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    color: #2a241a;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* 侧边栏 */
.sidebar {
    width: 300px;
    background: #2c4b32;
    backdrop-filter: blur(2px);
    color: #faf3e0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
    transition: width 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1), padding 0.2s ease;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 20;
}

.sidebar.sidebar-collapsed {
    width: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
    overflow: hidden;
}
.sidebar.sidebar-collapsed * {
    opacity: 0;
    pointer-events: none;
}

.logo-area {
    padding: 24px 20px 16px 24px;
    border-bottom: 1px solid #4f7357;
    white-space: nowrap;
}

.logo-area h2 {
    font-size: 1.6rem;
    font-weight: 600;
    background: linear-gradient(135deg, #f9e0a0, #fff0cf);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.logo-area p {
    font-size: 0.75rem;
    opacity: 0.75;
    margin-top: 6px;
}

.nav-menu {
    flex: 1;
    padding: 16px 12px 24px 12px;
    overflow-y: auto;
}

/* 一级科目样式 */
.nav-category {
    margin-bottom: 12px;
    border-radius: 16px;
}
.cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 32px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
    margin-bottom: 4px;
}
.cat-header:hover {
    background: rgba(255, 255, 255, 0.12);
}
.cat-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f3e5cf;
    letter-spacing: 0.5px;
}
.cat-title span:first-child {
    font-size: 1.2rem;
}
.toggle-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    transition: transform 0.2s ease;
    color: #e7c9ae;
    font-weight: 500;
}
.sub-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 20px;
    margin-top: 4px;
    margin-bottom: 6px;
    overflow: hidden;
}
.sub-items.collapsed {
    display: none;
}
.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 28px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
    color: #fef0df;
}
.nav-sub-item i {
    font-style: normal;
    font-size: 1rem;
    opacity: 0.8;
}
.nav-sub-item:hover {
    background: #4b6e53;
    transform: translateX(4px);
}
.nav-sub-item.active-sub {
    background: #e7b183;
    color: #2a3a2a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-weight: 600;
}

/* 右侧内容区 */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: #fefaf2;
    /*padding: 24px 28px 40px;*/
    scroll-behavior: smooth;
    transition: all 0.2s;
}

/* 悬浮菜单按钮 */
.menu-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 99;
    background: #e7b183;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 26px;
    color: #2c3e2a;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    background-color: #e7b183ee;
}
.menu-toggle-btn:hover {
    transform: scale(1.02);
    background-color: #d6955e;
}

/* 内容卡片公用样式 */
.content-card {
    max-width: 1200px;
    margin: 0 auto;
}
.content-card .hero-mini {
    background: linear-gradient(105deg, #e5d5bc 0%, #f8efdf 100%);
    border-radius: 36px;
    padding: 1.2rem 1.8rem;
    margin-bottom: 2rem;
    border-left: 8px solid #b87c4a;
}
.content-card h2 {
    font-size: 1.7rem;
    font-weight: 700;
    border-left: 5px solid #c17b4c;
    padding-left: 18px;
    margin: 1.2rem 0 1rem 0;
    color: #2b4b2a;
}
.content-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.2rem 0 0.8rem;
    color: #9b5e2c;
    border-bottom: 2px solid #efdbc7;
    display: inline-block;
    padding-bottom: 4px;
}
.content-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
    border-radius: 20px;
    overflow: hidden;
    background: #fffef8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.content-card th {
    background-color: #e9dfd1;
    padding: 10px 8px;
    font-weight: 700;
    border: 1px solid #dccdb8;
}
.content-card td {
    padding: 8px;
    border: 1px solid #ede3d4;
}
.badge {
    background: #f5e6d3;
    color: #b45f2b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 30px;
    display: inline-block;
    margin-right: 0.5rem;
}
.highlight {
    background: #fef4e8;
    border-left: 4px solid #e7b183;
    padding: 0.8rem 1rem;
    margin: 1rem 0;
    border-radius: 16px;
}
.memory-box {
    background: #f8f0e4;
    border-radius: 20px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px dashed #ceb17a;
    font-family: monospace;
    font-weight: 500;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.2rem;
}
.organ-card {
    background: #fefaf5;
    border-radius: 20px;
    padding: 1rem;
    border: 1px solid #efddce;
}
.footnote {
    font-size: 0.8rem;
    color: #8f735b;
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5d5c0;
}
.welcome-card {
    text-align: center;
    padding: 3rem 2rem;
}

/* 移动端适配 */
@media (max-width: 760px) {
    .main-content {
        /*padding: 70px 16px 30px;*/
    }
    .menu-toggle-btn {
        top: 12px;
        left: 12px;
        width: 42px;
        height: 42px;
        font-size: 24px;
    }
    .sidebar {
        position: fixed;
        height: 100vh;
        z-index: 100;
        box-shadow: 6px 0 20px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s ease, width 0.3s;
    }
    .sidebar.sidebar-collapsed {
        width: 0;
        transform: translateX(-100%);
    }
    .sidebar:not(.sidebar-collapsed) {
        transform: translateX(0);
        width: 280px;
    }
}
@media (min-width: 761px) {
    .sidebar {
        position: relative;
    }
}
