:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #d8e5e7;
  --panel: rgba(255, 255, 255, 0.9);
  --bg: #f4fbfa;
  --cyan: #0891b2;
  --green: #13a074;
  --violet: #6d5dfc;
  --orange: #e1812c;
  --red: #d64545;
  --soft: #eef8f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(8, 145, 178, 0.07) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #f4fbfa 0%, #f8f6ff 54%, #fffaf4 100%);
  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(1220px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hero {
  min-height: 236px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 26px;
  padding: 34px;
  border: 1px solid rgba(8, 145, 178, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 253, 250, 0.86)),
    repeating-linear-gradient(135deg, rgba(109, 93, 252, 0.14) 0 1px, transparent 1px 18px);
  box-shadow: 0 20px 46px rgba(31, 74, 88, 0.13);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  color: #122138;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: 0;
}

.heroText {
  max-width: 760px;
  margin: 14px 0 0;
  color: #475569;
  line-height: 1.75;
}

.heroStat {
  min-height: 170px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(8, 145, 178, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 253, 245, 0.9)),
    linear-gradient(90deg, rgba(8, 145, 178, 0.08) 1px, transparent 1px) 0 0 / 18px 18px;
  text-align: left;
}

.heroStat strong {
  display: block;
  color: var(--violet);
  font-size: 34px;
  line-height: 1;
}

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

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

.tabs {
  padding: 10px;
  border: 1px solid rgba(8, 145, 178, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.switchButton,
.tab,
.smallButton,
.primary,
.secondary {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #516071;
  box-shadow: 0 8px 22px rgba(18, 33, 56, 0.06);
  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(-2px);
  box-shadow: 0 16px 32px rgba(18, 33, 56, 0.12);
}

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

.switchButton.active,
.tab.active,
.primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #fff;
}

.primary.green {
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.primary.blue {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
}

.secondary {
  background: #eef8f5;
  color: #315064;
}

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

.panel,
.loginPanel {
  border: 1px solid rgba(8, 145, 178, 0.16);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  box-shadow: 0 16px 36px rgba(31, 74, 88, 0.08);
  animation: surfaceIn 0.24s ease both;
}

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

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

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

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

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

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

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

.row,
.task,
.checkItem {
  transition: background 0.16s ease, padding 0.16s ease, border-color 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: rgba(236, 253, 245, 0.78);
}

.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: #eef2ff;
  color: var(--violet);
  font-size: 13px;
  font-weight: 700;
}

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

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

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

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(8, 145, 178, 0.24);
  border-radius: 8px;
  background: #ecfeff;
  color: #155e75;
}

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

.metric {
  min-height: 108px;
  padding: 18px;
  border: 1px solid rgba(8, 145, 178, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.9), rgba(238, 242, 255, 0.8)),
    linear-gradient(90deg, rgba(8, 145, 178, 0.08) 1px, transparent 1px) 0 0 / 20px 20px;
}

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

.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 #dff7f1;
  border-top-color: var(--violet);
  border-right-color: var(--cyan);
  border-radius: 50%;
  background: #fff;
  text-align: center;
  box-shadow: inset 0 0 0 8px #f8fffd;
}

.ring strong {
  display: block;
  color: var(--violet);
  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: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid rgba(8, 145, 178, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #eef8ff);
  color: #315064;
  font-weight: 800;
  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: rgba(255, 255, 255, 0.86);
  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(--cyan);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.14);
}

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

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

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

.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: #ecfeff;
  box-shadow: inset 4px 0 0 var(--violet);
}

.chat {
  min-height: 280px;
  padding: 14px;
  border: 1px solid rgba(8, 145, 178, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(236, 253, 245, 0.62)),
    linear-gradient(90deg, rgba(8, 145, 178, 0.06) 1px, transparent 1px) 0 0 / 18px 18px;
}

.message {
  max-width: 86%;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  line-height: 1.6;
  box-shadow: 0 8px 18px rgba(18, 33, 56, 0.06);
}

.message.user {
  margin-left: auto;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #fff;
}

.reportBox {
  white-space: pre-wrap;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(8, 145, 178, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  line-height: 1.7;
}

.empty {
  padding: 24px;
  border: 1px dashed rgba(8, 145, 178, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  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, var(--green), var(--cyan), var(--violet));
  color: #fff;
  font-weight: 800;
  text-align: center;
}

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

.tableLike span {
  padding: 12px;
  border-right: 1px solid rgba(8, 145, 178, 0.16);
  border-bottom: 1px solid rgba(8, 145, 178, 0.16);
  background: rgba(255, 255, 255, 0.76);
  color: #315064;
  font-size: 14px;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(18, 33, 56, 0.28);
}

.drawerPanel {
  width: min(540px, 100%);
  height: 100%;
  overflow: auto;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff, #f2fffc);
  box-shadow: -20px 0 44px rgba(18, 33, 56, 0.18);
  animation: labDrawerIn 0.22s ease both;
}

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

@keyframes surfaceIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes labDrawerIn {
  from {
    transform: translateX(28px);
  }
  to {
    transform: translateX(0);
  }
}

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

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

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

  .drawerPanel {
    width: 100%;
  }
}
