:root {
    --bg-cream: #f8f5e6;
    --bg-card: #ffffff;
    --bg-example: #f1f5f9;
    --text-dark: #2d3748;
    --text-muted: #718096;
    --text-light: #a0aec0;
    --blue-dark: #2c5282;
    --blue-word: #2b6cb0;
    --orange: #dd6b20;
    --border-light: #e2e8f0;
    --border-sidebar: #cbd5e0;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Topbar */
.topbar {
    padding: 20px 32px;
}

.topbar h1 {
    font-size: 22px;
    color: var(--blue-dark);
    font-weight: 600;
}

/* Layout */
.layout {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 240px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 20px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.4);
    padding: 20px 16px;
    border-right: 1px solid var(--border-light);
}

.sidebar-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 8px;
}

.topic-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topic-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.topic-nav a:hover {
    background: rgba(44, 82, 130, 0.08);
}

.topic-nav a.active {
    background: var(--blue-dark);
    color: white;
}

.topic-nav a.active .nav-en {
    color: rgba(255, 255, 255, 0.8);
}

.nav-num {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.6;
    min-width: 24px;
}

.nav-cn {
    font-size: 14px;
    font-weight: 500;
}

.nav-en {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

/* Main Content */
.content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

/* Topic Section */
.topic {
    scroll-margin-top: 90px;
    margin-bottom: 40px;
}

.topic-title {
    font-size: 24px;
    color: var(--blue-dark);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--orange);
}

.topic-title .num {
    margin-right: 8px;
}

.topic-title .cn {
    font-weight: 600;
}

.topic-title .en {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

/* Block Title */
.block-title {
    font-size: 16px;
    color: var(--blue-dark);
    margin: 24px 0 16px;
    font-weight: 600;
}

/* Vocab Grid */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.vocab-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vocab-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.vocab-card .word {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.vocab-card .num {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

.vocab-card .en {
    font-size: 17px;
    font-weight: 600;
    color: var(--blue-word);
}

.vocab-card .ipa {
    font-size: 14px;
    color: var(--text-light);
    font-family: "Lucida Sans Unicode", "Arial Unicode MS", sans-serif;
}

.vocab-card .cn {
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.vocab-card .example {
    background: var(--bg-example);
    border-left: 3px solid var(--border-sidebar);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

/* Sentence List */
.sentence-list {
    list-style: none;
    counter-reset: sent-counter;
}

.sentence-list li {
    counter-increment: sent-counter;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 10px;
    position: relative;
    padding-left: 48px;
    box-shadow: var(--shadow-card);
}

.sentence-list li::before {
    content: counter(sent-counter);
    position: absolute;
    left: 16px;
    top: 14px;
    width: 24px;
    height: 24px;
    background: var(--blue-word);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.sentence-list .en {
    font-size: 16px;
    color: var(--blue-dark);
    margin-bottom: 5px;
}

.sentence-list .cn {
    font-size: 14px;
    color: var(--text-muted);
}

/* Footer */
.page-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border-light);
    margin-top: 40px;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--blue-dark);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    opacity: 1;
    transform: scale(1.05);
}

.back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .layout {
        max-width: 100%;
    }

    .sidebar {
        width: 200px;
    }

    .content {
        padding: 20px 24px;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 16px 20px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 12px 16px;
    }

    .topic-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .topic-nav a {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 12px;
    }

    .topic-nav a .nav-en {
        display: none;
    }

    .vocab-grid {
        grid-template-columns: 1fr;
    }

    .topic-title {
        font-size: 20px;
    }

    .topic-title .en {
        font-size: 14px;
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }

    .sentence-list li {
        padding-left: 16px;
    }

    .sentence-list li::before {
        position: static;
        margin-right: 10px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}
