:root {
  --page-bg: #f4f7fe;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --line: #e9ecf5;
  --line-strong: #d9e0ef;
  --text: #101019;
  --text-2: #444963;
  --muted: #838bab;
  --muted-soft: #a4abc0;
  --primary: #6574fc;
  --primary-dark: #4a4fed;
  --primary-weak: #ebf1ff;
  --blue: #2091ff;
  --blue-weak: #e9f4ff;
  --purple: #6f60ff;
  --purple-weak: #f0f0ff;
  --green: #2dc01f;
  --green-weak: #e9fbe4;
  --orange: #db7505;
  --orange-weak: #fff3e6;
  --danger: #e0443f;
  --danger-weak: #fff0eb;
  --shadow: 0 18px 40px rgba(112, 144, 176, 0.08);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 1100px;
  min-height: 100%;
  margin: 0;
  background: var(--page-bg);
}

body {
  font-size: 14px;
  line-height: 1.5;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid rgba(101, 116, 252, 0.22);
  outline-offset: 2px;
}

.demo-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 28px;
  border-bottom: 1px solid rgba(217, 224, 239, 0.9);
  background: rgba(244, 247, 254, 0.94);
  backdrop-filter: blur(14px);
}

.demo-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.demo-copy strong {
  color: #323a55;
  font-size: 14px;
}

.demo-copy span {
  color: var(--muted);
  font-size: 12px;
}

.demo-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #eef2f9;
}

.demo-switch button {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #707a96;
  font-size: 12px;
  font-weight: 600;
}

.demo-switch button.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(52, 66, 112, 0.1);
}

.page-shell {
  width: 100%;
  min-height: calc(100vh - 58px);
  padding: 24px 28px 40px;
}

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.report-heading {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.round-back {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: #66708c;
  font-size: 25px;
  line-height: 1;
}

.round-back:hover {
  border-color: #aeb9dc;
  color: var(--primary);
}

.report-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.title-line h1 {
  max-width: 800px;
  margin: 0;
  overflow: hidden;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-weak);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.type-tag.practice {
  color: #5a50d9;
  background: #efedff;
}

.type-tag.homework {
  color: #7260e8;
  background: var(--purple-weak);
}

.report-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.report-meta strong {
  color: var(--text-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #424a67;
  font-weight: 600;
}

.btn:hover {
  border-color: #aeb8d5;
  color: var(--text);
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 16px rgba(93, 101, 237, 0.14);
}

.btn.primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.btn:disabled {
  cursor: default;
  opacity: 0.56;
}

.report-layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.structure-panel {
  position: sticky;
  top: 82px;
  overflow: hidden;
}

.structure-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.structure-head h2 {
  margin: 0;
  font-size: 16px;
}

.structure-head span {
  color: var(--muted);
  font-size: 11px;
}

.structure-nav {
  display: grid;
  gap: 4px;
  padding: 14px 12px 18px;
}

.structure-item {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4f5874;
  text-align: left;
}

.structure-item.entire {
  grid-template-columns: 1fr;
  margin-bottom: 6px;
  padding-left: 12px;
  color: var(--primary-dark);
  font-weight: 650;
}

.structure-item:hover {
  background: #f4f7fd;
}

.structure-item.active {
  background: #e8edff;
  color: var(--primary-dark);
}

.structure-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eff2f8;
  color: #8490ad;
  font-size: 10px;
  font-weight: 650;
}

.structure-item.active .structure-index {
  background: #fff;
  color: var(--primary);
}

.structure-label {
  min-width: 0;
}

.structure-label strong,
.structure-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure-label strong {
  color: #3c455f;
  font-size: 12px;
}

.structure-label small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.report-main {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.summary-panel {
  padding: 22px 24px;
}

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

.section-head h2 {
  margin: 0;
  color: #303851;
  font-size: 17px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.scope-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--primary-dark);
  background: var(--primary-weak);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-card {
  min-height: 120px;
  padding: 17px 18px;
  border-radius: 13px;
}

.metric-card.blue {
  background: var(--blue-weak);
}

.metric-card.purple {
  background: #eef0ff;
}

.metric-card.green {
  background: var(--green-weak);
}

.metric-card.orange {
  background: var(--orange-weak);
}

.metric-card span,
.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card span {
  color: #7b86a4;
  font-size: 11px;
}

.metric-card strong {
  margin-top: 8px;
  font-size: 27px;
  line-height: 1.15;
}

.metric-card small {
  margin-top: 8px;
  color: #7e87a1;
  font-size: 10px;
}

.metric-card.blue strong {
  color: var(--blue);
}

.metric-card.purple strong {
  color: #5f69ee;
}

.metric-card.green strong {
  color: var(--green);
}

.metric-card.orange strong {
  color: #d78a20;
}

.time-facts {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid #e1e6f4;
  border-radius: 11px;
  background: #fbfcff;
}

.time-facts > div {
  min-width: 170px;
}

.time-facts > div + div {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.time-facts span,
.time-facts strong {
  display: block;
}

.time-facts span {
  color: var(--muted);
  font-size: 10px;
}

.time-facts strong {
  margin-top: 3px;
  color: #48516b;
  font-size: 12px;
}

.summary-note {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 9px;
  background: #f1f3ff;
  color: #6d7693;
  font-size: 10px;
}

.content-panel {
  padding: 22px 24px 12px;
}

.content-table {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.content-row {
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) 0.7fr 0.7fr 0.7fr auto;
  gap: 18px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}

.content-row:last-child {
  border-bottom: 0;
}

.content-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-glyph {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  color: var(--primary);
  background: var(--primary-weak);
  font-size: 15px;
  font-weight: 700;
}

.content-glyph.practice {
  color: #6757e8;
  background: #efedff;
}

.content-glyph.homework {
  color: #6f60ff;
  background: var(--purple-weak);
}

.content-identity strong,
.content-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-identity strong {
  color: #353e58;
  font-size: 13px;
}

.content-identity small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.progress-cell {
  min-width: 110px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-cell i {
  width: 82px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f7;
}

.progress-cell b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--primary);
}

.progress-cell strong {
  color: #39425c;
  font-size: 12px;
}

.result-cell span,
.result-cell strong,
.result-cell small {
  display: block;
}

.result-cell span {
  color: var(--muted);
  font-size: 9px;
}

.result-cell strong {
  margin-top: 3px;
  color: #39425c;
  font-size: 12px;
}

.result-cell small {
  margin-top: 2px;
  color: var(--muted-soft);
  font-size: 9px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.link-button {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 650;
}

.link-button:hover {
  background: var(--primary-weak);
}

.link-button.secondary {
  color: var(--muted);
}

.detail-panel {
  padding: 22px 24px;
}

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

.distribution > div {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
}

.distribution span,
.distribution strong {
  display: block;
}

.distribution span {
  color: var(--muted);
  font-size: 10px;
}

.distribution strong {
  margin-top: 5px;
  color: #3d4660;
  font-size: 15px;
}

.drawer-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  background: rgba(24, 29, 50, 0.28);
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(560px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -20px 0 55px rgba(26, 32, 61, 0.18);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 0;
  font-size: 17px;
}

.drawer-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.drawer-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f1f3f8;
  color: var(--muted);
  font-size: 20px;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 22px;
}

.preview-block {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbff;
}

.preview-block + .preview-block {
  margin-top: 12px;
}

.preview-block span,
.preview-block strong,
.preview-block p {
  display: block;
}

.preview-block span {
  color: var(--muted);
  font-size: 10px;
}

.preview-block strong {
  margin-top: 5px;
  color: #3a435c;
  font-size: 14px;
}

.preview-block p {
  margin: 8px 0 0;
  color: #68718b;
  font-size: 11px;
  line-height: 1.7;
}

.toast-root {
  position: fixed;
  z-index: 90;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
}

.toast {
  min-width: 240px;
  padding: 11px 16px;
  border: 1px solid #dce3f5;
  border-radius: 10px;
  background: #fff;
  color: #343b58;
  box-shadow: 0 16px 34px rgba(44, 53, 98, 0.17);
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-row {
    grid-template-columns: minmax(260px, 1.4fr) 0.7fr 0.7fr auto;
  }

  .content-row > :nth-child(4) {
    display: none;
  }
}
