: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 {
  width: min(100%, 448px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 34px;
}

.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 24px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: clamp(34px, 10vw, 42px);
  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 {
  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);
}

.search-hint {
  margin: 18px 0 0;
  color: rgba(234, 225, 212, 0.72);
  font-size: 15px;
}

.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;
}

.back-link {
  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: 27px;
  font-weight: 700;
  line-height: 1;
}

.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;
}

.note-version {
  display: block;
  margin-top: 1em;
}

.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;
  }

  .metrics {
    gap: 5px;
  }

  .metric {
    padding-right: 8px;
    padding-left: 8px;
  }

  .metric-value {
    font-size: 23px;
  }
}
