:root {
  --ink: #1a2332;
  --muted: #5a6a7a;
  --paper: #f3f0ea;
  --card: #fffdf8;
  --line: #d5cfc3;
  --accent: #0f5c4c;
  --accent-2: #c45c26;
  --sky: #dce8e4;
  --danger: #9b2c2c;
  --ok: #1f6f4a;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --edge: clamp(12px, 1.2vw, 28px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.page-body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #ebe6dc;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
body.portal-learn,
body.portal-manage {
  font-size: 18px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 动态背景层 · 医学氛围 */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(15, 92, 76, .14) 0%, transparent 55%),
    radial-gradient(900px 480px at 92% 8%, rgba(46, 120, 130, .10) 0%, transparent 50%),
    radial-gradient(700px 420px at 70% 90%, rgba(196, 92, 38, .07) 0%, transparent 55%),
    linear-gradient(165deg, #f4f7f5 0%, #f3f0ea 40%, #e7eee9 100%);
}
.bg-med-pattern {
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(15, 92, 76, .14) 1px, transparent 0),
    linear-gradient(90deg, rgba(15, 92, 76, .03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 92, 76, .03) 1px, transparent 1px);
  background-size: 28px 28px, 84px 84px, 84px 84px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 85%);
}
.bg-med-cross {
  position: absolute;
  width: 64px;
  height: 64px;
  opacity: .12;
  background:
    linear-gradient(#0f5c4c, #0f5c4c) center/18% 70% no-repeat,
    linear-gradient(#0f5c4c, #0f5c4c) center/70% 18% no-repeat;
  animation: crossFloat 18s ease-in-out infinite;
}
.bg-med-cross-a { left: 8%; top: 18%; animation-delay: 0s; }
.bg-med-cross-b { right: 10%; top: 22%; width: 48px; height: 48px; opacity: .1; animation-delay: -6s; }
.bg-med-cross-c { left: 18%; bottom: 16%; width: 56px; height: 56px; opacity: .09; animation-delay: -11s; }
@keyframes crossFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(6deg); }
}
.bg-ecg-line {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 18%;
  width: 110%;
  height: 120px;
  opacity: .85;
}
.ecg-path {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: ecgDraw 7.5s linear infinite;
}
@keyframes ecgDraw {
  0% { stroke-dashoffset: 1400; opacity: .15; }
  15% { opacity: .55; }
  50% { stroke-dashoffset: 0; opacity: .45; }
  100% { stroke-dashoffset: -1400; opacity: .12; }
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .45;
  animation: orbFloat 16s ease-in-out infinite;
}
.bg-orb-a {
  width: 42vw; height: 42vw; max-width: 520px; max-height: 520px;
  left: -8%; top: 10%;
  background: rgba(15, 92, 76, .22);
}
.bg-orb-b {
  width: 36vw; height: 36vw; max-width: 420px; max-height: 420px;
  right: -6%; top: 28%;
  background: rgba(55, 130, 140, .14);
  animation-delay: -5s;
}
.bg-orb-c {
  width: 28vw; height: 28vw; max-width: 320px; max-height: 320px;
  left: 38%; bottom: -10%;
  background: rgba(196, 92, 38, .10);
  animation-delay: -9s;
}
.bg-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .5;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2%, -3%) scale(1.05); }
  66% { transform: translate(-2%, 2%) scale(.97); }
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: color-mix(in srgb, #f4f7f5 88%, #0f5c4c 12%);
}
.page-transition.is-leaving {
  visibility: visible;
  animation: fadeCover .18s ease forwards;
}
.page-transition.is-entering {
  visibility: visible;
  animation: fadeReveal .22s ease forwards;
}
@keyframes fadeCover {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeReveal {
  from { opacity: 1; }
  to { opacity: 0; }
}

.page-content {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  padding-bottom: 3.2rem;
  animation: pageIn .28s ease both;
}
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.main-area { min-height: 40vh; }

/* 大宽屏：贴边，几乎占满显示器 */
.wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 var(--edge);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: .75rem;
  min-width: 0;
  flex: 1;
}
.brand strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: .03em;
  white-space: nowrap;
}
.brand span {
  color: var(--muted);
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav {
  display: flex;
  gap: .85rem;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.nav a { color: var(--ink); font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .35rem; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; padding: .4rem .85rem; border-radius: 3px;
  font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; color: #fff; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.warn { background: var(--accent-2); border-color: var(--accent-2); }

.hero-home {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem 2rem;
  align-content: center;
  align-items: center;
  padding: 1.5rem 0 2rem;
}
.hero-home--centered {
  grid-template-columns: 1fr;
  justify-items: center;
  justify-content: center;
  text-align: center;
  gap: 3.5rem;
  padding: 2.5rem 0 3rem;
  width: 100%;
}
.hero-copy--center {
  display: grid;
  gap: .9rem;
  justify-items: center;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 1.25rem;
}
.portal-grid--center {
  width: min(980px, 100%);
  gap: 1.25rem;
  margin: 0.75rem auto 0;
  text-align: left;
}
.hero-eyebrow {
  margin: 0 auto;
  color: var(--muted);
  letter-spacing: .18em;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  white-space: normal;
  text-align: center;
  width: 100%;
  animation: fadeRise .8s ease both;
}
.hero-title {
  font-family: var(--font-display) !important;
  font-size: clamp(2.75rem, 5.2vw, 4.1rem) !important;
  line-height: 1.15 !important;
  margin: 0 auto;
  white-space: nowrap;
  letter-spacing: .06em;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(105deg, #0f5c4c 0%, #1f6f4a 35%, #c45c26 70%, #0f5c4c 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShine 5s linear infinite, fadeRise .9s .1s ease both;
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.portal-card h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem) !important;
  white-space: nowrap;
  letter-spacing: .04em;
  text-align: center;
}
.portal-card p {
  color: var(--muted);
  margin: 0;
  font-size: clamp(1.15rem, 1.5vw, 1.35rem) !important;
  text-align: center;
}
.portal-grid--center .btn {
  font-size: clamp(1.15rem, 1.45vw, 1.35rem) !important;
  padding: .75rem 1.4rem;
  margin: 0 auto;
}

.hero-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  color: transparent;
  text-shadow: 0 0 28px rgba(15, 92, 76, .25);
  animation: titlePulse 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes titleShine {
  0% { background-position: 0% center; }
  100% { background-position: 220% center; }
}
@keyframes titlePulse {
  0%, 100% { opacity: .35; transform: scale(1); }
  50% { opacity: .7; transform: scale(1.01); }
}
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-home .hero-copy { display: grid; gap: .85rem; }
.hero-home h1.hero-title,
.hero-home .hero-title {
  font-family: var(--font-display) !important;
  font-size: clamp(2.75rem, 5.2vw, 4.1rem) !important;
  line-height: 1.15 !important;
  margin: 0 auto;
  white-space: nowrap;
  text-align: center;
}
.hero-home .lead {
  display: none;
}
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.portal-grid--center {
  width: min(980px, 100%);
  gap: 1.25rem;
  margin: 0.75rem auto 0;
  text-align: left;
}
.auth-center {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0 2.5rem;
  width: 100%;
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(260px, 340px);
  gap: 1.25rem;
  align-items: stretch;
  width: min(780px, 100%);
}
@media (max-width: 760px) {
  .auth-layout { grid-template-columns: 1fr; width: min(420px, 100%); }
}
.auth-card {
  width: 100%;
  margin: 0;
  text-align: left;
}
.auth-card h2 {
  text-align: center;
  white-space: nowrap;
}
.auth-card .form-grid.narrow {
  max-width: none;
  width: 100%;
  margin: 0 auto;
}
.auth-card .muted {
  text-align: center;
}
.auth-card .btn {
  width: 100%;
}
.demo-accounts {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin: 0;
}
.demo-accounts h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-align: center;
}
.demo-hint {
  margin: 0;
  font-size: .92rem;
  text-align: center;
}
.demo-item {
  display: grid;
  gap: .55rem;
  padding: .85rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--sky) 55%, #fff);
}
.demo-meta {
  display: grid;
  gap: .2rem;
  font-size: .95rem;
}
.demo-meta strong {
  font-size: 1.05rem;
}
.demo-meta code {
  font-family: ui-monospace, Consolas, monospace;
  background: #fff;
  padding: .05rem .3rem;
  border-radius: 3px;
  border: 1px solid var(--line);
}
.demo-item .btn {
  width: 100%;
}
.reveal-card {
  animation: fadeRise .85s ease both;
}
.reveal-card:nth-child(1) { animation-delay: .28s; }
.reveal-card:nth-child(2) { animation-delay: .4s; }
@media (max-width: 980px) {
  .hero-home { grid-template-columns: 1fr; min-height: auto; }
  .hero-home h1, .hero-title { white-space: normal; }
  .portal-grid { grid-template-columns: 1fr; }
  .brand { flex-direction: column; gap: .1rem; }
  .brand span { white-space: normal; }
}
.portal-card {
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line);
  padding: 2rem 1.7rem;
  backdrop-filter: blur(6px);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.1rem;
  min-height: 180px;
}
.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(26, 35, 50, .08);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.portal-card h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem) !important;
  white-space: nowrap;
  letter-spacing: .04em;
  text-align: center;
}
.portal-card p {
  color: var(--muted);
  margin: 0;
  font-size: clamp(1.15rem, 1.5vw, 1.35rem) !important;
  text-align: center;
}
.portal-grid--center .btn {
  font-size: clamp(1.15rem, 1.45vw, 1.35rem) !important;
  padding: .75rem 1.4rem;
  margin: 0 auto;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  padding: .85rem 1rem;
  margin: .65rem 0;
}
.panel h2, .panel h3 {
  margin: 0 0 .55rem;
  font-family: var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .55rem;
}
.stat {
  background: var(--sky);
  padding: .65rem .8rem;
  border: 1px solid var(--line);
}
.stat .n { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: .8rem; white-space: nowrap; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
table.data th, table.data td {
  border-bottom: 1px solid var(--line);
  padding: .4rem .35rem;
  text-align: left;
  vertical-align: top;
}
table.data th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .65rem .9rem;
  max-width: none;
}
.form-grid.narrow { max-width: 480px; grid-template-columns: 1fr; }
label { display: grid; gap: .2rem; font-weight: 600; font-size: .88rem; }
input[type=text], input[type=password], input[type=number], input[type=url],
input[type=email], select, textarea {
  font: inherit; padding: .4rem .55rem; border: 1px solid var(--line);
  background: #fff; border-radius: 3px; width: 100%;
}
.flash {
  padding: .5rem .75rem; border: 1px solid var(--line); background: #eef6f2;
  margin: .55rem 0; font-size: .9rem;
}
.flash.error { background: #f8e8e8; border-color: #e2b6b6; color: var(--danger); }

.q-block {
  border-top: 1px dashed var(--line);
  padding: .55rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: .35rem 1.25rem;
  align-items: start;
}
.q-block:first-child { border-top: 0; }
.q-block .q-stem { margin: 0; }
.q-block .q-choices { display: grid; gap: .15rem; }
@media (max-width: 900px) {
  .q-block { grid-template-columns: 1fr; }
}
.choice {
  display: flex; gap: .45rem; align-items: flex-start;
  margin: 0; font-size: .92rem;
}
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.footer,
.footer--fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid var(--line);
  padding: .55rem var(--edge);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: color-mix(in srgb, #f3f0ea 92%, transparent);
  backdrop-filter: blur(10px);
}

/* 学员/管理顶栏导航 */
.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  align-items: center;
  padding: .65rem 0 .75rem;
  margin-bottom: .35rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, #f7f4ef 90%, transparent);
  backdrop-filter: blur(8px);
}
.portal-nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.05em;
  padding: .45rem .75rem;
  border-radius: 4px;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
}
.portal-nav a:hover {
  background: var(--sky);
  text-decoration: none;
}
.portal-nav a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.portal-nav--manage a.active { background: #1a3d36; }
.portal-learn .panel h2,
.portal-learn .panel h3,
.portal-manage .panel h2,
.portal-manage .panel h3 { font-size: 1.45em; }
.portal-learn .stat .n,
.portal-manage .stat .n { font-size: 1.75rem; }
.portal-learn .stat .l,
.portal-manage .stat .l { font-size: .95rem; }
.portal-learn table.data,
.portal-manage table.data { font-size: 1.02em; }
.portal-learn .btn,
.portal-manage .btn {
  font-size: 1.05em;
  padding: .55rem 1.05rem;
}

.layout-side {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: .85rem;
  margin-top: .75rem;
  align-items: start;
}
@media (max-width: 860px) {
  .layout-side { grid-template-columns: 1fr; }
}
.side-nav {
  position: sticky;
  top: .5rem;
  padding: .55rem !important;
}
.side-nav a {
  display: block;
  padding: .4rem .55rem;
  color: var(--ink);
  border-left: 3px solid transparent;
  white-space: nowrap;
  font-size: .92rem;
}
.side-nav a:hover, .side-nav a.active {
  background: var(--sky);
  border-left-color: var(--accent);
  text-decoration: none;
}

/* 双栏紧凑内容区 */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
.nowrap { white-space: nowrap; }
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .35rem 0 .15rem;
}
.page-title h2 {
  margin: 0;
  font-family: var(--font-display);
  white-space: nowrap;
}
.inline-actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }

/* 首页端口下方登录状态提示 */
.portal-status {
  width: min(720px, 100%);
  margin: 1.1rem auto 0;
  text-align: center;
  padding: .85rem 1.1rem;
  border: 1px solid rgba(15, 92, 76, 0.28);
  border-radius: 12px;
  background: rgba(232, 246, 242, 0.92);
  box-shadow: 0 8px 24px rgba(12, 40, 48, 0.08);
}
.portal-status__text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 600;
}
.portal-status__text + .portal-status__text {
  margin-top: .45rem;
}
.portal-status a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ========== 手机端布局整理 ========== */
@media (max-width: 760px) {
  :root {
    --edge: 14px;
  }

  body.page-body {
    font-size: 15px;
  }
  body.portal-learn,
  body.portal-manage {
    font-size: 16px;
  }

  .page-content {
    padding-bottom: 4.5rem;
  }

  /* 顶栏：上下分区，避免横向撑破 */
  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: .55rem;
    padding: .65rem 0 .7rem;
  }
  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
  }
  .brand strong {
    white-space: normal;
    font-size: 1.02rem;
    line-height: 1.35;
  }
  .brand span {
    white-space: normal;
    font-size: .78rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .nav {
    flex-wrap: wrap;
    gap: .45rem .7rem;
    white-space: normal;
    font-size: .92rem;
  }
  .nav .muted {
    width: 100%;
    font-size: .85rem;
  }

  /* 首页英雄区 */
  .hero-home,
  .hero-home--centered {
    min-height: auto;
    gap: 1.35rem;
    padding: 1.1rem 0 1.75rem;
    align-content: start;
  }
  .hero-copy--center {
    margin-bottom: .35rem;
    gap: .55rem;
  }
  .hero-eyebrow {
    font-size: .68rem;
    letter-spacing: .12em;
    line-height: 1.4;
    padding: 0 .25rem;
  }
  .hero-title,
  .hero-home h1.hero-title,
  .hero-home .hero-title {
    font-size: clamp(1.45rem, 7.2vw, 1.95rem) !important;
    white-space: normal !important;
    letter-spacing: .04em;
    line-height: 1.3 !important;
    padding: 0 .15rem;
  }
  .portal-grid,
  .portal-grid--center {
    width: 100%;
    grid-template-columns: 1fr;
    gap: .85rem;
    margin-top: .35rem;
  }
  .portal-card {
    min-height: 0;
    padding: 1.25rem 1rem;
    gap: .85rem;
  }
  .portal-card:hover {
    transform: none;
  }
  .portal-card h2 {
    font-size: clamp(1.35rem, 5.8vw, 1.65rem) !important;
    white-space: normal !important;
    line-height: 1.3;
  }
  .portal-grid--center .btn {
    width: 100%;
    max-width: 280px;
    font-size: 1.05rem !important;
    padding: .7rem 1.1rem;
  }
  .portal-status {
    width: 100%;
    margin-top: .95rem;
    padding: .75rem .85rem;
  }
  .portal-status__text {
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.55;
  }

  /* 学员/管理导航：横向滑动，不挤成一坨 */
  .portal-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: .3rem;
    padding: .55rem 0 .65rem;
    margin: 0 calc(var(--edge) * -1) .45rem;
    padding-left: var(--edge);
    padding-right: var(--edge);
  }
  .portal-nav a {
    flex: 0 0 auto;
    font-size: .9rem;
    padding: .4rem .65rem;
  }

  /* 面板与标题 */
  .panel {
    padding: .75rem .8rem;
    margin: .55rem 0;
  }
  .panel h2,
  .panel h3,
  .page-title h2 {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.35;
    font-size: 1.2rem;
  }
  .portal-learn .panel h2,
  .portal-learn .panel h3,
  .portal-manage .panel h2,
  .portal-manage .panel h3 {
    font-size: 1.2rem;
  }
  .page-title {
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
  }
  .inline-actions {
    flex-wrap: wrap;
    width: 100%;
  }
  .inline-actions .btn {
    flex: 1 1 auto;
  }

  /* 数据卡与表格 */
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
  }
  .stat {
    padding: .55rem .6rem;
  }
  .stat .n {
    font-size: 1.25rem;
  }
  .portal-learn .stat .n,
  .portal-manage .stat .n {
    font-size: 1.35rem;
  }
  .stat .l {
    white-space: normal;
    font-size: .78rem;
    line-height: 1.3;
  }
  .panel:has(table.data) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.data {
    min-width: 480px;
    font-size: .88rem;
  }

  /* 表单与刷题 */
  .form-grid {
    grid-template-columns: 1fr;
    gap: .55rem;
  }
  .auth-center {
    min-height: auto;
    padding: .85rem 0 1.5rem;
    align-items: flex-start;
  }
  .auth-card h2,
  .demo-accounts h3 {
    white-space: normal;
    font-size: 1.25rem;
    line-height: 1.35;
  }
  .q-block {
    gap: .45rem;
    padding: .7rem 0;
  }
  .choice {
    gap: .55rem;
    padding: .35rem .15rem;
    min-height: 2.5rem;
    font-size: .95rem;
  }
  .choice input {
    margin-top: .25rem;
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
  }

  /* 底栏：允许换行，避免遮挡 */
  .footer,
  .footer--fixed {
    white-space: normal;
    line-height: 1.4;
    font-size: .75rem;
    padding: .55rem var(--edge) .65rem;
    text-align: center;
  }

  /* 背景在小屏弱化，减少干扰与性能压力 */
  .bg-med-cross,
  .bg-ecg-line {
    opacity: .06;
  }
  .bg-orb {
    opacity: .28;
    filter: blur(28px);
  }
}

@media (max-width: 420px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .hero-title,
  .hero-home h1.hero-title,
  .hero-home .hero-title {
    font-size: 1.38rem !important;
  }
  .portal-card h2 {
    font-size: 1.28rem !important;
  }
  .nav a {
    font-size: .88rem;
  }
}
