:root {
  --page-bg: #f5f0e8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #fffdf8;
  --stroke: rgba(73, 50, 33, 0.12);
  --text: #301d15;
  --muted: #7d6656;
  --accent: #f45c27;
  --accent-deep: #cc4316;
  --berry: #98185f;
  --gold: #f8bf2a;
  --mint: #4ea48d;
  --shadow: 0 24px 60px rgba(92, 58, 34, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(251, 197, 66, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(152, 24, 95, 0.14), transparent 34%),
    linear-gradient(180deg, #f8f2ea 0%, #f4eee6 100%);
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.5), transparent 30%),
    radial-gradient(circle at 78% 25%, rgba(244, 92, 39, 0.15), transparent 18%),
    radial-gradient(circle at 10% 80%, rgba(78, 164, 141, 0.16), transparent 20%);
  z-index: -1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(255, 251, 246, 0.78);
  border-bottom: 1px solid rgba(74, 50, 33, 0.08);
}

.topbar-inner {
  width: min(1160px, calc(100% - 32px));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-mini {
  letter-spacing: 0.06em;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--berry);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.topnav a {
  position: relative;
  padding-left: 14px;
}

.topnav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  transform: translateY(-50%);
}

.topnav a:hover {
  color: var(--accent);
}

.login-page--teacher .topnav a:hover,
.login-page--teacher .section-tag,
.login-page--teacher .eyebrow {
  color: var(--blue, #3d6f97);
}

.login-page--teacher .promo-shape {
  background: linear-gradient(145deg, #456f94 0%, #5d86a9 62%, #345a7d 100%);
  box-shadow: 0 24px 48px rgba(61, 111, 151, 0.24);
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.shell--compact {
  padding: 24px 0 28px;
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.shell--compact .masthead {
  align-items: center;
  margin-bottom: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 90px;
  height: 90px;
  flex: 0 0 auto;
  filter: drop-shadow(0 12px 28px rgba(118, 71, 34, 0.16));
}

.shell--compact .brand-mark {
  width: 72px;
  height: 72px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--berry);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.shell--compact .brand-copy h1 {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
}

.brand-subtitle {
  margin: 12px 0 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1rem;
}

.shell--compact .brand-subtitle {
  margin-top: 8px;
  max-width: 34rem;
  font-size: 0.95rem;
}

.masthead-slogan {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  color: rgba(48, 29, 21, 0.11);
  text-align: right;
}

.shell--compact .masthead-slogan {
  font-size: clamp(1.4rem, 4.2vw, 3rem);
}

.stage {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 0;
  border: 1px solid rgba(77, 48, 32, 0.08);
  border-radius: 30px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stage--compact {
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}

.login-panel,
.promo-panel {
  position: relative;
  min-height: 560px;
  padding: 34px;
}

.stage--compact .login-panel,
.stage--compact .promo-panel {
  min-height: 460px;
  padding: 26px 28px;
}

.login-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 245, 0.98)),
    var(--surface-strong);
  border-right: 1px solid rgba(77, 48, 32, 0.08);
}

.panel-header p,
.panel-header h2 {
  margin: 0;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.section-tag::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.panel-header h2 {
  margin-top: 14px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.panel-header > p:last-child {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.status-message {
  min-height: 56px;
  margin-top: 24px;
  padding: 0;
  border-radius: 18px;
  color: transparent;
  transition: 180ms ease;
}

.stage--compact .status-message {
  min-height: 0;
  margin-top: 0;
}

.status-message.is-visible {
  padding: 16px 18px;
  color: var(--text);
  background: rgba(244, 92, 39, 0.08);
  border: 1px solid rgba(244, 92, 39, 0.18);
}

.status-message.is-success {
  background: rgba(78, 164, 141, 0.11);
  border-color: rgba(78, 164, 141, 0.26);
}

.login-form {
  margin-top: 12px;
}

.field {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.stage--compact .field {
  margin-top: 14px;
}

.field span {
  font-size: 0.95rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(77, 48, 32, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field input:focus {
  outline: none;
  border-color: rgba(244, 92, 39, 0.7);
  box-shadow: 0 0 0 4px rgba(244, 92, 39, 0.12);
  transform: translateY(-1px);
}

.field-password {
  position: relative;
}

.field-password input {
  padding-right: 88px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  bottom: 9px;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(48, 29, 21, 0.06);
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(48, 29, 21, 0.1);
}

.helper-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.stage--compact .helper-row {
  margin-top: 12px;
}

.helper-row--end {
  justify-content: flex-end;
}

.helper-row a:hover {
  color: var(--accent);
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.stage--compact .action-row {
  margin-top: 18px;
}

.btn {
  min-width: 126px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 18px 34px rgba(244, 92, 39, 0.24);
}

.btn-secondary {
  background: rgba(48, 29, 21, 0.04);
  border-color: rgba(77, 48, 32, 0.12);
  color: var(--text);
}

.register-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 18px 18px 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(249, 191, 42, 0.16), rgba(255, 255, 255, 0.74));
  border: 1px solid rgba(249, 191, 42, 0.24);
}

.register-card span {
  color: var(--muted);
}

.register-card a {
  color: var(--berry);
  font-weight: 800;
}

.promo-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  background:
    linear-gradient(180deg, rgba(255, 248, 243, 0.8), rgba(252, 248, 242, 0.68)),
    radial-gradient(circle at top right, rgba(248, 191, 42, 0.22), transparent 20%);
}

.stage--compact .promo-panel {
  gap: 14px;
}

.promo-panel::before,
.promo-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.85;
}

.promo-panel::before {
  width: 180px;
  height: 180px;
  right: -30px;
  top: -36px;
  background: rgba(248, 191, 42, 0.12);
}

.promo-panel::after {
  width: 120px;
  height: 120px;
  left: -30px;
  bottom: 32px;
  background: rgba(152, 24, 95, 0.08);
}

.promo-shape {
  position: relative;
  overflow: hidden;
  padding: 28px 28px 34px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(145deg, #f65a1f 0%, #ff6627 62%, #e84d16 100%);
  box-shadow: 0 24px 48px rgba(238, 90, 30, 0.28);
  isolation: isolate;
}

.stage--compact .promo-shape {
  padding: 24px 24px 26px;
  border-radius: 24px;
}

.promo-shape::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, transparent 0 18%, rgba(255, 255, 255, 0.15) 18% 20%, transparent 20% 100%),
    linear-gradient(210deg, transparent 0 76%, rgba(0, 0, 0, 0.08) 76% 100%);
  z-index: -1;
}

.promo-badge {
  display: inline-flex;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.promo-shape h3 {
  margin: 18px 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.stage--compact .promo-shape h3 {
  margin-top: 14px;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
}

.promo-shape p {
  margin: 0;
  max-width: 36rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
}

.stage--compact .promo-shape p {
  line-height: 1.6;
}

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

.stage--compact .metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid article {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--stroke);
}

.stage--compact .metric-grid article {
  padding: 16px 18px;
  border-radius: 18px;
}

.metric-grid strong {
  display: block;
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}

.metric-grid span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature-strip > div {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--stroke);
}

.feature-kicker {
  margin: 0 0 14px;
  color: var(--berry);
  font-weight: 800;
}

.feature-strip ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.feature-strip li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
}

.feature-strip li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--accent));
}

.browser-note {
  padding: 16px 18px;
  border-radius: 18px;
  color: var(--muted);
  border: 1px dashed rgba(77, 48, 32, 0.16);
  background: rgba(255, 255, 255, 0.5);
}

.footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(74, 50, 33, 0.08);
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.footer p {
  margin: 6px 0;
}

.info-modal[hidden] {
  display: none;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(57, 36, 28, 0.28);
  backdrop-filter: blur(8px);
}

.info-modal__card {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  padding: 28px 24px 24px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 236, 0.96));
  box-shadow: 0 24px 60px rgba(123, 74, 28, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.72);
  text-align: center;
}

.info-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(92, 60, 40, 0.08);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.info-modal__eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.info-modal__title {
  margin: 0;
  font-size: 1.8rem;
  color: var(--text);
}

.info-modal__content {
  margin: 14px 0 0;
  font-size: 1.08rem;
  color: var(--muted);
}

.login-page .footer {
  margin-bottom: 18px;
  padding-top: 12px;
  font-size: 0.86rem;
}

@media (min-width: 981px) {
  body.login-page {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .login-page .shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 20px 0 18px;
  }

  .login-page .shell--compact {
    padding: 14px 0 14px;
  }

  .login-page .stage {
    min-height: 0;
  }

  .login-page .login-panel,
  .login-page .promo-panel {
    min-height: 0;
  }

  .login-page .footer {
    margin: 0 auto 14px;
    padding-top: 10px;
  }
}

@media (min-width: 981px) and (max-height: 900px) {
  .topbar-inner {
    min-height: 50px;
  }

  .login-page .shell,
  .login-page .shell--compact {
    padding: 10px 0 10px;
  }

  .masthead {
    gap: 18px;
    margin-bottom: 12px;
  }

  .shell--compact .masthead {
    margin-bottom: 10px;
  }

  .brand-lockup {
    gap: 14px;
  }

  .brand-mark,
  .shell--compact .brand-mark {
    width: 58px;
    height: 58px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 0.74rem;
  }

  .brand-copy h1,
  .shell--compact .brand-copy h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
  }

  .brand-subtitle,
  .shell--compact .brand-subtitle {
    margin-top: 6px;
    font-size: 0.9rem;
  }

  .masthead-slogan,
  .shell--compact .masthead-slogan {
    font-size: clamp(1.35rem, 3.2vw, 2.4rem);
  }

  .stage {
    border-radius: 24px;
  }

  .login-panel,
  .promo-panel {
    padding: 20px 22px;
  }

  .stage--compact .login-panel,
  .stage--compact .promo-panel {
    padding: 18px 20px;
  }

  .panel-header h2 {
    margin-top: 10px;
    font-size: clamp(1.45rem, 2.8vw, 2rem);
  }

  .panel-header > p:last-child {
    margin-top: 8px;
    line-height: 1.55;
  }

  .status-message {
    min-height: 0;
    margin-top: 14px;
  }

  .status-message.is-visible {
    padding: 12px 14px;
  }

  .field,
  .stage--compact .field {
    gap: 8px;
    margin-top: 12px;
  }

  .field input {
    min-height: 46px;
    padding: 0 16px;
    border-radius: 14px;
  }

  .field-password input {
    padding-right: 82px;
  }

  .password-toggle {
    right: 10px;
    bottom: 7px;
    padding: 8px 12px;
  }

  .helper-row,
  .stage--compact .helper-row {
    margin-top: 10px;
    font-size: 0.88rem;
  }

  .action-row,
  .stage--compact .action-row {
    margin-top: 14px;
  }

  .btn {
    min-height: 44px;
    padding: 0 20px;
    border-radius: 14px;
  }

  .register-card {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
  }

  .promo-panel,
  .stage--compact .promo-panel {
    gap: 12px;
  }

  .promo-shape,
  .stage--compact .promo-shape {
    padding: 20px 20px 22px;
    border-radius: 20px;
  }

  .promo-badge {
    padding: 7px 12px;
  }

  .promo-shape h3,
  .stage--compact .promo-shape h3 {
    margin: 12px 0 8px;
    font-size: clamp(1.3rem, 2.35vw, 1.85rem);
  }

  .promo-shape p,
  .stage--compact .promo-shape p {
    line-height: 1.55;
  }

  .metric-grid,
  .stage--compact .metric-grid {
    gap: 10px;
  }

  .metric-grid article,
  .stage--compact .metric-grid article {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .metric-grid strong {
    font-size: 1.45rem;
  }

  .browser-note {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .footer,
  .login-page .footer {
    margin-bottom: 10px;
    padding-top: 8px;
  }
}

@media (max-width: 980px) {
  .masthead {
    flex-direction: column;
    align-items: flex-start;
  }

  .masthead-slogan {
    text-align: left;
  }

  .stage {
    grid-template-columns: 1fr;
  }

  .login-panel {
    border-right: none;
    border-bottom: 1px solid rgba(77, 48, 32, 0.08);
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .shell {
    padding-top: 28px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark {
    width: 72px;
    height: 72px;
  }

  .login-panel,
  .promo-panel {
    min-height: auto;
    padding: 24px;
  }

  .action-row,
  .register-card,
  .helper-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .metric-grid,
  .feature-strip {
    grid-template-columns: 1fr;
  }
}
