:root {
  color-scheme: light;
  --bg: #ffffff;
  --paper: #ffffff;
  --panel: #f5f6fa;
  --ink: #17224b;
  --ink-strong: #0e0e0e;
  --muted: #a5a9b9;
  --line: #eef0f6;
  --accent: #eaff68;
  --accent-soft: #f4ffc2;
  --lavender: #ddd6ff;
  --lavender-strong: #8d7be6;
  --shadow: 0 18px 44px rgba(17, 26, 68, 0.08);
  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.72;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.page {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px
    max(32px, env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  margin: 4px 0 18px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 80% 10%, rgba(234, 255, 104, 0.46), transparent 28%),
    var(--lavender);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--lavender-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.16;
  letter-spacing: 0;
}

.subtitle {
  margin: 12px 0 0;
  color: rgba(23, 34, 75, 0.72);
  font-size: 17px;
  line-height: 1.45;
}

.summary-card,
.card,
.section,
.part,
details.subsection,
details.term-group {
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: none;
}

.summary-card,
.card {
  margin: 14px 0 18px;
  padding: 20px;
}

.summary-card h2,
.card h2,
.section-title,
.part-title,
.appendix-title,
.glossary-title {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0;
}

.summary-card p,
.card p,
.definition p,
.term p,
.footer p {
  margin: 10px 0 0;
}

.toc {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin: 0 -16px 18px;
  padding: 10px 16px;
  border-block: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.toc a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.section,
.part {
  margin: 16px 0;
  overflow: hidden;
  scroll-margin-top: 76px;
}

.section-header,
.part-header {
  padding: 20px;
  border-bottom: 0;
  background: var(--panel);
}

.section-kicker,
.part-kicker,
.number {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.body,
.competency-body,
.sub-body,
.term {
  padding: 0 20px 20px;
}

.pair {
  display: grid;
  gap: 10px;
}

.cn,
.en {
  margin: 0;
  white-space: pre-line;
}

.cn,
.item-cn {
  color: var(--ink-strong);
  font-size: 16px;
}

.en,
.item-en {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.en-block,
.definition {
  padding: 14px 16px;
  border-left: 0;
  border-radius: var(--radius);
  background: #ffffff;
}

.definition {
  margin: 0 0 14px;
}

.label,
.clause-code,
.item-code {
  display: inline-block;
  margin: 0 0 4px;
  color: var(--lavender-strong);
  font-size: 13px;
  font-weight: 900;
}

.plain-list,
.clause-list,
.items {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.plain-list li,
.clause,
.items li,
.value-card {
  padding: 14px;
  border: 0;
  border-radius: var(--radius);
  background: #ffffff;
}

.plain-list li::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: var(--accent);
}

.value-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.value-card {
  overflow: hidden;
}

.value-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.value-card .pair {
  padding-top: 10px;
}

summary {
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}

summary::-webkit-details-marker {
  display: none;
}

.competency {
  border-top: 1px solid #ffffff;
}

.competency:first-of-type {
  border-top: 0;
}

.competency summary,
.subsection summary,
.term-group summary {
  position: relative;
  min-height: 58px;
  padding: 16px 52px 16px 20px;
  background: var(--panel);
}

.competency summary::after,
.subsection summary::after,
.term-group summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

details[open] > summary::after {
  content: "-";
}

.subsection,
.term-group {
  margin: 12px 0;
  overflow: hidden;
}

.competency-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.competency-title .number {
  margin-bottom: 0;
}

.title-text,
.sub-title,
.term-heading {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.36;
}

.title-text .en,
.sub-title small,
.term-heading .en,
.term-heading small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-left: 6px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.appendix,
.glossary {
  margin-top: 22px;
  scroll-margin-top: 76px;
}

.glossary-title {
  margin: 0 0 12px;
}

.footer {
  margin: 24px 0 0;
  padding: 20px 0 6px;
  color: var(--muted);
  text-align: center;
}

.motto {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 560px) {
  .page {
    padding-inline: 12px;
  }

  .hero {
    padding: 24px 20px;
  }

  h1,
  .hero h1 {
    font-size: 25px;
  }

  .subtitle {
    font-size: 15px;
  }

  .summary-card,
  .card,
  .section-header,
  .part-header {
    padding: 16px;
  }

  .toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .section,
  .part,
  .appendix,
  .glossary {
    scroll-margin-top: 118px;
  }

  .body,
  .competency-body,
  .sub-body,
  .term {
    padding-inline: 16px;
  }

  .competency summary,
  .subsection summary,
  .term-group summary {
    padding: 14px 46px 14px 16px;
  }

  .title-text,
  .sub-title,
  .term-heading {
    font-size: 16px;
  }

  .cn,
  .item-cn {
    font-size: 15px;
  }

  .en,
  .item-en {
    font-size: 13px;
  }

  .badge {
    margin-left: 0;
    margin-top: 4px;
  }
}
