:root {
  --navy: #112a5b;
  --blue: #1765d9;
  --cyan: #09b7d6;
  --orange: #ff9d34;
  --ink: #17233d;
  --muted: #5b6981;
  --line: #d9e3f1;
  --pale: #edf5ff;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #eaf1fa;
  color: var(--ink);
}
.slide {
  position: relative;
  margin: 20px auto;
  width: min(1280px, calc(100vw - 40px));
  min-height: min(960px, calc((100vw - 40px) * 0.75));
  padding: 52px 68px 68px;
  background: linear-gradient(145deg, #fff, #fbfdff 68%, #eef8ff);
  box-shadow: 0 16px 42px rgba(20, 47, 91, 0.16);
  overflow: hidden;
}
.slide:after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, #bdeaff, transparent 66%);
  opacity: 0.7;
  pointer-events: none;
}
.slide-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #dce9f7;
  padding-bottom: 13px;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.page-number {
  color: #71829b;
  letter-spacing: 0;
}
.eyebrow {
  position: relative;
  z-index: 1;
  margin: 36px 0 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--blue);
}
h1,
h2,
h3,
p,
ul,
ol,
pre,
table {
  position: relative;
  z-index: 1;
}
h1 {
  margin: 0;
  color: var(--navy);
  font-size: 52px;
  line-height: 1.25;
}
h2 {
  margin: 0 0 20px;
  color: var(--navy);
  font-size: 36px;
  line-height: 1.28;
}
h3 {
  margin: 0 0 9px;
  color: #1a3974;
  font-size: 22px;
}
.subtitle {
  font-size: 23px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 920px;
}
.lead {
  font-size: 25px;
  line-height: 1.58;
  font-weight: 700;
  color: #1a3974;
  max-width: 820px;
}
.lead strong {
  color: var(--blue);
}
.meta {
  position: absolute;
  bottom: 54px;
  left: 68px;
  z-index: 1;
  color: #63748d;
}
.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 27px;
}
.grid.two {
  grid-template-columns: repeat(2, 1fr);
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 18px rgba(31, 65, 112, 0.06);
}
.card.blue {
  border-top: 5px solid var(--cyan);
}
.card.orange {
  border-top: 5px solid var(--orange);
}
.card.dark {
  background: linear-gradient(145deg, #173b7a, #0f2858);
  border-color: #173b7a;
  color: #fff;
}
.card.dark h3,
.card.dark p {
  color: #fff;
}
.card p,
.card li {
  font-size: 17px;
  line-height: 1.62;
  color: #536078;
}
.card.dark p {
  color: #e7f0ff;
}
.num {
  font-size: 14px;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: 0.08em;
}
.card.dark .num {
  color: #a9eaff;
}
.card ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.flow {
  position: relative;
  z-index: 1;
  display: flex;
  margin: 34px 8px 0;
}
.step {
  position: relative;
  flex: 1;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  min-height: 156px;
}
.step:first-child {
  border-radius: 14px 0 0 14px;
}
.step:last-child {
  border-radius: 0 14px 14px 0;
}
.step:not(:last-child) {
  border-right: 0;
}
.step:not(:last-child):after {
  content: "›";
  position: absolute;
  right: -15px;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 24px;
}
.step p {
  margin: 7px 0;
  color: #536078;
  font-size: 17px;
  line-height: 1.6;
}
.compare {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.compare > div {
  border-radius: 14px;
  padding: 21px;
  background: #fff;
  border: 1px solid var(--line);
}
.compare .highlight {
  background: #eef7ff;
  border-color: #bcdcf5;
}
.code {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  padding: 19px 22px;
  border-radius: 14px;
  background: #112545;
  color: #dff4ff;
  font:
    19px/1.62 Consolas,
    "Courier New",
    monospace;
  white-space: pre-wrap;
  box-shadow: 0 10px 20px rgba(10, 35, 74, 0.16);
}
.tag {
  color: #7ee6ff;
}
.attr {
  color: #ffc36b;
}
.value {
  color: #a9e8ad;
}
.comment {
  color: #88a7c8;
}
.tip {
  position: relative;
  z-index: 1;
  margin-top: 17px;
  padding: 15px 19px;
  border-left: 6px solid var(--cyan);
  border-radius: 4px 11px 11px 4px;
  background: #eff8ff;
  color: #3e5878;
  font-size: 18px;
  line-height: 1.62;
}
.tip strong {
  color: var(--blue);
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-size: 17px;
}
.table th {
  padding: 13px 16px;
  background: #eaf3ff;
  text-align: left;
  color: #234d8b;
}
.table td {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  line-height: 1.55;
  color: #4d5e77;
}
.table td:first-child {
  width: 31%;
  font-weight: 800;
  color: #203a68;
}
.activity {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: center;
  margin-top: 28px;
  padding: 22px;
  background: linear-gradient(135deg, #edf8ff, #f8fcff);
  border: 1px solid #badfee;
  border-radius: 15px;
}
.time {
  padding-right: 19px;
  border-right: 1px dashed #9ccce0;
  text-align: center;
  color: #087ca0;
  font-weight: 900;
  font-size: 29px;
}
.activity p {
  margin: 0;
  color: #4d627d;
  font-size: 18px;
  line-height: 1.62;
}
.check {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.check li {
  font-size: 18px;
  color: #40526e;
}
.check li:before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 9px;
  border-radius: 50%;
  background: #dff7ef;
  color: #128769;
  font-weight: 900;
}
.page-nav {
  position: absolute;
  z-index: 3;
  right: 68px;
  bottom: 45px;
  display: flex;
  gap: 9px;
}
.page-nav a {
  padding: 8px 11px;
  border: 1px solid #cddbec;
  border-radius: 8px;
  background: #fff;
  color: #234b82;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}
.page-nav a:hover {
  background: #eaf3ff;
}
.toc {
  position: relative;
  z-index: 1;
  columns: 3;
  gap: 18px;
  margin-top: 16px;
}
.toc a {
  display: block;
  break-inside: avoid;
  margin: 5px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #244d86;
  text-decoration: none;
  font-size: 14px;
}
.toc a:hover {
  background: #eaf3ff;
}
.tree {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding: 20px 25px;
  border-radius: 14px;
  background: #112545;
  color: #dff4ff;
  font:
    19px/1.65 Consolas,
    "Courier New",
    monospace;
  white-space: pre-wrap;
}
.teacher-intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 235px;
  gap: 30px;
  align-items: center;
  margin-top: 28px;
  max-width: 920px;
}
.teacher-info {
  padding: 21px;
  border: 1px solid #cddff3;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(31, 65, 112, 0.06);
}
.teacher-info h3 {
  margin-bottom: 14px;
}
.teacher-info dl {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px 8px;
  margin: 0;
  color: #4d5e77;
  font-size: 18px;
}
.teacher-info dt {
  font-weight: 800;
  color: #2460ae;
}
.teacher-info dd {
  margin: 0;
  word-break: break-all;
}
.teacher-qr {
  width: 215px;
  height: 215px;
  padding: 8px;
  border: 1px solid #cddff3;
  border-radius: 14px;
  background: #fff;
}
.teacher-qr-label {
  margin: 5px 0 0;
  text-align: center;
  color: #60728b;
  font-size: 14px;
}
@media (max-width: 820px) {
  .teacher-intro {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }
  .teacher-info {
    padding: 14px;
  }
  .teacher-info dl {
    font-size: 14px;
    grid-template-columns: 62px 1fr;
  }
  .teacher-qr {
    width: 150px;
    height: 150px;
    margin: auto;
  }
  .teacher-qr-label {
    font-size: 12px;
  }
}
@media (max-width: 820px) {
  .slide {
    width: 100%;
    margin: 0;
    min-height: 100vh;
    padding: 28px 28px 72px;
  }
  .slide-top {
    font-size: 12px;
  }
  .eyebrow {
    margin-top: 23px;
    font-size: 12px;
  }
  h1 {
    font-size: 34px;
  }
  h2 {
    font-size: 27px;
  }
  .subtitle,
  .lead {
    font-size: 17px;
  }
  .grid,
  .grid.two,
  .compare {
    grid-template-columns: 1fr;
    gap: 11px;
    margin-top: 16px;
  }
  .card {
    padding: 14px;
  }
  .card p,
  .card li,
  .step p,
  .table,
  .activity p {
    font-size: 14px;
  }
  .flow {
    display: block;
    margin-top: 15px;
  }
  .step,
  .step:first-child,
  .step:last-child {
    border: 1px solid var(--line);
    border-radius: 9px;
    min-height: 0;
  }
  .step:not(:last-child):after {
    display: none;
  }
  .code {
    font-size: 12px;
    margin-top: 12px;
  }
  .table th,
  .table td {
    padding: 9px;
  }
  .activity {
    grid-template-columns: 75px 1fr;
    padding: 14px;
    gap: 12px;
  }
  .time {
    font-size: 20px;
    padding-right: 12px;
  }
  .check {
    grid-template-columns: 1fr;
  }
  .toc {
    columns: 1;
  }
  .meta {
    left: 28px;
    bottom: 28px;
  }
  .page-nav {
    right: 28px;
    bottom: 24px;
  }
  .page-nav a {
    font-size: 12px;
  }
}
@media print {
  body {
    background: #fff;
  }
  .slide {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    box-shadow: none;
  }
  .page-nav {
    display: none;
  }
}
@media (min-width: 821px) {
  .slide {
    padding: 42px 58px 62px;
  }
  .slide-top {
    padding-bottom: 16px;
  }
  .eyebrow {
    margin-top: 30px;
  }
  .slide h2 {
    margin-bottom: 26px;
  }
  .grid {
    margin-top: 32px;
    align-items: stretch;
  }
  .card {
    min-height: 225px;
    padding: 24px;
  }
  .flow {
    margin-top: 31px;
  }
  .step {
    min-height: 210px;
    padding: 24px;
  }
  .compare {
    margin-top: 30px;
  }
  .compare > div {
    min-height: 250px;
    padding: 26px;
  }
  .code {
    min-height: 300px;
    margin-top: 25px;
    padding: 24px;
  }
  .table {
    margin-top: 27px;
  }
  .table th,
  .table td {
    padding: 16px 19px;
  }
  .activity {
    min-height: 190px;
    margin-top: 30px;
    padding: 26px;
  }
  .check {
    margin-top: 30px;
  }
  .teacher-intro {
    margin-top: 34px;
  }
  .teacher-info {
    padding: 25px;
  }
}

.compact-table {
  margin-top: 18px;
  font-size: 15px;
}

.compact-table th,
.compact-table td {
  padding: 8px 12px;
  line-height: 1.35;
}

.reveal {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid #a9c9ed;
  border-radius: 12px;
  background: #f3f8ff;
  color: #37577a;
  font-size: 17px;
  line-height: 1.55;
}

.reveal summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

.reveal p {
  margin: 10px 0 0;
}

.compact-code {
  min-height: 0;
  margin-top: 14px;
  padding: 14px 17px;
  font-size: 16px;
  line-height: 1.5;
}

.card .compact-code {
  margin-top: 12px;
  padding: 12px;
  font-size: 15px;
}

.compact-grid {
  gap: 14px;
  margin-top: 18px;
}

.compact-grid .card {
  min-height: 0;
  padding: 15px 18px;
}

.resource-url {
  display: block;
  margin-top: 5px;
  color: #6c7f97;
  font:
    12px/1.35 Consolas,
    "Courier New",
    monospace;
  overflow-wrap: anywhere;
}

.resource-card p {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.35;
}

.resource-card .resource-url {
  margin-top: 2px;
  font-size: 11px;
}

.textbook-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  margin-top: 20px;
}

.textbook-figure {
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 65, 112, 0.12);
}

.textbook-figure img {
  display: block;
  width: 100%;
  border-radius: 9px;
}

.textbook-content {
  display: grid;
  gap: 16px;
}

.textbook-content .card {
  min-height: 0;
}

@media (max-width: 820px) {
  .textbook-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .textbook-figure {
    width: min(260px, 100%);
    margin: auto;
  }
}

.concept-duo {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 22px;
}

.concept-card {
  min-height: 292px;
  padding: 27px 29px;
  border: 1px solid;
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(31, 65, 112, 0.1);
}

.internet-card {
  border-color: #9bcff7;
  background: linear-gradient(145deg, #f4fbff, #dcedff);
}

.web-card {
  border-color: #ffc888;
  background: linear-gradient(145deg, #fffaf2, #ffe8c7);
}

.concept-card h3 {
  margin: 10px 0 12px;
  font-size: 34px;
}

.concept-label {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.internet-card .concept-label {
  background: #c6e9ff;
  color: #1664a0;
}

.web-card .concept-label {
  background: #ffdfb0;
  color: #a75a00;
}

.concept-definition {
  margin: 0 0 12px;
  color: #163e70;
  font-size: 23px;
  font-weight: 850;
  line-height: 1.45;
}

.web-card .concept-definition {
  color: #8a4b00;
}

.concept-card p:not(.concept-definition) {
  margin: 0;
  color: #4b617d;
  font-size: 17px;
  line-height: 1.62;
}

.concept-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.concept-tags span {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #31577f;
  font-size: 14px;
  font-weight: 800;
}

.concept-relation {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin-top: 17px;
  padding: 15px 24px;
  border: 1px dashed #8abde4;
  border-radius: 13px;
  background: linear-gradient(90deg, #edf9ff, #fff4e5);
  color: #28517f;
  font-size: 18px;
  font-weight: 800;
}

.concept-relation b {
  color: var(--orange);
  font-size: 28px;
}

@media (max-width: 820px) {
  .concept-duo {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .concept-card {
    min-height: 0;
    padding: 19px;
  }

  .concept-card h3 {
    font-size: 28px;
  }

  .concept-definition {
    font-size: 18px;
  }

  .concept-relation {
    gap: 10px;
    padding: 12px;
    font-size: 14px;
  }
}

@media (min-width: 821px) {
  .compact-table th,
  .compact-table td {
    padding: 8px 12px;
  }
}

/* 课程统一视觉系统：每页按页码循环使用主题色，版式与阅读层级保持一致。 */
body[data-theme="ocean"] {
  --page-accent: #1765d9;
  --page-accent-2: #00a9c7;
  --page-accent-3: #7557dc;
  --page-tint: #eaf5ff;
  --page-tint-2: #e7fbff;
}

body[data-theme="violet"] {
  --page-accent: #6751c9;
  --page-accent-2: #a04ec5;
  --page-accent-3: #247ec7;
  --page-tint: #f2eeff;
  --page-tint-2: #fceeff;
}

body[data-theme="sunset"] {
  --page-accent: #c85c25;
  --page-accent-2: #df8a17;
  --page-accent-3: #c23d69;
  --page-tint: #fff2e7;
  --page-tint-2: #fff7de;
}

body[data-theme="jade"] {
  --page-accent: #187a70;
  --page-accent-2: #00a48a;
  --page-accent-3: #3b78c3;
  --page-tint: #e8f9f4;
  --page-tint-2: #e7f6ff;
}

body[data-theme] .slide {
  border: 1px solid color-mix(in srgb, var(--page-accent) 16%, white);
  background: linear-gradient(135deg, #fff 0%, #fff 79%, var(--page-tint) 100%);
}

body[data-theme] .slide:after {
  right: -125px;
  bottom: -135px;
  width: 255px;
  height: 255px;
  background: radial-gradient(circle, var(--page-tint), transparent 68%);
  opacity: 0.42;
}

body[data-theme] .slide-top {
  border-bottom-color: color-mix(in srgb, var(--page-accent) 25%, white);
  color: var(--page-accent);
}

body[data-theme] .page-number {
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--page-tint) 80%, white);
  color: color-mix(in srgb, var(--page-accent) 60%, #4e5b72);
}

body[data-theme] .eyebrow,
body[data-theme] h2,
body[data-theme] .tip strong {
  color: var(--page-accent);
}

body[data-theme] .card:not(.dark) {
  border-color: color-mix(in srgb, var(--page-accent) 21%, white);
  background: linear-gradient(145deg, #fff, var(--page-tint));
}

body[data-theme] .grid .card:not(.dark):nth-child(3n + 2) {
  border-top: 5px solid var(--page-accent-2);
  background: linear-gradient(145deg, #fff, var(--page-tint-2));
}

body[data-theme] .grid .card:not(.dark):nth-child(3n) {
  border-top: 5px solid var(--page-accent-3);
  background: linear-gradient(
    145deg,
    #fff,
    color-mix(in srgb, var(--page-accent-3) 10%, white)
  );
}

body[data-theme] .compare > div:first-child {
  border-top: 5px solid var(--page-accent);
  background: linear-gradient(145deg, #fff, var(--page-tint));
}

body[data-theme] .compare > div:last-child {
  border-top: 5px solid var(--page-accent-2);
  background: linear-gradient(145deg, #fff, var(--page-tint-2));
}

body[data-theme] .flow .step:nth-child(3n + 1) {
  border-top: 5px solid var(--page-accent);
  background: linear-gradient(145deg, #fff, var(--page-tint));
}

body[data-theme] .flow .step:nth-child(3n + 2) {
  border-top: 5px solid var(--page-accent-2);
  background: linear-gradient(145deg, #fff, var(--page-tint-2));
}

body[data-theme] .flow .step:nth-child(3n) {
  border-top: 5px solid var(--page-accent-3);
  background: linear-gradient(
    145deg,
    #fff,
    color-mix(in srgb, var(--page-accent-3) 10%, white)
  );
}

body[data-theme] .tip {
  border-left-color: var(--page-accent-2);
  background: linear-gradient(90deg, var(--page-tint), #fff);
}

body[data-theme] .table th {
  background: linear-gradient(90deg, var(--page-tint), var(--page-tint-2));
  color: color-mix(in srgb, var(--page-accent) 80%, #17233d);
}

body[data-theme] .table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--page-tint) 58%, white);
}

body[data-theme] .activity {
  border-color: color-mix(in srgb, var(--page-accent-2) 33%, white);
  background: linear-gradient(135deg, var(--page-tint), var(--page-tint-2));
}

body[data-theme] .time {
  color: var(--page-accent);
}

body[data-theme] .page-nav a:hover,
body[data-theme] .toc a:hover {
  border-color: var(--page-accent-2);
  background: var(--page-tint);
}

.term-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.term-grid .card {
  min-height: 0;
  padding: 15px 17px;
}

.term-grid .card h3 {
  margin-bottom: 6px;
  font-size: 21px;
}

.term-grid .card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.terms-chain {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
  padding: 13px 18px;
  border-radius: 13px;
  background: linear-gradient(
    90deg,
    var(--page-tint, #edf5ff),
    var(--page-tint-2, #e7fbff)
  );
  color: #31577f;
  font-size: 15px;
  font-weight: 800;
}

.terms-chain span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.terms-chain b {
  color: var(--page-accent-2, var(--cyan));
  font-size: 13px;
}

.source-compare-slide .card .compact-code {
  padding: 18px;
  font-size: 19px;
  line-height: 1.65;
}

.quiz-slide .grid .card h3 {
  font-size: 30px;
}

.quiz-slide .grid .card p {
  font-size: 21px;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .term-grid {
    grid-template-columns: 1fr;
  }

  .terms-chain {
    justify-content: flex-start;
    font-size: 13px;
  }

  .code,
  .tree {
    font-size: 14px;
  }

  .compact-code {
    font-size: 13px;
  }

  .card .compact-code {
    font-size: 12px;
  }

  .source-compare-slide .card .compact-code {
    padding: 14px;
    font-size: 14px;
  }

  .quiz-slide .grid .card h3 {
    font-size: 25px;
  }

  .quiz-slide .grid .card p {
    font-size: 17px;
  }
}
