:root {
  --fh-portal-ink: #141d3e;
  --fh-portal-night: #111a43;
  --fh-portal-night-2: #1e2d68;
  --fh-portal-paper: #f7f6ef;
  --fh-portal-white: #fffefa;
  --fh-portal-blue: #657bf5;
  --fh-portal-blue-soft: #dfe6ff;
  --fh-portal-coral: #ff806b;
  --fh-portal-coral-soft: #ffe0d8;
  --fh-portal-mint: #bcecd1;
  --fh-portal-gold: #ffcf76;
  --fh-portal-muted: #68718b;
  --fh-portal-line: rgba(20,29,62,.14);
  --fh-portal-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --fh-portal-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; color: var(--fh-portal-ink); background: var(--fh-portal-paper); font-family: var(--fh-portal-sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--fh-portal-gold); outline-offset: 4px; }
.fh-portal-wrap { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.fh-portal-skip { position: fixed; z-index: 100; top: -56px; left: 20px; padding: 9px 14px; border-radius: 9px; color: var(--fh-portal-night); background: var(--fh-portal-gold); font-size: 13px; font-weight: 800; transition: top .2s ease; }
.fh-portal-skip:focus { top: 16px; }

.fh-portal-bar { position: sticky; z-index: 30; top: 0; color: var(--fh-portal-white); background: rgba(17,26,67,.91); border-bottom: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(18px); }
.fh-portal-bar__inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.fh-portal-brand { display: inline-flex; align-items: center; gap: 11px; }
.fh-portal-brand__mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #fff; }
.fh-portal-brand__mark img { width: 30px; height: 30px; object-fit: contain; }
.fh-portal-brand > span:last-child { display: grid; line-height: 1.1; }
.fh-portal-brand strong { font-size: 15px; letter-spacing: .08em; }
.fh-portal-brand small { margin-top: 5px; color: #9da9dc; font: 9px var(--fh-portal-mono); letter-spacing: .1em; }
.fh-portal-bar__right { display: flex; align-items: center; gap: 22px; }
.fh-portal-locality { color: #aeb8e3; font: 10px var(--fh-portal-mono); letter-spacing: .06em; }
.fh-portal-locality i { width: 7px; height: 7px; display: inline-block; margin-right: 7px; border-radius: 50%; background: var(--fh-portal-mint); box-shadow: 0 0 0 4px rgba(188,236,209,.13); }
.fh-portal-team-link, .fh-portal-config-link { color: #e0e5ff; font-size: 12px; }
.fh-portal-team-link:hover, .fh-portal-config-link:hover { color: var(--fh-portal-gold); }
.fh-portal-config-link { padding: 9px 13px; border: 1px solid rgba(255,255,255,.23); border-radius: 999px; background: transparent; }

.fh-portal-hero { position: relative; overflow: hidden; color: var(--fh-portal-white); background: var(--fh-portal-night); }
.fh-portal-hero::before { position: absolute; width: 520px; height: 520px; top: -320px; left: 50%; content: ""; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 44px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); }
.fh-portal-hero__grid { position: relative; z-index: 1; min-height: 545px; display: grid; grid-template-columns: minmax(0, .92fr) minmax(390px, .88fr); align-items: center; gap: clamp(42px, 7vw, 100px); padding-top: 64px; padding-bottom: 62px; }
.fh-portal-kicker, .fh-portal-eyebrow { margin: 0 0 20px; color: #a5b1e7; font: 10px var(--fh-portal-mono); letter-spacing: .12em; }
.fh-portal-kicker span { width: 8px; height: 8px; display: inline-block; margin-right: 9px; border-radius: 50%; background: var(--fh-portal-coral); box-shadow: 0 0 0 5px rgba(255,128,107,.14); }
.fh-portal-hero h1 { max-width: 650px; margin: 0; font-size: clamp(47px, 6.3vw, 78px); line-height: 1.05; letter-spacing: -.07em; }
.fh-portal-hero h1 em { color: var(--fh-portal-gold); font-style: normal; }
.fh-portal-hero__lead { max-width: 510px; margin: 25px 0 0; color: #c6cdec; font-size: 15px; line-height: 1.9; }
.fh-portal-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.fh-portal-button { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 17px; border: 0; border-radius: 999px; font-size: 12px; font-weight: 800; transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease; }
.fh-portal-button:hover { transform: translateY(-2px); }
.fh-portal-button--primary { color: var(--fh-portal-night); background: var(--fh-portal-gold); box-shadow: 0 10px 25px rgba(255,207,118,.15); }
.fh-portal-button--primary:hover { background: #ffe3a5; }
.fh-portal-button--line { color: #e1e5ff; border: 1px solid rgba(255,255,255,.24); background: transparent; }
.fh-portal-button--line:hover { color: var(--fh-portal-night); background: #fff; }
.fh-portal-hero__note { display: flex; align-items: center; gap: 9px; margin-top: 28px; color: #8795cf; font-size: 11px; }
.fh-portal-note-icon { color: var(--fh-portal-gold); font-size: 16px; }
.fh-portal-hero__visual { position: relative; max-width: 540px; justify-self: end; }
.fh-portal-art { position: relative; overflow: hidden; aspect-ratio: 1.18 / 1; border: 1px solid rgba(255,255,255,.25); border-radius: 28px; box-shadow: 0 25px 70px rgba(0,0,0,.28); transform: rotate(1.8deg); }
.fh-portal-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.fh-portal-art__shade { position: absolute; inset: 0; background: linear-gradient(145deg, rgba(17,26,67,.03) 30%, rgba(17,26,67,.68)); }
.fh-portal-art__caption { position: absolute; z-index: 1; right: 25px; bottom: 24px; text-align: right; }
.fh-portal-art__caption span { display: block; margin-bottom: 8px; color: #c8d3ff; font: 9px var(--fh-portal-mono); letter-spacing: .12em; }
.fh-portal-art__caption strong { color: #fff; font-size: 23px; line-height: 1.15; letter-spacing: -.05em; }
.fh-portal-orbit { position: absolute; display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 999px; box-shadow: 0 12px 30px rgba(0,0,0,.22); font-size: 10px; font-weight: 800; }
.fh-portal-orbit span { font: 9px var(--fh-portal-mono); opacity: .55; }
.fh-portal-orbit--one { top: 33px; left: -24px; color: var(--fh-portal-night); background: var(--fh-portal-mint); transform: rotate(-7deg); }
.fh-portal-orbit--two { right: -18px; bottom: 34px; color: var(--fh-portal-night); background: var(--fh-portal-coral-soft); transform: rotate(6deg); }

.fh-portal-entries { padding: 100px 0 116px; background: var(--fh-portal-paper); }
.fh-portal-section-head { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 70px; }
.fh-portal-eyebrow { color: #e26d5c; }
.fh-portal-section-head h2, .fh-portal-guide h2 { margin: 0; font-size: clamp(39px, 4.8vw, 60px); line-height: 1.05; letter-spacing: -.065em; }
.fh-portal-section-head > p { max-width: 420px; justify-self: end; margin: 0; color: var(--fh-portal-muted); font-size: 13px; line-height: 1.9; }
.fh-portal-entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.fh-portal-entry-card { position: relative; min-height: 345px; display: flex; flex-direction: column; padding: 24px 24px 22px; border-radius: 23px; transition: transform .25s ease, box-shadow .25s ease; }
.fh-portal-entry-card:hover { transform: translateY(-6px); box-shadow: 0 22px 50px rgba(20,29,62,.13); }
.fh-portal-entry-card--student { background: var(--fh-portal-coral-soft); }
.fh-portal-entry-card--teacher { background: var(--fh-portal-blue-soft); }
.fh-portal-entry-card--admin { background: var(--fh-portal-mint); }
.fh-portal-entry-card--featured { box-shadow: inset 0 0 0 2px rgba(101,123,245,.3); }
.fh-portal-featured { position: absolute; top: -11px; right: 20px; padding: 5px 10px; border-radius: 999px; color: #fff; background: var(--fh-portal-blue); font: 9px var(--fh-portal-mono); letter-spacing: .04em; }
.fh-portal-entry-card__head { display: flex; align-items: center; justify-content: space-between; }
.fh-portal-entry-card__num { font: 11px var(--fh-portal-mono); opacity: .55; }
.fh-portal-entry-card__type { font: 9px var(--fh-portal-mono); letter-spacing: .12em; opacity: .56; }
.fh-portal-entry-card__icon { width: 52px; height: 52px; display: grid; place-items: center; margin-top: 37px; border-radius: 17px; background: rgba(255,255,255,.42); }
.fh-portal-entry-card__icon svg { width: 25px; height: 25px; stroke-width: 1.7; }
.fh-portal-entry-card--student .fh-portal-entry-card__icon { color: #dc6758; }
.fh-portal-entry-card--teacher .fh-portal-entry-card__icon { color: #536bdd; }
.fh-portal-entry-card--admin .fh-portal-entry-card__icon { color: #2a835a; }
.fh-portal-entry-card h3 { margin: 19px 0 5px; font-size: 23px; letter-spacing: -.06em; }
.fh-portal-entry-card p { margin: 0; color: rgba(20,29,62,.7); font-size: 12px; line-height: 1.8; }
.fh-portal-entry-card__button { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px 13px; border: 0; border-radius: 999px; color: var(--fh-portal-night); background: rgba(255,255,255,.7); font-size: 12px; font-weight: 800; transition: background .2s ease, transform .2s ease; }
.fh-portal-entry-card__button:hover { background: #fff; transform: translateX(3px); }
.fh-portal-entry-card__status { margin-top: 12px; color: rgba(20,29,62,.5); font: 9px var(--fh-portal-mono); }
.fh-portal-entry-card__status.is-custom { color: var(--fh-portal-night); }

.fh-portal-guide { padding: 98px 0; color: var(--fh-portal-white); background: var(--fh-portal-night-2); }
.fh-portal-guide__grid { display: grid; grid-template-columns: .72fr 1fr .62fr; gap: 50px; align-items: start; }
.fh-portal-guide h2 { color: #fff; }
.fh-portal-guide .fh-portal-eyebrow { color: var(--fh-portal-gold); }
.fh-portal-guide__steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.fh-portal-guide__steps li { display: grid; grid-template-columns: 49px 1fr; gap: 18px; min-height: 79px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.15); }
.fh-portal-guide__steps li + li { padding-top: 18px; }
.fh-portal-guide__steps b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: var(--fh-portal-night); background: var(--fh-portal-gold); font: 10px var(--fh-portal-mono); }
.fh-portal-guide__steps li:nth-child(2) b { background: var(--fh-portal-coral); }
.fh-portal-guide__steps li:nth-child(3) b { background: var(--fh-portal-mint); }
.fh-portal-guide__steps div { display: grid; gap: 3px; }
.fh-portal-guide__steps strong { color: #fff; font-size: 15px; }
.fh-portal-guide__steps span { color: #bac5ed; font-size: 12px; }
.fh-portal-guide__link { align-self: end; display: grid; gap: 7px; padding: 18px 0 4px; border-bottom: 1px solid var(--fh-portal-gold); color: #dce2ff; font-size: 11px; }
.fh-portal-guide__link strong { color: var(--fh-portal-gold); font-size: 12px; }

.fh-portal-footer { color: #8f9dd1; background: var(--fh-portal-night); }
.fh-portal-footer__inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 22px; font: 10px var(--fh-portal-mono); letter-spacing: .04em; }
.fh-portal-footer a, .fh-portal-footer button { color: #c4cdef; background: none; border: 0; font: inherit; }
.fh-portal-footer a:hover, .fh-portal-footer button:hover { color: var(--fh-portal-gold); }

.fh-portal-dialog { width: min(540px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 25px; background: transparent; box-shadow: 0 25px 80px rgba(0,0,0,.32); }
.fh-portal-dialog::backdrop { background: rgba(10,16,46,.72); backdrop-filter: blur(5px); }
.fh-portal-dialog__card { padding: 29px; border-radius: 25px; background: var(--fh-portal-white); }
.fh-portal-dialog__head { display: flex; justify-content: space-between; gap: 18px; }
.fh-portal-dialog__head h2 { margin: 0; font-size: 31px; line-height: 1.08; letter-spacing: -.06em; }
.fh-portal-dialog__close { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--fh-portal-muted); background: #eff0f7; font-size: 23px; line-height: 1; }
.fh-portal-dialog__close:hover { color: var(--fh-portal-ink); background: var(--fh-portal-blue-soft); }
.fh-portal-dialog__hint { margin: 22px 0 20px; color: var(--fh-portal-muted); font-size: 12px; line-height: 1.75; }
.fh-portal-dialog__fields { display: grid; gap: 12px; }
.fh-portal-dialog__fields label { display: grid; gap: 5px; }
.fh-portal-dialog__fields label span { font-size: 12px; font-weight: 800; }
.fh-portal-dialog__fields input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--fh-portal-line); border-radius: 10px; color: var(--fh-portal-ink); background: #faf9f3; font-size: 13px; }
.fh-portal-dialog__fields input:focus { outline: 3px solid rgba(101,123,245,.18); border-color: var(--fh-portal-blue); }
.fh-portal-dialog__fields input::placeholder { color: #9fa5b7; }
.fh-portal-dialog__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 23px; }
.fh-portal-dialog__actions .fh-portal-button--line { color: var(--fh-portal-muted); border-color: var(--fh-portal-line); }
.fh-portal-dialog__actions .fh-portal-button--line:hover { color: var(--fh-portal-ink); background: #eef0f8; }
.fh-portal-toast { position: fixed; z-index: 80; left: 50%; bottom: 24px; max-width: calc(100% - 30px); padding: 11px 16px; border-radius: 999px; color: #fff; background: var(--fh-portal-night); box-shadow: 0 15px 40px rgba(17,26,67,.18); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .2s ease, transform .2s ease; }
.fh-portal-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .fh-portal-hero__grid { grid-template-columns: 1fr; }
  .fh-portal-hero__visual { width: min(100%, 550px); justify-self: center; }
  .fh-portal-guide__grid { grid-template-columns: 1fr 1.2fr; }
  .fh-portal-guide__link { grid-column: 2; }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 70px; }
  .fh-portal-wrap { width: min(1200px, calc(100% - 32px)); }
  .fh-portal-bar__inner { min-height: 68px; }
  .fh-portal-locality, .fh-portal-team-link { display: none; }
  .fh-portal-config-link { padding: 8px 11px; }
  .fh-portal-hero__grid { min-height: auto; padding-top: 55px; padding-bottom: 60px; }
  .fh-portal-hero h1 { font-size: clamp(45px, 13vw, 65px); }
  .fh-portal-hero__lead { font-size: 14px; }
  .fh-portal-art { border-radius: 22px; }
  .fh-portal-orbit--one { left: 7px; }
  .fh-portal-orbit--two { right: 5px; }
  .fh-portal-entries { padding: 77px 0 82px; }
  .fh-portal-section-head, .fh-portal-guide__grid { grid-template-columns: 1fr; gap: 32px; }
  .fh-portal-section-head > p { justify-self: start; }
  .fh-portal-entry-grid { grid-template-columns: 1fr; margin-top: 42px; }
  .fh-portal-entry-card { min-height: 310px; }
  .fh-portal-guide { padding: 77px 0; }
  .fh-portal-guide__link { grid-column: auto; }
  .fh-portal-footer__inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 17px 0; gap: 8px; }
  .fh-portal-dialog__card { padding: 23px; }
  .fh-portal-dialog__head h2 { font-size: 27px; }
  .fh-portal-dialog__actions { align-items: stretch; flex-direction: column-reverse; }
}

/* 竖屏精调：减少标题孤行，并把入口卡片和配置弹窗保持在可触达范围内 */
@media (max-width: 420px) {
  html { scroll-padding-top: 68px; }
  .fh-portal-wrap { width: calc(100% - 28px); }
  .fh-portal-bar__inner { min-height: 64px; gap: 10px; }
  .fh-portal-brand { min-width: 0; gap: 8px; }
  .fh-portal-brand__mark { width: 34px; height: 34px; border-radius: 10px; }
  .fh-portal-brand__mark img { width: 27px; height: 27px; }
  .fh-portal-brand strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
  .fh-portal-brand small { margin-top: 3px; font-size: 8px; }
  .fh-portal-config-link { min-height: 44px; padding: 8px 10px; white-space: nowrap; }
  .fh-portal-hero__grid { padding-top: 42px; padding-bottom: 48px; gap: 30px; }
  .fh-portal-hero h1 { font-size: clamp(38px, 11.4vw, 46px); line-height: 1.1; letter-spacing: -.085em; word-break: keep-all; }
  .fh-portal-hero__lead { margin-top: 19px; font-size: 13px; line-height: 1.75; }
  .fh-portal-hero__actions { gap: 8px; margin-top: 23px; }
  .fh-portal-button { min-height: 44px; padding: 0 14px; }
  .fh-portal-hero__note { align-items: flex-start; margin-top: 22px; font-size: 10px; line-height: 1.55; }
  .fh-portal-art { margin: 0 3px; border-radius: 20px; transform: none; }
  .fh-portal-art__caption { right: 17px; bottom: 17px; }
  .fh-portal-art__caption strong { font-size: 19px; }
  .fh-portal-orbit { padding: 8px 10px; font-size: 9px; }
  .fh-portal-orbit--one { left: 7px; }
  .fh-portal-orbit--two { right: 7px; }
  .fh-portal-section-head h2, .fh-portal-guide h2 { font-size: clamp(34px, 10.8vw, 46px); line-height: 1.1; }
  .fh-portal-entry-card { min-height: 270px; padding: 21px; }
  .fh-portal-entry-card h3 { font-size: 21px; }
  .fh-portal-dialog { width: calc(100% - 20px); }
  .fh-portal-dialog__card { max-height: calc(100dvh - 24px); overflow-y: auto; padding: 20px; }
  .fh-portal-dialog__actions .fh-portal-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
