:root {
  --red: #f37021;
  --red-dark: #d95a11;
  --cream: #fff0e7;
  --paper: #ffffff;
  --line: #e6dfd8;
  --ink: #242424;
  --muted: #746d67;
  --soft: #faf8f5;
  --green: #0fb56d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(243, 112, 33, .13), transparent 30%),
    linear-gradient(135deg, #fffdfb 0%, #fff5ee 45%, #ffffff 100%);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

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

.topbar,
.control-panel,
.summary-strip,
.school-list,
.detail-panel,
.status-line {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 16px 40px rgba(102, 50, 22, .08);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 18px;
}

.eyebrow {
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
}

h1, h2, h3, p { margin: 0; }

h1 {
  margin-top: 4px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar a,
button {
  color: var(--red-dark);
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  border: 1px solid #e2bda1;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.topbar a { padding: 9px 14px; }

.control-panel {
  display: grid;
  grid-template-columns: 150px 130px 130px minmax(260px, 1fr) 108px;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select,
input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  border: 1px solid #dfc7b8;
  border-radius: 12px;
  background: #fff;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, .12);
}

#clearButton {
  align-self: end;
  height: 42px;
  background: var(--red);
  color: #fff;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 14px;
}

.summary-strip article {
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fff7e8 100%);
  border: 1px solid #f0d8c1;
}

.summary-strip b {
  display: block;
  color: var(--red);
  font-size: 25px;
  line-height: 1;
}

.summary-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(430px, 42%) 1fr;
  gap: 14px;
  height: calc(100vh - 210px);
  min-height: 560px;
  margin-top: 14px;
}

.school-list,
.detail-panel {
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.list-head strong { font-size: 19px; }
.list-head span { color: var(--muted); font-weight: 700; }

.school-scroll {
  height: calc(100% - 52px);
  overflow: auto;
  padding: 10px;
}

.school-card {
  display: grid;
  gap: 9px;
  width: 100%;
  margin-bottom: 10px;
  padding: 13px 14px;
  text-align: left;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
}

.school-card.is-active {
  border-color: var(--red);
  box-shadow: inset 5px 0 0 var(--red), 0 12px 26px rgba(139, 16, 24, .1);
}

.school-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.school-name {
  font-size: 21px;
  font-weight: 950;
}

.score-pill {
  color: #fff;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--red);
  font-size: 17px;
  font-weight: 950;
}

.school-sub {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.mini-groups,
.group-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.mini-group,
.group-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #e7c9b2;
  background: #fff9f0;
  color: var(--red-dark);
  font-size: 14px;
  font-weight: 900;
}

.group-chip.is-active {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.detail-panel {
  padding: 16px;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  height: 100%;
  text-align: center;
  color: var(--muted);
}

.empty-state span {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  color: #fff;
  background: var(--red);
  font-size: 34px;
  font-weight: 950;
}

.empty-state strong {
  color: var(--ink);
  font-size: 24px;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-title h2 {
  margin-top: 3px;
  font-size: 30px;
  line-height: 1.15;
}

#detailMeta {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

#copyButton {
  padding: 9px 13px;
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.group-chips {
  margin: 13px 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: calc(100vh - 370px);
  min-height: 390px;
}

.detail-card {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.detail-card h3 {
  padding: 12px 14px;
  color: var(--red-dark);
  border-bottom: 1px solid var(--line);
  background: #fff8ec;
}

.row-list {
  height: calc(100% - 50px);
  overflow: auto;
}

.data-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1e2d4;
}

.data-row strong {
  display: block;
  font-size: 17px;
  line-height: 1.32;
}

.data-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.row-score {
  text-align: right;
  color: var(--red);
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

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

.status-line {
  margin-top: 12px;
  padding: 10px 14px;
  color: var(--muted);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 920px) {
  .app-shell { width: min(100% - 18px, 720px); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .control-panel { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }
  .school-list { height: 520px; }
  .detail-panel { min-height: 680px; }
  .detail-grid { grid-template-columns: 1fr; height: auto; }
  .detail-card { height: 340px; }
}
