:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --panel: #ffffff;
  --line: #d9ded5;
  --text: #20231f;
  --muted: #667064;
  --green: #1f7a4d;
  --amber: #a86400;
  --red: #c52b2b;
  --blue: #245d8f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 36px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
}

.status-note {
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--green);
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 110px);
}

.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.section-title {
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-title:first-child {
  margin-top: 0;
}

button {
  font: inherit;
}

.filter,
.subject {
  width: 100%;
  display: block;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.filter.active,
.subject.active {
  border-color: var(--green);
  color: var(--green);
  font-weight: 700;
  background: #eef7f1;
}

.content {
  padding: 28px 36px 48px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

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

.insight {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
}

.insight h2 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.insight ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.insight li {
  margin-bottom: 6px;
}

.insight .muted {
  color: var(--muted);
}

.tag {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.subject-report {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.subject-report:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.subject-report h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.subject-report p {
  line-height: 1.6;
}

.metric {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.metric b {
  display: block;
  font-size: 26px;
  margin-bottom: 4px;
}

.metric span {
  color: var(--muted);
}

.day {
  margin-bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
}

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

.day-title {
  font-size: 20px;
  font-weight: 800;
}

.badge {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.badge.draft {
  color: var(--amber);
  background: #fff4df;
  border: 1px solid #efc77d;
}

.badge.confirmed {
  color: var(--green);
  background: #eef7f1;
  border: 1px solid #8ac39d;
}

.day-body {
  padding: 18px 20px 22px;
}

.note {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.subject-block {
  margin-top: 18px;
}

.subject-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 10px;
}

.mistakes {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--red);
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.thumb {
  border: 1px solid var(--line);
  background: #f7f8f5;
  padding: 8px;
  cursor: zoom-in;
}

.thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #ecefea;
}

.thumb div {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

dialog {
  width: min(92vw, 980px);
  border: 0;
  padding: 16px;
  background: var(--panel);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

#viewerImage {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  display: block;
}

.close {
  float: right;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

#viewerTitle {
  margin-top: 10px;
  color: var(--muted);
}

.empty {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar {
    display: block;
    padding: 22px;
  }

  .status-note {
    display: inline-block;
    margin-top: 14px;
  }

  .layout {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 20px;
  }

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

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