/* KHJ Material Library — design system
   Mobile first · light/dark · no horizontal scrolling */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI Variable Display", "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --bg-sunken: #ececef;
  --bg-glass: rgba(245, 245, 247, .78);
  --ink: #1d1d1f;
  --ink-2: #48484d;
  --ink-3: #86868b;
  --line: rgba(0, 0, 0, .09);
  --line-strong: rgba(0, 0, 0, .16);
  --accent: #0a66ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 102, 255, .1);
  --primary: #1d1d1f;
  --primary-ink: #ffffff;
  --epm: #12805c;
  --epm-soft: rgba(18, 128, 92, .12);
  --warn: #b25000;
  --diff: rgba(255, 196, 0, .16);
  --best: #12805c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05), 0 1px 1px rgba(0, 0, 0, .03);
  --shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .07);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .18);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --pad: clamp(16px, 4vw, 32px);
  --maxw: 1440px;
  --topbar-h: 60px;
  --tabbar-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"], :root[data-theme="auto"].is-dark {
  --bg: #0b0b0c;
  --bg-elev: #161618;
  --bg-sunken: #1f1f22;
  --bg-glass: rgba(11, 11, 12, .74);
  --ink: #f5f5f7;
  --ink-2: #c7c7cc;
  --ink-3: #8e8e93;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --accent: #4c8dff;
  --accent-soft: rgba(76, 141, 255, .16);
  --primary: #f5f5f7;
  --primary-ink: #0b0b0c;
  --epm: #3ecf8e;
  --epm-soft: rgba(62, 207, 142, .14);
  --diff: rgba(255, 196, 0, .12);
  --best: #3ecf8e;
  --shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--sm { width: 18px; height: 18px; }
.muted { color: var(--ink-3); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { max-width: var(--maxw); margin: 0 auto; height: var(--topbar-h); padding: 0 var(--pad); display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.brand__mark { width: 30px; height: 30px; color: var(--ink); }
.brand__text { font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand__text b { font-weight: 700; }
.topsearch {
  flex: 1; min-width: 0; max-width: 620px; margin: 0 auto; position: relative; display: flex; align-items: center;
  background: var(--bg-sunken); border-radius: 12px; height: 40px; padding: 0 6px 0 12px; gap: 8px;
  transition: background .2s, box-shadow .2s;
}
.topsearch:focus-within { background: var(--bg-elev); box-shadow: 0 0 0 2px var(--accent); }
.topsearch .ico { color: var(--ink-3); width: 19px; height: 19px; }
.topsearch input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; font-size: 16px; }
.topsearch input::-webkit-search-cancel-button { display: none; }
.topsearch__clear { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-3); }
body.is-home:not(.hero-out) .topsearch { opacity: 0; pointer-events: none; transform: translateY(-4px); }
.topsearch { transition: opacity .2s var(--ease), transform .2s var(--ease), background .2s, box-shadow .2s; }
.topnav { display: flex; align-items: center; gap: 4px; flex: none; }
.topnav__link { padding: 8px 12px; border-radius: 10px; font-size: 15px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.topnav__link:hover, .topnav__link.is-active { color: var(--ink); background: var(--bg-sunken); }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); }
.iconbtn:hover { background: var(--bg-sunken); color: var(--ink); }
.ico--moon { display: none; }
.is-dark-ui .ico--sun { display: none; }
.is-dark-ui .ico--moon { display: block; }
.pill { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }

@media (max-width: 767px) {
  :root { --tabbar-h: 62px; --topbar-h: 56px; }
  .brand__text { display: none; }
  .topnav__link { display: none; }
  .topbar__inner { gap: 10px; }
  body.is-home:not(.hero-out) .topsearch { opacity: 0; }
}

/* ---------- bottom tab bar (mobile) ---------- */
.tabbar { display: none; }
@media (max-width: 767px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; inset: auto 0 0 0; z-index: 45;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--bg-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-3); font-weight: 500; }
  .tabbar a.is-active { color: var(--accent); }
  .tabbar .pill--tab { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }
}

/* ---------- boot / skeleton ---------- */
.boot { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-3); }
.boot__spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view-enter { animation: fadein .28s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px;
  font-weight: 600; font-size: 15px; background: var(--bg-sunken); color: var(--ink); transition: transform .12s, background .2s, opacity .2s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn.is-on { background: var(--accent-soft); color: var(--accent); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 99px; font-size: 14px;
  background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-2); transition: background .15s, color .15s;
}
.chip:hover { color: var(--ink); background: var(--bg-sunken); }
.chip--active { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
.chip--active:hover { background: var(--primary); color: var(--primary-ink); opacity: .9; }
.chip .x { width: 16px; height: 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: .01em; background: var(--bg-sunken); color: var(--ink-2); white-space: nowrap; }
.badge--epm { background: var(--epm-soft); color: var(--epm); }
.badge--epm::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--sim { background: var(--primary); color: var(--primary-ink); }
.badge--good { background: var(--epm-soft); color: var(--epm); }
.badge--bad { background: rgba(255, 59, 48, .1); color: #d70015; }
.is-dark-ui .badge--bad { color: #ff6961; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- home ---------- */
.hero { padding-block: clamp(36px, 9vw, 96px) clamp(28px, 5vw, 48px); text-align: center; }
.hero__eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(34px, 7.4vw, 68px); line-height: 1.04; font-weight: 700; margin: 14px auto 14px; max-width: 16ch; letter-spacing: -.035em; }
.hero p.lede { color: var(--ink-2); font-size: clamp(16px, 2.2vw, 20px); max-width: 52ch; margin: 0 auto; }
.herosearch {
  margin: clamp(24px, 4vw, 40px) auto 0; max-width: 760px; position: relative; display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev); border-radius: 20px; padding: 8px 8px 8px 20px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  transition: box-shadow .2s;
}
.herosearch:focus-within { box-shadow: var(--shadow), 0 0 0 3px var(--accent); }
.herosearch .ico { color: var(--ink-3); width: 24px; height: 24px; }
.herosearch input { flex: 1; min-width: 0; height: 52px; border: 0; outline: none; background: none; font-size: clamp(17px, 2.4vw, 21px); letter-spacing: -.01em; }
.herosearch input::-webkit-search-cancel-button { display: none; }
.herosearch .btn { height: 52px; border-radius: 14px; padding: 0 22px; }
@media (max-width: 520px) { .herosearch .btn span { display: none; } .herosearch .btn { padding: 0 16px; } }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--bg-elev); border-radius: 16px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); overflow: hidden; z-index: 30; text-align: left;
}
.suggest a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px; }
.suggest a:hover, .suggest a.is-sel { background: var(--bg-sunken); }
.suggest img, .suggest .sw { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-sunken); }
.suggest .s-title { font-weight: 600; font-size: 15px; }
.suggest .s-sub { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest .s-all { justify-content: center; font-weight: 600; color: var(--accent); min-height: 48px; border-top: 1px solid var(--line); }
.examples { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.examples .label { width: 100%; font-size: 13px; color: var(--ink-3); }

.section { padding-block: clamp(20px, 4vw, 44px); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section__head h2 { font-size: clamp(21px, 3vw, 28px); font-weight: 700; }
.section__head a { color: var(--accent); font-weight: 500; font-size: 15px; white-space: nowrap; }
.types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .types { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; } }
.typetile { position: relative; aspect-ratio: 4/5; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-sunken); isolation: isolate; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease); }
.typetile:hover { transform: translateY(-3px); }
.typetile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .6s var(--ease); }
.typetile:hover img { transform: scale(1.05); }
.typetile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .66)); z-index: -1; }
.typetile__txt { position: absolute; left: 16px; right: 16px; bottom: 14px; color: #fff; }
.typetile__txt b { display: block; font-size: 18px; letter-spacing: -.01em; }
.typetile__txt span { font-size: 13px; opacity: .85; }
.typetile:nth-child(5):last-child { grid-column: span 2; aspect-ratio: 8/5; }
@media (min-width: 700px) { .typetile:nth-child(5):last-child { grid-column: auto; aspect-ratio: 4/5; } }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quickcard { background: var(--bg-elev); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 6px; min-height: 112px; transition: transform .2s var(--ease), box-shadow .2s; }
.quickcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quickcard .k { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-family: var(--font-display); }
.quickcard .l { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.footer { padding: 40px 0 32px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); margin-top: 32px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- results ---------- */
.results { display: grid; gap: 24px; padding-top: 18px; padding-bottom: 40px; }
@media (min-width: 1024px) { .results { grid-template-columns: 272px minmax(0, 1fr); gap: 32px; padding-top: 24px; } }
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar { display: block; position: sticky; top: calc(var(--topbar-h) + 20px); align-self: start; max-height: calc(100dvh - var(--topbar-h) - 40px); overflow: auto; padding-right: 6px; overscroll-behavior: contain; }
}
.resbar { display: contents; }
@media (min-width: 1024px) { .resbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; } }
.reshead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.reshead h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; flex: 1 1 auto; min-width: 0; }
.reshead h1 small { display: block; font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-top: 2px; font-family: var(--font); }
.toolbar { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 20; margin: 0 calc(var(--pad) * -1); padding: 10px var(--pad); background: var(--bg-glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); display: flex; gap: 8px; align-items: center; border-bottom: 1px solid transparent; }
.toolbar.is-stuck { border-bottom-color: var(--line); }
@media (min-width: 1024px) { .toolbar { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; margin: 0; padding: 0; } .toolbar .btn-filters { display: none; } }
.toolbar .spacer { flex: 1; }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 36px 0 14px; border-radius: 10px; border: 0; background: var(--bg-sunken); font-size: 15px; font-weight: 500; }
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.activechips { display: flex; flex-wrap: wrap; gap: 8px; }
.activechips .chip { min-height: 32px; font-size: 13px; padding: 0 10px 0 12px; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-2); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1680px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.card { position: relative; background: var(--bg-elev); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); display: flex; flex-direction: column; transition: transform .25s var(--ease), box-shadow .25s; content-visibility: auto; contain-intrinsic-size: 300px 380px; }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); } .card:hover .card__img img { transform: scale(1.04); } }
.card__img { position: relative; aspect-ratio: 1; background: var(--bg-sunken); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card__badges { position: absolute; top: 10px; left: 10px; right: 54px; display: flex; flex-wrap: wrap; gap: 6px; }
.card__badges .badge { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: rgba(255, 255, 255, .86); box-shadow: var(--shadow-sm); }
.card__badges .badge--epm { color: #0d6b4c; }
.card__badges .badge--sim { background: rgba(20, 20, 22, .86); color: #fff; }
.card__cmp { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; display: grid; place-items: center; }
.card__cmp span { width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .88); color: #1d1d1f; display: grid; place-items: center; box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); transition: background .15s; }
.card__cmp.is-on span { background: var(--accent); color: #fff; }
.card__cmp .ico { width: 18px; height: 18px; }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card__num { font-weight: 700; font-size: 15px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.card__type { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin: 8px 0 10px; font-size: 13px; color: var(--ink-2); }
.card__meta div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__meta b { font-weight: 600; color: var(--ink); }
.card__meta .wide { grid-column: 1 / -1; }
.card__deltas { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.card__deltas .badge { height: 22px; font-size: 11.5px; padding: 0 7px; }
.card__cta { margin-top: auto; }
.card__cta .btn { width: 100%; min-height: 40px; font-size: 14px; }
.card__link { position: absolute; inset: 0; z-index: 1; }
.card__cmp, .card__cta { z-index: 2; }
@media (max-width: 380px) { .card__meta { grid-template-columns: 1fr; } .card__body { padding: 10px 11px 12px; } }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.empty h2 { font-size: 22px; margin-bottom: 8px; color: var(--ink); }
.empty .chips { justify-content: center; margin-top: 16px; }
.sentinel { height: 1px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-direction: column; }
.fgroup { border-bottom: 1px solid var(--line); }
.fgroup > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 52px; cursor: pointer; font-weight: 600; font-size: 15px; }
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.fgroup[open] > summary::after { transform: rotate(-135deg); }
.fgroup > summary .cnt { margin-left: auto; margin-right: 12px; font-size: 12px; color: var(--accent); font-weight: 600; }
.fbody { padding: 0 0 16px; display: flex; flex-direction: column; gap: 2px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: 15px; border-radius: 10px; padding: 0 6px; margin: 0 -6px; }
.check:hover { background: var(--bg-sunken); }
.check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; margin: 0; background: var(--bg-elev); transition: background .15s, border-color .15s; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--primary-ink); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check .n { margin-left: auto; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.check.is-zero { opacity: .45; }
.switch { display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: 12px; cursor: pointer; font-size: 15px; }
.switch input { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--bg-sunken); box-shadow: inset 0 0 0 1px var(--line-strong); position: relative; margin: 0; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--epm); box-shadow: none; }
.switch input:checked::after { transform: translateX(20px); }
.range { padding: 6px 2px 4px; }
.range__vals { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.range__track { position: relative; height: 36px; }
.range__track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; border-radius: 4px; background: var(--bg-sunken); transform: translateY(-50%); }
.range__fill { position: absolute; top: 50%; height: 4px; border-radius: 4px; background: var(--primary); transform: translateY(-50%); }
.range input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 36px; }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .06); cursor: grab; }
.range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); cursor: grab; }
.range input[type=range]::-moz-range-track { background: none; }
.range__hist { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-bottom: -6px; }
.range__hist i { flex: 1; background: var(--line-strong); border-radius: 2px 2px 0 0; min-height: 2px; }
.range__hist i.in { background: var(--ink-3); }
.fhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.fhead h2 { font-size: 17px; }
.linkbtn { color: var(--accent); font-weight: 500; font-size: 15px; min-height: 44px; padding: 0 4px; }

/* sheet (mobile filters) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 60; opacity: 0; transition: opacity .25s; }
.sheet-backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--bg-elev); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform .32s var(--ease);
}
.sheet.is-open { transform: none; }
.sheet__grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 2px; flex: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 6px 20px 8px; flex: none; }
.sheet__head h2 { font-size: 19px; }
.sheet__body { overflow: auto; padding: 0 20px; overscroll-behavior: contain; flex: 1; }
.sheet__foot { padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 10px; flex: none; }
.sheet__foot .btn { flex: 1; min-height: 50px; }

/* ---------- detail ---------- */
.detail { padding-top: 12px; padding-bottom: 48px; }
.crumbs { display: flex; align-items: center; gap: 4px; min-height: 44px; font-size: 15px; color: var(--accent); }
.detail__grid { display: grid; gap: 20px; grid-template-areas: "head" "media" "info"; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) {
  .detail__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "media head" "media info"; grid-template-rows: auto 1fr; gap: 24px 48px; align-items: start; }
  .detail__media { align-self: start; }
  .detail__media { position: sticky; top: calc(var(--topbar-h) + 20px); }
}
.dhead__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.dhead__num { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink-2); background: var(--bg-sunken); padding: 3px 8px; border-radius: 6px; }
.dhead h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em; }
.dhead p { color: var(--ink-2); font-size: 17px; margin: 10px 0 0; }
.dactions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-top: 18px; }
.dactions .iconbtn { background: var(--bg-sunken); }

.gallery { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-sunken); }
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; aspect-ratio: 1; scroll-snap-align: center; position: relative; cursor: zoom-in; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery__label { position: absolute; left: 12px; bottom: 12px; }
.gallery__label .badge { background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(8px); }
.gallery__zoom { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); pointer-events: none; }
.gallery__dots { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.gallery__dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: background .2s, width .2s; }
.gallery__dots i.on { background: #fff; width: 18px; border-radius: 4px; }
.gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .85); color: #1d1d1f; display: none; place-items: center; box-shadow: var(--shadow-sm); }
.gallery__nav--prev { left: 12px; } .gallery__nav--next { right: 12px; }
@media (hover: hover) and (min-width: 768px) { .gallery:hover .gallery__nav { display: grid; } }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs button { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); opacity: .6; transition: opacity .2s; position: relative; }
.thumbs button.on { opacity: 1; box-shadow: 0 0 0 2px var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.panel { background: var(--bg-elev); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 26px); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 19px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel h2 .ico { color: var(--ink-3); width: 20px; height: 20px; }
.ai { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--bg-elev); }
.ai p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink); }
.ai .src { margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 0; }
.kv > div { padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.kv > div.wide { grid-column: 1 / -1; }
.kv dt { font-size: 12.5px; color: var(--ink-3); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.kv dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.kv dd small { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.kv dd .bench { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.compbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 6px 0 10px; background: var(--bg-sunken); }
.compbar i { height: 100%; }
.complegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.complegend span { display: inline-flex; align-items: center; gap: 6px; }
.complegend i { width: 10px; height: 10px; border-radius: 3px; }
.epmbox { display: flex; gap: 14px; align-items: flex-start; }
.epmbox__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--bg-sunken); color: var(--ink-3); }
.epmbox__icon.is-epm { background: var(--epm-soft); color: var(--epm); }
.epmbox b { font-size: 17px; display: block; }
.epmbox p { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.smart { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .smart { grid-template-columns: 1fr 1fr; } }
.smart a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 14px; background: var(--bg-sunken); font-weight: 600; font-size: 15px; transition: background .15s, transform .12s; }
.smart a:active { transform: scale(.98); }
.smart a:hover { background: var(--accent-soft); }
.smart a .ico { color: var(--accent); }
.smart a .n { margin-left: auto; font-size: 13px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.smart a.is-empty { opacity: .5; }
.smart a.primary { grid-column: 1 / -1; background: var(--primary); color: var(--primary-ink); }
.smart a.primary .ico, .smart a.primary .n { color: inherit; opacity: .85; }
.tech > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 19px; min-height: 32px; font-family: var(--font-display); letter-spacing: -.02em; }
.tech > summary::-webkit-details-marker { display: none; }
.tech > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s; }
.tech[open] > summary::after { transform: rotate(-135deg); }
.tech[open] > summary { margin-bottom: 14px; }
.tech h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 8px; font-family: var(--font); font-weight: 600; }
.tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tag { background: var(--bg-sunken); border-radius: 12px; padding: 10px 12px; }
.tag small { display: block; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tag b { font-size: 15px; }
.yarns { display: grid; gap: 8px; }
.yarn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 12px; border-radius: 12px; background: var(--bg-sunken); font-size: 14px; }
@media (min-width: 560px) { .yarn { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.yarn small { display: block; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.yarn div { overflow-wrap: anywhere; }
.downloads { display: grid; gap: 8px; }
.dl { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 14px; border-radius: 14px; background: var(--bg-sunken); transition: background .15s; text-align: left; width: 100%; }
.dl:hover { background: var(--accent-soft); }
.dl__ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-elev); flex: none; font-size: 11px; font-weight: 800; color: #d70015; letter-spacing: .02em; }
.dl__ic.xls { color: #107c41; } .dl__ic.img { color: var(--accent); }
.dl__t { font-weight: 600; font-size: 15px; display: block; }
.dl__s { font-size: 13px; color: var(--ink-3); display: block; overflow-wrap: anywhere; }
.dl .ico { margin-left: auto; color: var(--ink-3); }
.dl.is-missing { opacity: .55; pointer-events: none; }
.simhead { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 16px; gap: 12px; }
.simhead h2 { font-size: clamp(22px, 3vw, 28px); }
.simhead a { color: var(--accent); font-weight: 500; white-space: nowrap; }

/* ---------- similar header ---------- */
.simsrc { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--line); }
.simsrc img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.simsrc b { display: block; font-size: 16px; }
.simsrc span { display: block; color: var(--ink-3); font-size: 13.5px; }
.modes { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- compare ---------- */
.compare { padding-top: 16px; padding-bottom: 48px; }
.cmp { --n: 2; margin-top: 18px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.cmp__row { display: grid; grid-template-columns: 170px repeat(var(--n), minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cmp__row:first-child { border-top: 0; }
.cmp__label { padding: 14px 16px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.cmp__cell { padding: 14px 12px; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; min-width: 0; border-left: 1px solid var(--line); }
.cmp__row.is-diff .cmp__cell, .cmp__row.is-diff .cmp__label { background: var(--diff); }
.cmp__row.is-diff .cmp__label::after { content: " ●"; color: #e0a100; }
.cmp__cell .best { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--best); text-transform: uppercase; letter-spacing: .04em; }
.cmp__head { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--bg-elev); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.cmp__head .cmp__cell { padding: 12px; position: relative; }
.cmp__head img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--bg-sunken); }
.cmp__head b { display: block; margin-top: 8px; font-size: 15px; }
.cmp__head span { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.cmp__rm { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; }
.cmp__rm span { width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.cmp__rm .ico { width: 16px; height: 16px; }
.cmp__add { display: grid; place-items: center; align-content: center; gap: 8px; aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line-strong); color: var(--ink-3); font-size: 14px; font-weight: 600; text-align: center; padding: 8px; }
.cmp__opts { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.cmp__opts .switch { min-height: 44px; }
.cmp__opts .switch input:checked { background: var(--accent); }
@media (max-width: 767px) {
  .cmp__row { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .cmp__label { grid-column: 1 / -1; padding: 10px 12px 0; font-size: 11.5px; }
  .cmp__cell { padding: 6px 8px 12px; font-size: 13.5px; border-left: 0; }
  .cmp__cell + .cmp__cell { border-left: 1px solid var(--line); }
  .cmp__head .cmp__label { display: none; }
  .cmp__head .cmp__cell { padding: 8px 6px; }
  .cmp__head b { font-size: 12.5px; overflow-wrap: anywhere; }
  .cmp__head span { display: none; }
  .cmp__head img { border-radius: 8px; }
}

/* ---------- compare tray ---------- */
.tray {
  position: fixed; z-index: 44; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--tabbar-h) + var(--safe-b));
  width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 18px;
  background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-lg); animation: trayin .3s var(--ease);
}
@keyframes trayin { from { transform: translate(-50%, 20px); opacity: 0; } }
.tray__thumbs { display: flex; gap: 6px; flex: 1; min-width: 0; }
.tray__thumbs img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; border: 2px solid rgba(127, 127, 127, .4); }
.tray__label { font-size: 14px; font-weight: 600; white-space: nowrap; }
.tray .btn { background: var(--accent); color: #fff; min-height: 44px; }
.tray .iconbtn { color: inherit; width: 40px; height: 40px; opacity: .7; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .96); color: #fff; display: flex; flex-direction: column; touch-action: none; animation: fadein .2s; }
.lb__top { display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; gap: 12px; flex: none; }
.lb__title { font-size: 14px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb__btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; flex: none; }
.lb__stage { flex: 1; position: relative; overflow: hidden; }
.lb__stage img { position: absolute; top: 50%; left: 50%; max-width: 100%; max-height: 100%; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; will-change: transform; }
.lb__foot { text-align: center; padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px)); font-size: 13px; opacity: .7; flex: none; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb__nav--prev { left: 12px; } .lb__nav--next { right: 12px; }
@media (hover: none) { .lb__nav { display: none; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h) + var(--safe-b)); transform: translate(-50%, 20px); z-index: 95; background: var(--primary); color: var(--primary-ink); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- print (data sheet) ---------- */
@media print {
  .topbar, .tabbar, .tray, .crumbs, .dactions, .smart, .sim-section, .gallery__dots, .gallery__nav, .thumbs, .downloads, .no-print, .footer { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .panel { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .tech { display: block; } .tech > * { display: block !important; }
  .detail__grid { grid-template-columns: 1fr 1.4fr; }
  .gallery__track { overflow: visible; } .gallery__slide:not(:first-child) { display: none; }
}

/* language toggle */
.langbtn span { font-size: 14px; font-weight: 700; letter-spacing: 0; line-height: 1; }
html[lang="zh-Hans"] h1, html[lang="zh-Hans"] h2, html[lang="zh-Hans"] h3 { letter-spacing: 0; }
html[lang="zh-Hans"] .tech h3 { letter-spacing: .02em; }
