* {
    box-sizing: border-box;
}

:root {
    --ink: #14213d;
    --muted: #667085;
    --line: rgba(20, 33, 61, 0.1);
    --paper: #ffffff;
    --soft: #f5f8ff;
    --bio: #16a34a;
    --geo: #2563eb;
    --accent: #f97316;
    --shadow: 0 18px 46px rgba(20, 33, 61, 0.1);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #eef7ff 0%, #f7fbf4 48%, #fff8ed 100%);
}

button,
textarea,
select {
    font: inherit;
}

.exam-app {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: 48px;
}

.topbar {
    min-height: 66px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(246, 251, 255, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.product-name {
    font-weight: 900;
    font-size: 16px;
}

.product-subtitle {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.topbar nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.topbar a,
.topbar button,
.secondary-btn {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: end;
    padding: 42px 0 28px;
}

.kicker {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    margin: 0 0 12px;
    border-radius: 8px;
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    font-weight: 900;
    font-size: 13px;
}

.hero h1 {
    margin: 0;
    max-width: 820px;
    font-size: 42px;
    line-height: 1.14;
}

.hero-copy {
    max-width: 760px;
    margin: 16px 0 0;
    color: #475467;
    line-height: 1.85;
}

.exam-facts {
    display: grid;
    gap: 10px;
}

.exam-facts div,
.panel,
.mock-card,
.control-card {
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
}

.exam-facts div {
    min-height: 76px;
    padding: 15px;
}

.exam-facts span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.exam-facts strong {
    display: block;
    margin-top: 8px;
    font-size: 18px;
}

.layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
}

.nav-item {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #344054;
    font-weight: 800;
    text-align: left;
    padding: 0 12px;
    cursor: pointer;
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--bio), var(--geo));
}

.content {
    min-width: 0;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.section-head {
    margin-bottom: 16px;
}

.section-head h2,
.practice-top h2 {
    margin: 0;
    font-size: 24px;
}

.section-head p,
.practice-top p {
    margin: 6px 0 0;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card,
.chapter-card,
.paper-card {
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
}

.stat-card {
    min-height: 110px;
    padding: 16px;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.panel {
    padding: 18px;
}

.panel h3,
.mock-card h3 {
    margin: 0 0 10px;
}

.chapter-grid,
.paper-grid,
.learn-layout {
    display: grid;
    gap: 14px;
}

.chapter-grid,
.paper-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.learn-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    align-items: start;
}

.knowledge-map {
    display: grid;
    gap: 14px;
}

.map-lane {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
}

.map-lane h3 {
    margin: 0 0 12px;
}

.map-nodes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    position: relative;
}

.map-node {
    min-height: 128px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.map-node.active {
    border-color: var(--geo);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.map-lane.bio .map-node.active {
    border-color: var(--bio);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.node-index {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--geo);
    color: #ffffff;
    font-weight: 900;
    font-size: 12px;
}

.map-lane.bio .node-index {
    background: var(--bio);
}

.map-node strong {
    display: block;
    margin-top: 10px;
    font-size: 16px;
}

.map-node em {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    line-height: 1.55;
}

.learn-detail {
    position: sticky;
    top: 84px;
}

.learn-badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.learn-badge.bio {
    background: var(--bio);
}

.learn-badge.geo {
    background: var(--geo);
}

.learn-detail h3 {
    margin: 12px 0 6px;
    font-size: 22px;
}

.relation {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.65;
}

.learn-template {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.learn-template h4 {
    margin: 0 0 8px;
}

.learn-template ul,
.learn-template ol {
    margin: 0;
    padding-left: 20px;
    color: #475467;
    line-height: 1.75;
}

.concept-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.concept-tags span {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--soft);
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.chapter-card,
.paper-card {
    padding: 16px;
}

.chapter-card .subject {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 9px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.subject.bio {
    background: var(--bio);
}

.subject.geo {
    background: var(--geo);
}

.chapter-card h3,
.paper-card h3 {
    margin: 12px 0 8px;
}

.chapter-card p,
.paper-card p,
.mock-card p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.65;
}

.primary-btn {
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bio), var(--geo));
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

.mock-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 20px;
}

.practice-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.timer {
    min-width: 120px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #14213d;
    color: #ffffff;
    text-align: center;
    font-weight: 900;
}

.question-box,
.question-list {
    display: grid;
    gap: 12px;
}

.question-card {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.question-title {
    margin: 0 0 14px;
    font-weight: 900;
    line-height: 1.65;
}

.option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.option.selected {
    border-color: var(--geo);
    background: #eff6ff;
}

.option.correct {
    border-color: var(--bio);
    background: #ecfdf3;
}

.option.wrong {
    border-color: #ef4444;
    background: #fff1f2;
}

.explain {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--soft);
    color: #475467;
    line-height: 1.65;
}

.practice-actions,
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.record-list {
    display: grid;
    gap: 10px;
}

.record-item,
.plan-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.record-item strong {
    display: block;
}

.record-item span,
.plan-item span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.empty {
    color: var(--muted);
}

.schema {
    overflow: auto;
    padding: 12px;
    border-radius: 8px;
    background: #101828;
    color: #e0f2fe;
    font-size: 12px;
}

#importText {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    resize: vertical;
}

@media (max-width: 980px) {
    .hero,
    .layout,
    .two-col,
    .learn-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mock-card,
    .practice-top,
    .learn-detail {
        flex-direction: column;
        align-items: stretch;
        position: static;
    }
}

@media (max-width: 640px) {
    .exam-app {
        width: min(100% - 20px, 1320px);
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 0;
    }

    .hero h1 {
        font-size: 30px;
    }

    .sidebar,
    .stats-grid,
    .map-nodes {
        grid-template-columns: 1fr;
    }
}
