:root {
  --ink: #101214;
  --paper: #f4f1ea;
  --panel: #fffdf8;
  --muted: #626863;
  --line: #d8d1c5;
  --green: #0f8f6a;
  --green-soft: #dff4ed;
  --amber: #9d6410;
  --amber-soft: #f7ead1;
  --rust: #b54a2f;
  --rust-soft: #f5ded6;
  --blue: #2457a6;
  --blue-soft: #dce8fb;
  --shadow: 0 18px 54px rgb(26 22 16 / .08);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }

.topbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  width: min(1360px, calc(100% - 32px));
  margin: 14px auto 28px;
  padding: 10px 12px;
  border: 1px solid rgb(16 18 20 / .12);
  border-radius: 999px;
  background: rgb(255 253 248 / .9);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 32px rgb(26 22 16 / .06);
}

.brand, .nav, .hero-actions, .chip-row, .evidence, .admin-toolbar, .dialog-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--panel);
  background: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.nav {
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.nav a {
  padding: 8px 11px;
  border-radius: 999px;
}

.nav a:hover { background: rgb(16 18 20 / .06); color: var(--ink); }

main {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  gap: 18px;
  padding: 8px 0 42px;
}

.hero-copy,
.hero-panel,
.form-card,
.report-card,
.school-card,
.source-list,
.dialog-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy { padding: clamp(32px, 6vw, 70px); }

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 850;
}

h1 {
  max-width: 900px;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 1;
  letter-spacing: 0;
}

h2 { font-size: clamp(30px, 4vw, 52px); line-height: 1.05; }
h3 { font-size: 22px; line-height: 1.18; }
h4 { font-size: 18px; }

.lead {
  max-width: 760px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions, .admin-toolbar, .dialog-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 850;
}

.button.primary { color: var(--panel); background: var(--ink); }
.button.secondary { color: var(--ink); background: var(--green-soft); border-color: rgb(15 143 106 / .22); }
.button.ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button:active { transform: translateY(1px) scale(.99); }

.hero-panel {
  overflow: hidden;
  color: var(--panel);
  background: var(--ink);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgb(255 253 248 / .14);
  color: rgb(255 253 248 / .72);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 24px;
}

.metrics div {
  min-height: 104px;
  border: 1px solid rgb(255 253 248 / .14);
  border-radius: 14px;
  padding: 16px;
  background: rgb(255 253 248 / .08);
}

.metrics b { display: block; font-size: 40px; }
.metrics span { color: rgb(255 253 248 / .76); }

.status-list {
  display: grid;
  gap: 10px;
  padding: 0 24px 24px;
}

.status-list div {
  border-radius: 12px;
  padding: 13px;
  background: rgb(255 253 248 / .08);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
}
.dot.ok { background: var(--green); }
.dot.warn { background: var(--amber); }

.section { padding: 46px 0; }

.section-head {
  display: grid;
  grid-template-columns: .74fr 1fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}

.section-head.compact { display: block; }
.section-head p, .section-head.compact p { color: var(--muted); }
.section-head.compact p { margin-top: 12px; }

.school-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.school-card { padding: 20px; }
.school-card p { margin-top: 10px; color: var(--muted); }
.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}
.meta { color: var(--muted); }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 0;
}

.mini-stats div {
  border-radius: 12px;
  padding: 10px;
  background: rgb(16 18 20 / .045);
}

.mini-stats dt { color: var(--muted); font-size: 12px; }
.mini-stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 900; }

.chip-row {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.chip, .status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.chip { color: var(--muted); background: rgb(16 18 20 / .06); }
.status.ok { color: var(--green); background: var(--green-soft); }
.status.warn { color: var(--amber); background: var(--amber-soft); }
.status.risk { color: var(--rust); background: var(--rust-soft); }
.status.info { color: var(--blue); background: var(--blue-soft); }

.two-column {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(440px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.form-card, .report-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.form-card { grid-template-columns: repeat(2, 1fr); }
.form-card .full { grid-column: 1 / -1; }

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

input, textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea { min-height: 128px; resize: vertical; }
select[multiple] { min-height: 92px; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(15 143 106 / .14); }

.muted { color: var(--muted); }
.timestamp { color: var(--muted); font-size: 13px; }

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.professor-item, .info-band, .source-row {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.professor-item:first-of-type, .info-band:first-of-type, .source-row:first-child { border-top: 0; }

.professor-top, .task-item, .source-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.score {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--panel);
  background: var(--green);
  font-weight: 900;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fact-grid.small { grid-template-columns: repeat(3, 1fr); }

.fact-grid div {
  min-width: 0;
  border-radius: 12px;
  padding: 10px;
  background: rgb(16 18 20 / .045);
}

.fact-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.fact-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.publication-box {
  border-radius: 12px;
  padding: 12px;
  background: var(--green-soft);
}

.publication-box ul, .analysis-columns ul, .reason-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.analysis-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.analysis-columns section, .timeline article {
  border-radius: 12px;
  padding: 12px;
  background: rgb(16 18 20 / .045);
}

.evidence {
  flex-wrap: wrap;
  gap: 6px;
}

.evidence a, .source-row a {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 850;
}

.address-line {
  color: var(--muted);
}

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

.timeline p { margin-top: 4px; color: var(--muted); }

.risk-list {
  display: grid;
  gap: 8px;
}

.risk-list p {
  border-radius: 12px;
  padding: 10px;
  color: var(--rust);
  background: var(--rust-soft);
  font-weight: 750;
}

.source-list {
  padding: 4px 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

table { width: 100%; min-width: 940px; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 14px; text-align: left; vertical-align: top; }
th { color: var(--muted); background: rgb(16 18 20 / .04); font-size: 13px; }
td { font-size: 14px; }

dialog {
  width: min(680px, calc(100% - 32px));
  border: 0;
  padding: 0;
  border-radius: 18px;
  background: transparent;
}
dialog::backdrop { background: rgb(16 18 20 / .38); }
.dialog-card { padding: 24px; }
.dialog-card label { margin-top: 14px; }

@media (max-width: 1040px) {
  .topbar, .hero, .section-head, .two-column, .school-grid, .form-card, .analysis-columns, .timeline, .fact-grid {
    grid-template-columns: 1fr;
  }
  .nav { display: none; }
}

@media (max-width: 640px) {
  main, .topbar { width: min(100% - 20px, 1360px); }
  .metrics { grid-template-columns: 1fr; }
  h1 { font-size: 40px; }
  .report-head { display: grid; }
  .report-actions { justify-content: flex-start; }
  .professor-top, .task-item, .source-row { grid-template-columns: 1fr; }
}
