:root {
  --component-pink-soft: rgba(255, 59, 110, 0.08);
  --component-yellow-soft: rgba(255, 192, 31, 0.18);
  --component-sky-soft: rgba(56, 168, 255, 0.12);
  --component-success-soft: rgba(43, 182, 115, 0.12);
  --component-error-soft: rgba(229, 72, 77, 0.11);
  --component-white-glass: rgba(255, 255, 255, 0.88);
  --component-fab-shadow: rgba(217, 30, 83, 0.28);
}

.tab-set {
  min-width: 0;
}

.tab-list {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel-soft);
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.tab-list [role="tab"] {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 9px 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-transparent);
  color: var(--color-text-muted);
  font-weight: 720;
  cursor: pointer;
}

.tab-list [role="tab"]:hover {
  color: var(--color-text);
}

.tab-list [role="tab"][aria-selected="true"],
.tab-list [role="tab"].is-active {
  background: var(--color-panel);
  color: var(--color-accent-dark);
  box-shadow: var(--shadow-soft);
}

.tab-panel {
  padding-top: 28px;
}

.tab-panel[hidden] {
  display: none;
}

.toc-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  max-width: 100%;
  gap: 8px;
  margin-bottom: 40px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--component-white-glass);
  box-shadow: var(--shadow-soft);
  overscroll-behavior-inline: contain;
}

.toc-nav a {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
}

.toc-nav a:hover,
.toc-nav a[aria-current="true"] {
  background: var(--component-pink-soft);
  color: var(--color-accent-dark);
}

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

.faq-item {
  overflow: clip;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: 0 4px 14px var(--color-shadow-faint);
}

.faq-item summary {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  color: var(--color-text);
  font-weight: 780;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-panel-soft);
  color: var(--color-accent-dark);
  content: "+";
  font: 800 20px/28px var(--font-display);
  text-align: center;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 22px 20px;
  color: var(--color-text-muted);
}

.faq-answer > :last-child {
  margin-bottom: 0;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.term-card {
  position: relative;
  min-width: 0;
  padding: 24px;
  overflow: clip;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.term-card::before {
  position: absolute;
  top: 0;
  left: 24px;
  width: 56px;
  height: 5px;
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  background: var(--color-sky);
  content: "";
}

.term-card dt {
  margin-bottom: 9px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 820;
}

.term-card dd {
  margin: 0;
  color: var(--color-text-muted);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.download-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 18px;
  padding: 26px;
  overflow: clip;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.download-card.is-featured {
  border-color: var(--color-accent);
  background: linear-gradient(150deg, var(--color-panel), var(--component-pink-soft));
}

.download-card.is-archived {
  background: var(--color-panel-soft);
}

.download-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.download-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.download-title {
  margin-bottom: 4px;
  font-size: 22px;
}

.download-meta,
.download-note {
  color: var(--color-text-muted);
  font-size: 14px;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

[data-ver]:empty {
  display: none;
}

.badge-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.badge,
.tag {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-recommend {
  background: var(--component-pink-soft);
  color: var(--color-accent-dark);
}

.badge-primary {
  background: var(--color-warning);
  color: var(--color-text);
}

.badge-maintained {
  background: var(--component-success-soft);
  color: var(--color-text);
}

.badge-retired {
  background: var(--component-error-soft);
  color: var(--color-text);
}

.badge-info,
.tag {
  background: var(--component-sky-soft);
  color: var(--color-text);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.post-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.post-card time {
  color: var(--color-text-muted);
  font: 12px/1.5 var(--font-mono);
}

.post-card h3 {
  margin-top: 14px;
  font-size: 22px;
}

.post-card p {
  color: var(--color-text-muted);
}

.post-card-link {
  margin-top: auto;
  color: var(--color-accent-dark);
  font-weight: 760;
  text-decoration: none;
}

.callout {
  position: relative;
  margin-block: 28px;
  padding: 22px 24px 22px 28px;
  overflow: clip;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--component-yellow-soft);
  color: var(--color-text);
}

.callout::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--color-warning);
  content: "";
}

.callout-info {
  background: var(--component-sky-soft);
  color: var(--color-text);
}

.callout-info::before {
  background: var(--color-sky);
}

.callout-success {
  background: var(--component-success-soft);
  color: var(--color-text);
}

.callout-success::before {
  background: var(--color-success);
}

.callout-danger {
  background: var(--component-error-soft);
  color: var(--color-text);
}

.callout-danger::before {
  background: var(--color-error);
}

.callout-title {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text);
  font-weight: 820;
}

.callout > :last-child {
  margin-bottom: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}

.table-wrap .data-table {
  min-width: 680px;
}

.prose > .data-table {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-download-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel-soft);
  color: var(--color-text);
}

.article-download-card h2,
.article-download-card h3 {
  margin-bottom: 8px;
}

.article-download-card p {
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.dl-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 90;
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 12px 19px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-panel);
  box-shadow: 0 14px 34px var(--component-fab-shadow);
  font-weight: 800;
  text-decoration: none;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.dl-fab:hover {
  transform: translateY(-3px);
  background: var(--color-accent-dark);
  color: var(--color-panel);
}

.dl-fab svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.feature-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: clamp(32px, 7vw, 88px);
  padding: clamp(28px, 6vw, 70px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.feature-panel.is-reversed .feature-copy {
  order: 2;
}

.feature-panel.is-reversed .feature-visual {
  order: 1;
}

.feature-copy p {
  color: var(--color-text-muted);
}

.feature-visual {
  min-height: 300px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--component-sky-soft), var(--component-pink-soft));
  color: var(--color-text);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.token-swatch {
  min-height: 150px;
  padding: 18px;
  border-radius: var(--radius-lg);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.token-swatch strong,
.token-swatch code {
  display: block;
}

.token-swatch code {
  margin-top: 8px;
  color: var(--color-text);
}

.swatch-bg {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.swatch-panel {
  border: 1px solid var(--color-border);
  background: var(--color-panel);
}

.swatch-soft {
  background: var(--color-panel-soft);
}

.swatch-border {
  background: var(--color-border);
}

.swatch-accent {
  background: var(--color-accent);
  color: var(--color-panel);
}

.swatch-accent strong,
.swatch-accent code,
.swatch-accent-dark strong,
.swatch-accent-dark code,
.swatch-text strong,
.swatch-text code,
.swatch-error strong,
.swatch-error code {
  color: var(--color-panel);
}

.swatch-accent-dark {
  background: var(--color-accent-dark);
  color: var(--color-panel);
}

.swatch-text {
  background: var(--color-text);
  color: var(--color-panel);
}

.swatch-muted {
  background: var(--color-text-muted);
  color: var(--color-panel);
}

.swatch-muted strong,
.swatch-muted code {
  color: var(--color-panel);
}

.swatch-success {
  background: var(--color-success);
  color: var(--color-text);
}

.swatch-warning {
  background: var(--color-warning);
  color: var(--color-text);
}

.swatch-error {
  background: var(--color-error);
  color: var(--color-panel);
}

.swatch-sky {
  background: var(--color-sky);
  color: var(--color-text);
}

.type-sample {
  padding-block: 22px;
  border-bottom: 1px solid var(--color-border);
}

.preview-footer {
  margin-top: var(--section-space);
}

@media (max-width: 900px) {
  .download-grid,
  .post-grid,
  .glossary-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .feature-panel {
    grid-template-columns: 1fr;
  }

  .feature-panel.is-reversed .feature-copy,
  .feature-panel.is-reversed .feature-visual {
    order: initial;
  }
}

@media (max-width: 640px) {
  .tab-list {
    border-radius: var(--radius-md);
  }

  .toc-nav {
    top: 8px;
    border-radius: var(--radius-md);
  }

  .faq-item summary {
    padding-inline: 17px;
  }

  .faq-answer {
    padding-inline: 17px;
  }

  .download-card,
  .post-card,
  .term-card {
    padding: 20px;
  }

  .article-download-card {
    grid-template-columns: 1fr;
  }

  .article-download-card .button {
    width: 100%;
  }

  .dl-fab {
    right: 12px;
    bottom: 12px;
    min-height: 48px;
    padding: 10px 15px;
    font-size: 14px;
  }

  .feature-visual {
    min-height: 220px;
    padding: 20px;
  }
}