:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #65758b;
  --line: #d9e2ee;
  --panel: #ffffff;
  --bg: #eef3f8;
  --blue: #1f5fbf;
  --green: #16836f;
  --orange: #c96b15;
  --red: #b42318;
  --navy: #20314f;
  --soft: #f7f9fc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(31, 95, 191, 0.06), transparent 280px),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.hero {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(135deg, #1f5fbf, #20314f 62%, #16836f);
  color: #fff;
  box-shadow: 0 18px 42px rgba(32, 49, 79, 0.22);
}

.eyebrow {
  margin: 0 0 10px;
  opacity: 0.86;
  font-size: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

.heroText {
  max-width: 720px;
  margin: 14px 0 0;
  line-height: 1.75;
  opacity: 0.9;
}

.heroStat {
  width: 146px;
  min-height: 128px;
  flex: 0 0 146px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  text-align: center;
}

.heroStat strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.heroStat span {
  display: block;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.projectSwitch,
.tabs,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(32, 49, 79, 0.08);
}

.switchButton,
.tab,
.smallButton,
.primary,
.secondary {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.05), 0 8px 20px rgba(23, 32, 51, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.switchButton:hover,
.tab:hover,
.smallButton:hover,
.primary:hover,
.secondary:hover,
.studentCard:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.11);
}

.switchButton:active,
.tab:active,
.smallButton:active,
.primary:active,
.secondary:active {
  transform: translateY(0);
}

.switchButton.active,
.tab.active,
.primary {
  background: var(--navy);
  color: #fff;
}

.primary.blue {
  background: var(--blue);
}

.primary.green {
  background: var(--green);
}

.secondary {
  background: #edf2f8;
  color: #3b4c64;
}

.layout {
  display: grid;
  grid-template-columns: 292px 1fr;
  gap: 18px;
  align-items: start;
}

.panel,
.loginPanel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  box-shadow: 0 12px 32px rgba(32, 49, 79, 0.07);
  animation: panelIn 0.22s ease both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue), transparent 68%);
  opacity: 0.7;
}

.termPanel {
  margin: 14px 0 18px;
  padding: 16px 18px;
}

.termPanel .titleRow {
  margin-bottom: 0;
}

.field.compact {
  min-width: 240px;
  max-width: 320px;
}

.loginPanel {
  max-width: 620px;
  margin: 22px auto 0;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.layout > .side:first-child {
  position: sticky;
  top: 84px;
}

.accountCard,
.studentCard,
.row,
.task,
.log,
.checkItem {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.row,
.task,
.log,
.checkItem {
  transition: background 0.16s ease, padding 0.16s ease;
}

.row:hover,
.task:hover,
.checkItem:hover {
  margin-left: -10px;
  margin-right: -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 8px;
  background: var(--soft);
}

.studentCard {
  width: 100%;
  display: block;
  text-align: left;
  background: transparent;
  color: var(--ink);
}

.accountCard:first-child,
.studentCard:first-child,
.row:first-child,
.task:first-child,
.log:first-child,
.checkItem:first-child {
  border-top: 0;
}

.titleRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 17px;
}

.muted,
.meta,
.hint {
  color: var(--muted);
  line-height: 1.6;
}

.meta {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #e9f1ff;
  color: var(--blue);
  font-size: 13px;
}

.badge.ok {
  background: #eaf8f3;
  color: var(--green);
}

.badge.warn {
  background: #fff3e7;
  color: var(--orange);
}

.badge.danger {
  background: #fff0ef;
  color: var(--red);
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #b8d4ff;
  border-radius: 8px;
  background: #eef5ff;
  color: #17427e;
}

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

.metric {
  min-height: 102px;
  padding: 18px;
  border: 1px solid #e3eaf4;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #f4f7fb);
}

.metric strong {
  display: block;
  color: var(--blue);
  font-size: 30px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.ring {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 14px solid #dce8f8;
  border-top-color: var(--blue);
  border-right-color: var(--green);
  border-radius: 50%;
  background: #fff;
  text-align: center;
  box-shadow: inset 0 0 0 8px #f7f9fc;
}

.ring strong {
  display: block;
  color: var(--blue);
  font-size: 42px;
  line-height: 1;
}

.ring span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.flow span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  color: #2d3b52;
  font-weight: 700;
  text-align: center;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  padding: 12px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.14);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.bar {
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: #e2e9f2;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.bars {
  display: grid;
  gap: 14px;
}

.bars > div > span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.selected {
  margin-left: -10px;
  margin-right: -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 8px;
  background: #eaf2ff;
  box-shadow: inset 4px 0 0 var(--blue);
}

.chat {
  min-height: 260px;
  padding: 14px;
  border-radius: 8px;
  background: #f7f9fc;
}

.message {
  max-width: 86%;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  line-height: 1.6;
}

.message.user {
  margin-left: auto;
  background: var(--green);
  color: #fff;
}

.reportBox {
  white-space: pre-wrap;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #e3eaf4;
  border-radius: 8px;
  background: #f7f9fc;
  line-height: 1.7;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  text-align: center;
}

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

.heatmap span {
  min-height: 78px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #1f5fbf, #16836f);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.tableLike {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.tableLike span {
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
  color: #334155;
  font-size: 14px;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(20, 30, 48, 0.38);
}

.drawerPanel {
  width: min(520px, 100%);
  height: 100%;
  overflow: auto;
  padding: 24px;
  background: #fff;
  box-shadow: -18px 0 40px rgba(20, 30, 48, 0.2);
  animation: drawerIn 0.2s ease both;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drawerIn {
  from {
    transform: translateX(24px);
  }
  to {
    transform: translateX(0);
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .heroStat {
    width: 100%;
    min-height: auto;
    flex: none;
  }

  .layout,
  .grid2,
  .flow,
  .metrics {
    grid-template-columns: 1fr;
  }

  .layout > .side:first-child,
  .tabs {
    position: static;
  }

  .drawerPanel {
    width: 100%;
  }
}
