:root {
  --site-bg: #f6f8fc;
  --site-bg-strong: #eef2f8;
  --surface: #ffffff;
  --surface-soft: #f2f5fb;
  --text-main: #213a73;
  --text-soft: #5d719b;
  --text-muted: #8b9ab8;
  --border-soft: #d9e1f0;
  --accent-red: #cc2434;
  --accent-red-soft: #fdf1f2;
  --navy-deep: #223a74;
  --shadow-soft: 0 10px 28px rgba(34, 58, 116, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  /* 可主题化背景变量 */
  --portal-bg:         linear-gradient(180deg, #fafcff 0%, var(--site-bg) 100%);
  --portal-header-bg:  rgba(255, 255, 255, 0.92);
  --portal-side-bg:    linear-gradient(180deg, rgba(255,255,255,0.44), rgba(255,255,255,0.22));
  --portal-card-bg:    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.90));
  --portal-icon-bg:    linear-gradient(180deg, #f8faff, #eef3fb);
  --portal-tag-bg:     #f1f5fb;
  --portal-note-bg:    linear-gradient(180deg, #f6f8fd, #f1f4fa);
  --portal-btn-sec-bg: rgba(255, 255, 255, 0.92);
}

body {
  background: var(--portal-bg);
  color: var(--text-main);
}

.cover {
  background: var(--portal-bg) !important;
}

.cover::before,
.app-nav,
.cover-main > p:last-child {
  display: none !important;
}

body.is-home-cover aside.sidebar,
body.is-home-cover .sidebar-toggle,
body.is-home-cover .close-btn,
body.is-home-cover aside.toc-nav {
  display: none !important;
}

body.is-home-cover section.content {
  left: 0 !important;
  right: 0 !important;
  padding-left: 0 !important;
}

body.is-home-cover .markdown-section {
  max-width: none;
  padding: 0 !important;
}

.cover-main {
  margin: 0 auto !important;
  max-width: none !important;
  min-height: 100vh;
  padding: 0 !important;
  text-align: left !important;
  width: 100%;
}

.portal-shell {
  min-height: 100vh;
  text-align: left;
}

.portal-header {
  align-items: center;
  background: var(--portal-header-bg);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  min-height: 80px;
  padding: 16px 32px;
}

.portal-brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.portal-brand strong {
  color: var(--navy-deep);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.portal-brand__logo,
.portal-emblem {
  background: var(--accent-red);
  transform: rotate(45deg);
}

.portal-brand__logo {
  border-radius: 9px;
  display: inline-block;
  height: 26px;
  width: 26px;
}

.portal-brand__version {
  background: var(--accent-red-soft);
  border: 1px solid rgba(204, 36, 52, 0.28);
  border-radius: 8px;
  color: var(--accent-red);
  font-size: 0.82rem;
  line-height: 1;
  padding: 7px 10px 6px;
}

.portal-header__nav {
  display: flex;
  gap: 12px;
}

.portal-header__nav a,
.module-card a,
.markdown-section a,
.sidebar ul li a {
  color: var(--text-soft);
  text-decoration: none !important;
}

.portal-header__nav a {
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  padding: 10px 14px;
}

.portal-header__nav a:hover,
.module-card a:hover,
.markdown-section a:hover,
.sidebar ul li a:hover {
  color: var(--navy-deep);
}

.portal-header__nav a:hover {
  background: rgba(34, 58, 116, 0.05);
}

.portal-main {
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  padding: 24px 32px 24px;
}

.portal-hero {
  align-self: start;
  max-width: 940px;
  padding: 20px 12px 0 12px;
}

.portal-kicker {
  align-items: center;
  color: var(--accent-red);
  display: inline-flex;
  font-size: 0.98rem;
  font-weight: 700;
  gap: 12px;
  letter-spacing: 0.02em;
  margin: 0 0 32px;
}

.portal-kicker__line {
  background: var(--accent-red);
  display: inline-block;
  height: 2px;
  width: 40px;
}

.portal-hero__heading {
  align-items: center;
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.portal-emblem {
  border-radius: 20px;
  box-shadow: 12px 12px 0 rgba(204, 36, 52, 0.1);
  flex: 0 0 58px;
  height: 58px;
  margin: 0 0 0 12px;
  width: 58px;
}

.portal-hero h1 {
  color: var(--navy-deep);
  font-size: clamp(3rem, 4.9vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin: 0;
  transform: translateY(20px);
}

.portal-summary {
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.72;
  margin: 0;
  max-width: 39rem;
}

.portal-metrics {
  border-bottom: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
  padding: 16px 0;
}

.portal-metric {
  text-align: left;
}

.portal-metric strong {
  color: var(--navy-deep);
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.portal-metric span {
  color: var(--text-soft);
  display: block;
  font-size: 0.94rem;
  margin-top: 8px;
}

.portal-actions {
  display: flex;
  gap: 18px;
  margin-top: 24px;
}

.portal-btn {
  align-items: center;
  border-radius: 14px;
  display: inline-flex;
  font-size: 0.98rem;
  font-weight: 700;
  height: 56px;
  justify-content: center;
  line-height: 1;
  min-width: 154px;
  padding: 0 24px;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
}

.portal-btn--primary {
  background: var(--navy-deep);
  box-shadow: 0 8px 20px rgba(34, 58, 116, 0.14);
  color: #fff !important;
}

.portal-btn--primary::after {
  content: none;
}

.portal-btn--secondary {
  background: var(--portal-btn-sec-bg);
  border: 1px solid var(--border-soft);
  color: var(--navy-deep) !important;
}

.portal-side {
  align-self: start;
  background: var(--portal-side-bg);
  border: 1px solid rgba(217, 225, 240, 0.55);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 18px 16px 14px;
}

.portal-side__label {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  text-align: left;
}

.module-card {
  align-items: flex-start;
  background: var(--portal-card-bg);
  border: 1px solid rgba(210, 220, 238, 0.92);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(34, 58, 116, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: flex;
  gap: 16px;
  min-height: 118px;
  padding: 14px 16px 13px;
  text-align: left;
}

.module-card + .module-card,
.module-card + .portal-note {
  margin-top: 10px;
}

.module-card__icon {
  align-items: center;
  background: var(--portal-icon-bg);
  border: 1px solid rgba(222, 230, 244, 0.9);
  border-radius: 12px;
  display: inline-flex;
  flex: 0 0 44px;
  height: 44px;
  justify-content: center;
  margin-top: 1px;
  width: 44px;
}

.module-card__icon svg {
  fill: none;
  height: 21px;
  stroke: var(--navy-deep);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 21px;
}

.module-card__body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.module-card__head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.module-card__head h3 {
  color: var(--navy-deep);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.module-card__tag {
  background: var(--portal-tag-bg);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1;
  padding: 4px 7px 3px;
  transform: translateY(-1px);
}

.module-card ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding-left: 0;
  text-align: left;
}

.module-card li {
  margin: 0;
}

.module-card a {
  align-items: center;
  border-radius: 10px;
  color: #5b6f9b;
  display: inline-flex;
  font-size: 0.98rem;
  gap: 10px;
  line-height: 1.42;
  padding: 4px 8px 4px 0;
  position: relative;
}

.module-card a:hover {
  color: var(--accent-red);
  transform: translateX(2px);
}

.module-card a::before {
  background: var(--accent-red);
  border-radius: 999px;
  content: "";
  display: inline-block;
  flex: 0 0 5px;
  height: 5px;
  width: 5px;
}

.module-card a::after {
  color: rgba(91, 111, 155, 0.5);
  content: none;
  font-size: 1rem;
  margin-left: auto;
  transition: color 0.2s ease, transform 0.2s ease;
}

.module-card a:hover::after {
  color: var(--accent-red);
  transform: translateX(2px);
}

.portal-note {
  align-items: flex-start;
  background: var(--portal-note-bg);
  border: 1px solid #d4dceb;
  border-radius: 16px;
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding: 14px 14px 13px;
  text-align: left;
}

.portal-note__bar {
  background: var(--accent-red);
  border-radius: 999px;
  flex: 0 0 4px;
  height: 38px;
  margin-top: 2px;
}

.portal-note h4 {
  color: var(--navy-deep);
  font-size: 1rem;
  margin: 0 0 4px;
}

.portal-note p {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.portal-footer {
  align-items: center;
  border-top: 1px solid var(--border-soft);
  color: var(--text-soft);
  display: flex;
  font-size: 0.86rem;
  justify-content: space-between;
  padding: 12px 32px;
}

.sidebar,
.markdown-section {
  background: transparent;
}

.markdown-section {
  max-width: 920px;
}

@media (max-width: 1080px) {
  .portal-main {
    grid-template-columns: 1fr;
    padding: 40px 24px 36px;
  }

  .portal-hero,
  .portal-side {
    padding-top: 0;
  }
}

@media (max-width: 720px) {
  .portal-header,
  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 18px 16px;
  }

  .portal-header__nav {
    flex-wrap: wrap;
    gap: 16px 20px;
  }

  .portal-header__nav a {
    padding: 0;
  }

  .portal-main {
    gap: 32px;
    padding: 28px 16px 32px;
  }

  .portal-kicker {
    margin-bottom: 32px;
  }

  .portal-hero__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px;
  }

  .portal-emblem {
    flex-basis: 44px;
    height: 44px;
    margin: 0;
    width: 44px;
  }

  .portal-hero h1 {
    font-size: clamp(2.5rem, 14vw, 3.4rem);
  }

  .portal-summary {
    font-size: 1rem;
  }

  .portal-metrics {
    gap: 20px;
    grid-template-columns: 1fr;
  }

  .portal-actions {
    flex-direction: column;
  }

  .portal-btn {
    width: 100%;
  }

  .module-card {
    padding: 20px 18px;
  }

  .portal-note {
    padding: 18px 16px;
  }
}

/* ── 封面页深色模式 ──────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) {
    --site-bg:           #0d1117;
    --site-bg-strong:    #161b22;
    --surface:           #1c2128;
    --surface-soft:      #161b22;
    --text-main:         #c9d1d9;
    --text-soft:         #8b949e;
    --text-muted:        #6e7681;
    --border-soft:       #30363d;
    --navy-deep:         #7ba7e0;
    --accent-red-soft:   #2d1519;
    --shadow-soft:       0 10px 28px rgba(0, 0, 0, 0.5);
    --portal-bg:         #0d1117;
    --portal-header-bg:  rgba(13, 17, 23, 0.95);
    --portal-side-bg:    linear-gradient(180deg, rgba(28,33,40,0.8), rgba(22,27,34,0.6));
    --portal-card-bg:    linear-gradient(180deg, rgba(28,33,40,0.96), rgba(22,27,34,0.92));
    --portal-icon-bg:    linear-gradient(180deg, #1c2128, #161b22);
    --portal-tag-bg:     #1c2128;
    --portal-note-bg:    linear-gradient(180deg, #1c2128, #161b22);
    --portal-btn-sec-bg: rgba(28, 33, 40, 0.9);
  }
  html:not([data-theme='light']) body,
  html:not([data-theme='light']) .cover   { background: #0d1117 !important; }
  html:not([data-theme='light']) .portal-shell  { background: #0d1117; }
  html:not([data-theme='light']) .portal-header { background: rgba(13,17,23,0.95) !important; border-bottom-color: #30363d !important; }
  html:not([data-theme='light']) .portal-side   { background: rgba(28,33,40,0.7) !important; border-color: #30363d !important; box-shadow: none !important; }
  html:not([data-theme='light']) .module-card   { background: #1c2128 !important; border-color: #30363d !important; box-shadow: none !important; }
  html:not([data-theme='light']) .module-card__icon { background: #161b22 !important; border-color: #30363d !important; }
  html:not([data-theme='light']) .module-card__tag  { background: #0d1117 !important; color: #8b949e !important; }
  html:not([data-theme='light']) .portal-note   { background: #161b22 !important; border-color: #30363d !important; }
  html:not([data-theme='light']) .portal-footer { background: #0d1117 !important; border-top-color: #30363d !important; }
  html:not([data-theme='light']) .portal-btn--secondary { background: #1c2128 !important; border-color: #30363d !important; color: #c9d1d9 !important; }
  html:not([data-theme='light']) .portal-metrics { border-color: #30363d !important; }
}

html[data-theme='dark'] {
  --site-bg:           #0d1117;
  --site-bg-strong:    #161b22;
  --surface:           #1c2128;
  --surface-soft:      #161b22;
  --text-main:         #c9d1d9;
  --text-soft:         #8b949e;
  --text-muted:        #6e7681;
  --border-soft:       #30363d;
  --navy-deep:         #7ba7e0;
  --accent-red-soft:   #2d1519;
  --shadow-soft:       0 10px 28px rgba(0, 0, 0, 0.5);
  --portal-bg:         #0d1117;
  --portal-header-bg:  rgba(13, 17, 23, 0.95);
  --portal-side-bg:    linear-gradient(180deg, rgba(28,33,40,0.8), rgba(22,27,34,0.6));
  --portal-card-bg:    linear-gradient(180deg, rgba(28,33,40,0.96), rgba(22,27,34,0.92));
  --portal-icon-bg:    linear-gradient(180deg, #1c2128, #161b22);
  --portal-tag-bg:     #1c2128;
  --portal-note-bg:    linear-gradient(180deg, #1c2128, #161b22);
  --portal-btn-sec-bg: rgba(28, 33, 40, 0.9);
}
html[data-theme='dark'] body,
html[data-theme='dark'] .cover   { background: #0d1117 !important; }
html[data-theme='dark'] .portal-shell  { background: #0d1117; }
html[data-theme='dark'] .portal-header { background: rgba(13,17,23,0.95) !important; border-bottom-color: #30363d !important; }
html[data-theme='dark'] .portal-side   { background: rgba(28,33,40,0.7) !important; border-color: #30363d !important; box-shadow: none !important; }
html[data-theme='dark'] .module-card   { background: #1c2128 !important; border-color: #30363d !important; box-shadow: none !important; }
html[data-theme='dark'] .module-card__icon { background: #161b22 !important; border-color: #30363d !important; }
html[data-theme='dark'] .module-card__tag  { background: #0d1117 !important; color: #8b949e !important; }
html[data-theme='dark'] .portal-note   { background: #161b22 !important; border-color: #30363d !important; }
html[data-theme='dark'] .portal-footer { background: #0d1117 !important; border-top-color: #30363d !important; }
html[data-theme='dark'] .portal-btn--secondary { background: #1c2128 !important; border-color: #30363d !important; color: #c9d1d9 !important; }
html[data-theme='dark'] .portal-metrics { border-color: #30363d !important; }
