*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #1f2937;
  line-height: 1.75;
}
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #0f766e 50%, #14b8a6 100%);
  color: #fff;
  padding: 48px 24px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12), transparent 45%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1), transparent 45%);
  pointer-events: none;
}
.hero .badge {
  display: inline-block;
  padding: 6px 14px;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  font-size: 13px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
}
.hero .subtitle {
  max-width: 760px;
  margin: 0 auto;
  font-size: 15px;
  color: rgba(255,255,255,0.95);
  position: relative;
  z-index: 1;
}
.hero .subtitle strong { color: #fff; }
.hero .back {
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.hero .back a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  margin: 0 8px;
}
.hero .back a:hover { border-bottom-color: #fff; }
main {
  max-width: 920px;
  margin: -28px auto 56px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  padding: 36px 44px;
  position: relative;
}
@media (max-width: 720px) {
  main { padding: 28px 18px; margin: -20px 12px 40px; }
  .hero h1 { font-size: 20px; }
}
h2 {
  color: #115e59;
  font-size: 20px;
  margin: 32px 0 12px;
  padding-left: 12px;
  border-left: 5px solid #14b8a6;
  line-height: 1.35;
}
h2:first-of-type { margin-top: 0; }
h3 { color: #0f766e; font-size: 17px; margin: 24px 0 10px; }
h4 { color: #334155; font-size: 15px; margin: 18px 0 8px; }
p { margin: 10px 0; color: #374151; }
ul, ol { padding-left: 22px; }
li { margin: 6px 0; }
strong { color: #111827; }
code {
  background: #f1f5f9;
  color: #0f766e;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
}
pre code { background: transparent; color: inherit; padding: 0; }
.figure { margin: 20px 0 10px; text-align: center; }
.figure img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border: 1px solid #e5e7eb;
  background: #fff;
}
.figure figcaption { color: #6b7280; font-size: 13px; margin-top: 8px; }
.image-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.image-row .figure { margin: 0; }
table.spec {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
table.spec th, table.spec td {
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  text-align: left;
}
table.spec th {
  background: #f0fdfa;
  color: #115e59;
  font-weight: 600;
}
.highlight-box {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  border: 1px solid #99f6e4;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
}
.highlight-box strong { color: #115e59; }
.note {
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  padding: 10px 14px;
  margin: 14px 0;
  border-radius: 0 6px 6px 0;
}
.code-box {
  background: #ecfeff;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
}
.code-box a { color: #0d9488; font-weight: 700; text-decoration: none; }
.code-box a:hover { text-decoration: underline; }
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.chapter-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid #99f6e4;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.12);
}
.chapter-card .num {
  display: inline-flex;
  width: 28px; height: 28px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  background: #0d9488;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.chapter-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #115e59;
}
.chapter-card p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}
.pager {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 14px;
}
.pager a {
  color: #0d9488;
  text-decoration: none;
  font-weight: 700;
}
.pager a:hover { text-decoration: underline; }
.footer-nav {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: #6b7280;
  font-size: 14px;
}
.footer-nav a {
  color: #0d9488;
  text-decoration: none;
  font-weight: 600;
}
.footer-nav a:hover { text-decoration: underline; }
.file-list { display: block; }
.file-list li code { font-size: 12px; }
table.code-explain {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 14px;
}
table.code-explain th, table.code-explain td {
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
table.code-explain th {
  background: #f0fdfa;
  color: #115e59;
  font-weight: 600;
  width: 28%;
}
table.code-explain td { color: #374151; }
table.code-explain code { font-size: 12px; }
