:root {
  --page: #f2f7f6;
  --card: #ffffff;
  --ink: #1d2b35;
  --muted: #6e7f89;
  --line: #d9e3e2;
  --brand: #0d9488;
  --brand-deep: #155e75;
  --brand-dark: #0f766e;
  --brand-soft: #e9f8f5;
  --accent: #c2410c;
  --shadow: 0 14px 32px rgba(21, 54, 75, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(145deg, #f2f7f6, #eef3f8);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  line-height: 1.6;
}

a { color: var(--brand); }

.university-app {
  width: min(1160px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 52px;
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 11px 15px;
  border: 1px solid #cfe2df;
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  color: var(--muted);
  font-size: 13px;
}

.back-link {
  text-decoration: none;
  font-weight: 700;
}

.site-label { white-space: nowrap; }

.card {
  background: var(--card);
  border: 1px solid rgba(211, 225, 228, .88);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.university-picker {
  position: relative;
  overflow: hidden;
  border-color: #b8d9d4;
  background: linear-gradient(145deg, #ffffff 0%, #f2f8f7 100%);
}

.university-picker::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #155e75, #0d9488, #65c7b9);
}

.university-picker h1 { color: var(--brand-deep); }

.school-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f8f7 100%);
}

.school-brand { display: flex; align-items: center; gap: 20px; min-width: 0; }

.school-logo {
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  object-fit: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(26px, 4vw, 38px); line-height: 1.2; }
h2 { margin-bottom: 0; font-size: 22px; line-height: 1.25; }
h3 { margin-bottom: 10px; font-size: 15px; }

.school-alias { min-height: 1.6em; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag, .status-badge, .meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}
.tag { background: var(--brand-soft); color: var(--brand); }
.status-badge { background: #fff4df; color: #925c1b; white-space: nowrap; }
.meta-chip { background: #f1f5f6; color: #536771; }
.hero-status { align-self: flex-start; }

.detail-section { margin-top: 18px; padding: 26px 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }

.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}
.fact { min-width: 0; padding: 13px 15px; background: #fff; }
.fact dt { color: var(--muted); font-size: 12px; }
.fact dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 700; }
.fact dd a { font-weight: 600; }

.profile-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 30px; }
.intro-text { margin-bottom: 0; color: #42545d; white-space: pre-line; font-size: 14px; }
.ranking-list { display: grid; gap: 10px; }
.ranking-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
.ranking-title { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.ranking-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.source-line, .page-foot { margin-top: 20px; color: var(--muted); font-size: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #fff, #f8fbfb); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 2px; color: var(--brand); font-size: 25px; font-weight: 800; line-height: 1.25; }
.stat-sub { margin-top: 2px; color: var(--muted); font-size: 11px; }

.notice { margin: 18px 0; padding: 11px 13px; border-left: 3px solid var(--accent); background: #fff9ef; color: #765329; font-size: 13px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table th { color: var(--muted); background: #f8fbfb; font-size: 12px; font-weight: 700; }
.data-table td:first-child, .data-table td:nth-child(3) { font-weight: 700; }
.empty-row { color: var(--muted); text-align: center !important; }

.group-list { display: grid; gap: 13px; }
.group-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.group-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 15px 17px; background: #f5faf9; }
.group-title { margin: 0; font-size: 15px; }
.group-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.group-plan { color: var(--brand); font-size: 14px; font-weight: 800; white-space: nowrap; }
.major-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.major-table th, .major-table td { padding: 9px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.major-table th { color: var(--muted); font-size: 12px; font-weight: 600; }
.major-table td:first-child { width: 86px; color: var(--muted); }
.major-table td:nth-child(3) { width: 80px; white-space: nowrap; }
.major-remark { color: var(--muted); font-size: 12px; }

.university-picker { padding: 30px; }
.picker-intro { margin: -8px 0 18px; color: #42545d; font-size: 14px; }
.picker-search { display: grid; gap: 6px; max-width: 680px; }
.picker-search span { color: var(--muted); font-size: 12px; font-weight: 700; }
.picker-search input { width: 100%; padding: 12px 14px; border: 1px solid #b8d9d4; border-radius: 10px; outline: none; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
.picker-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 148, 136, .14); }
.picker-status { min-height: 1.6em; margin: 15px 0 0; color: var(--muted); font-size: 12px; }
.university-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; padding: 2px; }
.university-choice { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; min-width: 0; gap: 11px; min-height: 88px; padding: 12px; border: 1px solid #d2e4e1; border-radius: 14px; background: linear-gradient(145deg, #fff, #f2fbfa); color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.university-choice:hover, .university-choice:focus-visible { border-color: var(--brand); box-shadow: 0 7px 16px rgba(13, 148, 136, .15); transform: translateY(-1px); }
.university-choice-logo { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border: 1px solid #b8d9d4; border-radius: 13px; background: #fff; }
.university-choice-logo img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.university-choice-body { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.university-choice strong { overflow: hidden; color: var(--brand-deep); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.university-choice-body > span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.university-choice em { margin-top: 3px; color: var(--accent); font-size: 12px; font-style: normal; font-weight: 700; }
.picker-empty { grid-column: 1 / -1; padding: 24px 12px; color: var(--muted); text-align: center; font-size: 13px; }

.loading-panel, .error-panel { padding: 54px 24px; border: 1px dashed #cbdcde; border-radius: 18px; background: #fff; text-align: center; }
.error-panel h1 { font-size: 24px; }
.error-panel p { color: var(--muted); }
.button-link { display: inline-flex; padding: 8px 15px; border-radius: 9px; background: var(--brand); color: #fff; text-decoration: none; font-size: 13px; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .university-app { width: min(100% - 18px, 620px); padding-top: 10px; }
  .site-bar { align-items: flex-start; flex-direction: column; gap: 4px; }
  .school-hero { align-items: flex-start; flex-direction: column; padding: 20px; }
  .school-logo { width: 82px; height: 82px; flex-basis: 82px; }
  .school-brand { gap: 14px; }
  .university-picker { padding: 24px 20px 20px; }
  .detail-section { padding: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-columns { grid-template-columns: 1fr; gap: 22px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .university-list { grid-template-columns: 1fr; max-height: none; }
}
