:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --card: #1d1d1d;
  --line: #303030;
  --text: #eaeaea;
  --muted: #8f8f8f;
  --btn: #d9d9d9;
  --btn-text: #1a1a1a;
  --btn-hover: #eeeeee;
  --chip: #161616;
  --chip-hover: #2e2e2e;
  --soft: #262626;
  --tag: #3d3d3d;
  --tag-text: #f0f0f0;
  --link: #d9d9d9;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --card: #fff;
  --line: #d8dbe1;
  --text: #1c1f24;
  --muted: #5e646e;
  --btn: #2a2e36;
  --btn-text: #f4f5f7;
  --btn-hover: #3d4450;
  --chip: #fff;
  --chip-hover: #e7eaef;
  --soft: #e6e8ec;
  --tag: #e4e4e4;
  --tag-text: #1a1a1a;
  --link: #1c1f24;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-tap-highlight-color: transparent; }
a, button, label, .hit { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 14px/1.6 system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.home-lead { flex: 1 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20; height: 52px;
  background: var(--bg);
}
.navbar { height: 52px; display: flex; align-items: center; justify-content: space-between; }
.nav-side { display: flex; align-items: center; gap: 18px; min-width: 0; }
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 720; letter-spacing: -.03em; line-height: 1;
}
.logo img { width: 32px; height: 32px; display: block; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer; font: inherit;
  transition: background .15s ease, color .15s ease;
}
.theme-toggle:hover { background: var(--soft); color: var(--text); }
.theme-face { display: none; align-items: center; }
html[data-theme-mode="light"] .theme-face[data-face="light"],
html[data-theme-mode="dark"] .theme-face[data-face="dark"] { display: inline-flex; }
.theme-ico { width: 17px; height: 17px; display: block; fill: currentColor; }
.home-lead { padding-top: 28px; }
.page-search {
  display: flex; flex-direction: column; align-items: stretch; gap: 16px;
  width: min(860px, 100%); margin: 0 auto 56px;
}
body:not(.has-q) .page-search {
  width: min(1080px, 100%);
  align-items: center;
  gap: 0;
  margin: 0 auto 40px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.search-field { position: relative; width: min(860px, 100%); order: 1; }
body.has-q .search-field { align-self: center; }
.recent-pop {
  position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 8px);
  padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 18, 22, .12);
}
.recent-pop .word-line,
.recent-pop .word-chips { justify-content: flex-start; }
.search-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 60px; padding: 0 8px 0 18px;
  border: 1.5px solid color-mix(in srgb, var(--text) 28%, var(--line));
  border-radius: 12px; background: var(--card);
  box-shadow: none;
}
html[data-theme="dark"] .search-row {
  background: #282828;
  border-color: #646464;
}
.search-row:focus-within { border-color: var(--text); box-shadow: none; }
.search-ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pan-pick { order: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; }
body:not(.has-q) .pan-pick { margin-top: 18px; }
.pan-label { display: none; }
body.has-q .page-search {
  width: 100%; margin: 0; padding: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  align-items: stretch; gap: 16px;
}
body:not(.has-q) .search-row button {
  height: 46px; padding: 0 18px; border-radius: 10px;
  background: var(--btn); color: var(--btn-text); border-color: var(--btn);
}
body:not(.has-q) .search-row button:hover {
  background: var(--btn-hover); color: var(--btn-text); border-color: var(--btn-hover);
}
body.has-q .search-row button {
  height: 46px; padding: 0 18px; border-radius: 10px;
  background: var(--btn); color: var(--btn-text); border-color: var(--btn);
}
body.has-q .search-row button:hover {
  background: var(--btn-hover); color: var(--btn-text); border-color: var(--btn-hover);
}
body.has-q .pan-pick { align-items: center; }
body.has-q .result-top {
  width: 100%; margin: 0; padding: 0;
  background: transparent; border: 0;
}
.pan-switch {
  display: inline-flex; gap: 0; padding: 3px; margin-top: 12px;
  background: transparent; border: 1px solid color-mix(in srgb, var(--text) 18%, var(--line));
  border-radius: 12px; justify-content: flex-start;
}
.pan-switch label {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border: 0; border-radius: 9px; background: transparent;
  color: var(--text); cursor: pointer; font-size: 14px; font-weight: 650;
  transition: background .15s ease, color .15s ease;
}
.pan-switch img { width: 18px; height: 18px; object-fit: contain; background: transparent; }
.pan-switch input {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.pan-switch label:hover { background: var(--soft); }
.pan-switch label:has(input:checked),
.pan-switch label:has(input:checked):hover {
  background: var(--btn); color: var(--btn-text);
  box-shadow: none;
}
.pan-switch label:focus-within { outline: 1px solid #646464; outline-offset: 1px; }
.pan-drop { display: none; position: relative; }
.pan-drop-btn {
  position: relative; width: 100%; height: 40px; display: flex; align-items: center; justify-content: center;
  padding: 0 28px; border: 1px solid color-mix(in srgb, var(--text) 18%, var(--line));
  border-radius: 12px; background: var(--card); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
}
.pan-drop-face { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pan-drop-face img, .pan-drop-menu img { width: 18px; height: 18px; object-fit: contain; flex: none; }
.pan-drop-caret { position: absolute; right: 12px; width: 12px; height: 8px; color: var(--muted); }
.pan-drop-menu {
  position: absolute; z-index: 8; left: 0; top: calc(100% + 6px);
  width: 100%;
  padding: 6px; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--text) 18%, var(--line));
  border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 18, 22, .18);
}
.pan-drop-menu button {
  width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 10px; border: 0; border-radius: 8px; background: transparent; white-space: nowrap;
  color: var(--text); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
}
.pan-drop-menu button.is-on,
.pan-drop-menu button:hover { background: var(--soft); }
body.has-q .search-words {
  align-items: center; width: 100%; margin-top: 0;
}
body.has-q .word-line,
body.has-q .word-chips { justify-content: center; }
.search-words {
  order: 3; display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: min(860px, 100%); margin-top: 22px;
}
.word-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px;
  width: 100%;
}
.word-k { color: var(--muted); font-size: 13px; font-weight: 650; }
.word-line button {
  border: 0; padding: 0 2px; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.word-line button:hover { color: var(--text); }
.word-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.word-chips a {
  display: inline-flex; align-items: center; max-width: 16em; height: 30px; padding: 0 12px;
  border: 0; border-radius: 999px; background: var(--soft);
  font-size: 13px; font-weight: 650;
}
.word-chips a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-chips a:hover { background: var(--chip-hover); color: var(--text); }
@media (max-width: 720px) {
  .page-search, .pan-pick, .result-top { min-width: 0; max-width: 100%; }
  .pan-pick { width: 100%; }
  .pan-switch { display: none; }
  .pan-drop { display: block; width: 50%; margin-top: 12px; }
  .footer-bar { min-height: 64px; }
}
.search-row input {
  flex: 1; min-width: 0; height: 100%; padding: 0;
  border: 0; border-radius: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 16px; outline: none;
}
.search-row input::placeholder { color: var(--muted); }
.search-row button,
.get,
.btns button,
.btns a {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--text) 16%, var(--line));
  border-radius: 8px;
  background: var(--card); color: var(--text); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 650; line-height: 1;
  text-decoration: none; flex: none; white-space: nowrap;
  box-shadow: 0 1px 1px rgba(16, 18, 22, .04);
}
.search-row button { height: 44px; padding: 0 22px; font-size: 15px; box-shadow: none; }
.search-row button:hover,
.get:hover,
.btns button:hover,
.btns a:hover { border-color: var(--text); background: var(--card); }
.btns button.quiet {
  background: transparent; color: var(--muted); border-color: var(--line); box-shadow: none;
}
.btns button.quiet:hover { background: var(--soft); color: var(--text); border-color: var(--line); }
.result-head { display: none; margin: 28px 0 0; }
body.has-q .result-head { display: block; }
.result-head + .block { margin-top: 16px; }
.result-head h1 { margin: 0; font-size: 28px; font-weight: 720; letter-spacing: -.02em; }
.result-head p { margin: 10px 0 0; max-width: 40em; color: var(--muted); font-size: 15px; line-height: 1.65; }
.block {
  margin: 28px 0 0; padding: 0;
  background: transparent; border: 0;
}
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 2px; }
.block-head p { margin: 0; color: var(--muted); font-size: 13px; }
.tag {
  display: inline-block; padding: 0;
  background: transparent; color: var(--text); font-size: 18px; font-weight: 720;
}
.block-note { margin-left: 8px; color: var(--muted); font-size: 13px; }
.hits { list-style: none; margin: 0; padding: 0; }
.hit {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px; margin: 0 -8px; border-top: 1px solid var(--soft);
  border-radius: 10px; cursor: pointer;
}
.hit:hover { background: var(--soft); }
.hit-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.pan-ico { width: 36px; height: 36px; border-radius: 10px; background: #fff; object-fit: contain; padding: 4px; flex: none; }
.hit-text { min-width: 0; }
.hit-title { font-size: 16px; font-weight: 650; }
.hit-meta { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 12px 0 28px; }
.ext-live { margin: 10px 0 4px; }
.ext-live-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.ext-live-row p { margin: 0; flex: 1; min-width: 0; }
.ext-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text); flex: none;
  animation: ext-pulse 1s ease-in-out infinite;
}
.ext-track { height: 2px; margin-top: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.ext-track span {
  display: block; height: 100%; width: 32%; background: var(--text);
  animation: ext-slide 1.15s ease-in-out infinite;
}
@keyframes ext-pulse { 50% { opacity: .2; } }
@keyframes ext-slide { from { transform: translateX(-120%); } to { transform: translateX(360%); } }
.hit.is-ghost { cursor: default; }
.hit.is-ghost:hover { background: transparent; }
.ghost-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); flex: none; }
.ghost-copy { flex: 1; min-width: 0; }
.ghost-bar { display: block; height: 12px; width: 72%; border-radius: 6px; background: var(--soft); }
.ghost-bar.short { width: 36%; height: 10px; margin-top: 8px; }
.list-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 4px; }
.list-pager .nums { display: flex; gap: 2px; }
.list-pager button { min-width: 0; padding: 6px 8px; border: 0; border-radius: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.list-pager button.num.is-on { color: var(--text); font-weight: 760; }
.list-pager button:disabled { opacity: .35; cursor: default; }
.list-pager .step:hover:not(:disabled),
.list-pager button.num:hover { color: var(--text); }
.site-footer { margin-top: auto; background: transparent; }
.footer-bar {
  min-height: 72px; display: flex; align-items: center; justify-content: center;
  padding: 8px 0 20px;
}
.footer-bar p { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 50; }
.dialog {
  position: relative;
  width: min(480px, calc(100% - 32px)); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px 20px 18px; text-align: left;
}
.dialog-x {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.dialog-x:hover { color: var(--text); background: var(--soft); }
.dialog.is-center { text-align: center; }
.dialog.is-center p { margin: 0; }
.sheet-title { margin: 0 0 8px; padding-right: 28px; font-size: 17px; font-weight: 680; line-height: 1.45; text-align: left; }
#fail-msg { margin: 0; white-space: pre-line; line-height: 1.5; text-align: center; }
.sheet-pan {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 0 16px; padding: 0;
  background: transparent; color: var(--muted);
  font-size: 16px; font-weight: 650;
}
.sheet-pan img {
  width: 22px; height: 22px; flex: none; display: block;
  object-fit: contain;
}
.sheet-time {
  margin: 0 0 10px; padding-right: 28px;
  color: var(--muted); font-size: 13px; line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.sheet-desc-wrap { position: relative; margin: 0 0 10px; }
.sheet-desc {
  margin: 0; max-height: 9em; overflow-y: auto; padding-right: 12px;
  color: var(--muted); font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.sheet-desc::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sheet-bar {
  position: absolute; top: 2px; right: 0; bottom: 2px; width: 4px;
  border-radius: 4px; background: var(--soft); pointer-events: none;
}
.sheet-bar i {
  display: block; width: 100%; border-radius: 4px; background: var(--muted);
}
.sheet-tags {
  display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px;
  margin: 0 0 16px;
}
.sheet-tags span {
  padding: 2px 8px; border-radius: 6px;
  background: var(--tag); color: var(--tag-text);
  font-size: 12px; font-weight: 650;
}
.sheet-pwd {
  margin: 0 0 12px; text-align: center;
  font-size: 15px; font-weight: 680;
}
#qr { display: block; width: 196px; height: 196px; margin: 4px auto 0; background: #fff; border-radius: 8px; }
@media (max-width: 720px), ((hover: none) and (pointer: coarse)) {
  #qr { display: none; }
}
.dialog a.link { display: block; margin: 14px 0; word-break: break-all; color: var(--link); text-align: center; }
.btns {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 8px;
}
.btns .sheet-pan {
  display: flex; align-items: center; gap: 6px; min-width: max-content;
  margin: 0; height: 34px; font-size: 14px; justify-self: end;
}
#sheet-pan, #ask-pan { grid-column: 1; }
#open2, #ask-go { grid-column: 2; justify-self: center; }
#copy { grid-column: 3; justify-self: start; width: 84px; }
.spin {
  width: 36px; height: 36px; margin: 8px auto 12px; border: 3px solid var(--line);
  border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.home-chart {
  width: min(860px, 100%);
  margin: 20px auto 48px;
}
.chart-tabs, .chart-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chart-tabs { margin: 0 0 4px; }
.chart-chips { margin: 0 0 16px; }
.chart-tab, .chart-chip {
  padding: 2px 8px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.chart-tab:hover, .chart-chip:hover { background: var(--soft); color: var(--text); }
.chart-tab.is-on, .chart-chip.is-on,
.chart-tab.is-on:hover, .chart-chip.is-on:hover { background: var(--btn); color: var(--btn-text); }
.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; }
.chart-item { display: block; min-width: 0; color: inherit; }
.chart-cover { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--soft); }
.chart-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.chart-name {
  margin-top: 8px; font-size: 15px; font-weight: 650; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chart-badge, .chart-score {
  position: absolute; padding: 0 5px; border-radius: 4px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 18px;
}
.chart-badge { top: 6px; left: 6px; }
.chart-score { right: 6px; bottom: 6px; font-variant-numeric: tabular-nums; }
.chart-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 8px 0; }
[hidden] { display: none !important; }
