/* PicDex page. Cool charcoal like the app; amber marks what you press. Boxy, small radii. */
:root {
  --page: #14161a; --panel: #1b1e24; --well: #101216; --ink: #e8e9eb; --soft: #9fa5ad; --rule: #30353d; --amber-t: #f2b33d; --pick: #2a2415; --mk: #4a3a10;
  --amber: #f2b33d; --amber-ink: #1d1400; --tx: #8fd0f5; --fl: #c9b8ff;
  --font: "Yu Gothic UI", "Meiryo UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", Meiryo, sans-serif;
}
/* Light theme. theme.js sets data-theme; without scripts the page follows the system. */
:root[data-theme="light"] { --page: #f3f4f6; --panel: #ffffff; --well: #e8eaee; --ink: #15171b; --soft: #59606a; --rule: #d3d7dd; --amber-t: #8f5b00; --pick: #fdf0d2; --mk: #fbe3a8; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) { --page: #f3f4f6; --panel: #ffffff; --well: #e8eaee; --ink: #15171b; --soft: #59606a; --rule: #d3d7dd; --amber-t: #8f5b00; --pick: #fdf0d2; --mk: #fbe3a8; }
}
/* The app and its fragments keep the app's own dark colours in either page theme. */
.app, .mini { --page: #14161a; --panel: #1b1e24; --well: #101216; --ink: #e8e9eb; --soft: #9fa5ad; --rule: #30353d; --amber-t: #f2b33d; --pick: #2a2415; --mk: #4a3a10; color: var(--ink); }
:root:lang(zh-CN), [lang="zh-CN"] { --font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Yu Gothic UI", sans-serif; }
[lang="ja"] { --font: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", Meiryo, sans-serif; }
[lang] { font-family: var(--font); }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 16.5px; line-height: 1.8; }
h1, h2, h3, p, ul, ol, dl, dd, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
svg, img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2 { word-break: auto-phrase; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--amber); color: var(--amber-ink); padding: 6px 12px; z-index: 9; }
.intro { padding: 80px 0; }

.top, main, .foot { width: min(1200px, 100% - 40px); margin-inline: auto; }
.top { display: flex; align-items: center; gap: 28px; padding: 16px 0; }
.name { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; text-decoration: none; }
.top nav { display: flex; gap: 24px; margin-left: auto; font-size: .9rem; }
.top nav a { text-decoration: none; color: var(--soft); }
.top nav a:hover { color: var(--amber-t); }

.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 60px; align-items: end; padding: 64px 0 46px; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.4; font-weight: 800; }
.lead { margin-top: 20px; color: var(--soft); font-size: 1.05rem; max-width: 36em; }
.cta { margin-top: 28px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.btn { background: var(--amber); color: var(--amber-ink); font-weight: 800; text-decoration: none; padding: 12px 26px; border-radius: 4px; }
.btn:hover { filter: brightness(1.08); }
.link { font-weight: 700; }
.facts li { display: grid; grid-template-columns: 7.2em 1fr; gap: 16px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--rule); }
.facts li:last-child { border-bottom: 1px solid var(--rule); }
.facts b { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.facts span { color: var(--soft); font-size: .88rem; }

.try { font-size: .84rem; color: var(--soft); margin-bottom: 8px; }
.queries { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.queries button { padding: 7px 16px; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); font-weight: 700; }
.queries button:hover { border-color: var(--amber); }
.queries button[aria-selected="true"] { border-color: var(--amber); color: var(--amber-t); background: var(--pick); }

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr) 236px; gap: 10px; background: var(--well); border: 1px solid var(--rule); border-radius: 6px; padding: 10px; font-size: .8rem; line-height: 1.55; }
.lib, .mid, .info { background: var(--panel); border-radius: 5px; padding: 10px; min-width: 0; }
.amber { background: var(--amber); color: var(--amber-ink); font-weight: 700; text-align: center; padding: 6px; border-radius: 4px; }
.cap { color: var(--soft); font-size: .74rem; margin: 10px 0 6px; }
.btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.btns span, .wide { border: 1px solid var(--rule); border-radius: 4px; text-align: center; padding: 5px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide { margin-top: 6px; }
.libs li { padding: 8px 8px 8px 30px; border-bottom: 1px solid var(--rule); position: relative; overflow-wrap: anywhere; }
.libs li::before { content: "✓"; position: absolute; left: 6px; top: 12px; width: 15px; height: 15px; background: var(--amber); color: var(--amber-ink); border-radius: 3px; font-size: .68rem; font-weight: 800; text-align: center; line-height: 15px; }
.libs small { display: block; color: var(--soft); font-size: .74rem; }
.outline { margin-top: 14px; border: 1px solid var(--amber); border-radius: 4px; text-align: center; padding: 6px; background: var(--pick); }
.bar { display: flex; gap: 6px; margin-bottom: 6px; }
.sel { background: var(--well); border: 1px solid var(--rule); border-radius: 4px; padding: 6px 24px 6px 10px; white-space: nowrap; position: relative; overflow: hidden; text-overflow: ellipsis; }
.sel::after { content: ""; position: absolute; right: 9px; top: 50%; width: 5px; height: 5px; border-right: 1.5px solid var(--soft); border-bottom: 1.5px solid var(--soft); transform: translateY(-70%) rotate(45deg); }
.sel.block { display: block; }
.field { flex: 1; min-width: 0; background: var(--well); border: 1px solid var(--amber); border-radius: 4px; padding: 6px 12px; font-weight: 700; font-size: .95rem; }
.go { background: var(--amber); color: var(--amber-ink); font-weight: 700; border-radius: 4px; padding: 6px 14px; white-space: nowrap; }
.meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 10px; }
.sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-height: 230px; align-content: start; background: var(--well); border-radius: 5px; padding: 10px; }
.sheet li { border: 1px solid transparent; border-radius: 4px; padding: 3px; }
.sheet li.on { border-color: var(--amber); }
.pic { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 3px; }
.pic svg { width: 100%; height: 100%; }
.why { position: absolute; left: 5px; top: 5px; display: flex; gap: 4px; }
.why b, .clues b { font-size: .68rem; padding: 0 6px; border-radius: 3px; background: var(--amber); color: var(--amber-ink); white-space: nowrap; }
.why b.t, .clues b.t { background: var(--tx); color: #052233; }
.why b.f, .clues b.f { background: var(--fl); color: #1c1238; }
.score { position: absolute; right: 5px; top: 5px; background: rgba(0, 0, 0, .6); border-radius: 3px; padding: 0 5px; font-size: .68rem; }
.fn { padding: 6px 2px 2px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info dl, .mini dl { display: grid; gap: 2px; }
.info dt, .mini dt { color: var(--soft); font-size: .72rem; margin-top: 10px; }
.info dd, .mini dd { overflow-wrap: anywhere; }
mark { background: var(--mk); color: var(--amber-t); padding: 0 2px; }
.hint { color: var(--soft); font-size: .72rem; margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--rule); }
.status { grid-column: 1 / -1; display: flex; gap: 14px; color: var(--soft); padding: 2px 6px; }
.status .r { margin-left: auto; }
.fine { margin-top: 12px; color: var(--soft); font-size: .8rem; line-height: 1.7; max-width: 64em; }

.sec { padding-top: 96px; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.45; font-weight: 800; }
.sub { color: var(--soft); margin-top: 10px; max-width: 46em; }
.clues { width: 100%; border-collapse: collapse; margin-top: 26px; font-size: .95rem; }
.clues th { text-align: left; font-weight: 400; font-size: .8rem; color: var(--soft); padding: 8px 14px; border-bottom: 1px solid var(--rule); }
.clues td { padding: 15px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.clues td:first-child { width: 7em; }
.clues td:last-child { color: var(--soft); }
.clues b { font-size: .8rem; padding: 2px 10px; }
.mini { background: var(--well); border: 1px solid var(--rule); border-radius: 6px; padding: 14px; font-size: .82rem; line-height: 1.55; display: grid; gap: 6px; align-content: center; min-height: 142px; }
.mini .libs li:last-child { border-bottom: 0; }
.mini .bar { margin: 0; }
.row2 { display: flex; justify-content: space-between; gap: 12px; padding: 5px 2px; border-bottom: 1px solid var(--rule); color: var(--soft); }
.row2 span:last-child { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 36px; margin-top: 30px; }
.uses h3, .steps h3 { font-size: 1.1rem; margin: 14px 0 4px; }
.uses article > p, .steps > li > p { color: var(--soft); font-size: .95rem; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 30px; }
.steps > li { counter-increment: s; }
.steps h3::before { content: counter(s) ". "; color: var(--amber-t); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 50px; margin-top: 26px; align-items: start; }
.points li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.points b { display: block; }
.points span { color: var(--soft); }
.spec { border-collapse: collapse; width: 100%; font-size: .93rem; background: var(--panel); border-radius: 6px; }
.spec th, .spec td { text-align: left; padding: 11px 16px; vertical-align: top; border-bottom: 1px solid var(--page); }
.spec th { width: 7.5em; font-weight: 400; color: var(--soft); white-space: nowrap; }
.faq { margin-top: 20px; max-width: 800px; }
.faq dt { font-weight: 800; padding-top: 20px; }
.faq dd { color: var(--soft); padding: 4px 0 20px; border-bottom: 1px solid var(--rule); }
.end p { margin-top: 14px; max-width: 46em; color: var(--soft); }
.foot { display: flex; justify-content: space-between; padding: 26px 0 42px; margin-top: 90px; border-top: 1px solid var(--rule); font-size: .82rem; color: var(--soft); }

@media (max-width: 960px) {
  .top nav { display: none; }
  .top { justify-content: space-between; gap: 10px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 34px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .lib { display: none; }
  .hide { display: none; }
  .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uses, .two, .steps { grid-template-columns: minmax(0, 1fr); }
  .clues th:nth-child(2), .clues td:nth-child(2) { display: none; }
  .sec { padding-top: 64px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* autoplay control */
.auto { margin-top: 10px; }
.auto button { font-size: .8rem; color: var(--soft); border: 1px solid var(--rule); border-radius: 4px; padding: 4px 12px; }
.auto button:hover { color: var(--amber-t); border-color: var(--amber); }
.auto [aria-pressed="true"] .off, .auto [aria-pressed="false"] .on { display: none; }
.ty { display: inline-block; }

/* Motion: the query is typed, the button is pressed, results come back. Restarts whenever a query is shown. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes press { 50% { transform: scale(.94); filter: brightness(1.25); } }
  @keyframes land { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
  .mid [data-panel] .ty { animation: type .8s steps(8) .2s both; }
  .mid [data-panel] .go { animation: press .3s 1.1s; }
  .mid [data-panel] .meta { animation: land .3s 1.4s both; }
  .mid [data-panel] .sheet li { animation: land .4s 1.5s both; }
  .mid [data-panel] .sheet li:nth-child(2) { animation-delay: 1.65s; }
  .mid [data-panel] .sheet li:nth-child(3) { animation-delay: 1.8s; }
  .info [data-panel] dl { animation: land .4s 2.2s both; }
}

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* language and theme switches: one button each, showing what a click switches to */
.ctl { display: flex; gap: 8px; }
.sw { height: 32px; padding: 0 11px; border: 1px solid var(--rule); border-radius: 4px; font-size: .8rem; color: var(--ink); }
.sw:hover { border-color: currentColor; }
.sw > span { display: inline-flex; align-items: center; gap: 7px; height: 100%; }
.sw .flag { border: 1px solid var(--rule); }
html[data-lang="ja"] .to-ja, html[data-lang="zh"] .to-zh { display: none; }
:root[data-theme="light"] .to-light, :root:not([data-theme="light"]) .to-dark { display: none; }
html[data-bilingual="off"] [data-lang-toggle] { display: none; }
