:root {
  --bg: #f4f7fb;
  --bg-soft: #eef4ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe5f3;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1440px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34rem),
    linear-gradient(180deg, var(--bg-soft), var(--bg) 22rem);
  color: var(--text);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.68;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.hero {
  padding: 34px 28px 28px;
}

.hero__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  padding: 38px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.92)),
    linear-gradient(120deg, rgba(37, 99, 235, 0.12), rgba(22, 163, 74, 0.1));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero__inner::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 280px;
  height: 280px;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.11) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 99, 235, 0.11) 1px, transparent 1px);
  background-size: 22px 22px;
  transform: rotate(8deg);
}

.hero__copy,
.hero__panel {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.2;
}

h1 {
  max-width: 820px;
  font-size: clamp(34px, 4.4vw, 64px);
  font-weight: 900;
}

h2 {
  font-size: clamp(25px, 2.3vw, 36px);
  font-weight: 850;
}

h3 {
  font-size: 19px;
}

.hero__subtitle {
  max-width: 720px;
  margin: 18px 0 0;
  color: #334155;
  font-size: 20px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero__meta span {
  padding: 8px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-size: 14px;
}

.hero__panel {
  align-self: stretch;
  display: grid;
  gap: 16px;
  align-content: center;
  padding: 24px;
  border: 1px solid rgba(22, 163, 74, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.hero__mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  font-size: 24px;
  font-weight: 900;
}

.hero__panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.print-button,
.ghost-button,
.back-to-top {
  border: 0;
  cursor: pointer;
}

.print-button {
  width: max-content;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.print-button:hover,
.print-button:focus-visible {
  background: var(--blue-dark);
}

.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px 64px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

.toc {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.toc__title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.toc a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: #334155;
  font-size: 14px;
}

.toc a:hover,
.toc a.is-active {
  background: #e8f0ff;
  color: var(--blue);
  font-weight: 800;
}

.manual-content {
  display: grid;
  gap: 24px;
}

.section-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading p:not(.eyebrow) {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
}

.section-heading--actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.section-actions {
  display: flex;
  gap: 10px;
  align-items: start;
}

.notice {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.notice strong {
  display: block;
  margin-bottom: 4px;
}

.notice p {
  margin: 0;
  color: #334155;
}

.notice-primary {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.notice-success {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.notice-warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.capability-grid,
.role-grid,
.admin-grid,
.notes-grid,
.flow-grid {
  display: grid;
  gap: 16px;
}

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

.capability-card,
.role-card,
.admin-card,
.info-panel,
.notes-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.capability-card__icon {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.capability-card p,
.role-card p,
.admin-card p,
.info-panel p,
.notes-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.boundary-grid,
.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.check-list,
.muted-list,
.info-panel ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.check-list li::marker {
  color: var(--green);
}

.muted-list li::marker {
  color: var(--amber);
}

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

.role-card {
  border-top: 5px solid var(--blue);
}

.role-card--teacher {
  border-top-color: var(--green);
}

.role-card--super {
  border-top-color: var(--amber);
}

.role-card__summary {
  min-height: 52px;
}

.role-card dl {
  margin: 18px 0 0;
}

.role-card dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.role-card dd {
  margin: 4px 0 14px;
}

.flow-card {
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.flow-card--compact {
  margin-top: 0;
}

.flow-card__header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #f8fbff, #eef6ff);
}

.flow-card__header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.mermaid {
  margin: 0;
  padding: 22px;
  background: white;
  overflow-x: auto;
}

.step-list {
  display: grid;
  gap: 14px;
}

.step-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
}

.step-card > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  font-weight: 900;
}

.step-card p {
  margin: 7px 0;
  color: #334155;
}

.step-card small {
  color: var(--muted);
}

.example-text {
  padding: 14px;
  border-left: 4px solid var(--green);
  border-radius: 10px;
  background: #f0fdf4;
  color: #14532d;
}

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

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

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

.process-strip div {
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  background: #eff6ff;
}

.process-strip strong {
  display: block;
  color: var(--blue);
  font-size: 24px;
}

.process-strip span {
  color: #334155;
  font-weight: 800;
}

.ghost-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: #334155;
  font-weight: 800;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.faq-list {
  display: grid;
  gap: 10px;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
}

summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 900;
}

details p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.check-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.check-table th,
.check-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.check-table th {
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
}

.check-table td {
  background: white;
}

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

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 22px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.back-to-top.is-visible {
  display: block;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .toc {
    position: relative;
    top: auto;
    max-height: none;
  }

  .toc nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

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

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

@media (max-width: 760px) {
  .hero,
  .page-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero__inner,
  .section-card {
    padding: 20px;
    border-radius: 20px;
  }

  .capability-grid,
  .role-grid,
  .boundary-grid,
  .two-column,
  .admin-grid,
  .notes-grid,
  .flow-grid,
  .process-strip {
    grid-template-columns: 1fr;
  }

  .section-heading--actions {
    display: block;
  }

  .section-actions {
    margin-top: 12px;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

  .hero {
    padding: 0;
  }

  .hero__inner,
  .section-card,
  .flow-card,
  .capability-card,
  .role-card,
  .admin-card,
  .info-panel,
  .notes-grid article {
    box-shadow: none;
  }

  .page-shell {
    display: block;
    max-width: none;
    padding: 0;
  }

  .toc,
  .back-to-top,
  .print-button,
  .section-actions {
    display: none !important;
  }

  .manual-content {
    display: block;
  }

  .section-card {
    break-inside: avoid;
    margin: 0 0 18px;
  }

  .mermaid {
    overflow: visible;
  }
}
