﻿:root {
  --bg: #f6f3ea;
  --paper: #fffcf4;
  --paper-2: #f1ebdd;
  --ink: #17231f;
  --muted: #6e766f;
  --soft: #e7ddc7;
  --green: #116a5b;
  --green-dark: #173b33;
  --mint: #e7f0e8;
  --gold: #f2b66d;
  --blue: #5c7d94;
  --red: #b95b3f;
  --shadow: 0 8px 28px rgba(32, 35, 30, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 74px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 252, 244, 0.92);
  border-bottom: 1px solid rgba(231, 221, 199, 0.9);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  color: #d7e6a2;
  font-weight: 800;
}

.brand-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.ghost-button,
.primary-button,
.tab-button,
.pill-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-button {
  width: 40px;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
}

.ghost-button {
  gap: 7px;
  padding: 0 13px;
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
}

.primary-button {
  gap: 7px;
  padding: 0 16px;
  background: var(--green);
  color: #fffaf0;
  font-weight: 800;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  background: var(--mint);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
}

.hero {
  display: grid;
  min-height: 370px;
  align-items: end;
  border-bottom: 1px solid var(--soft);
  padding: 52px 0 34px;
}

.hero-kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.hero-title {
  margin: 12px 0 12px;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.95;
  font-weight: 900;
}

.hero-desc {
  max-width: 680px;
  color: #40514a;
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

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

.metric {
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--paper);
}

.metric strong {
  display: block;
  font-size: 22px;
}

.metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.section-title {
  margin: 26px 0 12px;
  font-size: 22px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.panel {
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel.pad {
  padding: 18px;
}

.panel-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.panel-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.quick-card {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--bg);
  text-align: left;
}

.quick-card strong,
.quick-card span {
  display: block;
}

.quick-card strong {
  margin-bottom: 6px;
  color: var(--ink);
}

.quick-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.filter-bar {
  position: sticky;
  top: 62px;
  z-index: 20;
  padding: 14px 0;
  background: var(--bg);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--paper);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

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

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field select,
.field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  outline: 0;
  padding: 0 10px;
}

.advanced-grid {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.advanced-grid.show {
  display: grid;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.pill-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--soft);
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pill-button.active {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
}

.result-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.school-list {
  display: grid;
  gap: 12px;
}

.school-card {
  overflow: hidden;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 4px 18px rgba(32, 35, 30, 0.06);
}

.school-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
}

.school-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag.green {
  background: var(--mint);
  color: var(--green);
}

.tag.gold {
  background: var(--gold);
  color: #3a2412;
}

.tag.blue {
  background: #d7e7ed;
  color: #23465b;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--soft);
  border-bottom: 1px solid var(--soft);
  background: var(--paper-2);
}

.score-cell {
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid var(--soft);
}

.score-cell:last-child {
  border-right: 0;
}

.score-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.score-value {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.score-value.highlight {
  color: var(--green);
}

.diff {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--red);
  background: rgba(185, 91, 63, 0.12);
  font-size: 11px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
}

.major-preview {
  display: none;
  padding: 0 16px 14px;
}

.major-preview.show {
  display: grid;
  gap: 8px;
}

.major-mini {
  padding: 10px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--bg);
}

.major-mini strong {
  display: block;
  margin-bottom: 4px;
}

.major-mini span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pager {
  display: flex;
  justify-content: center;
  padding: 18px 0 8px;
}

.detail-header {
  padding: 24px;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fffaf0;
}

.detail-header h1 {
  margin: 0 0 10px;
  font-size: 32px;
}

.detail-header .tag {
  background: rgba(255, 252, 244, 0.12);
  color: #fffaf0;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  overflow-x: auto;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--soft);
  font-weight: 800;
}

.tab-button.active {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
}

.info-grid,
.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.info-item {
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
}

.info-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.info-value {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.year-section {
  margin-top: 14px;
}

.year-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--green);
  font-weight: 900;
}

.major-list {
  display: grid;
  gap: 10px;
}

.major-card {
  padding: 14px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--paper);
}

.major-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.major-title {
  margin: 0;
  font-size: 17px;
}

.major-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #d5cba7;
  border-radius: 8px;
  background: #fff7d7;
  color: #665620;
}

.life-list {
  display: grid;
  gap: 10px;
}

.qa {
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--paper);
}

.qa summary {
  cursor: pointer;
  padding: 14px;
  font-weight: 900;
}

.qa-answer {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.qa-answer div {
  padding: 10px;
  border-radius: 8px;
  background: var(--bg);
  color: #40514a;
  line-height: 1.65;
}

.favorites-list {
  display: grid;
  gap: 10px;
}

.empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  border: 1px dashed var(--soft);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.55);
  color: var(--muted);
  text-align: center;
  padding: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 82px;
  z-index: 80;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fffaf0;
  box-shadow: var(--shadow);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  border-top: 1px solid var(--soft);
  background: rgba(255, 252, 244, 0.94);
  backdrop-filter: blur(16px);
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 720px;
  margin: 0 auto;
}

.nav-item {
  display: grid;
  min-height: 58px;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.nav-item.active {
  color: var(--green);
}

@media (max-width: 760px) {
  .main {
    padding: 12px;
  }

  .topbar-inner {
    padding: 10px 12px;
  }

  .brand-subtitle,
  .desktop-only {
    display: none;
  }

  .hero {
    min-height: 330px;
    padding-top: 28px;
  }

  .metrics,
  .home-grid,
  .select-grid,
  .advanced-grid.show,
  .info-grid,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

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

  .filter-bar {
    top: 57px;
  }

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

  .score-cell:nth-child(2n) {
    border-right: 0;
  }

  .school-card-head,
  .major-head {
    grid-template-columns: 1fr;
  }

  .detail-header h1 {
    font-size: 25px;
  }
}

.notice-banner {
  margin: 14px 0 18px;
  padding: 13px 15px;
  border: 1px solid #d5cba7;
  border-radius: 8px;
  background: #fff7d7;
  color: #665620;
  font-weight: 800;
  line-height: 1.6;
}

.article-page {
  max-width: 860px;
  margin: 18px auto 0;
  padding: 28px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.article-head {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--soft);
}

.article-head h1 {
  margin: 10px 0;
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1.15;
}

.article-subtitle,
.article-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.article-paragraph {
  margin: 0 0 16px;
  color: #2f3e38;
  font-size: 16px;
  line-height: 1.95;
}

.article-section {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--soft);
}

.article-section h2 {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 21px;
}

.article-lines {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: #2f3e38;
  line-height: 1.8;
}



/* Compact school filters for mobile and dense screens */
@media (max-width: 760px) {
  .filter-bar {
    top: 56px;
    margin: 0 -12px 8px;
    padding: 8px 12px 10px;
    border-bottom: 1px solid rgba(231, 221, 199, 0.8);
    background: rgba(246, 243, 234, 0.96);
    backdrop-filter: blur(12px);
  }

  .filter-bar .search-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .filter-bar .search-box {
    min-height: 38px;
    padding: 0 10px;
  }

  .filter-bar #advancedToggle {
    min-height: 38px;
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .filter-bar #advancedToggle .icon {
    width: 19px;
    height: 19px;
  }

  .filter-bar .select-grid {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filter-bar .select-grid::-webkit-scrollbar {
    display: none;
  }

  .filter-bar .field {
    position: relative;
    flex: 0 0 auto;
    min-width: 88px;
    gap: 0;
  }

  .filter-bar .field label {
    position: absolute;
    left: 10px;
    top: 4px;
    z-index: 1;
    color: var(--green);
    font-size: 10px;
    line-height: 1;
  }

  .filter-bar .field select,
  .filter-bar .field input {
    min-height: 40px;
    padding: 14px 28px 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }

  .filter-bar .field-batch {
    min-width: 132px;
  }

  .filter-bar .advanced-grid.show {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .filter-bar .advanced-grid.show .field {
    min-width: 0;
  }

  .filter-bar .toggle-row {
    margin-top: 8px;
  }

  .result-meta {
    margin: 8px 0;
    font-size: 12px;
  }
}

