 :root {
  --ink: #25272e;
  --muted: #737984;
  --line: #e6e8ed;
  --soft: #f6f7f8;
  --orange: #ff5a2f;
  --orange-dark: #df4324;
  --paper: #ffffff;
  --shadow: 0 18px 50px rgba(25, 28, 35, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: #f4f5f6;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 22px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  min-height: 70px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.brand img {
  width: 228px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.sidebar-card {
  border-radius: 8px;
  padding: 18px;
  background: #25272e;
  color: #ffffff;
}

.sidebar-card h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: 0;
}

.side-copy {
  margin: 10px 0 0;
  color: #d9dce1;
  line-height: 1.6;
  font-size: 13px;
}

.side-section { margin: 0; }
.side-label {
  font-size: 12px;
  font-weight: 900;
  color: #9b9fa7;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.filter-stack {
  display: grid;
  gap: 8px;
}

.chip {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: #343842;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chip small,
.school-tile small {
  color: #8a9099;
  font-weight: 800;
}

.chip.active {
  border-color: var(--orange);
  background: #fff2ed;
  color: var(--orange-dark);
  font-weight: 900;
}

.download {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 0;
  background: var(--orange);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  padding: 0 16px;
}

.side-download { margin-top: auto; }

.main {
  min-width: 0;
  padding: 26px 30px 38px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
}

.topbar h2,
.section-heading h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  padding: 15px 16px;
  box-shadow: 0 8px 24px rgba(25, 28, 35, 0.04);
}

.metric span {
  display: block;
  font-size: 25px;
  font-weight: 950;
}

.metric small {
  color: var(--muted);
  font-weight: 800;
}

.controls,
.school-board,
.qs-board,
.selection-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(25, 28, 35, 0.04);
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(220px, .9fr) minmax(150px, .55fr) auto;
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

input, select {
  width: 100%;
  height: 38px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.controls button {
  align-self: end;
  min-height: 38px;
  border-radius: 8px;
  border: 0;
  background: #25272e;
  color: #fff;
  font-weight: 900;
  padding: 0 16px;
  cursor: pointer;
}

.selection-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-left: 4px solid var(--orange);
}

.selection-bar b {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.selection-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.selection-actions button {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  padding: 0 12px;
  cursor: pointer;
}

.selection-actions .primary-action {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.school-board {
  padding: 16px;
  margin-bottom: 14px;
}

.qs-board {
  padding: 16px;
  margin-bottom: 14px;
}

.qs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.qs-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid #eceff3;
  border-left: 5px solid var(--orange);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8f4, #ffffff);
  padding: 12px;
}

.qs-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.qs-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 950;
}

.qs-card strong {
  color: var(--orange-dark);
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.qs-card p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.qs-trend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.qs-trend span {
  border-radius: 999px;
  background: #f4f0ec;
  color: #6d5a47;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
}

.qs-trend b {
  margin-right: 3px;
  color: #9b5526;
}

.qs-empty {
  border: 1px dashed #d9dfe7;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h3 {
  font-size: 20px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.school-tile {
  min-height: 82px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
  cursor: pointer;
  text-align: left;
}

.school-tile.active {
  border-color: var(--orange);
  background: #fff5f1;
  box-shadow: 0 0 0 2px rgba(255, 90, 47, .12);
}

.school-logo {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #f7f8fa;
  border: 1px solid #edf0f3;
  object-fit: contain;
  padding: 5px;
}

.school-logo.all {
  display: grid;
  place-items: center;
  background: #25272e;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.school-name {
  display: block;
  font-weight: 950;
  font-size: 14px;
  line-height: 1.25;
}

.school-en {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 10px 2px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.active-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  border-radius: 999px;
  background: #fff2ed;
  color: var(--orange-dark);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}

.program-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(25, 28, 35, 0.05);
  display: grid;
  gap: 12px;
}

.program-card.selected {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 90, 47, .12), 0 12px 28px rgba(25, 28, 35, 0.06);
}

.select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef0f3;
}

.select-project {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: #343842;
}

.select-project input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

.position-control span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.position-control select {
  height: 34px;
  padding: 0 9px;
  font-size: 13px;
}

.card-head {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.school-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--orange-dark);
  font-weight: 950;
  font-size: 13px;
}

.program-card h2 {
  margin: 5px 0 0;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.en-name {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.meta {
  min-height: 54px;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fafafa;
}

.meta b {
  display: block;
  color: #8b9099;
  font-size: 11px;
  margin-bottom: 4px;
}

.meta span {
  font-size: 13px;
  line-height: 1.35;
}

.excerpt {
  color: #4b515b;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}

.detail-btn {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--orange);
  background: #fff7f4;
  color: var(--orange-dark);
  font-weight: 950;
  padding: 0 12px;
  cursor: pointer;
}

.source-link {
  color: #4f5662;
  font-size: 13px;
  font-weight: 900;
}

.source-link.muted {
  color: #a1a6af;
}

.pager {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.pager button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.pager button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.detail-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(880px, 96vw);
  background: linear-gradient(180deg, #f7f8fa 0%, #ffffff 38%);
  box-shadow: -24px 0 70px rgba(25, 28, 35, .22);
  transform: translateX(105%);
  transition: transform .18s ease;
  z-index: 20;
  overflow: auto;
  padding: 22px;
}

.detail-panel.open { transform: translateX(0); }

.close-panel {
  position: sticky;
  top: 0;
  float: right;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 10px 26px rgba(25, 28, 35, .08);
}

.detail-content {
  display: grid;
  gap: 16px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(255, 90, 47, .13), rgba(255, 255, 255, 0) 44%),
    radial-gradient(circle at 94% 12%, rgba(255, 90, 47, .18), transparent 34%),
    #ffffff;
  border: 1px solid #eceff3;
  box-shadow: 0 22px 54px rgba(25, 28, 35, .10);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 44px solid rgba(255, 90, 47, .06);
}

.detail-title {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.detail-title .school-logo {
  width: 74px;
  height: 74px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(25, 28, 35, .10);
}

.detail-title h2 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.18;
  font-weight: 950;
  letter-spacing: 0;
}

.detail-kicker {
  margin: 0 0 9px;
  color: #444a55;
  font-size: 15px;
  font-weight: 950;
}

.detail-en {
  margin: 0;
  color: #5d6470;
  font-size: 17px;
  line-height: 1.45;
}

.detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.detail-pills span {
  border-radius: 999px;
  background: #25272e;
  color: #fff;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.detail-stat {
  min-height: 96px;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid #eceff3;
  box-shadow: 0 10px 28px rgba(25, 28, 35, .05);
}

.detail-stat b {
  display: block;
  color: #8a9099;
  font-size: 12px;
  margin-bottom: 9px;
  font-weight: 950;
}

.detail-stat span {
  display: block;
  color: #25272e;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 760;
}

.stat-school { border-left: 5px solid #ff5a2f; }
.stat-rank { border-left: 5px solid #25272e; background: linear-gradient(180deg, #fff2ed, #ffffff); }
.stat-track { border-left: 5px solid #c47a3a; }
.stat-time { border-left: 5px solid #8a7661; }
.stat-money { border-left: 5px solid #b84f36; }

.detail-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-section {
  position: relative;
  border-radius: 16px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #eceff3;
  box-shadow: 0 12px 34px rgba(25, 28, 35, .06);
}

.detail-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 16px 0 0 16px;
  background: var(--orange);
}

.detail-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.detail-section-head span {
  order: 2;
  border-radius: 999px;
  background: #f3f4f6;
  color: #8b9099;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  white-space: nowrap;
}

.detail-section-head h3 {
  margin: 0;
  color: #25272e;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 950;
}

.detail-section-body {
  color: #3f4652;
  font-size: 16px;
  line-height: 1.85;
}

.detail-section-body p {
  margin: 0;
  white-space: normal;
}

.detail-section-body p + p {
  margin-top: 12px;
}

.detail-objective {
  background: linear-gradient(180deg, #fff7f3, #ffffff);
}

.detail-objective::before { background: #ff5a2f; }
.detail-objective .detail-section-head span { background: #ffe6dc; color: #d84724; }

.detail-requirements {
  background: linear-gradient(180deg, #fff8ef, #ffffff);
}

.detail-requirements::before { background: #c47a3a; }
.detail-requirements .detail-section-head span { background: #f7eadb; color: #9b5526; }

.detail-advisor {
  background: linear-gradient(180deg, #fff5f1, #ffffff);
}

.detail-advisor::before { background: #b84f36; }
.detail-advisor .detail-section-head span { background: #f9e2da; color: #963d28; }

.detail-timeline {
  background: linear-gradient(180deg, #f8f5f1, #ffffff);
}

.detail-timeline::before { background: #8a7661; }
.detail-timeline .detail-section-head span { background: #ebe3da; color: #6d5a47; }

.detail-courses {
  background: #25272e;
  border-color: #25272e;
}

.detail-courses::before { background: var(--orange); }
.detail-courses .detail-section-head h3,
.detail-courses .detail-section-body {
  color: #fff;
}

.detail-courses .detail-section-head span {
  background: rgba(255, 255, 255, .12);
  color: #ffd6c8;
}

.detail-courses .detail-section-body {
  color: #f3f4f6;
  font-size: 15px;
}

.detail-compact {
  min-height: 100%;
}

.detail-compact .detail-section-body {
  font-weight: 760;
}

.detail-link {
  background: #fff;
}

.detail-link .detail-section-body a {
  color: var(--orange-dark);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

.side-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.side-nav-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #343842;
  font-weight: 950;
  cursor: pointer;
}

.side-nav-btn.active {
  border-color: var(--orange);
  background: #fff2ed;
  color: var(--orange-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 47, .12);
}

.school-name em {
  display: inline-flex;
  margin-left: 5px;
  border-radius: 999px;
  background: #fff2ed;
  color: var(--orange-dark);
  padding: 2px 6px;
  font-style: normal;
  font-size: 10px;
  vertical-align: middle;
}

.text-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--orange-dark);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.text-link:hover {
  text-decoration: underline;
}

.page-hero,
.school-profile,
.school-projects {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(25, 28, 35, 0.05);
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 14px;
  padding: 22px;
  border-left: 5px solid var(--orange);
}

.page-hero h2,
.school-profile-title h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.page-hero p,
.school-profile-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 700;
}

.year-picker {
  width: 190px;
  flex: 0 0 190px;
}

.qs-ranking-list {
  display: grid;
  gap: 8px;
}

.qs-table-head,
.qs-ranking-row {
  display: grid;
  grid-template-columns: 86px minmax(280px, 1.3fr) 96px minmax(260px, .9fr);
  gap: 12px;
  align-items: center;
}

.qs-table-head {
  padding: 0 16px 6px;
  color: #8a9099;
  font-size: 12px;
  font-weight: 950;
}

.qs-ranking-row {
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(25, 28, 35, .04);
}

.qs-ranking-row:hover {
  border-color: #f0b09b;
  background: #fffaf7;
}

.qs-rank-num {
  color: var(--orange-dark);
  font-size: 24px;
  font-weight: 950;
}

.qs-school-cell {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.qs-school-cell b {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.qs-school-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
  font-weight: 700;
}

.qs-score {
  font-size: 18px;
  font-weight: 950;
}

.qs-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qs-indicators em {
  border-radius: 999px;
  background: #f6f7f8;
  color: #525965;
  padding: 5px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.school-page-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.school-page-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #343842;
  padding: 0 13px;
  font-weight: 950;
  cursor: pointer;
}

.school-profile {
  padding: 20px;
  margin-bottom: 14px;
}

.school-profile-title {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.school-profile-title .school-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(25, 28, 35, .08);
}

.school-projects {
  padding: 18px;
}

.school-project-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.qs-profile-card {
  border: 1px solid #eceff3;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf7, #ffffff);
  padding: 16px;
  box-shadow: 0 12px 30px rgba(25, 28, 35, .05);
}

.detail-content > .qs-profile-card {
  margin-top: -2px;
}

.qs-profile-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 132px;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.qs-profile-head .school-logo {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: #fff;
}

.qs-profile-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.qs-profile-head p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.qs-rank-badge {
  min-height: 92px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #25272e;
  color: #fff;
  text-align: center;
  padding: 10px;
}

.qs-rank-badge span {
  color: #ffd6c8;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
}

.qs-rank-badge b {
  display: block;
  font-size: 31px;
  line-height: 1;
  font-weight: 950;
}

.qs-rank-badge small {
  color: #eceff3;
  font-size: 12px;
  font-weight: 800;
}

.qs-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.qs-metric {
  min-height: 70px;
  border: 1px solid #eceff3;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.qs-metric span {
  display: block;
  color: #8a9099;
  font-size: 11px;
  font-weight: 950;
  margin-bottom: 8px;
}

.qs-metric b {
  color: #25272e;
  font-size: 18px;
  font-weight: 950;
}

.qs-trend-panel {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  background: #f6f7f8;
  padding: 12px;
}

.panel-label {
  display: block;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 950;
  margin-bottom: 5px;
}

.qs-trend-panel strong {
  display: block;
  color: #606774;
  font-size: 12px;
  line-height: 1.45;
}

.trend-svg {
  width: 100%;
  min-height: 118px;
  display: block;
}

.trend-axis {
  stroke: #dfe3e8;
  stroke-width: 1.5;
}

.trend-line {
  fill: none;
  stroke: var(--orange);
  stroke-width: 3.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.trend-dot {
  fill: #fff;
  stroke: #25272e;
  stroke-width: 2;
}

.trend-rank {
  fill: #25272e;
  font-size: 12px;
  font-weight: 900;
}

.trend-year {
  fill: #7c838d;
  font-size: 11px;
  font-weight: 800;
}

.trend-empty {
  padding: 16px;
  color: var(--muted);
  font-weight: 850;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-download { margin-top: 0; }
  .filter-stack { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .qs-table-head { display: none; }
  .qs-ranking-row { grid-template-columns: 76px minmax(0, 1fr); }
  .qs-score,
  .qs-indicators { grid-column: 2; }
  .qs-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .main { padding: 18px 14px 28px; }
  .topbar { flex-direction: column; }
  .controls { grid-template-columns: 1fr; }
  .selection-bar { align-items: stretch; flex-direction: column; }
  .selection-actions { justify-content: stretch; }
  .selection-actions button { flex: 1 1 140px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .school-grid { grid-template-columns: 1fr; }
  .page-hero { flex-direction: column; align-items: stretch; }
  .year-picker { width: 100%; flex-basis: auto; }
  .qs-profile-head { grid-template-columns: 52px minmax(0, 1fr); }
  .qs-rank-badge { grid-column: 1 / -1; min-height: 82px; }
  .qs-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qs-trend-panel { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .metrics, .meta-grid, .detail-grid, .detail-title, .detail-two-col, .school-profile-title { grid-template-columns: 1fr; }
  .select-row { grid-template-columns: 1fr; }
  .card-head { grid-template-columns: 42px minmax(0, 1fr); }
  .school-logo { width: 42px; height: 42px; }
  .topbar h2 { font-size: 24px; }
  .qs-ranking-row { grid-template-columns: 1fr; }
  .qs-score,
  .qs-indicators { grid-column: auto; }
}
