:root {
  color-scheme: light;
  --ink: #23313d;
  --muted: #5f6f7c;
  --paper: #ffffff;
  --page: #f6f8f7;
  --line: #dde5e1;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --amber: #b7791f;
  --rose: #b42318;
  --green-soft: #e5f4ef;
  --amber-soft: #fff3d6;
  --blue-soft: #e9f2ff;
  --violet-soft: #f0ecff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  line-height: 1.72;
}

a {
  color: inherit;
}

.hero {
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 255, 255, .32), transparent 24%),
    linear-gradient(135deg, #0f766e 0%, #355c7d 54%, #7a4e64 100%);
  color: #fff;
  padding: 22px clamp(18px, 4vw, 48px) 42px;
}

.topbar {
  max-width: 1180px;
  margin: 0 auto 34px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.ghost-link,
.print-button {
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}

.ghost-link:hover,
.print-button:hover {
  background: rgba(255, 255, 255, .2);
}

.hero-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  opacity: .82;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 16px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.12;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 18px;
}

.priority-panel {
  border: 1px solid rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .13);
  border-radius: 8px;
  padding: 18px 20px;
  backdrop-filter: blur(10px);
}

.priority-panel h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.priority-panel ol {
  margin: 0;
  padding-left: 20px;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 44px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 8px;
}

.toc a {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--teal-dark);
  text-decoration: none;
  font-size: 14px;
}

.toc a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  min-width: 0;
}

.section h2 {
  margin-bottom: 16px;
  color: var(--teal-dark);
  font-size: 23px;
  line-height: 1.3;
}

.section h3 {
  margin-bottom: 7px;
  font-size: 17px;
}

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

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f6f3;
  color: #173f3b;
  font-weight: 700;
}

tbody tr:nth-child(even) td {
  background: #fbfcfb;
}

.note-list,
.calc-grid,
.memory-grid,
.formula-grid {
  display: grid;
  gap: 12px;
}

.note-list {
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
}

.calc-grid,
.memory-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
}

.formula-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.note,
.formula,
.memory {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note p,
.memory p {
  margin-bottom: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info {
  background: var(--blue-soft);
}

.warn {
  margin-top: 12px;
  background: var(--amber-soft);
  border-color: #f1c56e;
}

.formula {
  background: var(--amber-soft);
  display: grid;
  gap: 6px;
}

.formula span {
  overflow-wrap: anywhere;
}

.steps {
  margin-top: 0;
  margin-bottom: 16px;
  padding-left: 22px;
}

.bad {
  color: var(--rose);
  font-weight: 700;
}

.memory {
  background: var(--violet-soft);
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 0 16px 28px;
  font-size: 14px;
}

sub,
sup {
  font-size: .72em;
}

@media (max-width: 860px) {
  .hero-grid,
  .page-shell,
  .note-list,
  .calc-grid,
  .memory-grid,
  .formula-grid {
    grid-template-columns: 1fr;
  }

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

  .lead {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .hero {
    padding-inline: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 28px;
  }

  .ghost-link,
  .print-button {
    text-align: center;
    width: 100%;
  }

  .page-shell {
    width: min(100% - 20px, 1180px);
  }

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

  .section {
    padding: 16px;
  }
}

@media print {
  .topbar,
  .toc {
    display: none;
  }

  .hero {
    color: var(--ink);
    background: #fff;
    padding: 0 0 18px;
  }

  .page-shell {
    display: block;
    width: 100%;
    margin: 0;
  }

  .section {
    break-inside: avoid;
    border-color: #cfd8d3;
    margin-bottom: 12px;
  }
}
