:root {
  color-scheme: light;
  --blue-900: #063f82;
  --blue-800: #0756a8;
  --blue-700: #0965c3;
  --blue-100: #eaf3ff;
  --blue-050: #f5f9ff;
  --navy: #102a43;
  --muted: #5c6f84;
  --line: #d8e2ef;
  --line-strong: #b7cae0;
  --success: #18794e;
  --success-bg: #ecf8f2;
  --error: #a52a2a;
  --error-bg: #fff1f0;
  --red: #c9363f;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(21, 67, 117, 0.09);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--blue-050); }

body {
  min-width: 320px;
  margin: 0;
  color: var(--navy);
  background: var(--white);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.school-header {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: var(--blue-800);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 900px);
  min-height: 82px;
  margin: 0 auto;
  padding: 14px 22px;
}

.school-mark {
  z-index: 1;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--white);
  object-fit: cover;
}

.school-name {
  z-index: 1;
  margin-left: 14px;
  font-size: clamp(18px, 4.8vw, 25px);
  font-weight: 700;
  letter-spacing: .02em;
}

.sun-mark {
  position: absolute;
  right: -25px;
  bottom: -61px;
  width: 150px;
  height: 150px;
  border: 3px solid rgba(255,255,255,.14);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(255,255,255,.035), 0 0 0 37px rgba(255,255,255,.025);
}

.page-shell {
  width: min(100%, 900px);
  min-height: calc(100vh - 220px);
  margin: 0 auto;
  background: var(--white);
}

.intro { padding: 28px 20px 22px; text-align: center; }

.intro h1 {
  margin: 0;
  color: var(--blue-800);
  font-size: clamp(25px, 6.6vw, 36px);
  line-height: 1.3;
  letter-spacing: .025em;
}

.intro p { margin: 13px 0 0; color: var(--muted); font-size: 16px; }
.intro p span { display: inline; }

.sun-divider { display: flex; align-items: center; gap: 8px; width: 118px; margin: 15px auto 0; }
.sun-divider::before, .sun-divider::after { width: 44px; height: 1px; content: ""; background: var(--line-strong); }
.sun-divider span { width: 12px; height: 12px; border: 2px solid var(--blue-700); border-radius: 50%; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  min-height: 56px;
  border: 0;
  background: var(--white);
  color: var(--muted);
  font-size: 17px;
  font-weight: 650;
}

.tab::after {
  position: absolute;
  right: 14%;
  bottom: -1px;
  left: 14%;
  height: 3px;
  content: "";
  background: transparent;
}

.tab.is-active { color: var(--blue-800); }
.tab.is-active::after { background: var(--blue-700); }
.tab:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid rgba(9,101,195,.22); outline-offset: 2px; }

.panel { padding: 24px 18px 34px; }
.panel:not(.is-active) { display: none; }

.search-form {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.search-form label, .class-toolbar label { margin-top: 4px; font-weight: 650; }

input, select {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
}

input::placeholder { color: #94a3b3; }
input:focus, select:focus { border-color: var(--blue-700); box-shadow: 0 0 0 3px rgba(9,101,195,.08); }

.primary-button, .secondary-button {
  min-height: 52px;
  margin-top: 9px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: .02em;
}

.primary-button { border: 1px solid var(--blue-700); background: var(--blue-700); color: var(--white); }
.primary-button:hover { background: var(--blue-900); }
.primary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button { border: 1px solid var(--blue-700); background: var(--white); color: var(--blue-800); }
.secondary-button:hover { background: var(--blue-050); }

.status { margin: 20px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; }
.status.success { border-color: #b7dfcc; background: var(--success-bg); color: var(--success); }
.status.error { border-color: #efc0bd; background: var(--error-bg); color: var(--error); }
.status.loading { background: var(--blue-050); color: var(--blue-900); }

.result-area, .roster-area { margin-top: 16px; }

.result-heading { margin: 0 0 10px; color: var(--blue-900); font-size: 18px; }

.student-list { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }

.student-card { padding: 16px; background: var(--white); }
.student-card + .student-card { border-top: 1px solid var(--line); }
.student-card header { margin-bottom: 12px; text-align: center; }
.student-card h3 { margin: 0; color: var(--navy); font-size: 18px; }
.class-result {
  display: grid;
  gap: 2px;
  margin: 0 0 16px;
  padding: 14px 16px 16px;
  border: 1px solid #bfd7f1;
  border-radius: 8px;
  background: var(--blue-050);
  color: var(--blue-800);
  text-align: center;
}
.class-result span { color: var(--muted); font-size: 13px; font-weight: 650; letter-spacing: .08em; }
.class-result strong { font-size: clamp(28px, 8vw, 36px); line-height: 1.2; letter-spacing: .05em; }
.student-card dl { display: grid; grid-template-columns: 104px 1fr; gap: 6px 10px; margin: 0; }
.student-card dt { color: var(--muted); }
.student-card dd { margin: 0; overflow-wrap: anywhere; }

.class-toolbar { display: grid; gap: 8px; }
.class-summary { min-height: 25px; margin: 4px 0 0; color: var(--muted); }

.roster-header { display: none; }
.roster-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.roster-row:first-child { border-top: 1px solid var(--line); }
.roster-no { color: var(--muted); text-align: center; }
.roster-main strong { display: block; font-size: 16px; }
.roster-main span { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; }
.roster-id { align-self: center; color: var(--blue-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
.roster-id small { display: block; color: var(--muted); font-size: 11px; text-align: right; }

footer {
  display: grid;
  gap: 5px;
  padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--blue-050);
  color: var(--blue-800);
  text-align: center;
}
footer strong { font-size: 17px; }
[hidden] { display: none !important; }

@media (max-width: 480px) {
  .intro p span { display: block; }
}

@media (min-width: 720px) {
  body { background: var(--blue-050); }
  .school-header { box-shadow: 0 3px 12px rgba(4,49,99,.14); }
  .page-shell { margin-top: 28px; border: 1px solid var(--line); border-radius: 12px 12px 0 0; box-shadow: var(--shadow); }
  .panel { padding: 28px 40px 44px; }
  .search-form { grid-template-columns: 150px 1fr; align-items: center; padding: 26px 30px; }
  .search-form label { margin: 0; }
  .primary-button, .secondary-button { grid-column: 2; }
  .student-card dl { grid-template-columns: 120px 1fr 120px 1fr; }
  .roster-area { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
  .roster-header, .roster-row { display: grid; grid-template-columns: 58px 100px minmax(180px, 1fr) 70px 140px; }
  .roster-header { padding: 12px 14px; background: var(--blue-050); color: var(--muted); font-weight: 650; }
  .roster-row { padding: 13px 14px; border-top: 1px solid var(--line); border-bottom: 0; }
  .roster-row:first-of-type { border-top: 0; }
  .roster-main { display: contents; }
  .roster-main strong, .roster-main span { margin: 0; color: inherit; font-size: 15px; }
  .roster-id { text-align: left; }
  .roster-id small { display: none; }
  footer { margin-top: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .panel.is-active { animation: fade-in .22s ease-out; }
  @keyframes fade-in { from { opacity: .35; transform: translateY(4px); } }
}
