:root {
  --paper: #05070d;
  --paper-2: #0b0f18;
  --surface: rgba(16, 21, 34, 0.78);
  --surface-strong: rgba(22, 29, 46, 0.96);
  --surface-hot: rgba(31, 40, 64, 0.9);
  --ink: #f5f8ff;
  --muted: #a6b0c3;
  --soft: #dce5f7;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --accent: #42f5c8;
  --acid: #d7ff5a;
  --blue: #72a7ff;
  --gold: #ffb45e;
  --rose: #ff6f9d;
  --violet: #a98bff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  --glow: 0 0 38px rgba(66, 245, 200, 0.18);
  --radius: 8px;
  --chart-bg: rgba(9, 13, 22, 0.95);
  --chart-grid: rgba(255, 255, 255, 0.11);
  --chart-axis: rgba(255, 255, 255, 0.22);
  --chart-line: #42f5c8;
  --chart-line-2: #ffb45e;
  --chart-text: #edf4ff;
  --chart-muted: #95a2b8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(66, 245, 200, 0.12), transparent 30%),
    linear-gradient(250deg, rgba(255, 111, 157, 0.11), transparent 34%),
    linear-gradient(180deg, var(--paper), var(--paper-2) 54%, #05060b);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(135deg, transparent 0 47%, rgba(66, 245, 200, 0.07) 48% 52%, transparent 53% 100%);
  background-size: 56px 56px, 56px 56px, 220px 220px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.16));
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 7px
    );
  opacity: 0.26;
}

button,
input,
select {
  font: inherit;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(16px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 13, 0.78);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(24px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 186px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(66, 245, 200, 0.65);
  border-radius: 8px;
  color: var(--paper);
  background:
    linear-gradient(135deg, var(--accent), var(--acid));
  box-shadow:
    0 0 28px rgba(66, 245, 200, 0.42),
    inset 0 0 18px rgba(255, 255, 255, 0.2);
  font-weight: 900;
}

.brand-mark::after {
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(66, 245, 200, 0.14);
  border-radius: 12px;
  content: "";
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease;
}

.nav-link:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  transform: translateY(-1px);
}

.nav-link.active {
  border-color: rgba(66, 245, 200, 0.54);
  color: var(--paper);
  background:
    linear-gradient(135deg, var(--accent), var(--acid));
  box-shadow: 0 0 28px rgba(66, 245, 200, 0.24);
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 480ms ease both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding: 18px 0 8px;
}

.section-head::before {
  position: absolute;
  left: 0;
  bottom: -8px;
  width: min(520px, 72vw);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--rose), transparent);
}

.eyebrow,
.card-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 0;
  background: linear-gradient(100deg, #ffffff 0%, #d8ffe9 34%, #8eb8ff 66%, #ffb7cf 100%);
  background-clip: text;
  color: transparent;
  font-size: clamp(2.25rem, 6.8vw, 5.3rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.2vw, 1.95rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  color: var(--muted);
}

.exam-chip {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  min-width: 138px;
  padding: 15px 17px;
  overflow: hidden;
  border: 1px solid rgba(255, 180, 94, 0.38);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 180, 94, 0.18), rgba(255, 111, 157, 0.1)),
    rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow), 0 0 34px rgba(255, 180, 94, 0.12);
}

.exam-chip::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: translateX(-120%);
  animation: sweep 4.2s ease-in-out infinite;
}

@keyframes sweep {
  0%,
  46% {
    transform: translateX(-120%);
  }
  72%,
  100% {
    transform: translateX(120%);
  }
}

.exam-chip span {
  position: relative;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.exam-chip strong {
  position: relative;
  font-size: 1.55rem;
}

.overview-grid,
.rank-layout,
.analysis-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.analysis-layout,
.rank-layout {
  grid-template-columns: 1.45fr 0.8fr;
  align-items: stretch;
}

.summary-card {
  position: relative;
  min-width: 0;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(130%);
  transition:
    transform 190ms ease,
    border-color 190ms ease,
    box-shadow 190ms ease;
}

.summary-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--rose));
  opacity: 0.72;
}

.summary-card::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 120px;
  height: 120px;
  content: "";
  background:
    linear-gradient(135deg, transparent 0 38%, rgba(66, 245, 200, 0.14) 39% 42%, transparent 43% 100%),
    linear-gradient(45deg, transparent 0 58%, rgba(255, 180, 94, 0.14) 59% 62%, transparent 63% 100%);
  opacity: 0.62;
}

.summary-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow), var(--glow);
  transform: translateY(-3px);
}

.summary-card > * {
  position: relative;
  z-index: 1;
}

.overview-grid > .summary-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--blue), var(--accent));
}

.overview-grid > .summary-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--gold), var(--acid));
}

.overview-grid > .summary-card:nth-child(4)::before {
  background: linear-gradient(90deg, var(--rose), var(--violet));
}

.span-2 {
  grid-column: span 2;
}

.visual-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.82fr) minmax(260px, 1.18fr);
  gap: 18px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(66, 245, 200, 0.13), transparent 46%),
    linear-gradient(225deg, rgba(114, 167, 255, 0.16), transparent 45%),
    var(--surface);
}

.visual-card canvas,
.chart-card canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--chart-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.time-item {
  position: relative;
  min-height: 112px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.time-item::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  content: "";
  background: linear-gradient(var(--accent), var(--gold));
}

.time-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.98rem;
}

.time-item span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 800;
}

.time-item p {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 360px);
}

.control-row.compact {
  min-width: 260px;
}

.control-row label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 rgba(66, 245, 200, 0);
  outline: none;
}

select option {
  color: #101522;
  background: #ffffff;
}

input::placeholder {
  color: rgba(166, 176, 195, 0.74);
}

input:focus,
select:focus,
.nav-link:focus-visible,
.pill:focus-visible,
.chapter-button:focus-visible {
  border-color: rgba(66, 245, 200, 0.8);
  box-shadow: 0 0 0 4px rgba(66, 245, 200, 0.14);
  outline: 0;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.quick-stats div {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.quick-stats dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.quick-stats dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 900;
}

.content-system-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 16px;
  margin: 16px 0;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.heat-cell {
  display: grid;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.heat-cell:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.heat-cell span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.heat-cell strong {
  align-self: end;
  color: var(--ink);
  font-size: 1.15rem;
}

.heat-cell.level-3 {
  background: rgba(114, 167, 255, 0.11);
}

.heat-cell.level-4 {
  background: rgba(255, 180, 94, 0.13);
}

.heat-cell.level-5 {
  border-color: rgba(66, 245, 200, 0.28);
  background: linear-gradient(135deg, rgba(66, 245, 200, 0.18), rgba(169, 139, 255, 0.1));
  box-shadow: 0 0 24px rgba(66, 245, 200, 0.1);
}

.weightage-bars,
.roi-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 38px;
  gap: 10px;
  align-items: center;
}

.weight-row strong,
.weight-row span {
  display: block;
}

.weight-row strong {
  color: var(--ink);
}

.weight-row span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.weight-row em {
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.weight-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.weight-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.weight-track .physics {
  background: var(--accent);
}

.weight-track .chemistry {
  background: var(--gold);
}

.weight-track .mathematics {
  background: var(--blue);
}

.roi-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.roi-item > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: var(--paper);
  background: linear-gradient(135deg, var(--accent), var(--acid));
  font-weight: 950;
}

.roi-item strong,
.roi-item small {
  display: block;
}

.roi-item small {
  color: var(--muted);
}

.content-system-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.content-system-strip article {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.content-system-strip span,
.content-system-strip strong {
  display: block;
}

.content-system-strip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.content-system-strip strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--soft);
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: rgba(66, 245, 200, 0.055);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.read-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(66, 245, 200, 0.16);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(66, 245, 200, 0.1);
  font-size: 0.82rem;
  font-weight: 800;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pill {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease;
}

.pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.pill.active {
  border-color: rgba(66, 245, 200, 0.62);
  color: var(--paper);
  background: linear-gradient(135deg, var(--accent), var(--blue));
}

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

.syllabus-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 238px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    var(--surface);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.syllabus-card::after {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 120px;
  height: 120px;
  content: "";
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(114, 167, 255, 0.13) 46% 49%, transparent 50% 100%);
}

.syllabus-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow), 0 0 30px rgba(114, 167, 255, 0.13);
  transform: translateY(-3px);
}

.syllabus-card > * {
  position: relative;
  z-index: 1;
}

.subject-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 29px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 900;
}

.subject-chip.physics {
  border-color: rgba(66, 245, 200, 0.28);
  color: #bafdec;
  background: rgba(66, 245, 200, 0.12);
}

.subject-chip.chemistry {
  border-color: rgba(255, 180, 94, 0.28);
  color: #ffe1b5;
  background: rgba(255, 180, 94, 0.13);
}

.subject-chip.mathematics {
  border-color: rgba(114, 167, 255, 0.3);
  color: #d1e0ff;
  background: rgba(114, 167, 255, 0.14);
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-list li {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.82rem;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1.12fr);
  gap: 16px;
  align-items: start;
}

.chapter-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(66, 245, 200, 0.45) transparent;
}

.chapter-button {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 112px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    rgba(16, 21, 34, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.chapter-button::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: linear-gradient(var(--accent), var(--blue));
  opacity: 0;
}

.chapter-button:hover {
  border-color: var(--line-strong);
  transform: translateX(3px);
}

.chapter-button.active {
  border-color: rgba(66, 245, 200, 0.68);
  background:
    linear-gradient(135deg, rgba(66, 245, 200, 0.14), rgba(114, 167, 255, 0.08)),
    rgba(16, 21, 34, 0.86);
}

.chapter-button.active::before {
  opacity: 1;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.chapter-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}

.score-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.score-card span,
.score-card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.score-card strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.score-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.score-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--acid));
}

.mini-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.075);
  font-weight: 800;
}

.note-panel {
  position: sticky;
  top: 96px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.formula-bank {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(66, 245, 200, 0.16);
  border-radius: 8px;
  background: rgba(66, 245, 200, 0.07);
}

.formula-list,
.pattern-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.formula-list code {
  padding: 7px 9px;
  border: 1px solid rgba(66, 245, 200, 0.2);
  border-radius: 6px;
  color: #c9fff1;
  background: rgba(5, 7, 13, 0.52);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.pattern-row {
  margin-top: 12px;
}

.pattern-row span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 180, 94, 0.22);
  border-radius: 999px;
  color: #ffe1b5;
  background: rgba(255, 180, 94, 0.09);
  font-size: 0.8rem;
  font-weight: 800;
}

.note-block {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.note-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.rank-layout {
  grid-template-columns: 0.82fr 1.18fr;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.range-row {
  margin: 22px 0;
}

input[type="range"] {
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.rank-result {
  display: grid;
  gap: 12px;
}

.rank-number {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid rgba(66, 245, 200, 0.35);
  border-radius: 8px;
  color: var(--paper);
  background:
    linear-gradient(135deg, var(--accent), var(--acid));
  box-shadow: 0 0 36px rgba(66, 245, 200, 0.22);
}

.rank-number::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, 0.28) 49% 51%, transparent 52% 100%);
  opacity: 0.55;
}

.rank-number span,
.rank-number strong {
  position: relative;
  z-index: 1;
}

.rank-number span {
  color: rgba(5, 7, 13, 0.72);
  font-weight: 900;
}

.rank-number strong {
  color: #05070d;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
}

.source-list {
  display: grid;
  gap: 7px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  color: var(--accent);
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav-tabs {
    width: 100%;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .overview-grid,
  .analysis-layout,
  .rank-layout,
  .content-system-grid,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .visual-card {
    grid-template-columns: 1fr;
  }

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

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

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

  .chapter-list {
    max-height: none;
    padding-right: 0;
  }

  .note-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  main {
    width: min(100% - 24px, 1240px);
    padding-top: 28px;
  }

  .topbar {
    padding: 12px;
  }

  h1 {
    font-size: clamp(2.2rem, 13vw, 3.45rem);
  }

  .summary-card {
    padding: 18px;
  }

  .overview-grid,
  .timeline,
  .syllabus-grid,
  .heatmap-grid,
  .form-grid,
  .chapter-scoreboard,
  .content-system-strip,
  .note-grid,
  .quick-stats {
    grid-template-columns: 1fr;
  }

  .weight-row {
    grid-template-columns: 1fr;
  }

  .weight-row em {
    text-align: left;
  }

  .control-row {
    align-items: stretch;
    flex-direction: column;
  }

  .site-footer {
    flex-direction: column;
  }
}
