:root {
  color-scheme: light;
  --primary: #6c4bc5; --primary-end: #6046d1; --primary-soft: #f0edff;
  --primary-start: #7c5ad1; --primary-hover-start: #6a45c5; --primary-hover-end: #5236bd; --primary-hover: #e8e1fb;
  --disabled-bg: #eae8f2; --disabled-text: #606477; --disabled-border: #c9c6d6;
  --page: #f5f4fb; --surface: #fff; --soft: #f8f8fc; --line: #eceaf3;
  --text: #292c3e; --muted: #626779; --success: #1d785d; --danger: #b93f65;
  --blue: #316caa; --warning: #8e621e; --gold: #91651d; --rose: #b54569; --teal: #247888; --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
}
html[data-theme=dark] {
  color-scheme: dark; --primary: #c3b1ff; --primary-soft: #332c48; --primary-hover: #443a61;
  --disabled-bg: #363440; --disabled-text: #bcb8cf; --disabled-border: #565160;
  --page: #171720; --surface: #24242e; --soft: #2c2b38; --line: #393745;
  --text: #eeedf6; --muted: #b1aec3; --success: #6bc9b0; --danger: #f09abb; --blue: #9cc6f3;
  --warning: #eac084; --gold: #e4bc72; --rose: #ee9bb3; --teal: #78cddd;
}
* { box-sizing: border-box; }
html { min-height: 100%; scrollbar-gutter: stable; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 50% 0%, #eeeafa66, transparent 70%), var(--page); color: var(--text); font-size: 14px; line-height: 1.6; }
html[data-theme=dark] body { background: var(--page); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: 1; cursor: not-allowed; }
a { text-decoration: none; color: var(--blue); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 21px; line-height: 1.4; font-weight: 700; letter-spacing: .25px; }
h2 { font-size: 17px; line-height: 1.5; }
h3 { font-size: 14px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
input:not([type=checkbox]), select, textarea { border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--soft); min-width: 0; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 9%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }
textarea { resize: vertical; width: 100%; }
select { cursor: pointer; }
.svg-symbols, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.icon { display: inline-block; width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: 11px; } .full { width: 100%; }

/* Shared controls */
.button { min-height: 39px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; display: inline-flex; gap: 7px; align-items: center; justify-content: center; color: var(--text); background: var(--surface); font-weight: 550; transition: background .15s, transform .15s; }
.button:hover:not(:disabled) { background: var(--primary-soft); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.primary { background: linear-gradient(105deg,var(--primary-start),var(--primary-end)); border: 0; color: #fff; box-shadow: 0 5px 12px #7860d923; }
/* Modifier hover states must keep their own foreground/background pair. */
.button.primary:hover:not(:disabled) { color: #fff; background: linear-gradient(105deg,var(--primary-hover-start),var(--primary-hover-end)); }
.button.secondary { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.button.secondary:hover:not(:disabled) { color: var(--primary); background: var(--primary-hover); }
.button.danger { color: var(--danger); margin-top: 20px; background: color-mix(in srgb,var(--danger) 7%,var(--surface)); }
.button.danger:hover:not(:disabled) { color: var(--danger); background: color-mix(in srgb,var(--danger) 11%,var(--surface)); }
.icon-button { width: 36px; height: 36px; display: inline-flex; justify-content: center; align-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); flex-shrink: 0; }
.icon-button:hover:not(:disabled) { color: var(--primary); background: var(--primary-soft); }
.text-button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 4px 0; color: var(--primary); cursor: pointer; font-size: 12px; }
.text-button:hover:not(:disabled),.copy-id:hover:not(:disabled),.fact-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 15px #57508608; }

/* Compact query card followed by seven equal categories on a single row. */
.query-layout { width: min(100% - 40px, 840px); margin: auto; padding: 24px 0 32px; display: flex; flex-direction: column; gap: 15px; }
.query-card { padding: 23px 25px 16px; box-shadow: 0 7px 20px #77669b0d; }
.query-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.query-heading-text { flex: 1; min-width: 0; }
.query-heading p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.heading-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--soft); border-radius: 13px; color: var(--primary); flex-shrink: 0; }
.heading-icon .icon { width: 24px; height: 24px; }
.settings-button { display: flex; flex-direction: column; gap: 1px; align-items: center; justify-content: center; min-width: 40px; min-height: 44px; padding: 2px 4px; background: transparent; color: var(--muted); border: 0; border-radius: 9px; font-size: 10px; flex-shrink: 0; }
.settings-button .icon { width: 19px; height: 19px; }
.settings-button:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.room-field { display: flex; align-items: center; gap: 9px; }
.field-symbol { width: 36px; height: 45px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; flex-shrink: 0; color: var(--primary); box-shadow: 0 3px 8px #766b9c05; }
.field-symbol .icon { width: 20px; height: 20px; }
.room-field input { flex: 1; width: 100%; min-width: 0; height: 45px; font-size: 14px; background: color-mix(in srgb,var(--soft) 60%,var(--surface)); }
.recent-row { display: flex; align-items: stretch; gap: 9px; margin: 11px 0; }
.recent-row select { flex: 1; min-width: 0; width: 100%; height: 41px; font-size: 13px; font-weight: 550; background-color: var(--surface); padding: 8px 12px; box-shadow: 0 2px 4px #766b9c05; }
.recent-anchor { border: 1px solid color-mix(in srgb,var(--primary) 18%,var(--line)); border-radius: 10px; background: var(--primary-soft); color: var(--primary); padding: 7px 14px; font-weight: 600; font-size: 12px; min-width: 86px; max-width: 38%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-anchor span { display: block; overflow: hidden; text-overflow: ellipsis; }
.recent-anchor:hover:not(:disabled) { color: var(--primary); background: var(--primary-hover); border-color: var(--primary); }
.query-button { width: 100%; height: 45px; font-size: 15px; letter-spacing: 2px; border-radius: 10px; gap: 8px; }
.query-button .icon { width: 18px; height: 18px; }
.query-button.is-querying { color: var(--disabled-text); background: var(--disabled-bg); box-shadow: none; opacity: 1; cursor: progress; }
.query-button.is-querying .icon { animation: gentle-pulse 1.3s ease-in-out infinite; }
.query-session { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; margin-top: 10px; border-radius: 8px; color: var(--blue); background: color-mix(in srgb,var(--blue) 8%,var(--surface)); }
.query-session .text-button { font-size: 10px; color: var(--blue); padding: 1px 0; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.status-pill i,.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; flex-shrink: 0; }
.status-pill.online { color: var(--blue); }
.status-pill.online i,.status-dot.online { background: var(--success); }
.status-pill.warning i,.status-dot.warning { background: var(--warning); }
.collection-progress { padding-top: 10px; }
.collection-progress>div { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
#job-stage { min-width: 0; overflow-wrap: anywhere; }
.collection-progress .text-button { flex-shrink: 0; font-size: 11px; }
progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 4px; overflow: hidden; background: var(--primary-soft); margin-top: 4px; accent-color: var(--primary); }
progress::-webkit-progress-bar { background: var(--primary-soft); }
progress::-webkit-progress-value { background: var(--primary); border-radius: 4px; }
.info-box { padding: 8px 10px; margin-top: 10px; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.info-box.error { color: var(--danger); background: color-mix(in srgb,var(--danger) 7%,var(--surface)); }
.login-needed { color: var(--primary); width: 100%; margin-top: 8px; font-size: 12px; }
.result-categories { padding: 8px; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; }
.category { --category-color: #7050bd; --category-bg: #efebff; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 2px 9px; min-height: 101px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: border .15s,box-shadow .15s; }
.category[data-category=paygrade] { --category-color: #8050b0; --category-bg: #f3eafb; }
.category[data-category=hidden] { --category-color: #197c66; --category-bg: #e7f7f1; }
.category[data-category=audience] { --category-color: #945f20; --category-bg: #fff0e3; }
.category[data-category=microphone] { --category-color: #b04079; --category-bg: #fdeaf3; }
.category[data-category=gift] { --category-color: #a25331; --category-bg: #fff0e8; }
.category[data-category=contribution] { --category-color: #316fae; --category-bg: #eaf2fe; }
html[data-theme=dark] .category { --category-color: #baa3f6; }
html[data-theme=dark] .category[data-category=paygrade] { --category-color: #c5a1f5; }
html[data-theme=dark] .category[data-category=hidden] { --category-color: #71d6bd; }
html[data-theme=dark] .category[data-category=audience] { --category-color: #edb579; }
html[data-theme=dark] .category[data-category=microphone] { --category-color: #ef9dc5; }
html[data-theme=dark] .category[data-category=gift] { --category-color: #efac8c; }
html[data-theme=dark] .category[data-category=contribution] { --category-color: #8dbbeb; }
.category.active { border-color: color-mix(in srgb,var(--category-color) 65%,var(--line)); box-shadow: 0 0 0 2px color-mix(in srgb,var(--category-color) 8%,transparent); background: linear-gradient(var(--surface),color-mix(in srgb,var(--category-color) 2%,var(--surface))); }
@media (hover: hover) and (pointer: fine) { .category:hover:not(:disabled) { border-color: var(--category-color); } }
.category strong { font-size: 13px; font-weight: 650; white-space: nowrap; line-height: 1.5; }
.category>span:last-child { font-size: 12px; color: var(--muted); line-height: 1.4; white-space: nowrap; }
.category.active strong,.category.active>span:last-child { color: var(--category-color); }
.category b { font-weight: 500; margin-right: 1px; }
.category-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--category-bg); color: var(--category-color); display: grid; place-items: center; margin-bottom: 3px; }
.category-icon .icon { width: 22px; height: 22px; }
html[data-theme=dark] .category-icon { background: color-mix(in srgb,var(--category-color) 15%,var(--surface)); }

/* Reference videos: no dashboard table; detail cards and compact audience rows. */
.result-panel { min-width: 0; }
.results-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; margin-bottom: 12px; background: color-mix(in srgb,var(--surface) 84%,transparent); border-radius: 12px; }
.results-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.result-phase { display: flex; align-items: center; gap: 4px; color: var(--success); font-size: 12px; white-space: nowrap; }
.result-phase::before { content: "✓"; font-size: 14px; }
.result-phase[data-status=running] { color: var(--muted); }
.result-phase[data-status=running]::before { content: ""; width: 11px; height: 11px; border: 1.5px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
.result-phase[data-status=partial],.result-phase[data-status=offline] { color: var(--warning); }
.result-phase[data-status=failed] { color: var(--danger); }
.result-phase[data-status=failed]::before { content: "!"; }
.results-header h2 { font-size: 11px; color: var(--muted); font-weight: 400; }
.results-header h2::before { content: "·"; margin-right: 7px; }
#result-count { font-variant-numeric: tabular-nums; }
#result-count::after { content: " 人"; }
.result-options { border: 0; background: transparent; border-radius: 8px; color: var(--muted); width: 30px; height: 30px; display: grid; place-items: center; flex-shrink: 0; }
.result-options:hover:not(:disabled) { color: var(--primary); background: var(--primary-soft); }
.result-options .icon { width: 17px; height: 17px; }
.result-cards,.result-loading { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; align-items: start; }
.result-user-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 3px 10px #67608005; min-width: 0; }
.user-card-head { display: flex; align-items: flex-start; gap: 8px; }
.person { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.avatar { width: 43px; height: 43px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--primary-soft); color: var(--primary); border: 2px solid #d0dff4; font-size: 15px; font-weight: 600; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-main { flex: 1; min-width: 0; }
.person-name { font-size: 15px; font-weight: 650; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 5px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.rank-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; color: var(--blue); background: color-mix(in srgb,var(--blue) 9%,var(--surface)); border-radius: 10px; font-weight: 550; }
.rank-chip .icon { width: 11px; height: 11px; color: var(--gold); }
.gender-chip { display: inline-flex; align-items: center; gap: 3px; }
.gender-chip .icon { width: 10px; height: 10px; }
.card-copy { width: 29px; height: 29px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); display: grid; place-items: center; padding: 0; }
.card-copy .icon { width: 14px; height: 14px; }
.card-copy:hover:not(:disabled) { color: var(--primary); background: var(--primary-soft); }
.user-facts { display: grid; gap: 7px; margin: 15px 0 0; font-size: 12px; }
.fact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; min-height: 37px; background: var(--soft); border-radius: 8px; }
.fact-row dt { display: flex; align-items: center; gap: 7px; color: color-mix(in srgb,var(--text) 65%,var(--muted)); flex-shrink: 0; }
.fact-row dt .icon { width: 14px; height: 14px; }
.fact-row dd { margin: 0; max-width: 57%; text-align: right; overflow-wrap: anywhere; line-height: 1.5; }
.fact-row .gold { color: var(--gold); } .fact-row .rose { color: var(--rose); } .fact-row .teal { color: var(--teal); } .fact-row .blue { color: var(--blue); } .fact-row .purple { color: var(--primary); }
.level-pill { display: inline-flex; align-items: center; border-radius: 12px; background: linear-gradient(105deg,#95509b,#7b44b8 75%,#6943b4); color: #fff; padding: 0 8px; min-width: 29px; justify-content: center; font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 2px #ffffff36; }
.fan-pill { display: inline-flex; color: var(--warning); background: color-mix(in srgb,#efb76d 15%,var(--surface)); padding: 0 7px; border-radius: 9px; font-size: 11px; }
.unknown-value { color: var(--muted); font-size: 11px; font-weight: 400; }
.score { color: var(--primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.copy-id { border: 0; padding: 0; color: var(--text); background: transparent; font-size: 12px; font-variant-numeric: tabular-nums; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; max-width: 100%; }
.fact-link { display: inline-flex; align-items: center; gap: 3px; color: var(--blue); background: transparent; border: 0; padding: 0; font-size: 12px; }
.fact-link .icon { width: 12px; height: 12px; }
.user-card-foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 9px; min-width: 0; font-size: 10px; color: var(--muted); }
.user-card-foot .text-button { font-size: 11px; padding: 2px 0; margin-left: auto; }
.room-link { color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.result-user-card.compact { padding: 12px 14px; border-radius: 12px; }
.compact .user-card-head { align-items: center; }
.compact .avatar { width: 36px; height: 36px; font-size: 13px; }
.compact .person { gap: 10px; }
.compact .person-name { font-size: 13px; }
.compact .user-chips { margin-top: 2px; font-size: 10px; }
.compact .rank-chip { padding: 0; background: transparent; color: var(--muted); font-weight: 400; }
.compact .rank-chip .icon { display: none; }
.view-user { color: var(--blue); background: color-mix(in srgb,var(--blue) 7%,var(--surface)); border: 1px solid color-mix(in srgb,var(--blue) 20%,var(--line)); border-radius: 7px; min-width: 47px; min-height: 31px; font-size: 11px; font-weight: 600; padding: 4px 8px; flex-shrink: 0; }
.view-user:hover:not(:disabled) { background: color-mix(in srgb,var(--blue) 13%,var(--surface)); }
.active-result-filter { margin: 0 0 10px; padding: 7px 10px; background: var(--primary-soft); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.active-result-filter>span { min-width: 0; overflow-wrap: anywhere; }
.active-result-filter button { flex-shrink: 0; font-size: 11px; }
.empty-state { text-align: center; padding: 36px 20px; box-shadow: none; }
.empty-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 11px; }
.empty-icon .icon { width: 24px; height: 24px; }
.empty-state h3 { font-size: 13px; font-weight: 500; }
.empty-state p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 5px 0 9px; overflow-wrap: anywhere; }
.empty-state .text-button { font-size: 11px; }
.results-footer { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 10px 0; font-size: 11px; color: var(--muted); }
.pagination { display: flex; align-items: center; gap: 10px; }
.page-button { width: 32px; height: 31px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--primary); font-size: 18px; }
.page-button:hover:not(:disabled) { color: var(--primary); background: var(--primary-hover); border-color: var(--primary); }
#page-current { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.skeleton-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.skeleton-heading { display: flex; gap: 10px; align-items: center; margin-bottom: 17px; }
.skeleton-heading i { width: 41px; height: 41px; border-radius: 50%; }
.skeleton-heading div { flex: 1; }
.skeleton-heading b,.skeleton-heading span { display: block; height: 9px; width: 40%; border-radius: 6px; }
.skeleton-heading span { margin-top: 9px; width: 64%; }
.skeleton-card p { height: 34px; margin-top: 8px; border-radius: 8px; }
.skeleton-card i,.skeleton-card b,.skeleton-card span,.skeleton-card p { background: linear-gradient(100deg,var(--soft) 15%,var(--line) 45%,var(--soft) 75%); background-size: 240% 100%; animation: shimmer 1.7s linear infinite; }
.help-card { padding: 22px; }
.help-card header { display: flex; justify-content: space-between; align-items: center; }
.help-card h2 { display: flex; gap: 9px; align-items: center; font-size: 16px; }
.help-card h2 .icon { color: var(--primary); width: 20px; height: 20px; }
.warm-label { padding: 2px 9px; border-radius: 12px; color: var(--warning); background: color-mix(in srgb,var(--warning) 8%,var(--surface)); font-size: 10px; }
.help-card ol { list-style: none; margin: 0; padding: 20px 0; display: grid; gap: 16px; }
.help-card li { display: flex; gap: 11px; align-items: center; font-size: 13px; color: color-mix(in srgb,var(--text) 75%,var(--muted)); }
.help-card li>span { display: grid; place-items: center; width: 25px; height: 25px; flex-shrink: 0; background: var(--primary-soft); border-radius: 50%; color: var(--primary); font-size: 11px; font-weight: 600; }
.inline-query { display: inline-flex; align-items: center; gap: 3px; background: var(--primary-soft); color: var(--primary); padding: 0 5px; border-radius: 4px; font-weight: 500; }
.inline-query .icon { width: 12px; height: 12px; }
.help-tip { padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 12px; }
.help-tip .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--primary); }
.page-footer { text-align: center; color: var(--muted); font-size: 10px; letter-spacing: .5px; padding: 0 0 3px; }

/* Existing collection, login and session controls are kept in settings. */
dialog { margin: auto; padding: 0; max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 80px #2520372a; color: var(--text); background: var(--surface); } dialog::backdrop { background: #29233966; backdrop-filter: blur(3px); } .dialog-heading { padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); } .dialog-heading h2 { font-size: 18px; } .dialog-heading p { font-size: 11px; color: var(--muted); margin-top: 2px; } .dialog-body { padding: 22px; } .settings-dialog { width: 510px; } .settings-tabs { display: flex; padding: 10px 18px 0; gap: 8px; border-bottom: 1px solid var(--line); } .settings-tabs button { flex: 1; padding: 9px 5px; background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; font-size: 13px; } .settings-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; } .settings-dialog .dialog-body { max-height: calc(100dvh - 225px); overflow-y: auto; overscroll-behavior: contain; } .setting-row { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 11px 0; font-size: 13px; } .setting-row label,.toggle-label { display: inline-flex; align-items: center; gap: 9px; } .setting-row>span { display: flex; align-items: center; gap: 5px; font-size: 11px; } .setting-row input.number-input { width: 67px; min-height: 30px; font-size: 12px; text-align: center; border-radius: 7px; padding: 4px; } .field-hint { color: var(--muted); font-size: 11px; line-height: 1.75; margin: 0 0 9px; } .section-title { margin-top: 22px; margin-bottom: 11px; } .filter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 10px; } .filter-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); } .filter-grid input,.filter-grid select { width: 100%; font-size: 12px; height: 37px; padding: 6px 10px; } .settings-save { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; } .settings-save .button { font-size: 12px; } .cloud-settings { border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 12px; margin: 0 0 8px; } .cloud-categories { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; } .cloud-categories label { font-size: 12px; display: flex; align-items: center; gap: 6px; } .cloud-settings .button { min-height: 29px; font-size: 11px; }
.session-status { display: flex; align-items: flex-start; gap: 9px; padding: 12px; margin: 12px 0 18px; background: var(--soft); border-radius: 10px; font-size: 12px; } .session-status .status-dot { margin-top: 7px; flex-shrink: 0; } .session-status p { margin-top: 3px; font-size: 11px; overflow-wrap: anywhere; } .account-settings-form { display: grid; gap: 8px; } .account-settings-form label { font-size: 12px; margin-top: 5px; } .account-settings-form input { width: 100%; } .account-settings-form .button { margin-top: 4px; } .session-details { display: grid; gap: 10px; margin: 19px 0; font-size: 11px; } .session-details>div { display: flex; justify-content: space-between; color: var(--muted); } .session-details b { font-weight: 450; color: var(--text); } .session-events { font-size: 11px; display: grid; gap: 7px; color: var(--muted); max-height: 180px; overflow: auto; } .session-events time { margin-right: 6px; color: var(--primary); } .cookie-details { margin-top: 20px; color: var(--muted); font-size: 12px; } .cookie-details textarea { margin: 12px 0 8px; font-size: 12px; } #settings-panel-douyin>.field-hint { margin-top: 13px; }
.history-dialog { width: 560px; } .history-list { display: grid; } .history-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); } .history-item:last-child { border: 0; } .history-item strong { font-size: 13px; font-weight: 550; } .history-item p { font-size: 11px; color: var(--muted); margin-top: 3px; } .history-item>div { min-width: 0; } .history-item .button { flex-shrink: 0; font-size: 11px; } .user-dialog { width: 500px; } .detail-list { display: grid; grid-template-columns: 94px minmax(0,1fr); gap: 13px; margin: 0; font-size: 12px; } .detail-list dt { color: var(--muted); } .detail-list dd { margin: 0; overflow-wrap: anywhere; } .detail-note { font-size: 11px; margin-top: 18px; color: var(--muted); }
.douyin-dialog { width: 800px; padding-bottom: 17px; } .login-view-tools { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px 0; font-size: 12px; color: var(--muted); } .login-view-tools label { display: flex; align-items: center; gap: 7px; } .login-browser { margin: 12px 18px; background: #f6f6f6; border: 1px solid var(--line); border-radius: 12px; min-height: 140px; overflow: hidden; } .login-browser img { display: block; width: 100%; height: auto; touch-action: none; user-select: none; cursor: pointer; } .view-tip { margin: 9px 18px; color: var(--muted); font-size: 11px; line-height: 1.75; } .login-inputs { padding: 2px 18px; display: grid; gap: 10px; } .remote-input-form { display: grid; grid-template-columns: 68px minmax(0,1fr) 74px; align-items: center; gap: 9px; } .remote-input-form label { font-size: 12px; } .remote-input-form input { min-height: 44px; font-size: 16px; } .remote-input-form .button { min-height: 43px; font-size: 12px; padding: 5px 9px; } .dialog-footer { padding: 14px 18px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); margin-top: 13px; } .dialog-footer>span { font-size: 11px; color: var(--muted); }
.form-error { color: var(--danger); font-size: 12px; line-height: 1.7; margin-top: 10px; } .toast { position: fixed; top: 15px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 28px); padding: 12px 19px; z-index: 2000; color: var(--primary); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 8px 25px #29233920; font-size: 12px; } .toast.error { color: var(--danger); }
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 28px 20px; } .login-card { width: min(100%,400px); background: var(--surface); border: 1px solid var(--line); border-radius: 25px; padding: 33px; box-shadow: 0 12px 50px #7264a310; } .login-logo { display: block; width: 55px; height: 55px; margin: 0 auto 15px; } .login-card h1 { text-align: center; font-size: 22px; } .login-card>.muted { text-align: center; font-size: 12px; margin-top: 6px; margin-bottom: 24px; } .login-card label { display: block; margin: 15px 0 7px; font-size: 12px; } .login-card input { width: 100%; height: 45px; } .login-card .button { margin-top: 25px; min-height: 45px; } .login-card>.small { margin: 15px 0 0; }
.settings-dialog { width: 540px; }
.settings-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; padding-left: 14px; padding-right: 14px; }
.settings-tabs button { min-width: 0; white-space: nowrap; font-size: 12px; }
.settings-tabs button:hover:not(:disabled) { color: var(--primary); background: var(--primary-soft); }
.progressive-result-note { padding: 0 12px; margin: -3px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.proxy-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.proxy-form fieldset>label:not(.proxy-clear-label) { display: block; font-size: 12px; margin: 11px 0 7px; }
.proxy-form select,.proxy-form input:not([type=checkbox]) { width: 100%; }
.proxy-address-grid { display: grid; grid-template-columns: minmax(0,1fr) 90px; gap: 12px; margin: 14px 0; }
.proxy-address-grid label { display: grid; min-width: 0; gap: 7px; font-size: 12px; }
.proxy-clear-label { display: flex; align-items: center; gap: 8px; margin: 13px 0 8px; font-size: 12px; }
.proxy-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 10px; }
.proxy-actions .button { min-width: 0; padding-left: 8px; padding-right: 8px; }
.proxy-test-note { margin: 10px 0 0; }
.proxy-toolbar { display: flex; align-items: end; gap: 12px; justify-content: space-between; margin: 14px 0; }
.proxy-toolbar label { display: grid; gap: 6px; min-width: 0; flex: 1; font-size: 12px; }
.proxy-toolbar .button { flex-shrink: 0; }
.proxy-list { display: grid; gap: 14px; margin-bottom: 14px; }
.proxy-node { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.proxy-node>label:not(.proxy-clear-label),.proxy-node-heading>label:first-child { display: grid; gap: 7px; min-width: 0; font-size: 12px; }
.proxy-node-heading { display: flex; gap: 12px; align-items: end; margin-bottom: 12px; }
.proxy-node-heading>label:first-child { flex: 1; }
.proxy-node-heading .toggle-label { flex-shrink: 0; font-size: 11px; padding-bottom: 11px; }
.proxy-node .proxy-address-grid { grid-template-columns: minmax(0,1fr) 76px; gap: 8px; margin: 12px 0; }
.proxy-node .filter-grid { gap: 8px; }
.proxy-node-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.proxy-node-actions .button { padding: 5px 9px; min-height: 32px; font-size: 11px; }
.proxy-health { flex: 1; font-size: 11px; color: var(--muted); min-width: 90px; }
.proxy-health[data-state=healthy] { color: var(--success); }
.proxy-health[data-state=unhealthy] { color: var(--danger); }
.proxy-health[data-state=checking] { color: var(--primary); }
.proxy-node-message { margin: 8px 0 0; overflow-wrap: anywhere; }
.proxy-node-message:empty { display: none; }
.proxy-empty { padding: 16px 12px; border: 1px dashed var(--line); border-radius: 10px; }
@media (max-width: 680px) { .proxy-form select,.proxy-form input:not([type=checkbox]) { font-size: 16px; } }
.settings-panel h3 { font-size: 14px; }
.display-settings { display: grid; gap: 9px; margin-top: 15px; }
.display-settings>label { color: var(--muted); font-size: 12px; }
.display-settings>input { width: 100%; }
.display-settings .filter-grid { margin-top: 5px; }
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 8px; }
.export-actions .button { font-size: 12px; }
.category-order-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.category-order-list li { display: flex; align-items: center; gap: 9px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.order-number { width: 22px; text-align: center; color: var(--primary); font-size: 12px; }
.order-name { flex: 1; min-width: 0; font-size: 12px; }
.order-move { min-width: 48px; min-height: 40px; padding: 6px 9px; font-size: 11px; }
.order-actions { display: flex; gap: 9px; justify-content: flex-end; margin: 12px 0; }
.order-actions .button { font-size: 12px; }
.server-account-files { margin-top: 20px; padding: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 11px; font-size: 12px; }
.server-account-files h3 { margin-bottom: 7px; }
.server-account-files code { overflow-wrap: anywhere; color: var(--primary); font-size: 11px; }
.server-account-files .field-hint { margin: 4px 0 11px; }
.server-account-files .config-error { color: var(--danger); }
.login-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 18px 2px; }
.login-actions .button { flex: 1 1 120px; min-height: 44px; font-size: 13px; }
.login-browser img { -webkit-user-drag: none; -webkit-touch-callout: none; }
.login-view-tools { gap: 6px; flex-wrap: wrap; }
.login-navigation { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.login-navigation button { min-height: 34px; padding: 4px; white-space: nowrap; font-size: 11px; }
.login-browser.is-interacting { box-shadow: 0 0 0 2px color-mix(in srgb,var(--primary) 55%,transparent); }
.result-explanation { margin-top: 22px; font-size: 12px; color: var(--muted); line-height: 1.8; border-top: 1px solid var(--line); padding-top: 15px; }
.category-note { margin: 10px 0; font-size: 11px; }
.source-status { margin-top: 12px; font-size: 11px; }
#source-status-list { display: grid; gap: 6px; padding-top: 8px; overflow-wrap: anywhere; }
.result-warnings { color: var(--danger); font-size: 11px; margin-top: 10px; display: grid; gap: 7px; overflow-wrap: anywhere; }
#theme-toggle { font-size: 12px; min-height: 34px; padding: 5px 10px; }
#theme-toggle .icon { width: 15px; height: 15px; }
.copy-dialog { width: 430px; }
.copy-dialog textarea { font-size: 14px; }

/* Reference video 1 at 17.92 s: charcoal user-details modal. */
.user-dialog { --primary: #c3b1ff; --primary-soft: #332c48; --primary-hover: #443a61; --disabled-bg: #363440; --disabled-text: #bcb8cf; --disabled-border: #565160; width: 440px; color-scheme: dark; background: #202024; color: #f2f1f6; border: 1px solid #36363f; border-radius: 19px; padding: 22px; box-shadow: 0 18px 60px #15141e4d; }
.user-detail-heading { display: flex; gap: 12px; align-items: center; }
.user-detail-heading .avatar { width: 52px; height: 52px; border-color: #506b81; background: #33313f; color: #c4b8ed; }
.user-detail-name { flex: 1; min-width: 0; }
.user-detail-heading h2 { font-size: 18px; overflow-wrap: anywhere; line-height: 1.45; }
.user-detail-heading p { font-size: 11px; color: #95949e; margin-top: 3px; }
.user-detail-heading .icon-button { background: #2d2c34; color: #aaa9b5; width: 33px; height: 33px; align-self: flex-start; }
.user-detail-actions { display: flex; gap: 10px; margin: 19px 0 14px; }
.user-detail-actions .button { flex: 1; min-height: 37px; background: transparent; color: #e0dfe7; border-color: #3a3843; font-size: 13px; }
.user-detail-actions .button .icon { width: 14px; height: 14px; }
.user-detail-actions .button:hover:not(:disabled) { background: #303038; }
#user-detail-link { color: #ee80aa; }
.user-detail-body { max-height: min(58dvh,570px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.user-dialog .detail-list { display: block; font-size: 13px; margin: 0; }
.detail-field { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 1px; border-bottom: 1px solid #2b2a32; }
.detail-field:last-child { border-bottom: 0; }
.detail-field dt { color: #92919c; flex: 0 0 auto; }
.detail-field dd { color: #e6e5ed; margin: 0; text-align: right; overflow-wrap: anywhere; max-width: 68%; }
.user-dialog .detail-note { color: #7e7d87; font-size: 10px; line-height: 1.8; padding-top: 13px; margin: 0; }
.user-dialog a { color: #c5b4fa; }
.toast { top: 16px; border-radius: 10px; font-size: 12px; }
html[data-theme=dark] .rank-chip { background: #2c3447; color: #9ebce9; }
html[data-theme=dark] .avatar { background: #3b324f; border-color: #535875; color: #b7a5df; }

@media (max-width: 680px) {
  html { scrollbar-gutter: auto; }
  .query-layout { width: calc(100% - 24px); padding: 12px 0 24px; gap: 12px; }
  .query-card { padding: 16px 14px 12px; border-radius: 17px; }
  .query-heading { gap: 9px; margin-bottom: 14px; }
  .heading-icon { width: 35px; height: 37px; border-radius: 10px; }
  .heading-icon .icon { width: 21px; height: 21px; }
  .query-heading h1 { font-size: 17px; letter-spacing: 0; }
  .query-heading p { font-size: 10px; margin-top: 2px; line-height: 1.6; }
  .settings-button { min-width: 34px; min-height: 38px; font-size: 9px; }
  .settings-button .icon { width: 17px; height: 17px; }
  .room-field { gap: 7px; }
  .field-symbol { width: 33px; height: 43px; }
  .room-field input { font-size: 16px; height: 43px; padding: 8px 10px; border-radius: 9px; }
  .room-field input::placeholder { font-size: 12px; }
  .recent-row { gap: 7px; margin: 9px 0 10px; }
  .recent-row select { height: 37px; font-size: 12px; padding: 6px 9px; border-radius: 9px; }
  .recent-anchor { min-width: 77px; padding: 6px 10px; font-size: 11px; border-radius: 9px; }
  .query-button { height: 42px; font-size: 14px; border-radius: 9px; }
  .query-button .icon { width: 16px; height: 16px; }
  .query-session { margin-top: 9px; padding: 6px 8px; }
  .status-pill { font-size: 10px; }
  .query-session .text-button { font-size: 9px; }
  .result-categories { padding: 5px; gap: 3px; border-radius: 14px; }
  .category { border-radius: 9px; min-height: 80px; padding: 7px 0 6px; transition: none; }
  .category-icon { width: clamp(23px,7vw,29px); height: clamp(23px,7vw,29px); border-radius: 8px; margin-bottom: 3px; }
  .category-icon .icon { width: 18px; height: 18px; }
  .category strong { font-size: clamp(8.5px,2.55vw,11px); line-height: 1.6; }
  .category>span:last-child { font-size: clamp(9px,2.5vw,11px); }
  .results-header { padding: 7px 10px; margin-bottom: 10px; border-radius: 11px; }
  .result-phase { font-size: 11px; }
  .results-header h2 { font-size: 10px; }
  .results-heading { gap: 3px; }
  .results-header h2::before { margin-right: 5px; }
  .result-cards,.result-loading { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .result-user-card { padding: 14px; border-radius: 14px; }
  .user-card-head { gap: 7px; }
  .person { gap: 10px; }
  .person-name { font-size: 14px; }
  .avatar { width: 42px; height: 42px; }
  .user-chips { gap: 6px; font-size: 10px; }
  .user-facts { margin-top: 13px; gap: 6px; font-size: 12px; }
  .fact-row { min-height: 35px; padding: 7px 9px; border-radius: 7px; }
  .fact-row dt { gap: 6px; }
  .fact-row dt .icon { width: 13px; height: 13px; }
  .card-copy { width: 27px; height: 27px; }
  .result-user-card.compact { padding: 10px 12px; }
  .compact .avatar { width: 34px; height: 34px; }
  .compact .person-name { font-size: 12px; }
  .compact .user-chips { font-size: 9px; }
  .view-user { min-width: 45px; min-height: 29px; }
  .help-card { padding: 19px 17px; border-radius: 17px; }
  .help-card h2 { font-size: 15px; }
  .help-card ol { gap: 15px; padding: 18px 0; }
  .help-card li { font-size: 12px; gap: 9px; }
  .help-tip { font-size: 11px; }
  .skeleton-card:nth-child(2) { display: none; }
  dialog { max-width: calc(100vw - 22px); max-height: calc(100dvh - 30px); border-radius: 17px; }
  .dialog-heading { padding: 16px; }
  .dialog-heading h2 { font-size: 17px; }
  .dialog-body { padding: 17px; }
  .settings-dialog { margin: auto auto 12px; width: calc(100vw - 22px); }
  .settings-dialog .dialog-body { max-height: calc(100dvh - 211px); }
  .settings-tabs { padding: 7px 9px 0; gap: 1px; }
  .settings-tabs button { padding: 9px 3px; font-size: 11px; }
  .setting-row { font-size: 12px; }
  .setting-row>span { font-size: 10px; }
  .filter-grid input,.filter-grid select,.account-settings-form input,.display-settings>input { font-size: 16px; }
  .settings-save { position: sticky; bottom: -17px; background: var(--surface); margin-left: -17px; margin-right: -17px; padding: 12px 17px; border-top: 1px solid var(--line); }
  .settings-save .primary { flex: 1; }
  .user-dialog { margin: auto; padding: 20px; border-radius: 17px; max-width: calc(100vw - 30px); }
  .user-detail-heading { gap: 10px; }
  .user-detail-heading h2 { font-size: 16px; }
  .user-detail-heading .avatar { width: 47px; height: 47px; }
  .user-detail-body { max-height: calc(100dvh - 250px); }
  .user-dialog .detail-list { font-size: 12px; }
  .detail-field { padding: 10px 0; gap: 12px; }
  .detail-field dd { max-width: 64%; }
  .login-view-tools { padding: 11px 12px 0; }
  .login-browser { margin: 10px 12px; border-radius: 9px; }
  .view-tip { margin: 8px 12px; }
  .login-inputs { padding: 3px 12px; }
  .login-actions { padding: 9px 12px 2px; }
  .login-actions .button { flex-basis: 105px; font-size: 12px; }
  .remote-input-form { grid-template-columns: 54px minmax(0,1fr) 58px; gap: 7px; }
  .remote-input-form label { font-size: 11px; }
  .remote-input-form .button { padding: 5px; font-size: 11px; }
  .dialog-footer { padding: 13px 12px 0; flex-wrap: wrap; gap: 10px; }
  .dialog-footer .button { width: 100%; }
  .login-card { padding: 27px 25px; }
  .login-card input,.copy-dialog textarea { font-size: 16px; }
  .toast { top: auto; bottom: max(22px,env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .query-layout { width: calc(100% - 18px); padding-top: 9px; gap: 10px; }
  .query-card { padding: 13px 12px 10px; }
  .query-heading { gap: 7px; }
  .query-heading h1 { font-size: 16px; }
  .query-heading p { font-size: 9px; }
  .heading-icon { width: 30px; height: 34px; }
  .room-field input::placeholder { font-size: 11px; }
  .result-categories { gap: 2px; padding: 4px; }
  .category { min-height: 76px; }
  .fact-row { gap: 8px; font-size: 11px; }
  .help-card li { font-size: 11px; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -240% 0; } }
@keyframes gentle-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Use explicit disabled colors, not opacity that washes out the label. */
:is(.button,.page-button,.recent-anchor,.icon-button,.settings-button,.result-options,.card-copy,.view-user,.text-button,.copy-id,.category):disabled,.settings-tabs button:disabled { color: var(--disabled-text); background: var(--disabled-bg); border-color: var(--disabled-border); box-shadow: none; filter: none; }
.category:disabled strong,.category:disabled>span:last-child,.category:disabled .category-icon { color: var(--disabled-text); }
/* Action feedback stays in the modal, next to the controls that were used. */
.button.is-loading,.query-button.is-querying { color: var(--disabled-text); background: var(--disabled-bg); opacity: 1; box-shadow: none; cursor: progress; }
.button.is-loading>.icon { animation: spin 1s linear infinite; width: 16px; height: 16px; }
.button[data-feedback=success],.button[data-feedback=success]:hover:not(:disabled) { color: #fff; background: #21775f; border-color: transparent; box-shadow: 0 3px 10px #3ba17e22; }
.button[data-feedback=error],.button[data-feedback=error]:hover:not(:disabled) { color: #fff; background: #b23b5c; border-color: transparent; box-shadow: none; }
.button[data-feedback]>.icon { width: 16px; height: 16px; }
.settings-save { flex-wrap: wrap; }
.action-feedback { flex: 1 0 100%; margin: 0; padding: 8px 10px; background: color-mix(in srgb,var(--success) 9%,var(--surface)); color: var(--success); border-radius: 8px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.action-feedback[data-kind=pending] { color: var(--primary); background: var(--primary-soft); }
.action-feedback[data-kind=error] { color: var(--danger); background: color-mix(in srgb,var(--danger) 8%,var(--surface)); }
dialog .toast { z-index: 3000; top: max(16px,env(safe-area-inset-top)); bottom: auto; pointer-events: none; }
@media (max-width: 680px) { .action-feedback { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .button.is-loading>.icon { animation: none !important; } }
