:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #171a20;
  --muted: #5d6675;
  --line: #d9e0ea;
  --line-strong: #c2ccd9;
  --soft: #eef2f6;
  --soft-2: #f8fafc;
  --black: #111317;
  --red: #d8344f;
  --blue: #1e63d6;
  --green: #0e7a5f;
  --amber: #a15c00;
  --shadow: 0 18px 50px rgba(21, 30, 48, .12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  line-height: 1.78;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: var(--blue);
}

.site-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 100vh;
}

.menu-toggle,
.menu-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-right: 1px solid var(--line);
  background: var(--black);
  color: #fff;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.site-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  background: #fff;
  color: var(--black);
  font-size: 16px;
  font-weight: 900;
}

.side-menu {
  padding: 12px 12px 80px;
}

.menu-group,
.menu-children {
  display: grid;
  gap: 4px;
}

.menu-group {
  margin-bottom: 4px;
}

.menu-children {
  margin: 4px 0 6px;
  padding-left: 14px;
}

.menu-button,
.menu-link {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, .78);
  padding: 7px 9px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.menu-link {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.menu-parent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 4px;
  align-items: stretch;
}

.menu-parent-link {
  min-width: 0;
}

.menu-toggle-child {
  min-height: 38px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0;
}

.menu-button:hover,
.menu-link:hover,
.menu-link.is-active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.menu-link.is-active {
  border-color: rgba(216, 52, 79, .8);
  background: rgba(216, 52, 79, .24);
}

.menu-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
  font-weight: 900;
}

.menu-title-text {
  min-width: 0;
}

.menu-tags {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.menu-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .72);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.menu-level.mid {
  border-color: rgba(30, 99, 214, .45);
  background: rgba(30, 99, 214, .22);
  color: #cfe0ff;
}

.menu-level.high {
  border-color: rgba(216, 52, 79, .5);
  background: rgba(216, 52, 79, .22);
  color: #ffd6de;
}

.menu-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .04em;
  white-space: nowrap;
}

.menu-status.new {
  border: 1px solid rgba(14, 122, 95, .5);
  background: rgba(14, 122, 95, .22);
  color: #c8f7e8;
}

.menu-status.update {
  border: 1px solid rgba(161, 92, 0, .54);
  background: rgba(161, 92, 0, .24);
  color: #ffe0ad;
}

.menu-caret {
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
}

.menu-toggle-child[aria-expanded="true"] .menu-caret {
  transform: rotate(90deg);
}

.content-shell {
  min-width: 0;
  padding: 28px;
}

.article {
  width: min(980px, 100%);
  min-width: 0;
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 54px);
  overflow-wrap: anywhere;
}

.article:focus {
  outline: none;
}

.breadcrumb {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.16;
  letter-spacing: 0;
}

h2 {
  margin: 34px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  font-size: 24px;
  line-height: 1.35;
}

h3 {
  margin: 24px 0 8px;
  font-size: 18px;
  line-height: 1.45;
}

p {
  margin: 0 0 12px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

li {
  margin: 5px 0;
}

code {
  border-radius: 5px;
  background: var(--soft);
  padding: 2px 5px;
  color: #1b2938;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
}

pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #f7fafc;
  padding: 16px;
  line-height: 1.65;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.prompt-block {
  overflow-x: hidden;
}

.prompt-block code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lead {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.lead-block {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.lead-note {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 6px 10px;
  border-left: 4px solid #e15a6f;
  border-radius: 6px;
  background: #fdecef;
  color: #b4233c;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 26px;
  min-width: 0;
}

.meta-card,
.info-box,
.topic-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
  padding: 14px;
  overflow-wrap: anywhere;
}

.meta-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.level {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  background: #fff2f4;
  color: var(--red);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 900;
}

.level.mid {
  background: #eef5ff;
  color: var(--blue);
}

.level.high {
  background: #eef8f3;
  color: var(--green);
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

.badge.new {
  background: #eef8f3;
  color: var(--green);
}

.badge.update {
  background: #fff5e8;
  color: var(--amber);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  min-width: 0;
}

.topic-card {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: start;
  color: inherit;
  text-decoration: none;
}

.topic-card:hover {
  border-color: var(--red);
}

.topic-card h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 20px;
}

.topic-card p {
  margin: 0;
  color: var(--muted);
}

.source-list {
  padding-left: 1.2em;
}

.source-list li {
  overflow-wrap: anywhere;
}

.table-scroll {
  margin: 18px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.benchmark-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
}

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

.benchmark-table th {
  background: var(--soft);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.task-fields-table {
  min-width: 0;
}

.compact-table th,
.compact-table td {
  white-space: nowrap;
}

.compact-table th:not(:first-child),
.compact-table td:not(:first-child) {
  text-align: right;
}

.article-image {
  margin: 22px 0;
}

.article-image.article-image-narrow {
  width: min(66.666%, 680px);
  margin-inline: auto;
}

.article-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
}

.prompt-example-image {
  width: auto;
  max-width: min(100%, 1200px);
  height: auto;
  margin: 0 auto;
}

.article-image figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.callout {
  border-left: 5px solid var(--red);
  background: #fff7f8;
  padding: 14px 16px;
  margin: 18px 0;
}

.model-feature-list {
  display: grid;
  gap: 26px;
  margin: 18px 0;
}

.model-group {
  display: grid;
  gap: 10px;
}

.model-group h3 {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  font-size: 18px;
}

.model-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(20, 31, 46, .05);
}

.model-card.compact {
  background: var(--soft-2);
}

.model-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.model-card-head h4 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.model-card-head span {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.model-card p {
  margin: 0 0 12px;
}

.model-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.model-card dl div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
}

.model-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.model-card dd {
  margin: 0;
}

.term-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.term-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
  padding: 12px 14px;
}

.term-list dt {
  margin-bottom: 5px;
  font-weight: 900;
}

.term-list dd {
  margin: 0;
}

.metric-notes {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding-left: 0;
  list-style: none;
}

.metric-notes li {
  border-left: 3px solid var(--red);
  background: var(--soft-2);
  padding: 8px 10px;
}

.table-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.table-note p {
  margin: -6px 0 16px;
}

.model-accordion {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.model-accordion details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
  overflow: hidden;
}

.model-accordion summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.model-accordion summary::-webkit-details-marker {
  display: none;
}

.model-accordion summary::after {
  content: "＋";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  font-size: 16px;
}

.model-accordion details[open] summary::after {
  content: "−";
}

.model-accordion summary span,
.model-accordion summary small {
  min-width: 0;
}

.model-accordion summary span {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.model-accordion summary small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.model-detail {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 13px 14px 14px;
}

.model-detail p {
  margin-bottom: 8px;
}

.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  position: relative;
  padding-left: 30px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: .72em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
}

.next-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.next-links a {
  display: grid;
  gap: 4px;
  min-height: 70px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 11px 13px;
  text-decoration: none;
}

.next-links a span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.next-links a strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.next-links .next-link {
  text-align: right;
}

.next-links .prev-link strong::before {
  content: "← ";
}

.next-links .next-link strong::after {
  content: " →";
}

@media (max-width: 940px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  body.menu-open {
    overflow: hidden;
  }

  .menu-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(17, 19, 23, .12);
    border-radius: 16px;
    background: rgba(255, 255, 255, .92);
    color: var(--black);
    box-shadow: 0 16px 38px rgba(17, 19, 23, .18);
    backdrop-filter: blur(12px);
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
  }

  body.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    z-index: 19;
    height: 80px;
    border-bottom: 1px solid rgba(217, 224, 234, .9);
    background: rgba(245, 247, 250, .92);
    backdrop-filter: blur(12px);
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    background: rgba(8, 12, 18, .55);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(86vw, 340px);
    height: 100dvh;
    max-height: 100dvh;
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 18px 0 42px rgba(0, 0, 0, .28);
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .content-shell {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding: 96px 0 14px;
  }

  .article {
    width: 100%;
    max-width: calc(100vw - 24px);
    min-height: auto;
    overflow-x: hidden;
  }

  .meta-grid,
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .model-card-head {
    display: grid;
  }

  .model-card-head span {
    width: fit-content;
  }

  .model-card dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .article p,
  .article li,
  .article .lead,
  .article .meta-card,
  .article .topic-card {
    word-break: break-all;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 560px) {
  .article {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    padding: 22px 16px;
  }

  h1 {
    font-size: 32px;
  }

  .next-links {
    grid-template-columns: 1fr;
  }

  .next-links .next-link {
    text-align: left;
  }
}
