:root {
    --ink: #23332d;
    --muted: #7a847e;
    --green: #25674d;
    --mint: #eaf1e9;
    --line: #e2e6df;
    --paper: #fafbf7;
    --white: #fff;
    --orange: #b47741;
    font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--paper)
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

button, input {
    font: inherit
}

button, a, input {
    -webkit-tap-highlight-color: transparent
}

button {
    cursor: pointer
}

button:disabled {
    opacity: .5;
    cursor: wait
}

button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 3px solid #d2ac68;
    outline-offset: 3px
}

header {
    height: 82px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5vw;
    background: #fff
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    font-size: 20px;
    letter-spacing: 1px;
    font-weight: 700
}

.brand-mark {
    width: 37px;
    height: 39px;
    background: var(--green);
    color: white;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-size: 24px;
    font-family: serif
}

.brand-light {
    font-weight: 400;
    font-size: 15px;
    letter-spacing: 2px
}

.header-right {
    display: flex;
    gap: 24px;
    align-items: center
}

.connection {
    font-size: 12px;
    color: var(--green)
}

.connection:before {
    content: '●';
    margin-right: 8px;
    font-size: 8px
}

main {
    max-width: 1360px;
    margin: auto;
    padding: 0 5vw
}

.hero {
    padding: 54px 0 46px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 2.3px;
    color: var(--green);
    font-weight: 700
}

h1 {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 600;
    letter-spacing: -1px;
    margin: 15px 0
}

p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.9
}

h2 {
    font-size: 21px;
    margin: 0;
    font-weight: 600
}

.hero-seal {
    width: 94px;
    height: 104px;
    background: #f1f0e5;
    border: 1px solid #e8e5d4;
    color: #63745d;
    border-radius: 48% 48% 9px 9px;
    text-align: center;
    padding-top: 11px;
    font-size: 49px;
    font-family: serif;
    transform: rotate(5deg);
    margin-right: 18px
}

.hero-seal span {
    display: block;
    font-family: sans-serif;
    font-size: 10px;
    letter-spacing: 4px
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.section-heading p {
    margin: 8px 0 0
}

.source-toggle {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px
}

input[type=checkbox] {
    accent-color: var(--green)
}

.library-toolbar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin: 24px 0 20px
}

#levels {
    display: flex;
    background: #eff1eb;
    border-radius: 9px;
    padding: 4px;
    gap: 5px
}

#levels button {
    padding: 10px 24px;
    border: 0;
    background: transparent;
    color: #7e867c;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600
}

#levels button.active {
    background: white;
    color: var(--green);
    box-shadow: 0 2px 6px #23332d10
}

.search {
    margin-left: auto;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    color: var(--muted)
}

.search input {
    width: 180px;
    background: none;
    border: 0;
    padding: 11px 0;
    outline: none;
    font-size: 12px
}

.subtle {
    background: white;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 13px;
    font-size: 12px;
    color: var(--ink)
}

.subtle:hover {
    background: var(--mint);
    border-color: #b7c9b8
}

.primary {
    background: var(--green);
    border: 0;
    border-radius: 7px;
    color: white;
    padding: 11px 19px
}

.exam-grid {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 17px
}

.exam-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 23px;
    text-align: left;
    transition: transform .16s, border-color .16s
}

.exam-card:hover {
    transform: translateY(-3px);
    border-color: #82a58a
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px
}

.badge {
    background: var(--mint);
    color: var(--green);
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600
}

.free {
    font-size: 10px;
    color: var(--muted)
}

.exam-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px
}

.exam-card p {
    margin: 0 0 24px;
    font-size: 12px
}

.card-bottom {
    border-top: 1px solid #eef0eb;
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--green)
}

#list-status, #question-status {
    font-size: 13px;
    margin: 10px 0;
    color: var(--muted)
}

.error {
    color: #a94a3c !important;
    background: #fff1ec;
    padding: 15px;
    border-radius: 8px
}

.empty {
    padding: 70px 20px;
    text-align: center;
    grid-column: 1/-1;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 10px
}

footer {
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    margin: 55px 0 24px;
    padding-top: 21px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1px
}

.workspace-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px
}

#exam-title {
    font-size: 16px;
    font-weight: 600
}

#download {
    margin-left: auto
}

.study-layout {
    display: grid;
    grid-template-columns:245px minmax(0, 1fr);
    gap: 22px
}

aside {
    border: 1px solid var(--line);
    background: white;
    border-radius: 10px;
    padding: 19px 10px;
    height: fit-content;
    position: sticky;
    top: 16px
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    padding: 0 10px 17px
}

#group-count {
    color: var(--muted);
    font-weight: 400
}

#groups button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    background: transparent;
    padding: 12px 10px;
    border-radius: 6px;
    text-align: left;
    color: #59675e;
    font-size: 12px;
    margin-bottom: 3px
}

#groups button.active {
    background: var(--mint);
    color: var(--green);
    font-weight: 600
}

.group-number {
    font-size: 10px;
    color: var(--muted);
    min-width: 19px
}

#groups .count {
    margin-left: auto;
    font-size: 10px;
    font-weight: 400
}

article {
    min-width: 0
}

.study-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 15px
}

.study-toolbar h2 {
    margin-top: 9px;
    font-size: 22px
}

.instruction {
    background: var(--mint);
    padding: 20px;
    border-radius: 9px;
    font-size: 14px;
    line-height: 1.9;
    margin-bottom: 18px
}

.material, .question {
    padding: 24px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 16px
}

.material {
    border-top: 3px solid #b6c9ae
}

.material > .children {
    margin-top: 22px
}

.material .question {
    background: #fcfdf9;
    padding: 20px
}

.rich {
    white-space: pre-wrap;
    font-family: "Yu Gothic", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 2;
    overflow-wrap: anywhere
}

.rich p {
    font: inherit;
    color: inherit;
    margin: 0 0 12px
}

.rich img, .media-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 14px auto
}

.rich table {
    border-collapse: collapse;
    width: 100%
}

.rich td, .rich th {
    border: 1px solid var(--line);
    padding: 8px
}

.question-label {
    color: var(--green);
    font-size: 10px;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    font-weight: 600
}

.options {
    display: grid;
    gap: 9px;
    margin-top: 19px
}

.option {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 13px;
    text-align: left;
    color: var(--ink)
}

.option-number {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 11px
}

.option .rich {
    font-size: 14px;
    line-height: 1.7
}

.option:hover {
    border-color: #8fac99
}

.option.selected {
    border-color: var(--green);
    background: #edf4ee
}

.option.correct {
    border-color: #659c71;
    background: #eaf4ec
}

.option.wrong {
    border-color: #d5a295;
    background: #fff0eb
}

.answer-feedback {
    font-size: 13px;
    color: var(--green);
    margin-top: 16px
}

.answer-feedback.incorrect {
    color: #a5513b
}

details {
    margin-top: 15px;
    border-top: 1px solid var(--line);
    padding-top: 14px
}

summary {
    cursor: pointer;
    color: var(--green);
    font-size: 12px;
    margin-bottom: 9px
}

.media-note {
    font-size: 12px;
    color: #a46e38;
    overflow-wrap: anywhere
}

audio {
    width: 100%;
    margin: 15px 0
}

#practice-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 0;
    color: var(--muted);
    font-size: 12px
}

[hidden] {
    display: none !important
}

@media (max-width: 960px) {
    .exam-grid {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }

    .study-layout {
        grid-template-columns:190px minmax(0, 1fr)
    }

    #levels button {
        padding: 10px 17px
    }

    .library-toolbar {
        flex-wrap: wrap
    }

    .search {
        margin-left: 0
    }

    .material, .question {
        padding: 18px
    }
}

@media (max-width: 640px) {
    header {
        height: 70px;
        padding: 0 5vw
    }

    .brand {
        font-size: 17px;
        gap: 7px
    }

    .brand-light {
        font-size: 11px
    }

    .header-right {
        gap: 8px
    }

    .connection {
        font-size: 10px
    }

    .hero {
        padding: 32px 0
    }

    .hero-seal {
        display: none
    }

    h1 {
        font-size: 24px
    }

    .hero p {
        font-size: 12px
    }

    .exam-grid {
        grid-template-columns:1fr
    }

    .library-toolbar {
        gap: 10px
    }

    #levels {
        width: 100%;
        justify-content: space-between
    }

    #levels button {
        padding: 10px 20px
    }

    .search {
        flex: 1
    }

    .search input {
        width: 100%
    }

    .section-heading {
        align-items: flex-start;
        gap: 10px
    }

    .source-toggle {
        font-size: 10px
    }

    .study-layout {
        display: block
    }

    aside {
        position: static;
        margin-bottom: 20px
    }

    #groups {
        display: flex;
        overflow-x: auto;
        gap: 5px
    }

    #groups button {
        min-width: 145px;
        white-space: nowrap
    }

    .sidebar-title {
        padding-bottom: 10px
    }

    .workspace-heading {
        flex-wrap: wrap;
        gap: 10px
    }

    #download {
        margin-left: 0
    }

    .material .question {
        padding: 14px
    }

    .rich {
        font-size: 14px
    }

    footer {
        font-size: 9px;
        gap: 20px
    }

    footer span {
        text-align: right
    }
}
