/* =============================================
   星空体育全站 Shared CSS /assets/site.css
   设计语言：星际竞技场
   深空蓝 × 星芒银 × 活力橙
   ============================================= */

/* ---------- Reset & Variables ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --color-space: #0B1026;
  --color-silver: #C0C8D8;
  --color-orange: #FF6B35;
  --color-teal: #0F4C5C;
  --color-wine: #6B2A3A;
  --color-indigo: #3B2E6E;
  --color-white: #F0F4F8;
  --color-dark: #1A1D29;

  --font-heading: 'Impact', 'Arial Black', 'PingFang SC', sans-serif;
  --font-body: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;

  --content-w: 1120px;
  --radius: 6px;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.45);
  --border-soft: 1px solid rgba(192, 200, 216, 0.18);
  --grad-signal: linear-gradient(90deg, transparent, var(--color-teal) 18%, var(--color-orange) 55%, var(--color-indigo) 85%, transparent);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--color-silver);
  background-color: var(--color-space);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--color-white);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.125rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }

p { margin-top: 0; }

a {
  color: var(--color-silver);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-orange);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: var(--color-orange);
  color: var(--color-space);
}

:focus-visible {
  outline: 3px solid var(--color-orange);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(var(--content-w), 92%);
  margin-inline: auto;
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 1rem;
  z-index: 1000;
  display: inline-block;
  padding: 0.7rem 1.1rem;
  background: var(--color-orange);
  color: var(--color-space);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 0 0 var(--radius) var(--radius);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--color-space);
  outline: 2px solid var(--color-white);
}

/* ---------- Scroll Progress ---------- */
.page-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  pointer-events: none;
  z-index: 10;
  background: transparent;
}

.page-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-teal), var(--color-orange));
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.7);
  transition: width 0.05s linear;
}

/* ---------- Back Top ---------- */
.back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--color-white);
  background: var(--color-teal);
  border: 1px solid rgba(192, 200, 216, 0.35);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
}

.back-top:hover {
  background: var(--color-orange);
  color: var(--color-space);
}

.back-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 16, 38, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(192, 200, 216, 0.14);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header[data-scrolled] {
  background: rgba(11, 16, 38, 0.97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.site-header[data-scrolled] .masthead {
  padding-block: 0.625rem;
}

.site-header[data-scrolled] .brand-sub {
  display: none;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  transition: padding 0.3s ease;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-white);
  min-width: 0;
}

.brand:hover {
  color: var(--color-white);
}

.brand-star {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border: 2px solid var(--color-orange);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, var(--color-indigo), var(--color-space) 72%);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.35), inset 0 0 10px rgba(240, 244, 248, 0.08);
}

.brand-star-dot {
  display: block;
  width: 14px;
  height: 14px;
  background: var(--color-white);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-white);
  white-space: nowrap;
}

.brand-name-accent {
  color: var(--color-orange);
}

.brand-sub {
  margin-top: 0.2em;
  font-size: 0.656rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-silver);
}

/* Masthead Tools */
.masthead-tools {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  border: 1px solid rgba(192, 200, 216, 0.28);
  border-radius: 999px;
  background: rgba(15, 76, 92, 0.28);
  color: var(--color-silver);
  font-size: 0.75rem;
  white-space: nowrap;
}

.version-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-orange);
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.85);
}

.login-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.2rem;
  color: var(--color-white);
  font-size: 0.875rem;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.login-link:hover {
  color: var(--color-orange);
  border-color: var(--color-orange);
}

.login-arrow {
  font-size: 0.8125rem;
  transition: transform 0.2s ease;
}

.login-link:hover .login-arrow {
  transform: translateX(2px);
}

/* Nav Orbit */
.nav-orbit {
  position: relative;
  border-top: 1px solid rgba(192, 200, 216, 0.1);
  background-image:
    radial-gradient(1px 1px at 12% 38%, rgba(240, 244, 248, 0.30) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 28% 18%, rgba(240, 244, 248, 0.48) 50%, transparent 51%),
    radial-gradient(1px 1px at 42% 62%, rgba(240, 244, 248, 0.28) 50%, transparent 51%),
    radial-gradient(1px 1px at 56% 26%, rgba(240, 244, 248, 0.36) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 71% 58%, rgba(240, 244, 248, 0.42) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 34%, rgba(240, 244, 248, 0.30) 50%, transparent 51%);
}

.nav-orbit::before {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 2px;
  background: var(--grad-signal);
  opacity: 0.75;
  pointer-events: none;
}

.star-nav {
  position: relative;
  width: min(var(--content-w), 92%);
  margin-inline: auto;
}

.nav-list {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  position: relative;
  margin: 0;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(192, 200, 216, 0.55);
  transform: translateX(-50%);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.nav-item:hover::before,
.nav-item:focus-within::before {
  background: var(--color-orange);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.9);
}

.nav-item a {
  position: relative;
  display: block;
  padding: 0.9rem 1.05rem 0.8rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-silver);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-item a::after {
  content: '';
  position: absolute;
  left: 1.05rem;
  right: 1.05rem;
  bottom: 0.3rem;
  height: 2px;
  background: var(--color-orange);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav-item a:hover,
.nav-item a:focus-visible {
  color: var(--color-white);
}

.nav-item a:hover::after,
.nav-item a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-item a[aria-current="page"] {
  color: var(--color-white);
  text-shadow: 0 0 16px rgba(255, 107, 53, 0.4);
}

.nav-item a:focus-visible {
  outline-offset: -4px;
}

/* Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 40px;
  padding: 8px;
  margin: 0;
  background: transparent;
  border: 1px solid rgba(192, 200, 216, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--color-orange);
}

.nav-toggle:hover .nav-toggle-bar {
  background: var(--color-orange);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-white);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.nav-toggle[aria-expanded="true"] > .nav-toggle-bar:nth-child(2) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] > .nav-toggle-bar:nth-child(3) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] > .nav-toggle-bar:nth-child(4) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 4rem;
  background: var(--color-dark);
  color: var(--color-silver);
  border-top: 1px solid rgba(192, 200, 216, 0.12);
}

.footer-rail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-signal);
  opacity: 0.8;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1fr;
  gap: 2.5rem;
  padding-block: 3rem 2rem;
}

.brand-footer {
  margin-bottom: 0.875rem;
}

.footer-tagline {
  max-width: 48ch;
  font-size: 0.9375rem;
  color: var(--color-white);
  margin-bottom: 0.875rem;
}

.footer-trust {
  max-width: 52ch;
  margin: 0;
  padding-left: 0.875rem;
  border-left: 2px solid var(--color-orange);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: rgba(192, 200, 216, 0.7);
}

.footer-title {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-orange);
}

.footer-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-menu li {
  margin-bottom: 0.5rem;
}

.footer-menu a {
  font-size: 0.9375rem;
  color: var(--color-silver);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-menu a:hover {
  color: var(--color-orange);
  padding-left: 0.25rem;
}

.footer-contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.9;
}

.contact-label {
  display: inline-block;
  min-width: 2.2em;
  font-weight: 700;
  color: var(--color-orange);
}

.footer-bottom {
  border-top: 1px solid rgba(192, 200, 216, 0.1);
  background: rgba(11, 16, 38, 0.35);
  padding-block: 1rem;
}

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.footer-copy,
.footer-icp {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(192, 200, 216, 0.75);
}

.footer-icp {
  letter-spacing: 0.08em;
  color: rgba(192, 200, 216, 0.55);
}

/* ---------- Common Components ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-orange);
  color: var(--color-space);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
  background: #ff8348;
  color: var(--color-space);
  box-shadow: 0 10px 28px rgba(255, 107, 53, 0.5);
}

.btn-outline {
  border-color: var(--color-silver);
  color: var(--color-silver);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--color-orange);
  color: var(--color-orange);
}

.btn-ghost {
  border-color: transparent;
  color: var(--color-orange);
  background: transparent;
  padding-inline: 0.5rem;
}

.btn-ghost:hover {
  color: var(--color-white);
}

/* Chapter */
.chapter {
  position: relative;
  padding-block: 4rem;
}

.chapter-head {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.chapter-num {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 4.25rem;
  font-weight: 700;
  line-height: 0.9;
  color: var(--color-orange);
  opacity: 0.72;
}

@supports (-webkit-text-stroke: 2px black) {
  .chapter-num {
    color: transparent;
    -webkit-text-stroke: 2px var(--color-orange);
    opacity: 1;
  }
}

.chapter-title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.chapter-sub {
  margin: 0;
  color: rgba(192, 200, 216, 0.7);
  font-size: 0.9375rem;
}

/* Section Head */
.section-head {
  margin-bottom: 1.75rem;
}

.section-title {
  margin-bottom: 0.5rem;
}

.section-sub {
  max-width: 60ch;
  color: rgba(192, 200, 216, 0.7);
  font-size: 0.9375rem;
}

/* Cards */
.panel-card {
  padding: 1.5rem;
  background: var(--color-teal);
  border: 1px solid rgba(192, 200, 216, 0.22);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 53, 0.55);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55);
}

.data-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--color-indigo), var(--color-space) 80%);
  border: 1px solid rgba(192, 200, 216, 0.2);
  border-radius: 8px;
}

.data-card::after {
  content: '';
  position: absolute;
  right: -24px;
  top: -24px;
  width: 72px;
  height: 72px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.2), transparent 70%);
  pointer-events: none;
}

.data-card-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-silver);
  opacity: 0.85;
}

.data-card-value {
  margin-top: 0.4rem;
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1;
  color: var(--color-orange);
}

/* Media Frame */
.media-frame {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  background-color: var(--color-indigo);
  background-image:
    linear-gradient(rgba(192, 200, 216, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 200, 216, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid rgba(192, 200, 216, 0.22);
  border-radius: 8px;
}

.media-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 28%, rgba(255, 107, 53, 0.14), transparent 62%);
  pointer-events: none;
}

.media-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame-tag {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.35rem 0.8rem;
  background: var(--color-orange);
  color: var(--color-space);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 1.25rem 0 0;
  list-style: none;
  font-size: 0.875rem;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.breadcrumb li + li::before {
  content: '/';
  color: rgba(192, 200, 216, 0.4);
}

.breadcrumb a {
  color: var(--color-silver);
}

.breadcrumb a:hover {
  color: var(--color-orange);
}

.breadcrumb [aria-current="page"] {
  color: var(--color-orange);
  font-weight: 700;
}

/* Starfield */
.starfield {
  position: relative;
  overflow: hidden;
  background-color: var(--color-space);
  background-image:
    radial-gradient(1px 1px at 7% 18%, rgba(240, 244, 248, 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 21% 64%, rgba(240, 244, 248, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 30%, rgba(240, 244, 248, 0.42) 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 80%, rgba(240, 244, 248, 0.26) 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 44%, rgba(240, 244, 248, 0.46) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 70% 14%, rgba(240, 244, 248, 0.32) 50%, transparent 51%),
    radial-gradient(1px 1px at 83% 58%, rgba(240, 244, 248, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 24%, rgba(240, 244, 248, 0.36) 50%, transparent 51%);
}

/* Slab */
.slab {
  position: relative;
  padding-block: 4.5rem;
  overflow: hidden;
}

.slab-teal {
  background: var(--color-teal);
}

.slab-wine {
  background: var(--color-wine);
}

.slab-indigo {
  background: var(--color-indigo);
}

.slab-cut::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 28px;
  background: var(--color-space);
  clip-path: polygon(0 0, 60% 100%, 100% 0);
}

/* Note Block */
.note-block {
  padding: 1rem 1.25rem;
  background: rgba(15, 76, 92, 0.3);
  border-left: 4px solid var(--color-orange);
  border-radius: 0 6px 6px 0;
  font-size: 0.9375rem;
  line-height: 1.8;
}

.note-block-warn {
  background: rgba(107, 42, 58, 0.32);
  border-left-color: var(--color-wine);
}

/* Index List */
.list-index {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: listIndex;
}

.list-index li {
  position: relative;
  counter-increment: listIndex;
  padding-left: 3rem;
  margin-bottom: 0.75rem;
}

.list-index li::before {
  content: counter(listIndex, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15rem;
  padding: 0.15rem 0.4rem;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  line-height: 1;
  color: var(--color-orange);
  border: 1px solid rgba(255, 107, 53, 0.55);
  border-radius: 4px;
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.8125rem;
  color: rgba(192, 200, 216, 0.8);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-orange);
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Inner Page Head */
.page-head {
  padding: 3rem 0 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(192, 200, 216, 0.12);
}

.page-title {
  margin-bottom: 0.5rem;
}

.page-desc {
  max-width: 62ch;
  margin: 0;
  color: rgba(192, 200, 216, 0.75);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .masthead {
    padding-block: 0.75rem;
  }

  .brand-star {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 1.375rem;
  }

  .brand-sub {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-orbit {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 4%;
    border-top: none;
  }

  .star-nav {
    position: absolute;
    top: calc(100% + 2px);
    left: 4%;
    right: 4%;
    width: auto;
    z-index: 50;
    background: rgba(11, 16, 38, 0.98);
    border: 1px solid rgba(192, 200, 216, 0.2);
    border-radius: 8px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease, visibility 0.3s ease;
  }

  .star-nav[data-open] {
    max-height: 72vh;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0.35rem;
  }

  .nav-item::before {
    display: none;
  }

  .nav-item a {
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(192, 200, 216, 0.08);
  }

  .nav-item a::after {
    display: none;
  }

  .nav-item a:hover {
    background: rgba(15, 76, 92, 0.25);
  }

  .nav-item a[aria-current="page"] {
    background: rgba(15, 76, 92, 0.35);
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: auto;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .chapter {
    padding-block: 3rem;
  }

  .chapter-num {
    font-size: 3.25rem;
  }
}

@media (max-width: 420px) {
  .brand-star {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 1.125rem;
  }

  .version-text {
    font-size: 0.6875rem;
  }

  .login-link {
    font-size: 0.8125rem;
  }

  .back-top {
    width: 40px;
    height: 40px;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
