:root {
  --black: #16130b;
  --black-low: #1f1b13;
  --gold: #d4af37;
  --gold-bright: #f2ca50;
  --ink: #221b12;
  --muted: #786d5c;
  --paper: #f7f1e4;
  --paper-light: #fffaf0;
  --line-dark: rgba(212, 175, 55, 0.28);
  --line-light: rgba(92, 69, 28, 0.22);
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.1), transparent 24rem),
    linear-gradient(180deg, #110e07 0%, var(--black) 46%, #0f0c07 100%);
  color: #eae1d4;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.positioning-page {
  position: relative;
  width: min(100%, 448px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 112px;
}

.positioning-page.home-page > .top-back {
  position: absolute;
  top: 28px;
  left: 24px;
  z-index: 5;
}

.portal-page {
  position: relative;
  overflow: hidden;
  width: min(100%, 390px);
  padding: 24px 22px 34px;
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
}

.portal-topbar .profile-entry b {
  display: none;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(242, 202, 80, 0.76);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.portal-brand-logo {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.94);
}

.portal-brand-logo img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.portal-hero {
  margin-top: 118px;
}

.portal-kicker {
  margin: 0 0 12px;
  color: rgba(242, 202, 80, 0.58);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.16em;
}

.portal-hero h1 {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.14;
}

.portal-services {
  display: grid;
  gap: 10px;
  margin-top: 52px;
}

.portal-service-card {
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  color: #efe6d8;
  transition: color 160ms ease, transform 160ms ease;
}

.portal-service-card:last-child {
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}

.portal-service-card:hover,
.portal-service-card:focus-visible {
  color: var(--gold-bright);
}

.portal-service-card:active {
  transform: scale(0.985);
}

.service-featured {
  min-height: 66px;
  margin: 2px 0;
  padding-right: 14px;
  border: 1px solid rgba(212, 175, 55, 0.68);
  background: var(--paper-light);
  color: var(--ink);
}

.service-featured:hover,
.service-featured:focus-visible {
  color: var(--ink);
}

.service-index {
  color: rgba(242, 202, 80, 0.58);
  font-family: var(--serif);
  font-size: 13px;
  text-align: center;
}

.service-featured .service-index {
  color: rgba(143, 111, 24, 0.72);
}

.service-copy {
  min-width: 0;
}

.service-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.service-arrow {
  color: var(--gold-bright);
  font-size: 22px;
  line-height: 1;
  text-align: right;
}

.service-featured .service-arrow {
  color: #171105;
}

.portal-toast {
  min-height: 22px;
  margin: 18px 0 0;
  color: rgba(242, 202, 80, 0.78);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.portal-mark {
  position: absolute;
  right: 22px;
  bottom: 28px;
  left: 22px;
  margin: 0;
  color: rgba(242, 202, 80, 0.45);
  font-size: 13px;
}

.home-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 48px;
}

.home-search {
  width: 100%;
  margin-top: 0;
  text-align: center;
}

.home-search h1 {
  margin: 0 0 16px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
}

.subject-choice {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.subject-choice button {
  min-width: 84px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 999px;
  background: transparent;
  color: rgba(234, 225, 212, 0.72);
  font-size: 14px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.subject-choice button:hover {
  border-color: rgba(242, 202, 80, 0.82);
  color: var(--gold-bright);
}

.subject-choice button:active {
  transform: scale(0.97);
}

.subject-choice button.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #171105;
  font-weight: 700;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 5px 6px 5px 20px;
  border: 1px solid rgba(212, 175, 55, 0.65);
  border-radius: 999px;
  background: #f8f1df;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.search-shell input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
}

.search-shell input::placeholder {
  color: rgba(120, 109, 92, 0.7);
}

.search-shell button {
  min-width: 84px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #171105;
  font-size: 16px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.search-shell button:hover {
  background: var(--gold-bright);
}

.search-shell button:active {
  transform: scale(0.97);
}

.school-suggestions {
  width: calc(100% - 10px);
  margin: 8px auto 0;
  padding: 6px;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 8px;
  background: rgba(21, 16, 9, 0.96);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.school-suggestions[hidden] {
  display: none;
}

.school-suggestions button {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--paper-light);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

.school-suggestions button:hover,
.school-suggestions button:focus {
  outline: 0;
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-bright);
}

.search-hint {
  margin: 0 0 18px;
  color: rgba(234, 225, 212, 0.72);
  font-size: 15px;
}

.search-hint a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.brand-mark {
  margin: 46px 0 0;
  padding-top: 0;
  color: rgba(242, 202, 80, 0.62);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-align: center;
}

.result-page {
  padding-top: 22px;
}

.result-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 26px;
  color: rgba(234, 225, 212, 0.78);
  font-size: 14px;
}

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 8px;
}

.back-link {
  color: var(--gold-bright);
}

button.back-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.profile-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(234, 225, 212, 0.72);
  font-family: inherit;
  font-size: 13px;
}

.profile-entry span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
}

.profile-entry b {
  font-weight: 500;
}

.profile-entry-floating {
  position: absolute;
  top: 24px;
  right: 24px;
}

.about-page {
  padding-top: 22px;
}

.about-hero {
  padding: 34px 0 22px;
}

.about-kicker {
  margin: 0 0 10px;
  color: rgba(242, 202, 80, 0.72);
  font-family: var(--serif);
  font-size: 14px;
}

.about-hero h1 {
  margin: 0 0 18px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.25;
}

.about-copy,
.about-copy p {
  margin: 0;
  color: rgba(234, 225, 212, 0.82);
  font-size: 16px;
  line-height: 1.9;
}

.about-copy p + p {
  margin-top: 12px;
}

.about-image-card {
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 8px;
  background: rgba(247, 241, 228, 0.05);
}

.about-image-card h2 {
  margin: 14px 12px 10px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
  text-align: center;
}

.about-image-card img {
  display: block;
  width: 100%;
  height: auto;
}

.about-reading {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  background: rgba(247, 241, 228, 0.04);
}

.about-reading h2 {
  margin: 0 0 12px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
}

.about-reading a {
  display: block;
  padding: 12px 0;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  color: rgba(234, 225, 212, 0.9);
  font-size: 15px;
  line-height: 1.55;
}

.about-reading a:first-of-type {
  border-top: 0;
}

.about-reading a:hover {
  color: var(--gold-bright);
}

.result-label {
  color: rgba(234, 225, 212, 0.56);
  font-size: 13px;
}

.result-header {
  margin-bottom: 22px;
}

.result-header h1 {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: clamp(32px, 9vw, 42px);
  line-height: 1.25;
}

.result-header p {
  margin: 10px 0 0;
  color: rgba(234, 225, 212, 0.66);
  font-size: 14px;
  line-height: 1.6;
}

.subject-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
}

.subject-tab {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 999px;
  background: transparent;
  color: rgba(234, 225, 212, 0.6);
  font-size: 14px;
}

.subject-tab.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #171105;
  font-weight: 700;
}

.result-section {
  margin-top: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.metric {
  min-width: 0;
  padding: 18px 12px 16px;
  border: 1px solid var(--line-light);
  background: var(--paper-light);
  color: var(--ink);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  display: block;
  margin-top: 9px;
  font-family: var(--serif);
  font-size: clamp(18px, 5.4vw, 27px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.score-chart-card {
  margin: 18px 0 0;
  padding: 16px 14px 14px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background:
    linear-gradient(180deg, rgba(247, 241, 228, 0.98), rgba(255, 250, 240, 0.94));
  color: var(--ink);
}

.score-chart-heading {
  margin-bottom: 8px;
}

.score-chart-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
}

.score-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
}

.score-grid {
  stroke: rgba(92, 69, 28, 0.16);
  stroke-dasharray: 5 7;
  stroke-width: 1;
}

.score-watermark text {
  fill: rgba(147, 20, 6, 0.07);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  pointer-events: none;
}

.score-curve {
  fill: none;
  stroke: #8f6f18;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.score-marker-line {
  stroke: #221b12;
  stroke-dasharray: 4 5;
  stroke-width: 1.4;
}

.score-marker-dot {
  fill: var(--gold-bright);
  stroke: #221b12;
  stroke-width: 2;
}

.score-line-benchmark {
  stroke: rgba(120, 109, 92, 0.52);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.score-line-special {
  stroke: rgba(34, 27, 18, 0.5);
}

.score-axis-x,
.score-axis-y,
.score-benchmark-label {
  fill: rgba(120, 109, 92, 0.78);
  font-size: 10px;
}

.score-axis-x,
.score-benchmark-label {
  text-anchor: middle;
}

.score-axis-y {
  text-anchor: end;
}

.score-marker-label {
  fill: #221b12;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
}

.score-percent-label {
  fill: #931406;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}

.score-marker-label-stroke {
  fill: none;
  stroke: rgba(255, 250, 240, 0.92);
  stroke-linejoin: round;
  stroke-width: 4px;
}

.score-marker-sub {
  fill: rgba(34, 27, 18, 0.72);
  font-size: 11px;
}

.score-chart-note {
  margin: 4px 0 0;
  color: rgba(120, 109, 92, 0.92);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.section-heading::before {
  width: 4px;
  height: 20px;
  background: var(--gold);
  content: "";
}

.group-card {
  margin-top: 10px;
  padding: 20px 18px;
  border: 1px solid var(--line-light);
  background:
    linear-gradient(90deg, rgba(212, 175, 55, 0.08), transparent 34%),
    var(--paper-light);
  color: var(--ink);
}

.group-card h3 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
}

.group-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.group-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.group-programs {
  display: -webkit-box;
  overflow: hidden;
  margin: 14px 0 0;
  color: rgba(120, 109, 92, 0.9);
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.result-note {
  margin: 22px 0 0;
  padding: 12px 14px;
  border-left: 2px solid var(--gold);
  background: rgba(31, 27, 19, 0.76);
  color: rgba(234, 225, 212, 0.66);
  font-size: 12px;
  line-height: 1.7;
}

.dwf-ad-banner {
  display: block;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: rgba(35, 31, 23, 0.72);
}

.dwf-ad-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.empty-state,
.match-list {
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  padding: 24px 0;
}

.empty-state {
  color: rgba(234, 225, 212, 0.68);
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
}

.match-list {
  display: grid;
  gap: 0;
}

.match-list a {
  padding: 16px 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 18px;
}

.match-list a:last-child {
  border-bottom: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 360px) {
  .positioning-page {
    padding-right: 18px;
    padding-left: 18px;
  }

  .portal-page {
    padding-right: 18px;
    padding-left: 18px;
  }

  .portal-hero {
    margin-top: 94px;
  }

  .portal-hero h1 {
    font-size: 39px;
  }

  .service-copy strong {
    font-size: 17px;
  }

  .metrics {
    gap: 5px;
  }

  .metric {
    padding-right: 8px;
    padding-left: 8px;
  }

  .metric-value {
    font-size: 23px;
  }
}
