:root {
    --primary-blue: #1c5c80;
    --secondary-blue: #174963;
    --primary-yellow: #1c5c80;
    --accent-color: #1c5c80;
    --white: #fdfcfb;
    --ink: #102844;
    --muted: #4c596e;
    --paper: #f7f5f2;
    --line: #dedbd8;
    --rail: 188px;
    --mist-purple: #e8e2f3;
}
body { margin: 0; color: var(--ink); background: var(--paper); }
a:focus-visible, button:focus-visible { outline: 3px solid #174963; outline-offset: 4px; }
.page-content { margin-left: var(--rail); min-width: 0; }
.container, .hero-container { width: min(1120px, calc(100% - 80px)); padding: 0; margin: 0 auto; }

.header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail);
    background: var(--paper) !important;
    box-shadow: inset -1px 0 var(--line) !important;
    overflow-y: auto;
}
.navbar { height: 100%; padding: 0; }
.nav-container {
    min-height: 100%;
    padding: 34px 19px 22px;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    gap: 32px;
}
.nav-logo h2 { color: var(--ink); font-size: 21px; line-height: 1.25; letter-spacing: -.055em; }
.nav-menu {
    position: static;
    width: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    background: transparent;
    box-shadow: none;
}
.nav-link { display: block; color: #102540; padding: 7px 10px; border-radius: 5px; font-size: 14px; white-space: nowrap; }
.nav-link:hover, .nav-link:focus-visible { color: var(--ink); background: #eeece9; }
.nav-link[aria-current="location"] { color: var(--ink); background: var(--mist-purple); }
.nav-link::after, .hamburger { display: none; }
.language-switcher {
    position: static;
    width: fit-content;
    padding: 5px 10px;
    margin-top: auto;
    background: var(--paper);
    box-shadow: none;
    font-size: 12px;
    white-space: nowrap;
}

.hero { padding: clamp(38px, 6vw, 84px) 0 40px; background: var(--paper); }
.hero-container { display: block; text-align: center; }
.hero-content { text-align: center; }
.hero-title {
    margin: 0 auto 16px;
    color: var(--ink);
    font-size: clamp(36px, 5.1vw, 64px);
    line-height: 1.07;
    letter-spacing: -.075em;
    font-weight: 900;
}
.hero-title .accent { color: inherit; }
.hero-title-highlight {
    position: relative;
    display: inline-block;
    isolation: isolate;
    white-space: nowrap;
}
.hero-title-highlight::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto -.08em -.02em;
    height: .29em;
    border-radius: 999px;
    background: var(--mist-purple);
}
.hero-description { color: var(--muted); margin: 20px auto 25px; max-width: 610px; line-height: 1.85; }
.hero-buttons { justify-content: center; align-items: stretch; flex-direction: row; flex-wrap: wrap; gap: 12px; margin-bottom: 0; }
.btn { border-radius: 6px; box-shadow: none; }
.hero .btn-primary, .mock-test .btn-primary { background: var(--primary-blue); color: var(--white); border-color: transparent; }
.hero .btn-primary:hover, .mock-test .btn-primary:hover { background: var(--secondary-blue); color: var(--white); }
.hero .btn-secondary { background: transparent; border: 1px solid #102844; color: var(--ink); }
.hero .btn-secondary:hover { background: #eeece9; }
.hero-image { margin-top: 42px; }
.hero:has(.hero-posters) { container-type: inline-size; }
.hero-posters {
    /* Use the hero width, including room beyond the text column. */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: min(1280px, calc(100cqw - 16px));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    /* The gaps and outside gutters each clear one enlarged edge. */
    column-gap: 2.5%;
    padding-inline: min(32px, 2.5cqw);
}
.hero-poster {
    padding-block: 14%;
}
.hero-poster img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    outline: 1px solid var(--line);
    outline-offset: -1px;
}

@media (max-width: 980px) {
    .hero-posters {
        max-width: 680px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 5%;
        padding-inline: min(34px, 5cqw);
    }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .hero-poster img { transition: transform 240ms ease; }
    .hero-poster img:hover { transform: scale(1.2); }
    /* Clear the outgoing zoom immediately if another poster starts zooming. */
    .hero-posters:has(img:hover) img:not(:hover) { transition-duration: 0s; }
}
.hero-placeholder { height: auto; min-height: 210px; border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: none; }
.hero-placeholder i, .hero-placeholder p, .hero-placeholder small { color: var(--ink); }
.hero-stats { justify-content: center; margin-top: 28px; }

.about, .courses, .teachers, .mock-test { padding: clamp(46px, 7vw, 94px) 0; }
.section-header { text-align: left; margin: 0 0 28px; }
.section-title { color: var(--ink); font-size: clamp(26px, 3.1vw, 36px); letter-spacing: -.062em; line-height: 1.16; }
.section-title .accent, .mock-test-info .accent { color: inherit; }
.section-description { margin: 13px 0 0; color: var(--muted); }

.about { background: #fdfcfb; }
.about .section-header { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: end; }
.about .section-title, .about .section-title .accent { color: #102844; }
.about .section-description { color: #102540; }
.about-grid, .about-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; }
.about-row { display: contents; }
.about-card {
    text-align: left;
    padding: 20px 16px;
    border: 0;
    border-top: 1px solid #dedbd8;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.about-card:hover { transform: none; box-shadow: none; }
.about-card .card-icon { margin: 0 0 12px; width: 40px; height: 40px; border-radius: 6px; background: #e8eef1; }
.about-card .card-icon i { color: #174963; font-size: 18px; }
.about-card h3 { color: #102844; margin: 0 0 8px; }
.about-card p { color: #4c596e; margin: 0; }

.courses { background: var(--paper); }
html[lang="zh-CN"] .courses .container { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(0, 2.6fr); gap: 30px; align-items: start; }
html[lang="zh-CN"] .courses .section-header { position: sticky; top: 32px; }
html[lang="zh-CN"] .courses-grid { display: block; columns: 3; column-gap: 12px; }
html[lang="zh-CN"] .course-card {
    display: block;
    break-inside: avoid;
    margin: 0 0 12px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fdfcfb;
    box-shadow: none;
}
.course-image img { display: block; border-radius: 3px; }
html[lang="en"] .courses-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }

.teachers { background: var(--paper); }
.teacher-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: clamp(18px, 4vw, 52px);
    align-items: start;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.teacher-left { text-align: left; }
.teacher-avatar { width: 100%; height: auto; margin: 0; border-radius: 8px; box-shadow: none; }
.teacher-avatar img { display: block; height: auto; }
.teacher-name-block {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    text-align: center;
    color: var(--ink);
}
.teacher-name-block h3 {
    color: inherit;
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1.15;
    margin: 0;
}
.teacher-name-block span { color: inherit; font-size: 14px; }
.teacher-right { min-width: 0; gap: 9px; container-type: inline-size; }
.teacher-quote { margin: 0; gap: 6px; }
.teacher-quote i { flex: 0 0 18px; font-size: clamp(14px, 3.5cqi, 22px); }
.teacher-quote .quote-text {
    font-size: clamp(12px, 4.4cqi, 24px);
    line-height: 1.4;
    white-space: nowrap;
}
.teacher-quote i, .teacher-quote .quote-text { color: var(--ink) !important; }
.teacher-achievements { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.achievement-item { border-top: 1px solid #dedbd8; padding-top: 10px; gap: 9px; }
.achievement-item i { padding: 0; background: none; font-size: 16px; margin-top: 4px; }
.achievement-text p { white-space: normal !important; min-width: 0 !important; color: #34475d; }
.achievement-item:has(.fa-chalkboard-teacher) .achievement-text { container-type: inline-size; }
.achievement-item:has(.fa-chalkboard-teacher) .achievement-text p {
    font-size: clamp(12px, 8.5cqi, 16px);
    white-space: nowrap !important;
}
@media (max-width: 900px) {
    .teacher-profile { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 460px) {
    .teacher-achievements { grid-template-columns: minmax(0, 1fr); }
}


.mock-test { background: var(--paper); }
.mock-test-content { grid-template-columns: minmax(0, 1fr) minmax(0, .64fr); gap: 28px; text-align: left; }
.mock-test-content.without-image { grid-template-columns: 1fr; }
.mock-test-image { grid-column: 1; grid-row: 1; }
.mock-test-info { grid-column: 2; }
.mock-test-content.without-image .mock-test-info { grid-column: 1; }
.mock-test-info h2 { font-size: clamp(26px, 3.1vw, 36px); line-height: 1.16; }
.mock-test-info h2, .mock-test-info p, .mock-features li { color: var(--ink); }
.mock-features i { color: var(--primary-blue); }
.mock-placeholder { box-shadow: none !important; padding: 8px !important; height: auto; border-radius: 6px !important; }
.mock-test-image[hidden] { display: none; }
.fade-in, .slide-in-left, .slide-in-right { opacity: 1; transform: none; }
.page-content footer { background: #102844 !important; color: #fdfcfb !important; }
.page-content footer p, .page-content footer span, .page-content footer a { color: #fdfcfb !important; }
#qr-popup { z-index: 1100 !important; padding: 18px; }

@media (max-width: 1050px) {
    :root { --rail: 156px; }
    .nav-container { padding-inline: 12px; }
    .container, .hero-container { width: calc(100% - 48px); }
    .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html[lang="zh-CN"] .courses-grid { columns: 2; }
}
@media (max-width: 760px) {
    .page-content { margin-left: 0; }
    .header { position: static; width: 100%; overflow: visible; }
    .nav-container { flex-flow: row wrap; align-items: center; gap: 9px; padding: 12px 16px; }
    .nav-menu { flex-flow: row wrap; order: 3; width: 100%; gap: 2px; }
    .nav-link { font-size: 12px; padding: 5px 7px; }
    .language-switcher { margin: 0 0 0 auto; }
    .container, .hero-container { width: calc(100% - 32px); }
    .hero-title { font-size: clamp(34px, 7.4vw, 38px); }
    .section-title, .mock-test-info h2 { font-size: clamp(24px, 5.5vw, 28px); }
    .hero-image { margin-top: 25px; }
    .about .section-header, html[lang="zh-CN"] .courses .container,
    .teacher-profile, .mock-test-content { grid-template-columns: 1fr; gap: 14px; }
    html[lang="zh-CN"] .courses .section-header { position: static; margin-bottom: 8px; }
    .mock-test-info, .mock-test-image { grid-column: auto; grid-row: auto; }
    html[lang="en"] .courses-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.site-footer { padding-top: clamp(32px, 5vw, 60px); }
.site-footer .footer-navigation {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 56px);
    padding-bottom: 32px;
}
.site-footer h2 { color: var(--mist-purple); font-size: 17px; margin-bottom: 12px; }
.site-footer p, .footer-links { font-size: 14px; line-height: 1.65; }
.footer-links, .footer-socials { list-style: none; margin: 0; padding: 0; }
.footer-links { display: grid; gap: 7px; }
.footer-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.footer-socials a {
    display: block;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
}
.site-footer a:hover { text-decoration: underline; }
.site-footer a:focus-visible { outline-color: var(--mist-purple); }
.footer-qr { display: block; width: 100px; height: auto; border-radius: 6px; margin-top: 12px; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .footer-qr { transition: transform 240ms ease; transform-origin: top left; }
    .footer-qr:hover { transform: scale(1.2); }
}
.footer-legal {
    padding: 18px 16px;
    border-top: 1px solid rgba(255, 255, 255, .2);
    text-align: center;
}
.footer-legal p { margin: 3px 0; font-size: 12px; }
@media (max-width: 620px) {
    .site-footer .footer-navigation { grid-template-columns: 1fr; }
}
