@font-face {
  font-family: "Noto Serif TC Local";
  src: url("fonts/NotoSerifTC-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --portal-hue: 215;
  --portal-ink: hsl(var(--portal-hue) 42% 20%);
  --portal-muted: hsl(var(--portal-hue) 17% 43%);
  --portal-accent: hsl(var(--portal-hue) 58% 48%);
  --portal-accent-dark: hsl(var(--portal-hue) 62% 34%);
  --portal-wash: hsl(var(--portal-hue) 62% 95%);
  --portal-border: hsl(var(--portal-hue) 31% 76% / .45);
  color-scheme: light;
}

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

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--portal-ink);
  background:
    radial-gradient(circle at 12% 0%, hsl(var(--portal-hue) 76% 85% / .6), transparent 34rem),
    radial-gradient(circle at 94% 18%, hsl(calc(var(--portal-hue) + 52) 78% 88% / .52), transparent 32rem),
    linear-gradient(155deg, #fbfdff 0%, hsl(var(--portal-hue) 46% 96%) 58%, #f7f9fc 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.learning-portal-skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  background: var(--portal-accent-dark);
  transform: translateY(-160%);
}

.learning-portal-skip:focus { transform: none; }

.learning-portal-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 74px) 0 clamp(64px, 8vw, 110px);
}

.panel {
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 28px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 24px 70px hsl(var(--portal-hue) 40% 24% / .1), inset 0 1px rgba(255, 255, 255, .94);
  backdrop-filter: blur(22px) saturate(1.14);
  -webkit-backdrop-filter: blur(22px) saturate(1.14);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--portal-accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.connection-pill,
.user-pill,
.learning-portal-header-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  color: var(--portal-ink);
  background: rgba(255, 255, 255, .86);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.connection-pill[data-state="checking"]::before,
.connection-pill[data-state="online"]::before,
.connection-pill[data-state="error"]::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #e4a72d;
  box-shadow: 0 0 0 4px rgba(228, 167, 45, .12);
}

.connection-pill[data-state="online"]::before { background: #1c9a67; box-shadow: 0 0 0 4px rgba(28, 154, 103, .12); }
.connection-pill[data-state="error"]::before { background: #d44b52; box-shadow: 0 0 0 4px rgba(212, 75, 82, .12); }

.learning-portal-header-button { cursor: pointer; }
.learning-portal-header-button:hover,
.learning-portal-header-button:focus-visible { background: var(--portal-wash); }

.learning-portal-login__layout {
  min-height: min(690px, calc(100dvh - 190px));
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
  gap: clamp(22px, 3vw, 42px);
  align-items: stretch;
}

.learning-portal-hero {
  position: relative;
  isolation: isolate;
  min-height: 590px;
  overflow: hidden;
  padding: clamp(38px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  background:
    linear-gradient(120deg, rgba(5, 17, 34, .12), rgba(5, 17, 34, .44)),
    radial-gradient(circle at 82% 10%, hsl(calc(var(--portal-hue) + 55) 86% 69% / .58), transparent 34%),
    linear-gradient(145deg, hsl(var(--portal-hue) 63% 52%), hsl(var(--portal-hue) 59% 27%));
}

.learning-portal-hero::before {
  content: "";
  position: absolute;
  inset: 22px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 20px;
}

.learning-portal-hero .eyebrow { color: rgba(255, 255, 255, .76); }

.learning-portal-hero h1,
.learning-portal-dashboard__hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif TC Local", serif;
  font-size: clamp(38px, 5.2vw, 76px);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.learning-portal-hero > p:last-of-type {
  max-width: 600px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.75;
}

.learning-portal-hero__ordinal {
  position: absolute;
  top: clamp(30px, 4vw, 58px);
  right: clamp(34px, 4vw, 62px);
  color: rgba(255, 255, 255, .17);
  font-family: Georgia, serif;
  font-size: clamp(88px, 13vw, 190px);
  font-weight: 800;
  line-height: 1;
}

.learning-portal-hero__motif {
  position: absolute;
  right: 42px;
  bottom: 38px;
  width: min(38%, 250px);
  height: 82px;
  display: flex;
  align-items: end;
  gap: 10px;
  opacity: .34;
}

.learning-portal-hero__motif i {
  flex: 1;
  height: 38%;
  border-radius: 999px 999px 4px 4px;
  background: white;
}

.learning-portal-hero__motif i:nth-child(2) { height: 66%; }
.learning-portal-hero__motif i:nth-child(3) { height: 48%; }
.learning-portal-hero__motif i:nth-child(4) { height: 92%; }

.learning-portal-login__panel {
  padding: clamp(34px, 5vw, 62px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.learning-portal-login__heading {
  margin-bottom: 34px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.learning-portal-login__heading > span {
  padding-top: 3px;
  color: var(--portal-accent);
  font: 800 30px/1 Georgia, serif;
}

.learning-portal-login__heading h2,
.learning-portal-progress h2,
.learning-portal-empty h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif TC Local", serif;
  font-size: clamp(27px, 3vw, 39px);
  line-height: 1.13;
}

.learning-portal-login__heading p:last-child,
.learning-portal-progress__toolbar p:last-child,
.learning-portal-empty p:last-child {
  margin: 9px 0 0;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.7;
}

.learning-portal-login__form { display: grid; gap: 18px; }

.learning-portal-login__form label {
  display: grid;
  gap: 8px;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 800;
}

.learning-portal-login__form input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--portal-border);
  border-radius: 13px;
  outline: 0;
  color: var(--portal-ink);
  background: rgba(250, 252, 255, .92);
}

.learning-portal-login__form input:focus {
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 4px hsl(var(--portal-hue) 65% 55% / .13);
}

.learning-portal-password { position: relative; display: block; }
.learning-portal-password input { padding-right: 78px; }

.learning-portal-password button {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 57px;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--portal-accent-dark);
  background: var(--portal-wash);
  font-size: 12px;
  font-weight: 900;
  transform: translateY(-50%);
  cursor: pointer;
}

.learning-portal-login__status {
  min-height: 22px;
  margin: -3px 0;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 700;
}

.learning-portal-login__status[data-state="error"] { color: #b3262e; }

.learning-portal-primary {
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--portal-accent), var(--portal-accent-dark));
  box-shadow: 0 14px 28px hsl(var(--portal-hue) 50% 35% / .24);
  font-weight: 900;
  cursor: pointer;
}

.learning-portal-primary:hover,
.learning-portal-primary:focus-visible { filter: brightness(1.07); transform: translateY(-1px); }
.learning-portal-primary:disabled { cursor: wait; opacity: .6; transform: none; }

.learning-portal-dashboard { display: grid; gap: 24px; }

.learning-portal-dashboard__hero {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  padding: clamp(34px, 6vw, 72px);
  color: white;
  background:
    radial-gradient(circle at 85% 18%, hsl(calc(var(--portal-hue) + 50) 82% 72% / .46), transparent 35%),
    linear-gradient(135deg, hsl(var(--portal-hue) 63% 47%), hsl(var(--portal-hue) 59% 26%));
}

.learning-portal-dashboard__hero h1 { font-size: clamp(34px, 4.5vw, 62px); }
.learning-portal-dashboard__hero p:last-child { margin: 17px 0 0; color: rgba(255, 255, 255, .8); font-weight: 700; }
.learning-portal-dashboard__hero .eyebrow { color: rgba(255, 255, 255, .7); }

.learning-portal-dashboard__ordinal {
  position: absolute;
  right: clamp(28px, 6vw, 78px);
  bottom: -28px;
  color: rgba(255, 255, 255, .13);
  font: 900 clamp(110px, 17vw, 230px)/1 Georgia, serif;
}

.learning-portal-disclosure {
  width: 100%;
  min-height: 94px;
  padding: 22px clamp(22px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--portal-ink);
  text-align: left;
  cursor: pointer;
}

.learning-portal-disclosure > span:first-child { display: grid; gap: 5px; }
.learning-portal-disclosure strong { font-family: Georgia, "Noto Serif TC Local", serif; font-size: 22px; }
.learning-portal-disclosure small { color: var(--portal-muted); font-size: 13px; }
.learning-portal-disclosure > span:last-child { color: var(--portal-accent-dark); font-size: 13px; font-weight: 900; white-space: nowrap; }
.learning-portal-disclosure:hover,
.learning-portal-disclosure:focus-visible { border-color: var(--portal-border); background: rgba(255, 255, 255, .94); }

.learning-portal-progress { padding: clamp(28px, 5vw, 58px); }
.learning-portal-progress__section + .learning-portal-progress__section { margin-top: 54px; padding-top: 52px; border-top: 1px solid var(--portal-border); }

.learning-portal-progress__toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.learning-portal-progress__toolbar h2 { font-size: clamp(25px, 3vw, 36px); }

.learning-portal-ranges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.learning-portal-ranges button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  color: var(--portal-muted);
  background: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.learning-portal-ranges button[aria-pressed="true"] {
  color: white;
  border-color: var(--portal-accent-dark);
  background: var(--portal-accent-dark);
}

.learning-portal-chart-shell {
  margin-top: 25px;
  overflow-x: auto;
  border: 1px solid var(--portal-border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), var(--portal-wash));
}

.learning-portal-chart { width: 100%; min-width: 700px; display: block; }
.learning-portal-chart__grid line { stroke: hsl(var(--portal-hue) 24% 65% / .22); stroke-width: 1; }
.learning-portal-chart__grid .axis { stroke: hsl(var(--portal-hue) 28% 40% / .38); stroke-width: 1.5; }
.learning-portal-chart text { fill: var(--portal-muted); font-size: 18px; font-weight: 900; }
.learning-portal-chart .learning-portal-chart__hint { fill: hsl(var(--portal-hue) 15% 51%); font-size: 12px; font-weight: 700; }

.learning-portal-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.learning-portal-stats > div {
  min-height: 94px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
}

.learning-portal-stats strong { color: var(--portal-accent-dark); font: 800 24px/1 Georgia, serif; }
.learning-portal-stats span { color: var(--portal-muted); font-size: 12px; font-weight: 800; }

.learning-portal-empty {
  min-height: 260px;
  padding: clamp(32px, 6vw, 68px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.learning-portal-empty > span {
  width: clamp(76px, 9vw, 112px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--portal-border);
  border-radius: 26px;
  color: var(--portal-accent);
  background: var(--portal-wash);
  font: 900 clamp(30px, 4vw, 48px)/1 Georgia, serif;
}

@media (max-width: 880px) {
  .learning-portal-login__layout { min-height: 0; grid-template-columns: 1fr; }
  .learning-portal-hero { min-height: 460px; }
  .learning-portal-progress__toolbar { align-items: start; flex-direction: column; }
  .learning-portal-ranges { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .learning-portal-shell { width: min(100% - 24px, 1240px); padding-top: 22px; }
  .learning-portal-hero { min-height: 420px; padding: 34px 30px; }
  .learning-portal-hero::before { inset: 14px; }
  .learning-portal-hero h1 { font-size: clamp(36px, 12vw, 53px); }
  .learning-portal-hero__ordinal { top: 24px; right: 25px; }
  .learning-portal-login__panel { padding: 31px 24px; }
  .learning-portal-login__heading { grid-template-columns: 1fr; gap: 10px; }
  .learning-portal-dashboard__hero { min-height: 235px; padding: 34px 28px; }
  .learning-portal-disclosure { min-height: 88px; padding: 19px 20px; }
  .learning-portal-progress { padding: 27px 18px; }
  .learning-portal-stats { grid-template-columns: 1fr; }
  .learning-portal-stats > div { min-height: 82px; }
  .learning-portal-empty { grid-template-columns: 1fr; padding: 34px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
