body.portal-home {
    --ink: #102236;
    --blue: #246aff;
    --muted: #647995;
    --line: #e1eafa;
    margin: 0;
    min-width: 0;
    background: white;
    color: var(--ink);
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
.portal-home :where(main, .home-footer, .home-back, .home-qr) *,
.portal-home :where(section, article, footer, .home-back) { box-sizing: border-box; }
.portal-home :where(main, .home-footer) :where(h1, h2, h3, p, ul) { margin: 0; padding: 0; }
.portal-home main img, .home-footer img { display: block; max-width: 100%; }
.portal-home main a, .portal-home .home-footer a, .portal-home .home-back { text-decoration: none; color: inherit; }
:where(.portal-home main, .home-qr) button { cursor: pointer; font: inherit; color: inherit; border: 0; background: none; padding: 0; }
.portal-home main :is(button, a):focus-visible, .portal-home .home-back:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.portal-home main em { font-style: normal; }
.home-wrap, .portal-home .rl-header-inner { width: min(1152px, calc(100% - 48px)); margin-inline: auto; }
.portal-home .rl-header { position: sticky; inset-block-start: 0; z-index: 40; height: 70px; }
.portal-home .rl-header-inner { justify-content: flex-start; gap: 40px; padding: 0; }
.portal-home .rl-header-left, .portal-home .rl-header-right { display: flex; align-items: center; }
.portal-home .rl-header-right { flex: 1; align-self: stretch; min-width: 0; }
.portal-home .rl-header .rl-main-nav { gap: 32px; }
.portal-home .rl-header .rl-main-nav .is-active:after { bottom: 9px; }
.portal-home .rl-header .rl-login, .portal-home main .home-button {
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 12px; background: linear-gradient(105deg,#1767ff,#40aaff);
    color: white; font-size: 15px; font-weight: 600; padding: 0 24px;
    min-height: 44px; box-shadow: 0 6px 12px #1767ff28;
}
.portal-home .rl-header .rl-login { padding: 0 20px; }
.portal-home .rl-header :is(.rl-login, .rl-account) { margin-left: auto; }
.home-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.portal-home main .home-button.secondary { color: var(--blue); border: 1px solid #aac9ff; background: #ecf4ff99; box-shadow: none; }
.portal-home main .home-button:hover, .portal-home .rl-login:hover { filter: brightness(.95); }
.home-button span { margin-left: 8px; }
.home-hero { background: radial-gradient(ellipse at 85% 0%,#c8dcff 0,transparent 34%), radial-gradient(ellipse at 0 105%,#e0faf6 0,transparent 22%), linear-gradient(105deg,#fff,#eff6ff 56%,#deebff); }
.hero-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,420px); align-items: center; gap: 36px; min-height: 369px; padding-block: 44px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 24px; border: 1px solid #bed4ff; background: #eef5ff; color: var(--blue); font-size: 13px; font-weight: 600; }
.hero-kicker img { width: 16px; height: 16px; }
.hero-copy h1 { margin: 12px 0 8px; font-size: clamp(29px,2.6vw,36px); line-height: 1.24; font-weight: 700; }
.hero-copy em, .home-section h2 em { color: var(--blue); }
.hero-copy p, .section-intro, .home-cta p { color: var(--muted); }
.hero-copy .home-actions { margin: 10px 0; }
.hero-students { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.avatar-stack { display: inline-flex; padding-left: 8px; }
.avatar-stack img { width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%; margin-left: -9px; object-fit: cover; }
.hero-promos { position: relative; justify-self: end; width: min(100%,420px); }
.promo-frame { aspect-ratio: 3 / 2; overflow: hidden; border-radius: 20px; background: #e2efff; }
.promo-frame [data-promo]:not([hidden]), .promo-frame :is(a,button), .promo-frame img { display: block; width: 100%; height: 100%; }
.promo-frame img { object-fit: cover; }
.promo-frame .promo-fallback { display: flex; flex-direction: column; align-items: center; padding: 24px 14px 0; color: #fff; font-size: 26px; background: linear-gradient(125deg,#273d7d,#3289da); }
.promo-fallback img { min-height: 0; object-fit: contain; }
.promo-dots { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); display: flex; }
.promo-dots button { display: grid; place-items: center; height: 24px; padding: 0 2px; border: 0; background: transparent; }
.promo-dots button::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: rgb(255 255 255 / 55%); }
.promo-dots button[aria-pressed="true"]::before { width: 20px; background: #fff; }
@media (pointer: coarse) { .promo-dots button { min-width: 24px; } }
/* .home-exams, .home-lessons { background: #f5f8fc; } */
.home-exams { scroll-margin-top: 70px; padding: 30px 0; color: #0b1b2e; font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
.exam-layout { display: flex; gap: 20px; }
.exam-card { flex: 1; min-width: 0; padding: 20px; border-radius: 20px; background: linear-gradient(110deg,#eaf3ff,#d5e7ff); min-height: 202px; box-shadow: 0 8px 16px #243f5a0a; }
.exam-card.is-compact { flex: 0 0 200px; background: white; border: 1px solid var(--line); padding: 0; box-shadow: none; }
.is-compact .exam-summary { display: flex; flex-direction: column; align-items: flex-start; text-align: left; width: 100%; height: 100%; gap: 6px; border-radius: 20px; padding: 19px; }
.exam-detail { container-type: inline-size; }
.exam-summary strong { font-size: 18px; line-height: 26px; font-weight: 500; }
.gallery-card p, .footer-layout a, .footer-layout span { color: #7990af; }
.exam-summary span { color: #8a9bb2; font-size: 12px; line-height: 16px; }
.exam-entry-arrow { display: block; width: 20px; height: 20px; margin-top: auto; border-radius: 50%; background: #f0f6ff url(exam-chevron.png) center / 16px 16px no-repeat; background-blend-mode: multiply; }
.exam-mock:is(:hover,:focus-visible) .exam-entry-arrow, .exam-summary:is(:hover,:focus-visible) .exam-entry-arrow { background-color: #dceaff; }
.exam-card h2 { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 0 0 10px; font-size: 22px; line-height: 32px; font-weight: 500; }
.exam-card small, .teacher-profile small, .lesson-card small { display: inline-flex; align-items: center; border-radius: 16px; padding: 2px 12px; color: var(--blue); background: #e8f2ff; font-size: 12px; font-weight: 500; line-height: 20px; }
.exam-card h2 small { border: 1px solid #95baff; background: #cadeff; padding-block: 1px; font-weight: 400; }
.exam-summary small { border-radius: 8px; margin-bottom: 4px; }
.exam-links { display: grid; grid-template-columns: minmax(0,1fr) 110px; gap: 10px; }
.skill-links, .exam-mock { background: #fff; border-radius: 12px; }
.skill-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: center; gap: 8px; padding: 16px; }
.skill-links a { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 500; border-radius: 8px; min-height: 38px; position: relative; white-space: nowrap; }
.skill-links a:is(:hover,:focus-visible) { background: #f0f6ff; }
.skill-links img { width: 28px; height: 28px; }
.skill-links a::after { content: ""; flex: 0 0 16px; height: 16px; margin-left: 4px; background: url(exam-chevron.png) center / contain no-repeat; mix-blend-mode: multiply; }
.exam-mock { min-height: 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 12px 20px; position: relative; background: #fff url(exam-mock-illustration.png) right bottom / 48px 48px no-repeat; }
.exam-mock strong { font-weight: 500; line-height: 24px; }
.exam-mock span { color: #687b99; font-size: 12px; line-height: 16px; white-space: nowrap; }
.home-slot-badge { position: absolute; right: 2px; top: -5px; padding: 0 4px; border-radius: 6px 6px 6px 1px; background: #f35d52; color: #fff; font: 10px/15px sans-serif; }
@container (max-width: 384px) {
    .exam-links { grid-template-columns: minmax(0,1fr); }
    .exam-mock { display: grid; grid-template-columns: minmax(0,1fr) 20px; min-height: 64px; gap: 2px 8px; align-items: center; padding: 10px 60px 10px 12px; }
    .exam-mock span { grid-column: 1; }
    .exam-mock .exam-entry-arrow { grid-column: 2; grid-row: 1 / 3; margin: 0; }
}
.home-section, .home-lessons, .home-cta { padding-block: 60px; }
.home-section h2, .home-cta h2 { text-align: center; font-size: 40px; line-height: 1.3; font-weight: 700; }
.section-intro { text-align: center; margin: 12px 20px 30px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.gallery-card, .story-card, .teacher-card, .lesson-card { background: white; border: 1px solid var(--line); border-radius: 18px; }
.gallery-card { padding: 12px; }
.gallery-media { position: relative; border-radius: 12px; overflow: hidden; }
.gallery-media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.gallery-card h3, .gallery-card p { margin: 12px 10px 0; }
.gallery-card h3, .story-card h3 { font-size: 16px; font-weight: 600; }
.gallery-card p { margin-block: 6px 8px; font-size: 12px; line-height: 20px; }
.gallery-media button { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: #20364c70; border: 1px solid #fffc; color: white; font: 30px/1 Arial,sans-serif; opacity: 0; transition: opacity .15s; }
.gallery-media button:first-of-type { left: 12px; }
.gallery-media button:last-of-type { right: 12px; }
.gallery-media:is(:hover,:focus-within) button { opacity: 1; }
.home-stats { display: flex; margin-top: 24px; background: #f5f8fc; border: 1px solid var(--line); border-radius: 16px; padding: 16px 0; }
.home-stats > div { flex: 1; padding: 0 32px; display: grid; color: var(--muted); font-size: 14px; position: relative; }
.home-stats > div + div::before { content: ""; position: absolute; left: 0; top: 15%; height: 70%; border-left: 1px solid #dfe7f2; }
.home-stats strong { font-size: 30px; color: var(--ink); }
.home-stats div:last-child strong { color: var(--blue); }
.home-stories { background: #f7fafd; }
.story-viewport { width: 100%; overflow-x: auto; scrollbar-width: none; }
.story-viewport::-webkit-scrollbar { display: none; }
.story-track, .story-set { display: flex; width: max-content; }
.story-set { gap: 20px; padding-right: 20px; }
.story-card { width: 340px; padding: 12px; display: flex; flex-direction: column; }
.story-photo { border-radius: 12px; width: 100%; height: auto; }
.story-card h3 { min-height: 64px; padding: 14px 8px 12px; }
.story-byline { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; font-size: 14px; }
.story-byline img { width: 32px; height: 32px; border-radius: 50%; }
.story-byline small { margin-left: auto; color: #91a2bd; }
.story-byline i { font-style: normal; color: #ff6088; font-size: 17px; vertical-align: -1px; }
.teacher-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,440px); align-items: center; gap: 44px; padding: 48px 60px 48px 36px; box-shadow: 0 8px 20px #14243d08; }
.teacher-profile { display: grid; grid-template-columns: minmax(0,260px) minmax(0,1fr); gap: 30px; align-items: center; }
.teacher-profile > img { width: 100%; height: auto; }
.teacher-profile > div { align-self: start; }
.teacher-profile h3 { font-size: 20px; margin-bottom: 4px; }
.teacher-profile p { font-size: 14px; line-height: 1.7; margin-top: 12px; color: var(--muted); }
.teacher-picker { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.teacher-picker button { overflow: hidden; border-radius: 12px; position: relative; }
.teacher-picker button[aria-pressed=true]::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--blue); border-radius: inherit; }
.teacher-picker img { width: 100%; height: auto; }
.lesson-card { padding: 44px 48px 64px; display: flex; justify-content: space-between; gap: 24px; align-items: center; box-shadow: 0 16px 34px #1836520d; }
.lesson-card h2 { font-size: 30px; margin: 16px 0 12px; }
.lesson-card small { background: #e3f5f1; color: #008d79; }
.lesson-card ul { display: grid; gap: 6px; margin: 0 0 18px; list-style: none; color: var(--muted); }
.lesson-card li { display: flex; align-items: center; gap: 12px; }
.lesson-card li img { width: 16px; height: 16px; }
.lesson-card .home-button { min-height: 54px; }
.lesson-stats { display: grid; margin-right: 2%; font-size: 14px; color: var(--muted); }
.lesson-stats strong { font-size: 42px; line-height: 1.2; color: var(--blue); }
.lesson-stats strong:nth-of-type(2) { color: #0cab90; margin-top: 24px; }
.home-cta { text-align: center; background: radial-gradient(ellipse at 50% 5%,#c7dcff 0%,transparent 62%), linear-gradient(#e9f3ff,#d9eaff); }
.home-cta h2 { font-size: 44px; }
.home-cta p { margin: 16px 0 24px; }
.home-cta .home-actions { justify-content: center; }
.home-footer { background: #f7faff; padding: 60px 0 40px; font-size: 14px; color: var(--muted); }
.footer-layout { display: grid; grid-template-columns: minmax(260px,3fr) repeat(4,minmax(90px,.78fr)); gap: 24px; }
.footer-layout h3 { font-size: 14px; color: var(--ink); margin: 0 0 12px; }
.footer-layout :is(a,span) { display: block; margin-bottom: 10px; }
.footer-brand img { object-fit: contain; }
.footer-brand p { max-width: 325px; margin-top: 20px; line-height: 1.8; }
.portal-home .home-footer a:hover { color: var(--blue); }
.footer-legal { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding-top: 24px; font-size: 12px; border-top: 1px solid #dfe6f0; }
.footer-legal > div, .footer-legal a { display: inline-flex; align-items: center; gap: 6px; }
.footer-legal > div { gap: 12px; flex-wrap: wrap; }
.portal-home .home-back { position: fixed; bottom: 28px; right: 20px; display: grid; justify-items: center; gap: 4px; padding: 12px; border: 1px solid #e4e9f1; border-radius: 8px; font-size: 12px; background: #fff; z-index: 5; }
.home-qr { border: 0; border-radius: 18px; padding: 28px; text-align: center; color: var(--ink); }
.home-qr::backdrop { background: #16203380; }
.home-qr button { float: right; margin-left: 18px; width: 28px; }
.home-qr img { width: 180px; height: 180px; object-fit: contain; }
.home-qr p { margin: 6px 0 16px; }
@media (hover:none) { .gallery-media button { opacity: 1; } }
@media (max-width:1100px) {
    .exam-layout { gap: 10px; }
    .exam-card { padding: 13px; }
    .exam-card.is-compact { flex-basis: 145px; }
    .skill-links { gap: 6px 2px; padding: 5px; }
    .teacher-card { grid-template-columns: minmax(0,1fr) 34%; gap: 24px; padding: 28px; }
    .teacher-profile { grid-template-columns: 41% minmax(0,1fr); gap: 16px; }
}
@media (max-width:850px) {
    .hero-layout { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
    .exam-layout { flex-wrap: wrap; }
    .exam-card { flex: 1 1 290px; }
    .exam-card.is-compact { flex: 1 1 100%; min-height: auto; }
    .is-compact .exam-summary { flex-direction: row; gap: 10px; align-items: center; }
    .exam-summary .exam-entry-arrow { margin: 0 0 0 auto; }
    .exam-summary span { display: none; }
    .footer-layout { grid-template-columns: repeat(4,1fr); }
    .footer-brand { grid-column: 1/-1; }
}
@media (max-width:650px) {
    .home-wrap, .portal-home .rl-header-inner { width: calc(100% - 32px); }
    .portal-home .rl-header { height: auto; }
    .portal-home .rl-header-inner { min-height: 62px; position: relative; padding-bottom: 38px; gap: 8px; }
    .portal-home .rl-header .rl-brand img { width: 116px; height: auto; }
    .portal-home .rl-header-right { justify-content: flex-end; align-items: center; }
    .portal-home .rl-header .rl-login { min-height: 32px; padding-inline: 12px; }
    .portal-home .rl-header .rl-main-nav { display: flex; align-items: stretch; justify-content: space-between; position: absolute; inset: auto 0 0; height: 38px; gap: 8px; }
    .portal-home .rl-header .rl-main-nav .is-active:after { bottom: 3px; }
    .portal-home .rl-account-panel { max-width: calc(100vw - 32px); }
    .hero-layout { grid-template-columns: 1fr; padding-block: 28px; }
    .hero-promos { justify-self: center; }
    .home-exams { scroll-margin-top: 96px; }
    .exam-card { flex-basis: 100%; min-height: auto; }
    .skill-links { gap: 4px; }
    .home-section, .home-lessons, .home-cta { padding: 38px 0; }
    .home-section h2, .home-cta h2 { font-size: 28px; }
    .home-cta { padding-inline: 16px; }
    .section-intro { font-size: 14px; }
    .gallery-grid { grid-template-columns: 1fr; }
    .home-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 0; }
    .home-stats > div { padding: 0 16px; }
    .home-stats > div:nth-child(3)::before { display: none; }
    .story-card { width: min(80vw,340px); }
    .teacher-card { grid-template-columns: 1fr; padding: 16px; gap: 20px; }
    .teacher-profile { grid-template-columns: 30% 1fr; align-items: start; }
    .teacher-profile p { font-size: 13px; }
    .teacher-picker { grid-template-columns: repeat(6,1fr); gap: 4px; }
    .lesson-card { padding: 24px; flex-direction: column; align-items: flex-start; }
    .lesson-card h2 { font-size: 23px; }
    .lesson-stats { grid-template-columns: 1fr 1fr; column-gap: 16px; }
    .lesson-stats strong { grid-row: 1; font-size: 30px; }
    .lesson-stats strong:nth-of-type(2) { margin: 0; }
    .home-footer { padding: 32px 0; }
    .footer-layout { grid-template-columns: 1fr 1fr; }
    .portal-home .home-back { padding: 6px; right: 8px; bottom: 12px; }
}
