/* ow-patch-wiki · teenage-engineering 设计语言 + wiki 布局
   继承 pr-01 (ow-patch-reader) 的 tokens 与组件，新增 wiki shell / 侧边栏 / 时间线 / 索引等 */

/* ---------- tokens（沿用 pr-01） ---------- */
:root {
  --te-white: #f5f5f5;
  --te-black: #0f0e12;
  --te-grey-100: #e5e5e5;
  --te-grey-200: #ccc;
  --te-grey-300: #b2b2b2;
  --te-grey-500: #a1a7af;
  --te-grey-700: #7f7f7f;
  --te-grey-900: #4d4d4d;
  --te-grey-1000: #272727;
  --te-orange: #f05a24;
  --error: #c0262c;
  --success: #3fae5a;

  --font: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;

  --fs-10: clamp(11px, calc(.00918 * 100vw), 16px);
  --fs-15: clamp(13px, calc(.01327 * 100vw), 20px);
  --fs-20: clamp(17px, calc(.01837 * 100vw), 28px);
  --fs-30: clamp(26px, calc(.02755 * 100vw), 44px);
  --fs-40: clamp(34px, calc(.03673 * 100vw), 60px);
  --fs-hero: clamp(48px, calc(.07142 * 100vw), 120px);

  --space-sm: calc(.0102 * 100vw);
  --space-md: calc(.0153 * 100vw);
  --space-lg: calc(.0229 * 100vw);
  --space-xl: calc(.0459 * 100vw);
  --space-xxl: calc(.0918 * 100vw);

  --r-hair: 1.5px;
  --r-sm: 6px;
  --r-md: 29px;
  --r-lg: 37px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--te-white);
  color: var(--te-black);
  font-family: var(--font);
  font-weight: 100;
  font-size: var(--fs-15);
  line-height: 1.45;
  letter-spacing: -0.004em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 300; }
p, ul { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }
code { font-family: ui-monospace, monospace; font-size: .92em; background: var(--te-grey-100); padding: 1px 6px; border-radius: 4px; }
.grey { color: var(--te-grey-700); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { padding: 0 var(--space-xl); }

/* ---------- icon-cluster nav（沿用 pr-01） ---------- */
.icn-nav {
  display: grid;
  grid-template-columns: max-content repeat(6, minmax(0, 1fr)) 1fr auto;
  align-items: start;
  gap: clamp(10px, 1.1vw, 30px);
  padding: 1.5vw var(--space-xl);
  font-size: clamp(13px, 1.3vw, 20px);
}
.icn-nav__brand { font-weight: 300; font-size: clamp(14px, 1.5vw, 22px); line-height: 1.1; align-self: center; text-decoration: none; border-bottom: 0; }
.icn-cluster { display: grid; grid-template-columns: max-content 1fr; gap: 0 8px; align-items: start; }
.icn-cluster__icon { width: clamp(26px, 2.6vw, 44px); height: clamp(26px, 2.6vw, 44px); grid-row: 1 / span 2; }
.icn-cluster__icon svg { width: 100%; height: 100%; }
.icn-cluster__label { font-weight: 300; font-size: clamp(14px, 1.35vw, 20px); line-height: 1.1; white-space: nowrap; }
.icn-cluster__sub { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 1px; }
.icn-cluster__sub li { font-size: clamp(10px, .9vw, 14px); font-weight: 100; line-height: 1.3; white-space: nowrap; }
.icn-cluster__sub a { text-decoration: none; border-bottom: 1px solid transparent; }
.icn-cluster__sub a:hover, .icn-cluster__sub a[aria-current] { border-bottom-color: currentColor; }
.icn-nav__aside { font-size: clamp(9px, .7vw, 11px); line-height: 1.5; color: var(--te-grey-700); }
.icn-nav__mark { width: clamp(40px, 4.5vw, 80px); height: clamp(40px, 4.5vw, 80px); align-self: center; }
.icn-nav__mark svg { width: 100%; height: 100%; }

/* ---------- wiki shell ---------- */
.wiki-shell {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 72px);
  max-width: 1560px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl) var(--space-xxl);
  align-items: start;
}
.wiki-side {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow: auto;
  font-size: var(--fs-15);
  padding-bottom: 24px;
  scrollbar-width: thin;
}
.wiki-side__title {
  font-size: var(--fs-10);
  color: var(--te-grey-700);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 18px 0 8px;
}
.wiki-side__title:first-child { margin-top: 0; }
.wiki-side__box { border-top: 1px solid var(--te-grey-200); margin-top: 18px; padding-top: 4px; }
.wiki-side__note { font-size: var(--fs-10); color: var(--te-grey-700); line-height: 1.5; margin-top: 10px; }
.wiki-statline { font-size: var(--fs-30); font-weight: 300; line-height: 1.05; }
.wiki-statline span { display: block; font-size: var(--fs-10); color: var(--te-grey-700); font-weight: 100; margin-top: 2px; }

.wiki-nav ul, .wiki-months, .wiki-toc { list-style: none; padding: 0; }
.wiki-nav li, .wiki-months li, .wiki-toc li { margin: 0; }
.wiki-nav a, .wiki-months a, .wiki-toc a {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  text-decoration: none; padding: 5px 0; border-bottom: 1px solid transparent;
  color: var(--te-black);
}
.wiki-nav a:hover, .wiki-months a:hover, .wiki-toc a:hover { border-bottom-color: var(--te-black); }
.wiki-nav a[aria-current], .wiki-toc a.is-cur { color: var(--te-orange); }
.wiki-nav a small, .wiki-months a small, .wiki-toc a small { color: var(--te-grey-500); font-size: var(--fs-10); }
.wiki-toc a { font-size: var(--fs-15); }
.wiki-toc--heroes a { color: var(--te-grey-900); }
.wiki-months a { font-variant-numeric: tabular-nums; }

.wiki-main { min-width: 0; padding-bottom: var(--space-xl); }

/* breadcrumb + titles */
.crumb { font-size: var(--fs-10); color: var(--te-grey-700); padding: var(--space-md) 0 var(--space-lg); }
.crumb a { text-decoration: none; border-bottom: 1px solid var(--te-grey-300); }
.crumb a:hover { border-bottom-color: var(--te-black); }
.crumb__sep { margin: 0 6px; color: var(--te-grey-300); }
.wiki-title { font-size: var(--fs-40); letter-spacing: -0.02em; line-height: 1.02; margin: 0 0 var(--space-md); }
.wiki-lede { font-size: var(--fs-15); color: var(--te-grey-900); max-width: 60em; margin-bottom: var(--space-lg); }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 12px; border: 1px solid var(--te-grey-300); border-radius: 9999px;
  font-size: var(--fs-10); line-height: 1.5; text-decoration: none; color: var(--te-grey-900);
  white-space: nowrap;
}
.chip:hover { border-color: var(--te-black); color: var(--te-black); }
.chip--sm { font-size: 10px; padding: 1px 9px; }
.chip--hero { border-style: dashed; }
.chip--lang { font-variant-numeric: tabular-nums; }
.chip--on { background: var(--te-black); border-color: var(--te-black); color: var(--te-white); }
button.chip { cursor: pointer; background: transparent; font-family: inherit; }
button.chip--on:hover { opacity: .88; }
.mini-ic { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; }

/* ---------- home ---------- */
.home-lead { padding: var(--space-lg) 0 var(--space-xl); }
.home-lead__h {
  font-size: var(--fs-hero); font-weight: 300; letter-spacing: -0.03em; line-height: .95;
  margin: 0 0 var(--space-md);
}
.home-lead__sub { font-size: var(--fs-20); color: var(--te-grey-900); max-width: 46em; }
.home-lead__cta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: var(--space-lg); }
.latest-card {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 6px 20px; align-items: baseline;
  background: #fff; border-radius: var(--r-lg); padding: var(--space-lg);
  text-decoration: none; border: 1px solid transparent;
  transition: border-color .12s linear;
}
.latest-card:hover { border-color: var(--te-black); }
.latest-card__date { font-size: var(--fs-10); color: var(--te-grey-700); }
.latest-card__title { font-size: var(--fs-30); font-weight: 300; letter-spacing: -0.01em; line-height: 1.1; }
.latest-card__meta { grid-column: 3; grid-row: 1 / span 2; font-size: var(--fs-10); color: var(--te-grey-700); text-align: right; white-space: nowrap; }
.latest-card__heroes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.hero-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cloud__item {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border-radius: var(--r-md); padding: 8px 14px;
  text-decoration: none; font-size: var(--fs-15);
}
.hero-cloud__item:hover { outline: 1px solid var(--te-black); }
.hero-cloud__item small { color: var(--te-grey-500); }
.hero-cloud__item img, .hero-row__ic img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }

/* category cards */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--space-md); }
.cat-card {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border-radius: var(--r-md); padding: 18px 20px;
  text-decoration: none; border: 1px solid transparent;
}
.cat-card:hover { border-color: var(--te-black); }
.cat-card__n { font-size: var(--fs-30); font-weight: 300; line-height: 1; }
.cat-card__t { font-size: var(--fs-15); font-weight: 300; }
.cat-card__m { font-size: var(--fs-10); color: var(--te-grey-700); }
.cat-grid--lg .cat-card { padding: 26px 28px; }
.cat-grid--lg .cat-card__n { font-size: var(--fs-40); }

/* ---------- watermark sections（沿用 pr-01） ---------- */
.sec { position: relative; padding: var(--space-xxl) 0 0; }
.sec:first-child { padding-top: var(--space-xl); }
.sec__wm {
  position: absolute; top: calc(var(--space-xxl) - 30px); left: -16px;
  font-size: clamp(60px, calc(.085 * 100vw), 140px); font-weight: 300;
  color: var(--te-grey-100); letter-spacing: -0.025em; line-height: .9;
  pointer-events: none; user-select: none; z-index: 0;
}
.sec:first-child .sec__wm { top: calc(var(--space-xl) - 30px); }
.sec__h { position: relative; z-index: 1; font-size: var(--fs-40); letter-spacing: -0.02em; line-height: 1.05; margin: 60px 0 var(--space-xl); display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.sec__h--sm { font-size: var(--fs-30); margin-top: 40px; }
.sec__h small { font-size: var(--fs-15); font-weight: 100; color: var(--te-grey-700); letter-spacing: 0; display: inline-flex; gap: 8px; align-items: center; }
.sec__h small a { text-decoration: none; border-bottom: 1px solid var(--te-grey-300); }

.sub-title { font-size: var(--fs-15); color: var(--te-grey-700); padding: var(--space-lg) 0 var(--space-md); border-bottom: 1px solid var(--te-grey-200); margin-bottom: var(--space-lg); }

/* rich text */
.rich { font-size: var(--fs-15); line-height: 1.55; }
.rich p { font-weight: 100; margin: 0 0 .6em; }
.rich ul, .rich ol { padding-left: 1.1em; margin: 0 0 .8em; }
.rich li { margin: .2em 0; }
.rich li::marker { color: var(--te-grey-500); }
.rich strong, .rich b { font-weight: 300; }
.rich > :last-child { margin-bottom: 0; }

/* dev note（沿用 pr-01） */
.dev { font-size: var(--fs-15); line-height: 1.5; color: var(--te-grey-700); border-left: 1px solid var(--te-grey-300); padding-left: 16px; margin-top: 10px; }
.dev p { font-weight: 100; margin: 0 0 .5em; }
.dev::before { content: 'dev–note'; display: block; font-size: var(--fs-10); color: var(--te-black); margin-bottom: 6px; }

/* ---------- patch pages ---------- */
.pg-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: var(--space-xl);
  align-items: start;
  padding: var(--space-md) 0 var(--space-xxl);
}
.pg-head__code { font-size: clamp(48px, calc(.0673 * 100vw), 110px); font-weight: 300; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.pg-head .te-badge { margin-top: var(--space-sm); }
.pg-head__col { font-size: clamp(20px, calc(.0184 * 100vw), 32px); line-height: 1.15; padding-top: var(--space-sm); }
.pg-head__col:nth-child(2) { white-space: nowrap; }
.pg-head__col .grey { font-size: var(--fs-15); display: block; margin-top: 8px; }
.pg-head__ver { font-size: var(--fs-10); padding-top: var(--space-md); text-align: right; white-space: nowrap; }

.te-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px;
  padding: 24px 0;
  border-top: 1px solid var(--te-grey-200); border-bottom: 1px solid var(--te-grey-200);
}
.te-meta__cell { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.te-meta__label { font-size: var(--fs-10); color: var(--te-grey-700); }
.te-meta__value { font-size: var(--fs-20); }

.patch-tools {
  display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: center;
  padding: var(--space-lg) 0;
}
.patch-tools__label { font-size: var(--fs-10); color: var(--te-grey-700); margin-right: 10px; text-transform: uppercase; letter-spacing: .06em; }
.patch-tools a { text-decoration: none; }
.patch-tools__cats, .patch-tools__langs, .patch-tools__src { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* general update rows（沿用 pr-01） */
.gen { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px var(--space-lg); align-items: baseline; padding: var(--space-lg) 0; border-bottom: 1px solid var(--te-grey-200); }
.gen:last-child { border-bottom: 0; }
.gen__num { font-size: var(--fs-30); font-weight: 300; letter-spacing: -0.01em; line-height: 1; }
.gen__title { font-size: var(--fs-30); font-weight: 300; letter-spacing: -0.01em; line-height: 1.1; }
.gen__body { grid-column: 3; grid-row: 1 / span 2; }
.gen .dev { grid-column: 2; }
.text-block { max-width: 46em; }

/* hero tiles（沿用 pr-01 + 链接化） */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: var(--space-lg); align-items: start; }
.tile { background: #fff; border-radius: var(--r-lg); padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); scroll-margin-top: 24px; }
.tile__head { display: flex; align-items: center; gap: var(--space-md); }
.tile__media { width: clamp(56px, 5vw, 84px); aspect-ratio: 1; border-radius: var(--r-md); background: var(--te-grey-100); overflow: hidden; flex-shrink: 0; display: grid; place-items: center; font-size: var(--fs-10); color: var(--te-grey-700); }
.tile__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile__name { font-size: var(--fs-30); letter-spacing: -0.01em; line-height: 1; }
.tile__name a { text-decoration: none; border-bottom: 2px solid transparent; }
.tile__name a:hover { border-bottom-color: var(--te-black); }
.tile__tag { font-size: var(--fs-10); color: var(--te-grey-700); margin-top: 6px; }
.tile__more { text-decoration: none; border-bottom: 1px solid var(--te-grey-300); }
.abil { display: grid; grid-template-columns: 40px 1fr; gap: 4px 14px; padding-top: var(--space-md); border-top: 1px solid var(--te-grey-100); }
.abil:first-of-type { border-top: 0; }
.abil__icon { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--te-black); display: grid; place-items: center; grid-row: 1 / span 2; }
.abil__icon img { width: 70%; height: 70%; object-fit: contain; }
.abil__name { font-size: var(--fs-15); font-weight: 300; }
.abil ul { padding-left: 1.1em; font-size: var(--fs-15); line-height: 1.45; }
.abil li { font-weight: 100; margin: .15em 0; }
.abil li::marker { color: var(--te-grey-500); }
.abil--tl { padding-top: 14px; margin-top: 6px; }

/* patch list */
.patch-list { display: flex; flex-direction: column; }
.patch-row {
  display: grid; grid-template-columns: 92px 84px minmax(0, 1fr) auto auto auto; gap: 6px 18px; align-items: baseline;
  padding: 18px 4px; border-bottom: 1px solid var(--te-grey-200); text-decoration: none;
}
.patch-row:hover { background: #fff; }
.patch-row__date { font-size: var(--fs-15); font-variant-numeric: tabular-nums; }
.patch-row__code { font-size: var(--fs-10); color: var(--te-grey-500); }
.patch-row__title { font-size: var(--fs-20); font-weight: 300; letter-spacing: -0.01em; }
.patch-row__badges { display: flex; gap: 6px; }
.patch-row__meta { font-size: var(--fs-10); color: var(--te-grey-700); white-space: nowrap; }
.patch-row__cats { display: flex; gap: 6px; flex-wrap: wrap; }

/* permalink + pagenav */
.permalink {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid var(--te-grey-200); margin-top: var(--space-xl); padding-top: var(--space-lg);
}
.permalink__label { font-size: var(--fs-10); color: var(--te-grey-700); text-transform: uppercase; letter-spacing: .08em; margin-right: 12px; }
.pagenav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: var(--space-lg); }
.pagenav__btn {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--te-grey-200); border-radius: var(--r-md); padding: 20px 24px;
  text-decoration: none; background: #fff;
}
.pagenav__btn:hover { border-color: var(--te-black); }
.pagenav__btn--next { text-align: right; }
.pagenav__btn small { font-size: var(--fs-10); color: var(--te-grey-700); }
.pagenav__btn span { font-size: var(--fs-15); color: var(--te-grey-900); }

/* ---------- hero pages ---------- */
.hero-head { display: flex; gap: var(--space-lg); align-items: center; flex-wrap: wrap; padding: var(--space-md) 0 var(--space-lg); }
.hero-head__ic { width: clamp(96px, 9vw, 148px); aspect-ratio: 1; border-radius: var(--r-lg); background: #fff; display: grid; place-items: center; overflow: hidden; font-size: var(--fs-10); color: var(--te-grey-700); }
.hero-head__ic img { width: 100%; height: 100%; object-fit: cover; }
.hero-head__meta { flex: 1; min-width: 260px; }
.hero-head__stats { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: var(--fs-15); color: var(--te-grey-700); margin: var(--space-md) 0; }
.hero-head__stats b { font-weight: 300; color: var(--te-black); font-size: var(--fs-20); }
.hero-head__cats { display: flex; gap: 8px; flex-wrap: wrap; }

.hero-index__tools { display: flex; gap: 8px; margin-bottom: var(--space-md); }
.hero-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 28px; }
.hero-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 11px 4px; border-bottom: 1px solid var(--te-grey-200); text-decoration: none;
}
.hero-row:hover { background: #fff; }
.hero-row__ic { display: grid; place-items: center; }
.hero-row__ic:empty::before { content: ''; width: 26px; height: 26px; border-radius: 7px; background: var(--te-grey-100); }
.hero-row__name { font-size: var(--fs-15); }
.hero-row__n { font-size: var(--fs-10); color: var(--te-grey-500); }
.hero-row__dates { font-size: 10px; color: var(--te-grey-300); white-space: nowrap; }

.abil-index { display: flex; flex-wrap: wrap; gap: 8px; }
.abil-index__item { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: var(--r-md); padding: 8px 14px; text-decoration: none; font-size: var(--fs-15); }
.abil-index__item:hover { outline: 1px solid var(--te-black); }
.abil-index__item small { color: var(--te-grey-500); }

/* timeline */
.tl { display: flex; flex-direction: column; }
.tl__row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--space-lg); padding: var(--space-lg) 0; border-bottom: 1px solid var(--te-grey-200); }
.tl__row:last-child { border-bottom: 0; }
.tl__date { font-size: var(--fs-15); }
.tl__date a { text-decoration: none; border-bottom: 1px solid var(--te-grey-300); font-variant-numeric: tabular-nums; }
.tl__date small { display: block; font-size: 10px; color: var(--te-grey-500); margin-top: 4px; }
.tl__patch { font-size: var(--fs-20); font-weight: 300; margin-bottom: var(--space-md); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tl__patch a { text-decoration: none; border-bottom: 2px solid transparent; }
.tl__patch a:hover { border-bottom-color: var(--te-black); }
.tl__change { position: relative; padding: 10px 0; scroll-margin-top: 24px; }
.tl__change + .tl__change { border-top: 1px dashed var(--te-grey-200); }
.tl__anchor { font-size: 10px; color: var(--te-grey-500); text-decoration: none; opacity: 0; transition: opacity .12s; }
.tl__change:hover .tl__anchor { opacity: 1; }
.tl__anchor:hover { color: var(--te-orange); }
.cat-entry { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 6px 0; }
.cat-entry__title { text-decoration: none; border-bottom: 1px solid var(--te-grey-300); font-size: var(--fs-15); }
.cat-entry__title:hover { border-bottom-color: var(--te-black); }
.cat-entry__sec { font-size: 10px; color: var(--te-grey-500); }

/* ---------- recent / results rows ---------- */
.res-list { display: flex; flex-direction: column; }
.res-row {
  display: grid; grid-template-columns: 92px auto minmax(0, 220px) minmax(0, 1fr); gap: 8px 18px; align-items: baseline;
  padding: 12px 4px; border-bottom: 1px solid var(--te-grey-200);
}
.res-row:hover { background: #fff; }
.res-row__date { font-size: var(--fs-10); color: var(--te-grey-700); text-decoration: none; font-variant-numeric: tabular-nums; }
.res-row__cat { }
.res-row__label { font-size: var(--fs-15); }
.res-row__label a { text-decoration: none; border-bottom: 1px solid var(--te-grey-300); }
.res-row__label a:hover { border-bottom-color: var(--te-black); }
.res-row__text { font-size: var(--fs-15); color: var(--te-grey-900); }
.res-row[hidden] { display: none; }

/* ---------- search ---------- */
.search-box { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-lg); }
.search-kinds { display: flex; gap: 8px; flex-wrap: wrap; }
.search-meta { font-size: var(--fs-10); color: var(--te-grey-700); margin-bottom: var(--space-md); }
mark { background: var(--te-orange); color: var(--te-black); padding: 0 2px; }

/* ---------- buttons / input / kbd / toast（沿用 pr-01） ---------- */
.te-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 16px;
  background: var(--error); color: var(--te-white);
  border: 0; border-radius: var(--r-hair);
  font-size: var(--fs-20); font-weight: 100;
  padding: 0 24px; height: 64px;
  cursor: pointer; transition: opacity .12s linear;
  text-decoration: none;
}
.te-btn:hover { opacity: .88; }
.te-btn:active { transform: translateY(1px); opacity: 1; }
.te-btn--sm { height: 40px; font-size: var(--fs-15); padding: 0 18px; }
.te-btn--ghost { background: transparent; color: var(--te-black); border: 1px solid var(--te-black); }
.te-btn--ghost:hover { background: var(--te-black); color: var(--te-white); opacity: 1; }

.te-badge { display: inline-block; padding: 3px 14px; border: 1px solid var(--te-black); border-radius: 9999px; font-size: var(--fs-15); line-height: 1.3; background: transparent; color: inherit; font-family: inherit; font-weight: 100; }
.te-badge--dark { background: var(--te-black); color: var(--te-white); }

.te-input {
  font: inherit; font-size: var(--fs-15); font-weight: 100; color: var(--te-black);
  background: var(--te-grey-100); border: 1px solid var(--te-grey-100);
  border-radius: var(--r-md); padding: 16px 26px; width: 100%;
  transition: border-color .12s linear;
}
.te-input::placeholder { color: var(--te-grey-700); }
.te-input:focus { outline: none; border-color: var(--te-black); }
.te-input--sm { padding: 9px 14px; font-size: var(--fs-15); border-radius: var(--r-sm); }

.te-kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--te-grey-900); border-radius: var(--r-hair); font-family: ui-monospace, monospace; font-size: .85em; text-align: center; }

.te-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--te-black); color: var(--te-white);
  padding: 16px 22px; border-radius: var(--r-sm); font-size: var(--fs-15);
  box-shadow: rgba(0,0,0,.5) 0 6px 24px; z-index: 50;
}
[hidden] { display: none !important; }
.te-toast::before { content: ''; width: 8px; height: 8px; border-radius: 9999px; background: var(--success); }

/* states */
.state { padding: var(--space-xxl) 0; font-size: var(--fs-30); font-weight: 300; }
.state small { display: block; font-size: var(--fs-15); font-weight: 100; color: var(--te-grey-700); margin-top: 12px; }

/* ---------- footer（沿用 pr-01） ---------- */
.ft { margin-top: var(--space-xxl); background: var(--te-black); color: var(--te-grey-300); padding: var(--space-xxl) var(--space-xl) var(--space-xl); display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-xl); min-height: 30vh; }
.ft h4 { color: var(--te-white); font-size: var(--fs-15); margin-bottom: 14px; }
.ft ul { list-style: none; padding: 0; }
.ft li { padding: 10px 0; border-bottom: 1px solid var(--te-grey-1000); font-size: var(--fs-15); font-weight: 100; }
.ft li:last-child { border-bottom: 0; }
.ft a { text-decoration: none; border-bottom: 1px solid var(--te-grey-700); }
.ft__brand { font-size: var(--fs-40); font-weight: 300; color: var(--te-white); letter-spacing: -0.015em; line-height: 1.05; }
.ft__brand .grey { font-size: var(--fs-15); font-weight: 100; }
.ft .te-kbd { border-color: var(--te-grey-700); }

/* ---------- mobile topbar ---------- */
.wiki-topbar { display: none; }
.wiki-burger { background: none; border: 0; padding: 8px; cursor: pointer; }
.wiki-burger svg { width: 26px; height: 26px; display: block; }
.wiki-topbar__brand { font-weight: 300; font-size: var(--fs-20); text-decoration: none; flex: 1; }
.wiki-topbar__search svg { width: 22px; height: 22px; display: block; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .icn-nav { grid-template-columns: max-content repeat(6, 1fr) auto; }
  .icn-nav__aside { display: none; }
}
@media (max-width: 1000px) {
  .wiki-shell { grid-template-columns: 1fr; }
  .wiki-side {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); z-index: 40;
    background: var(--te-white); border-right: 1px solid var(--te-grey-200);
    padding: 24px; max-height: none; transform: translateX(-100%); transition: transform .18s linear;
  }
  .wiki-side.is-open { transform: none; }
  .wiki-topbar {
    display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 30;
    background: var(--te-white); border-bottom: 1px solid var(--te-grey-200);
    padding: 10px 20px;
  }
  .pg-head { grid-template-columns: auto minmax(0, 1fr); }
  .pg-head > :nth-child(2), .pg-head > :nth-child(4) { display: none; }
  .gen { grid-template-columns: 50px 1fr; }
  .gen__body { grid-column: 2; grid-row: auto; }
  .patch-row { grid-template-columns: 84px minmax(0, 1fr); }
  .patch-row__code, .patch-row__badges, .patch-row__meta, .patch-row__cats { grid-column: 2; }
  .res-row { grid-template-columns: 84px minmax(0, 1fr); }
  .res-row__cat { grid-column: 2; }
  .res-row__label, .res-row__text { grid-column: 2; }
  .tl__row { grid-template-columns: 1fr; gap: 10px; }
  .pagenav { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 20px; }
  .icn-nav { grid-template-columns: 1fr auto; padding: 16px 20px; }
  .icn-cluster { display: none; }
  .pg-head { grid-template-columns: 1fr; padding: 24px 20px 48px; }
  .pg-head > :nth-child(2), .pg-head > :nth-child(4) { display: none; }
  .pg-head__ver { display: none; }
  .te-meta { grid-template-columns: repeat(2, 1fr); }
  .tile { border-radius: var(--r-md); }
  .ft { grid-template-columns: 1fr; padding: 64px 20px 32px; }
  .latest-card { grid-template-columns: 1fr; }
  .latest-card__meta { grid-column: 1; grid-row: auto; text-align: left; }
}
