

:root {
  --ink: #101213;
  --muted: #686c70;
  --paper: #f4f1e9;
  --card: #fbfaf6;
  --line: #d6d2c8;
  --blue: #186fda;
  --blue-dark: #1157ad;
  --acid: #c9ff3c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
button, input, select { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

main { min-height: 100vh; overflow: hidden; }
.topbar {
  width: min(1180px, calc(100% - 48px));
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}
.dataTopbar { height: 76px; }
.topbarLeft { min-width: 0; display: flex; align-items: center; gap: 22px; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.brandMark { display: grid; place-items: center; width: 31px; height: 31px; background: var(--ink); color: var(--acid); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; transform: rotate(-4deg); }
.creatorTopSummary { min-width: 0; display: flex; align-items: center; gap: 18px; padding-left: 20px; border-left: 1px solid var(--line); }
.creatorTopTitle { min-width: 0; display: grid; gap: 3px; }
.creatorTopTitle strong { max-width: 210px; overflow: hidden; color: var(--ink); font-size: 14px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.creatorTopTitle span { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 800; }
.creatorTopMeta { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px 13px; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.35; }
.creatorTopMeta span { white-space: nowrap; }
.localBadge { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.localBadge i { width: 7px; height: 7px; border-radius: 50%; background: #25a55f; box-shadow: 0 0 0 4px rgba(37,165,95,.12); }
.topbarActions { flex: none; display: flex; align-items: center; gap: 10px; }
.topbarResultActions { display: flex; align-items: center; gap: 6px; }
.topbarAction { min-height: 36px; border: 1px solid var(--ink); padding: 0 12px; background: var(--ink); color: #fff; cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.topbarAction:hover { border-color: var(--blue); background: var(--blue); }
.topbarAction.secondary { background: transparent; color: var(--ink); }
.topbarAction.secondary:hover { color: #fff; }
.topbarAction.download { border-color: var(--blue); background: var(--blue); }
.topbarAction.download:hover { background: var(--blue-dark); }
.topbarAction:disabled { cursor: wait; opacity: .55; }
.logoutButton { min-height: 36px; border: 0; border-left: 1px solid var(--line); padding: 0 0 0 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.logoutButton:hover { color: var(--blue); }

.loginPage { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); overflow: hidden; }
.loginShell { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: center; padding: clamp(48px, 8vw, 120px); }
.loginShell::before { content: ""; position: absolute; width: 380px; height: 380px; right: -180px; top: -170px; border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 0 0 56px var(--paper), 0 0 0 57px var(--line), 0 0 0 112px var(--paper), 0 0 0 113px var(--line); z-index: -1; }
.loginBrand { position: absolute; top: 42px; left: clamp(48px, 8vw, 120px); display: inline-flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.loginIndex { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.loginShell h1 { max-width: 700px; margin: 22px 0; }
.loginShell > p { max-width: 590px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.loginForm { width: min(690px, 100%); margin-top: 42px; padding: 18px; border: 1px solid var(--ink); background: var(--card); box-shadow: 8px 8px 0 var(--ink); }
.loginForm label { display: block; margin: 0 0 10px 2px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.loginInputRow { display: flex; min-height: 62px; border: 1px solid var(--line); background: #fff; }
.loginInputRow input { min-width: 0; flex: 1; border: 0; padding: 0 18px; outline: 0; background: transparent; font-size: 17px; }
.loginInputRow input:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.loginInputRow button { min-width: 150px; border: 0; padding: 0 22px; background: var(--blue); color: #fff; cursor: pointer; font-weight: 800; }
.loginInputRow button:hover { background: var(--blue-dark); }
.loginInputRow button:disabled { cursor: wait; opacity: .7; }
.loginError { margin-top: 12px; padding: 11px 13px; background: #7a2424; color: #fff; font-size: 12px; }
.loginForm small { display: block; margin: 12px 2px 0; color: var(--muted); font-size: 10px; }
.loginAside { display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; padding: 48px; background: var(--ink); color: #fff; }
.loginAside span { color: var(--acid); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.loginAside strong { color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(28px, 3vw, 50px); line-height: .95; letter-spacing: -.06em; writing-mode: vertical-rl; transform: rotate(180deg); }

.hero { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 86px 0 68px; position: relative; }
.hero::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -310px;
  top: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 0 0 62px var(--paper), 0 0 0 63px var(--line), 0 0 0 126px var(--paper), 0 0 0 127px var(--line);
  z-index: -1;
}
.eyebrow { display: flex; align-items: center; gap: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow span { display: inline-grid; place-items: center; width: 30px; height: 22px; border: 1px solid currentColor; }
h1 { max-width: 830px; margin: 24px 0 24px; font-size: clamp(48px, 7vw, 88px); line-height: .98; letter-spacing: -.065em; font-weight: 850; }
h1 em { color: var(--blue); font-style: normal; position: relative; }
h1 em::after { content: ""; position: absolute; left: 2%; right: -1%; bottom: 2px; height: 8px; background: var(--acid); z-index: -1; transform: rotate(-1deg); }
.lede { max-width: 650px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.8; }

.searchForm { margin-top: 48px; padding: 18px; border: 1px solid var(--ink); background: var(--card); box-shadow: 8px 8px 0 var(--ink); }
.searchForm > label { display: block; margin: 0 0 10px 2px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.inputRow { display: flex; min-height: 64px; border: 1px solid var(--line); background: #fff; align-items: stretch; }
.prompt { display: flex; align-items: center; padding: 0 18px; border-right: 1px solid var(--line); color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; font-size: 12px; }
.inputRow input { min-width: 0; flex: 1; border: 0; padding: 0 18px; outline: 0; background: transparent; font-size: 17px; }
.inputRow input:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.inputRow button, .downloadButton { border: 0; background: var(--blue); color: #fff; padding: 0 28px; cursor: pointer; font-weight: 800; transition: background .15s ease, transform .15s ease; }
.inputRow button:hover, .downloadButton:hover { background: var(--blue-dark); }
.inputRow button:active, .downloadButton:active { transform: translateY(1px); }
.inputRow button:disabled { cursor: wait; opacity: .8; }
.inputRow button span:not(.spinner) { margin-left: 12px; }
.formMeta { display: flex; justify-content: space-between; gap: 20px; margin: 12px 2px 0; color: var(--muted); font-size: 11px; }
.recentHistory { display: flex; align-items: flex-start; gap: 14px; margin-top: 24px; }
.historyLabel { flex: none; padding-top: 10px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.historyItems { display: flex; flex-wrap: wrap; gap: 8px; }
.historyItems button { display: grid; gap: 2px; border: 1px solid var(--line); padding: 7px 11px; background: rgba(255,255,255,.4); color: var(--ink); cursor: pointer; text-align: left; }
.historyItems button:hover { border-color: var(--blue); }
.historyItems strong { max-width: 150px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.historyItems span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 2px solid rgba(255,255,255,.38); border-top-color: #fff; border-radius: 50%; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.statusPanel, .errorPanel { display: flex; gap: 16px; align-items: center; margin-top: 24px; padding: 18px 20px; background: var(--ink); color: #fff; }
.statusPanel p, .errorPanel p { margin: 4px 0 0; color: #b9bdc0; font-size: 13px; }
.statusPulse { width: 13px; height: 13px; flex: none; border-radius: 50%; background: var(--acid); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.65); opacity: .45; } }
.errorPanel { background: #7a2424; }
.errorPanel > span { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; font-weight: 900; }
.initialLoad { width: min(1040px, calc(100% - 48px)); min-height: 360px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 16px; }
.initialLoad p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.howItWorks { width: min(1180px, calc(100% - 48px)); margin: 0 auto 90px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-right: 0; background: rgba(255,255,255,.2); }
.howItWorks article { display: flex; gap: 20px; padding: 26px; border-right: 1px solid var(--line); }
.howItWorks strong { display: block; margin: 2px 0 7px; font-size: 14px; }
.howItWorks p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.stepNo { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; }

.results { width: min(1180px, calc(100% - 48px)); margin: 0 auto 90px; padding-top: 16px; }
.resultHeader { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 34px 0 28px; border-top: 1px solid var(--ink); }
.resultKicker { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.resultHeader h2 { margin: 8px 0 7px; font-size: clamp(32px, 4vw, 52px); line-height: 1; letter-spacing: -.04em; }
.resultHeader p { margin: 0; color: var(--muted); font-size: 13px; }
.cacheSummary { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; color: var(--muted); font-size: 10px; font-weight: 700; }
.cacheSummary span { display: inline-flex; align-items: center; gap: 6px; }
.cacheDot { width: 7px; height: 7px; border-radius: 50%; background: #25a55f; box-shadow: 0 0 0 3px rgba(37,165,95,.12); }
.downloadButton { min-height: 45px; white-space: nowrap; padding: 0 20px; }
.resultActions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.resultActionButton { min-height: 45px; border: 1px solid var(--ink); padding: 0 18px; background: var(--ink); color: #fff; cursor: pointer; font-size: 12px; font-weight: 800; white-space: nowrap; }
.resultActionButton:hover { border-color: var(--blue); background: var(--blue); }
.resultActionButton.secondary { background: transparent; color: var(--ink); }
.resultActionButton.secondary:hover { color: #fff; }
.resultActionButton:disabled { cursor: wait; opacity: .55; }
.resultStatus, .resultError { margin-bottom: 14px; padding: 13px 15px; font-size: 11px; font-weight: 700; }
.resultStatus { border: 1px solid rgba(24,111,218,.3); background: rgba(24,111,218,.07); color: var(--blue-dark); }
.resultError { background: #7a2424; color: #fff; }
.darkSpinner { width: 12px; height: 12px; margin-right: 7px; border-color: rgba(24,111,218,.25); border-top-color: var(--blue); }
.restoredSummary { color: #167445; }
.toolbar { display: grid; grid-template-columns: minmax(210px, 1fr) auto auto auto; gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--line); background: var(--card); }
.toolbar label { display: grid; gap: 7px; }
.toolbar label span, .choiceField legend { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.toolbar input { width: 100%; height: 42px; border: 1px solid var(--line); background: #fff; padding: 0 13px; outline: none; color: var(--ink); }
.toolbar input:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.choiceField { min-width: 0; margin: 0; padding: 0; border: 0; }
.choiceField legend { margin: 0 0 7px; padding: 0; }
.segmented { display: flex; height: 42px; border: 1px solid var(--line); background: #fff; }
.segmented button { min-width: 84px; border: 0; border-right: 1px solid var(--line); padding: 0 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { color: var(--ink); background: #f5f4ef; }
.segmented button.active { background: var(--ink); color: #fff; }
.viewSwitch button { min-width: 70px; }
.matchCount { padding-bottom: 12px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.videoGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 24px; background: var(--line); border: 1px solid var(--line); }
.videoCard { min-width: 0; background: var(--card); }
.coverLink { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #dedbd2; }
.coverLink img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.videoCard:hover .coverLink img { transform: scale(1.025); filter: saturate(1.08); }
.duration, .rank { position: absolute; background: rgba(16,18,19,.88); color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.duration { right: 10px; bottom: 10px; padding: 5px 7px; }
.rank { left: 0; top: 0; min-width: 36px; padding: 8px; color: var(--acid); text-align: center; }
.cardBody { min-height: 224px; padding: 20px; display: flex; flex-direction: column; }
.cardBody time { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; }
.cardBody h3 { margin: 10px 0 20px; font-size: 16px; line-height: 1.52; letter-spacing: -.015em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cardBody h3 a { text-decoration: none; }
.cardBody h3 a:hover { text-decoration: underline; text-decoration-color: var(--acid); text-decoration-thickness: 4px; }
.metrics { display: flex; flex-wrap: wrap; gap: 16px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.metrics b { color: var(--ink); font-weight: 700; }
.onlineControl { display: grid; gap: 5px; margin-top: 12px; }
.onlineButton { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 800; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.onlineButton i { width: 7px; height: 7px; border-radius: 50%; background: #25a55f; box-shadow: 0 0 0 3px rgba(37,165,95,.12); }
.onlineButton:hover { border-color: var(--blue); color: var(--blue); }
.onlineButton.hasValue { border-color: rgba(37,165,95,.45); background: rgba(37,165,95,.07); color: #167445; }
.onlineButton:disabled { cursor: wait; opacity: .62; }
.onlineButton:disabled i { animation: pulse 1s ease-in-out infinite; }
.onlineError { color: #9a3434; font-size: 10px; line-height: 1.4; }
.onlineAutoHint { color: #167445; font-size: 9px; line-height: 1.4; text-align: center; }

.videoList { margin-top: 24px; border: 1px solid var(--line); background: var(--card); }
.videoRow { display: grid; grid-template-columns: 42px 190px minmax(0, 1fr) 190px; gap: 20px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.videoRow:last-child { border-bottom: 0; }
.listRank { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; text-align: center; }
.listCover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #dedbd2; }
.listCover img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.videoRow:hover .listCover img { transform: scale(1.025); }
.listMain { min-width: 0; }
.listMain time { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; }
.listMain h3 { margin: 7px 0 12px; font-size: 15px; line-height: 1.5; }
.listMain h3 a { text-decoration: none; }
.listMain h3 a:hover { text-decoration: underline; text-decoration-color: var(--acid); text-decoration-thickness: 4px; }
.listMetrics { margin: 0; padding-top: 10px; }
.listOnline .onlineControl { margin-top: 0; }

.loadControls { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.loadControls button { min-height: 44px; border: 1px solid var(--ink); padding: 0 22px; background: var(--ink); color: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.loadControls button:hover { background: var(--blue); border-color: var(--blue); }
.loadControls .showAll { background: transparent; color: var(--ink); }
.loadControls .showAll:hover { color: #fff; }
.emptyState { margin-top: 24px; border: 1px dashed var(--line); padding: 60px 20px; color: var(--muted); text-align: center; }

footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 36px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 1020px) {
  .dataTopbar { height: 74px; gap: 12px; }
  .topbarLeft { gap: 12px; }
  .creatorTopSummary { gap: 12px; padding-left: 12px; }
  .creatorTopTitle strong { max-width: 150px; }
  .creatorTopMeta span:nth-child(2), .creatorTopMeta span:nth-child(3) { display: none; }
  .topbarAction { padding: 0 9px; font-size: 9px; }
}

@media (max-width: 860px) {
  .hero { padding-top: 62px; }
  .howItWorks { grid-template-columns: 1fr; border-bottom: 0; }
  .howItWorks article { border-bottom: 1px solid var(--line); }
  .videoGrid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .filterField { grid-column: 1 / -1; }
  .matchCount { padding: 4px 0 0; }
  .videoRow { grid-template-columns: 34px 150px minmax(0, 1fr); gap: 14px; }
  .listOnline { grid-column: 3; }
}
@media (max-width: 620px) {
  body { overflow-x: hidden; }
  main { overflow: clip; }
  .topbar, .hero, .howItWorks, .results, footer { width: min(calc(100% - 32px), 1180px); }
  .topbar { height: 66px; padding-top: env(safe-area-inset-top); }
  .dataTopbar { height: auto; min-height: 104px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: 8px 10px; padding: calc(8px + env(safe-area-inset-top)) 0 9px; }
  .topbarLeft { min-width: 0; gap: 10px; }
  .brand { gap: 9px; font-size: 16px; }
  .dataTopbar .brandText { display: none; }
  .brandMark { width: 29px; height: 29px; font-size: 14px; }
  .creatorTopSummary { min-width: 0; flex: 1; display: grid; gap: 5px; padding-left: 10px; }
  .creatorTopTitle { display: flex; align-items: baseline; gap: 7px; }
  .creatorTopTitle strong { max-width: min(46vw, 190px); font-size: 13px; }
  .creatorTopTitle span { flex: none; font-size: 8px; }
  .creatorTopMeta { display: flex; flex-wrap: nowrap; gap: 8px; overflow: hidden; font-size: 8px; }
  .creatorTopMeta span { overflow: hidden; text-overflow: ellipsis; }
  .creatorTopMeta span:nth-child(2), .creatorTopMeta span:nth-child(3) { display: none; }
  .creatorTopMeta span:last-child { flex: 1; min-width: 0; }
  .dataTopbar .topbarActions { grid-column: 1 / -1; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .topbarResultActions { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .topbarAction { min-height: 38px; padding: 0 6px; font-size: 9px; }
  .topbarActions { gap: 10px; }
  .localBadge { gap: 6px; font-size: 9px; letter-spacing: .05em; }
  .localBadge i { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(37,165,95,.12); }
  .logoutButton { min-height: 38px; padding: 0 0 0 9px; font-size: 9px; }

  .hero { padding: 34px 0 46px; }
  .hero::before { width: 220px; height: 220px; right: -165px; top: -20px; box-shadow: 0 0 0 36px var(--paper), 0 0 0 37px var(--line), 0 0 0 72px var(--paper), 0 0 0 73px var(--line); }
  .eyebrow { gap: 9px; font-size: 10px; }
  .eyebrow span { width: 27px; height: 20px; }
  h1 { margin: 20px 0 18px; font-size: clamp(40px, 11.5vw, 48px); line-height: 1.02; letter-spacing: -.055em; }
  h1 em::after { height: 5px; }
  .lede { font-size: 14px; line-height: 1.72; }

  .searchForm { margin-top: 30px; padding: 11px; box-shadow: 5px 5px 0 var(--ink); }
  .searchForm > label { margin-bottom: 8px; font-size: 10px; }
  .inputRow { display: grid; grid-template-columns: 52px minmax(0, 1fr); min-height: 0; }
  .prompt { justify-content: center; padding: 0; font-size: 10px; }
  .inputRow input { min-height: 56px; padding: 0 12px; font-size: 16px; }
  .inputRow button { grid-column: 1 / -1; min-height: 50px; padding: 0 18px; }
  .formMeta { display: block; margin-top: 9px; font-size: 9px; line-height: 1.5; }
  .formMeta span:last-child { display: none; }
  .recentHistory { align-items: stretch; flex-direction: column; gap: 8px; margin-top: 20px; }
  .historyLabel { padding-top: 0; }
  .historyItems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .historyItems button { min-height: 48px; }
  .historyItems strong { max-width: 100%; }
  .statusPanel, .errorPanel { align-items: flex-start; padding: 15px; }
  .statusPanel p, .errorPanel p { font-size: 11px; line-height: 1.6; }
  .initialLoad { width: calc(100% - 32px); min-height: 270px; align-items: flex-start; justify-content: flex-start; padding-top: 80px; }

  .howItWorks { margin-bottom: 58px; grid-template-columns: 1fr; border-bottom: 0; }
  .howItWorks article { gap: 14px; padding: 18px; border-bottom: 1px solid var(--line); }
  .howItWorks strong { margin-bottom: 5px; }
  .howItWorks p { font-size: 11px; }

  .results { margin-bottom: 58px; padding-top: 12px; }
  .resultHeader { align-items: stretch; flex-direction: column; gap: 20px; padding: 26px 0 20px; }
  .resultHeader h2 { margin-top: 7px; font-size: 34px; }
  .resultHeader p { font-size: 11px; line-height: 1.65; }
  .cacheSummary { gap: 7px 12px; font-size: 9px; }
  .downloadButton { width: 100%; min-height: 48px; }
  .resultActions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .resultActionButton { min-height: 48px; padding: 0 10px; }
  .resultActions .downloadButton { display: none; }
  .resultStatus, .resultError { line-height: 1.55; }

  .toolbar { grid-template-columns: 1fr auto; gap: 10px; padding: 12px; }
  .filterField { grid-column: 1 / -1; }
  .toolbar input { height: 48px; font-size: 16px; }
  .toolbar .viewField { display: none; }
  .toolbar .sortField { display: block; grid-column: 1; }
  .toolbar .sortField .segmented { width: 100%; }
  .segmented { height: 48px; }
  .segmented button { flex: 1; min-width: 0; font-size: 12px; }
  .matchCount { grid-column: 2; align-self: end; padding: 0 0 10px; text-align: right; }

  .videoGrid { grid-template-columns: 1fr; margin-top: 16px; }
  .coverLink { aspect-ratio: 16 / 9; }
  .cardBody { min-height: 0; padding: 17px; }
  .cardBody h3 { margin: 8px 0 16px; font-size: 15px; }
  .metrics { gap: 10px 14px; padding-top: 12px; }
  .onlineControl { margin-top: 11px; }
  .onlineButton { min-height: 44px; }

  .videoList { margin-top: 16px; }
  .videoRow { position: relative; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px; align-items: start; }
  .listRank { position: absolute; left: 12px; top: 12px; z-index: 2; min-width: 30px; padding: 6px; background: rgba(16,18,19,.88); color: var(--acid); }
  .listCover { grid-column: 1; }
  .listMain { grid-column: 2; }
  .listMain h3 { margin: 5px 0 9px; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .listMetrics { gap: 6px; padding-top: 7px; font-size: 9px; }
  .listMetrics span { width: 100%; }
  .listOnline { grid-column: 1 / -1; }
  .listOnline .onlineButton { width: 100%; }

  .loadControls { align-items: stretch; flex-direction: column; margin-top: 18px; padding-top: 18px; }
  .loadControls button { min-height: 48px; }
  footer { align-items: flex-start; flex-direction: column; padding-bottom: calc(28px + env(safe-area-inset-bottom)); line-height: 1.55; }

  .loginPage { grid-template-columns: 1fr; }
  .loginShell { min-height: 100dvh; padding: calc(96px + env(safe-area-inset-top)) 20px calc(34px + env(safe-area-inset-bottom)); justify-content: center; }
  .loginShell::before { width: 230px; height: 230px; right: -125px; top: -100px; box-shadow: 0 0 0 38px var(--paper), 0 0 0 39px var(--line), 0 0 0 76px var(--paper), 0 0 0 77px var(--line); }
  .loginBrand { top: calc(26px + env(safe-area-inset-top)); left: 20px; }
  .loginIndex { font-size: 10px; }
  .loginShell h1 { margin: 18px 0 16px; font-size: clamp(44px, 13vw, 52px); line-height: .98; word-break: keep-all; }
  .loginShell > p { font-size: 14px; line-height: 1.65; }
  .loginForm { margin-top: 28px; padding: 11px; box-shadow: 5px 5px 0 var(--ink); }
  .loginForm label { margin-bottom: 8px; font-size: 10px; }
  .loginInputRow { display: grid; }
  .loginInputRow input { min-height: 54px; padding: 0 13px; font-size: 16px; }
  .loginInputRow button { min-height: 50px; }
  .loginForm small { line-height: 1.5; }
  .loginAside { display: none; }
}

@media (max-width: 360px) {
  .topbar, .hero, .howItWorks, .results, footer { width: calc(100% - 24px); }
  .localBadge { display: none; }
  .dataTopbar { min-height: 100px; }
  .creatorTopTitle strong { max-width: 42vw; }
  .topbarAction { font-size: 8px; }
  .logoutButton { border-left: 0; padding-left: 0; }
  h1 { font-size: 38px; }
  .historyItems { grid-template-columns: 1fr; }
  .videoRow { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .listRank { left: 10px; top: 10px; }
  .loginShell { padding-left: 16px; padding-right: 16px; }
  .loginBrand { left: 16px; }
  .loginShell h1 { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Clear, light workspace: readable data, quiet controls, consistent spacing. */
:root { --ink: #1d2939; --muted: #667085; --paper: #f6f8fb; --card: #fff; --line: #e4e9f0; --blue: #3265d5; --blue-dark: #244fae; --acid: #dbe8ff; }
body { line-height: 1.5; }
button, input { transition: background .15s, border-color .15s; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #9bbaf8; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .5; }
.topbar, .dataTopbar { min-height: 80px; height: auto; padding: 16px 0; border-bottom: 1px solid var(--line); }
.brand { letter-spacing: -.02em; font-size: 18px; }
.brandMark { border-radius: 10px; background: var(--blue); color: white; transform: none; width: 36px; height: 36px; }
.topbarAction { border-radius: 8px; font-size: 13px; font-weight: 600; min-height: 40px; padding: 0 16px; background: var(--blue); border-color: var(--blue); }
.topbarAction.secondary { border-color: var(--line); background: white; }
.topbarAction.secondary:hover { background: #eff4ff; color: var(--blue); }
.topbarAction.download { color: var(--ink); border-color: var(--line); background: white; }
.logoutButton { font-size: 13px; font-weight: 500; padding-left: 16px; }
.hero { max-width: 780px; padding: 64px 0 48px; }
.hero::before, .loginShell::before { display: none; }
.eyebrow { font-family: inherit; letter-spacing: .04em; font-size: 13px; font-weight: 600; }
.eyebrow span { display: none; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.25; letter-spacing: -.04em; margin: 16px 0; font-weight: 750; }
h1 em::after { display: none; }
.lede { font-size: 15px; line-height: 1.8; }
.searchForm, .loginForm { margin-top: 28px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 24px #1d293906; padding: 24px; }
.searchForm > label, .loginForm label { font-size: 13px; letter-spacing: 0; font-weight: 600; }
.inputRow, .loginInputRow { border-radius: 10px; overflow: hidden; min-height: 54px; }
.inputRow input { font-size: 16px; }
.prompt { color: var(--muted); font-size: 12px; }
.inputRow button { font-size: 14px; font-weight: 600; }
.formMeta { font-size: 12px; }
.historyLabel { font-family: inherit; font-size: 12px; letter-spacing: 0; }
.historyItems button { border-radius: 8px; background: white; padding: 10px 14px; }
.historyItems strong { font-size: 13px; }
.historyItems span { font-size: 11px; }
.howItWorks { max-width: 780px; border: 0; background: transparent; gap: 24px; margin-bottom: 64px; }
.howItWorks article { padding: 8px 0; border: 0; gap: 12px; }
.howItWorks p { font-size: 13px; }
.statusPanel, .errorPanel, .resultStatus, .resultError, .resultWarning { border-radius: 10px; font-size: 13px; line-height: 1.7; }
.errorPanel, .resultError { background: #fff1f0; color: #a12d26; border: 1px solid #ffd2ce; }
.errorPanel p { color: #a12d26; }
.resultWarning { background: #fff8e8; color: #805a16; padding: 12px 16px; margin: 16px 0; border: 1px solid #f2dfb5; }
.statusPanel { background: #edf3ff; color: var(--blue-dark); }
.statusPanel p { color: var(--muted); }
.statusPulse { background: var(--blue); }
.results { padding-top: 32px; }
.dashboardHeading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.sectionKicker { color: var(--muted); font-size: 12px; }
.dashboardHeading h2 { font-size: 30px; letter-spacing: -.03em; margin: 5px 0 6px; line-height: 1.3; }
.dashboardHeading p { color: var(--muted); font-size: 13px; margin: 0; }
.dashboardHeading p span { margin: 0 8px; }
.dataBadge { flex: none; padding: 6px 12px; border-radius: 20px; color: #28704a; background: #eaf6ef; font-size: 12px; }
.overviewGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.overviewGrid > div { display: grid; gap: 10px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.overviewGrid span { font-size: 13px; color: var(--muted); }
.overviewGrid strong { font-size: clamp(22px, 2.6vw, 32px); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.overviewGrid small { font-size: 13px; color: var(--muted); font-weight: 400; }
.refreshNotice { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin: 16px 0 24px; font-size: 12px; color: var(--muted); }
.refreshNotice button, .cancelSwitch { border: 0; color: var(--blue); background: transparent; cursor: pointer; white-space: nowrap; font-size: 13px; }
.cancelSwitch { padding: 0; margin-bottom: 16px; }
.dataNote { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.toolbar { border-radius: 12px; padding: 16px 20px; gap: 20px; }
.toolbar label span, .choiceField legend { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.toolbar input { border-radius: 8px; font-size: 14px; }
.segmented { border-radius: 8px; overflow: hidden; background: #f8fafc; }
.segmented button { border-right: 0; font-weight: 500; }
.segmented button.active { background: #e8efff; color: var(--blue-dark); font-weight: 650; }
.matchCount { font-size: 12px; }
.videoGrid { border: 0; background: transparent; gap: 20px; margin-top: 24px; }
.videoCard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.videoCard:hover { border-color: #cbd6e9; box-shadow: 0 8px 22px #23355208; }
.coverLink { aspect-ratio: 16 / 9; background: #eef1f6; }
.duration { border-radius: 5px; font-size: 11px; padding: 3px 6px; }
.rank { display: none; }
.cardBody { padding: 18px; min-height: 268px; }
.cardBody time, .listMain time { color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 400; }
.cardBody h3 { margin: 8px 0 18px; font-size: 15px; font-weight: 650; min-height: 46px; line-height: 1.55; }
.cardBody h3 a:hover, .listMain h3 a:hover { color: var(--blue); text-decoration: none; }
.metrics { font-size: 13px; padding-top: 12px; gap: 16px; }
.metrics b { font-size: 12px; color: #98a2b3; }
.onlineControl { gap: 7px; margin-top: 16px; }
.onlineButton { min-height: 40px; border-radius: 8px; font-size: 13px; font-weight: 500; background: #f9fbfd; }
.onlineButton i { width: 6px; height: 6px; box-shadow: none; background: #98a2b3; }
.onlineButton.hasValue { background: #eff8f2; border-color: #d5eadd; color: #286847; }
.onlineButton.hasValue i { background: #3b9265; }
.onlineMeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.monitorToggle { background: transparent; border: 0; color: var(--blue); font-size: 12px; padding: 5px 0; cursor: pointer; }
.monitorToggle[aria-pressed=true] { color: #a12d26; }
.statsRefresh { min-height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.statsRefresh:hover { color: var(--blue); }
.onlineError { font-size: 12px; }
.videoList { border-radius: 12px; overflow: hidden; }
.videoRow { grid-template-columns: 28px 160px minmax(0, 1fr) 210px; padding: 20px; }
.listCover { border-radius: 8px; }
.listRank { color: #98a2b3; }
.listMain h3 { font-weight: 650; }
.listMetrics { border: 0; }
.loadControls { border-top: 0; padding-top: 8px; }
.loadControls button { border-radius: 8px; background: var(--blue); border-color: var(--blue); font-weight: 600; font-size: 13px; }
.loadControls .showAll { color: var(--muted); border-color: var(--line); background: white; }
.emptyState { border-radius: 12px; padding: 48px 20px; background: white; margin-top: 24px; color: var(--muted); text-align: center; }
.emptyState button { display: block; margin: 16px auto 0; color: var(--blue); background: transparent; border: 0; cursor: pointer; }
footer { font-size: 12px; }
.loginPage { display: flex; justify-content: center; }
.loginShell { width: min(540px, 100%); padding: 110px 24px 64px; }
.loginBrand { left: 24px; top: 36px; }
.loginShell h1 { font-size: 40px; line-height: 1.25; }
.loginShell > p { font-size: 15px; }
.loginAside { display: none; }
.loginForm small { font-size: 12px; }
@media (max-width: 960px) {
  .topbar, .dataTopbar { flex-wrap: wrap; gap: 12px; }
  .topbarActions { flex-wrap: wrap; }
  .videoRow { grid-template-columns: 140px minmax(0, 1fr) 190px; gap: 16px; }
  .listRank { display: none; }
  .listOnline { grid-column: auto; }
}
@media (max-width: 620px) {
  .topbar, .dataTopbar { display: flex; padding: 16px 0; min-height: auto; gap: 14px; }
  .brand { font-size: 16px; }
  .dataTopbar .brandText { display: inline; }
  .dataTopbar .topbarActions { display: flex; width: 100%; justify-content: space-between; }
  .topbarResultActions { display: flex; flex: 1; gap: 6px; }
  .topbarAction { min-height: 40px; font-size: 12px; padding: 0 10px; }
  .logoutButton { font-size: 12px; }
  .hero { padding: 36px 0; }
  h1 { font-size: 30px; line-height: 1.3; }
  .searchForm, .loginForm { padding: 16px; box-shadow: none; border-radius: 12px; }
  .inputRow { grid-template-columns: 48px minmax(0, 1fr); }
  .howItWorks { gap: 12px; }
  .howItWorks article { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .results { padding-top: 24px; }
  .dashboardHeading { align-items: flex-start; gap: 12px; }
  .dashboardHeading h2 { font-size: 25px; }
  .dashboardHeading p { font-size: 12px; }
  .dataBadge { font-size: 11px; padding: 5px 8px; }
  .overviewGrid { gap: 8px; }
  .overviewGrid > div { padding: 14px 10px; gap: 8px; }
  .overviewGrid span { font-size: 11px; }
  .overviewGrid strong { font-size: 20px; }
  .overviewGrid small { font-size: 11px; }
  .refreshNotice { align-items: flex-start; flex-direction: column; gap: 8px; line-height: 1.7; margin-bottom: 16px; }
  .toolbar { grid-template-columns: 1fr 1fr; padding: 14px; gap: 12px; }
  .toolbar .viewField { display: block; }
  .matchCount { grid-column: 1 / -1; padding: 0; text-align: left; }
  .segmented { height: 42px; }
  .videoGrid { gap: 16px; }
  .cardBody { min-height: auto; padding: 16px; }
  .metrics { font-size: 13px; }
  .videoRow { grid-template-columns: 112px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .listOnline { grid-column: 1 / -1; }
  .listMetrics { font-size: 12px; gap: 4px; }
  .listMain h3 { font-size: 14px; }
  .onlineMeta { font-size: 12px; }
  .monitorToggle { min-height: 32px; }
  .statsRefresh { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.overviewGrid strong span { font: inherit; color: inherit; }
.overviewGrid .compactValue { display: none; }
@media (max-width: 620px) {
  .overviewGrid .wideValue { display: none; }
  .overviewGrid .compactValue { display: inline; font-size: 18px; white-space: nowrap; }
}

[hidden] { display: none !important; }
.globalFeedback { margin-bottom: 0; padding-top: 0; }
.globalFeedback:has(> :not([hidden])) { padding-top: 16px; }
.globalFeedback > div { margin: 0 0 12px; }
.onlineMeta span { min-width: 0; }
#total-plays { overflow-wrap: normal; }
.scheduleBar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border:1px solid #dce8ef;border-radius:12px;background:#f5fafc;margin:20px 0}.scheduleBar p{font-size:13px;color:#657889;margin:6px 0 0}.scheduleBar button,.trendButton{border:1px solid #cddfea;background:white;color:#147bcb;padding:9px 12px;border-radius:8px;cursor:pointer}.trendButton{width:100%;margin-bottom:10px}#trend-dialog{width:min(960px,94vw);max-height:90vh;overflow:auto;border:1px solid #dce4ec;border-radius:18px;padding:28px;color:#263c50}#trend-dialog::backdrop{background:#15304488}.trendHeader{display:flex;justify-content:space-between;gap:20px}.trendHeader h2{font-size:20px;line-height:1.5}.trendHeader p,#trend-content>p{font-size:13px;color:#657889}.trendHeader button{align-self:flex-start;background:white;border:1px solid #dce4ec;border-radius:7px;padding:8px;cursor:pointer}#trend-range{padding:8px;margin:12px;border:1px solid #dce4ec;border-radius:7px}.trendChart{margin-top:20px;padding:16px;border:1px solid #e4eaf0;border-radius:12px}.trendChart h3{display:flex;justify-content:space-between;font-size:15px}.trendChart h3 span{color:#147bcb}.trendChart svg{width:100%;height:auto}.trendChart text{font-size:12px;fill:#657889}.trendTable{overflow:auto;max-height:300px;margin-top:12px}.trendTable table{width:100%;font-size:13px;border-collapse:collapse}.trendTable th,.trendTable td{padding:9px;border-bottom:1px solid #e4eaf0;white-space:nowrap;text-align:left}@media(max-width:600px){.scheduleBar{align-items:flex-start;flex-direction:column}#trend-dialog{padding:15px}.trendChart{padding:8px}.trendHeader h2{font-size:16px}}

/* ================================================================
   Theme system + refined trend cards (2026-10-03)
   ================================================================ */
:root {
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: #ffffff;
  --chart-card: #f8fbfd;
  --chart-grid: rgba(91, 114, 135, .14);
  --chart-play: #2ea77d;
  --chart-online: #4d83e6;
  --chart-shadow: rgba(35, 67, 84, .08);
  --soft-shadow: 0 18px 46px rgba(35, 53, 82, .08);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eaf2f8;
  --muted: #8b9baa;
  --paper: #091016;
  --card: #0e171f;
  --line: rgba(151, 173, 190, .15);
  --blue: #78aefe;
  --blue-dark: #a5c8ff;
  --acid: #72edbd;
  --surface: #0e171f;
  --surface-soft: #111c25;
  --surface-raised: #121e28;
  --chart-card: #0c151c;
  --chart-grid: rgba(151, 181, 198, .10);
  --chart-play: #68e0ad;
  --chart-online: #74a9ff;
  --chart-shadow: rgba(55, 223, 165, .16);
  --soft-shadow: 0 22px 60px rgba(0, 0, 0, .30);
}
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 20% -10%, rgba(60, 151, 121, .09), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(69, 115, 173, .08), transparent 28rem),
    var(--paper);
  color: var(--ink);
}

/* theme switch */
.topbarUtilities { display: flex; align-items: center; gap: 10px; }
.themeToggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.themeToggle:hover { color: var(--ink); border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); box-shadow: 0 7px 20px rgba(35, 53, 82, .08); }
.themeToggle:active { transform: translateY(1px); }
.themeToggleIcon { position: relative; width: 15px; height: 15px; flex: none; }
.themeToggleIcon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  box-shadow: -4px -3px 0 -3px currentColor, 4px -3px 0 -3px currentColor, -4px 3px 0 -3px currentColor, 4px 3px 0 -3px currentColor;
  transition: transform .28s ease, box-shadow .28s ease, background .28s ease;
}
html[data-theme="dark"] .themeToggleIcon::before {
  inset: 1px 3px 3px 1px;
  border-color: var(--acid);
  background: var(--acid);
  box-shadow: 4px -2px 0 0 var(--surface);
  transform: rotate(-18deg);
}
.loginThemeToggle { position: fixed; right: 28px; top: 28px; z-index: 10; min-height: 40px; }

/* shared surfaces */
html[data-theme="dark"] .brandMark { background: #14232c; color: var(--acid); border: 1px solid rgba(114, 237, 189, .22); }
html[data-theme="dark"] .topbar { border-color: var(--line); }
html[data-theme="dark"] .topbarAction { border-color: #223442; background: #17242e; color: #eaf2f8; }
html[data-theme="dark"] .topbarAction:hover { border-color: #315c61; background: #17343a; }
html[data-theme="dark"] .topbarAction.secondary { background: transparent; color: #c9d6df; }
html[data-theme="dark"] .topbarAction.download { border-color: rgba(120,174,254,.35); background: rgba(86,132,202,.20); color: #bad4ff; }
html[data-theme="dark"] .logoutButton { border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .themeToggle { background: #101a22; color: #9fb1bf; }
html[data-theme="dark"] .themeToggle:hover { color: #edf6fc; border-color: rgba(114, 237, 189, .30); box-shadow: 0 8px 26px rgba(0,0,0,.24); }

html[data-theme="dark"] .hero::before,
html[data-theme="dark"] .loginShell::before { opacity: .5; }
html[data-theme="dark"] h1 em::after { opacity: .65; }
html[data-theme="dark"] .searchForm,
html[data-theme="dark"] .loginForm {
  border-color: var(--line);
  background: rgba(14, 23, 31, .92);
  box-shadow: var(--soft-shadow);
}
html[data-theme="dark"] .inputRow,
html[data-theme="dark"] .loginInputRow,
html[data-theme="dark"] .toolbar input,
html[data-theme="dark"] .segmented {
  background: #0b141b;
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] input::placeholder { color: #5f7281; }
html[data-theme="dark"] .historyItems button { background: rgba(16, 27, 36, .78); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .historyItems button:hover { background: #12212b; border-color: rgba(120,174,254,.38); }
html[data-theme="dark"] .statusPanel { background: rgba(75, 124, 181, .10); border: 1px solid rgba(105, 157, 218, .17); color: #b7d3f7; }
html[data-theme="dark"] .statusPanel p { color: var(--muted); }
html[data-theme="dark"] .resultStatus { background: rgba(75, 124, 181, .10); border-color: rgba(105, 157, 218, .17); color: #b7d3f7; }
html[data-theme="dark"] .resultError { background: rgba(178, 67, 67, .14); border-color: rgba(222, 100, 100, .20); color: #ffc0bb; }
html[data-theme="dark"] .resultWarning { background: rgba(183, 133, 49, .10); border-color: rgba(225, 173, 82, .18); color: #e8c987; }
html[data-theme="dark"] .dataBadge { background: rgba(69, 175, 125, .12); color: #83d7ad; }
html[data-theme="dark"] .overviewGrid > div {
  background: linear-gradient(145deg, rgba(18, 31, 41, .96), rgba(12, 22, 30, .96));
  border-color: var(--line);
  box-shadow: 0 12px 34px rgba(0,0,0,.12);
}
html[data-theme="dark"] .toolbar { background: rgba(14, 23, 31, .92); border-color: var(--line); }
html[data-theme="dark"] .segmented { background: #0b141b; }
html[data-theme="dark"] .segmented button { color: #8497a7; }
html[data-theme="dark"] .segmented button:hover { background: #14212b; color: #dce8ef; }
html[data-theme="dark"] .segmented button.active { background: #1a2a36; color: #dbe9f3; box-shadow: inset 0 0 0 1px rgba(120,174,254,.16); }
html[data-theme="dark"] .videoCard,
html[data-theme="dark"] .videoList,
html[data-theme="dark"] .videoRow { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .videoCard:hover { border-color: rgba(111, 154, 184, .28); box-shadow: 0 16px 38px rgba(0,0,0,.20); }
html[data-theme="dark"] .coverLink { background: #0b1218; }
html[data-theme="dark"] .metrics b { color: #6f8494; }
html[data-theme="dark"] .onlineButton { background: #101a22; border-color: var(--line); color: #d8e4ec; }
html[data-theme="dark"] .onlineButton:hover { background: #13222b; border-color: rgba(120,174,254,.30); color: #aecaef; }
html[data-theme="dark"] .onlineButton.hasValue { background: rgba(67, 172, 123, .10); border-color: rgba(90, 205, 150, .20); color: #8fd9b4; }
html[data-theme="dark"] .onlineButton.hasValue i { background: #69d5a1; }
html[data-theme="dark"] .loadControls .showAll { background: #101a22; color: #a6b4bf; border-color: var(--line); }
html[data-theme="dark"] .emptyState { background: #0e171f; border: 1px solid var(--line); color: var(--muted); }
html[data-theme="dark"] footer { border-color: var(--line); }
html[data-theme="dark"] .loginShell { background: transparent; }

/* scheduler and trend entry */
.scheduleBar {
  background: var(--surface-soft);
  border-color: var(--line);
  box-shadow: 0 10px 32px var(--chart-shadow);
}
.scheduleBar p { color: var(--muted); }
.scheduleBar button, .trendButton {
  border-color: var(--line);
  background: var(--surface);
  color: var(--blue);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.scheduleBar button:hover, .trendButton:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: var(--surface-raised);
  box-shadow: 0 8px 24px var(--chart-shadow);
}

/* refined trend modal */
#trend-dialog {
  width: min(980px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0,0,0,.22);
}
#trend-dialog::backdrop { background: rgba(4, 13, 19, .68); backdrop-filter: blur(4px); }
.trendHeader { align-items: flex-start; }
.trendHeader h2 { color: var(--ink); margin: 0; }
.trendHeader p, #trend-content > p { color: var(--muted); }
.trendHeader button {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.trendHeader button:hover { color: var(--ink); background: var(--surface-raised); transform: translateY(-1px); }
#trend-dialog > label { color: var(--muted); font-size: 12px; font-weight: 650; }
#trend-range { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }
.trendChart {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: 18px 18px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 28% 58%, color-mix(in srgb, var(--trend-color, var(--chart-play)) 10%, transparent), transparent 36%),
    linear-gradient(155deg, color-mix(in srgb, var(--surface-raised) 96%, transparent), var(--chart-card));
  box-shadow: 0 14px 38px var(--chart-shadow);
  isolation: isolate;
}
.trendChart::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.035), transparent 28%, transparent 72%, rgba(255,255,255,.02));
  z-index: -1;
}
.trendChart[data-chart="plays"] { --trend-color: var(--chart-play); }
.trendChart[data-chart="online_total"] { --trend-color: var(--chart-online); }
.trendChart h3 { margin: 0 0 4px; align-items: baseline; font-size: 14px; font-weight: 650; color: var(--muted); }
.trendChart h3 span { color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.trendChart svg { display: block; width: 100%; height: auto; overflow: visible; }
.trendChart text { font-size: 11px; fill: var(--muted); }
.trendGrid { stroke: var(--chart-grid); stroke-width: 1; }
.trendArea { opacity: 0; animation: trendAreaIn .65s .16s ease forwards; }
.trendLine {
  fill: none;
  stroke: var(--trend-color);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--trend-color) 42%, transparent));
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: trendDraw .92s cubic-bezier(.22,.74,.25,1) forwards;
}
.trendPoint {
  fill: var(--surface-raised);
  stroke: var(--trend-color);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  animation: trendDotIn .32s .66s ease forwards;
  transition: r .16s ease, filter .16s ease;
}
.trendPoint:hover { r: 5.2; filter: drop-shadow(0 0 5px var(--trend-color)); }
.trendLatest { fill: var(--trend-color); opacity: 0; animation: trendDotIn .32s .72s ease forwards; filter: drop-shadow(0 0 6px var(--trend-color)); }
@keyframes trendDraw { to { stroke-dashoffset: 0; } }
@keyframes trendAreaIn { from { opacity: 0; transform: translateY(5px); } to { opacity: .92; transform: translateY(0); } }
@keyframes trendDotIn { from { opacity: 0; transform: scale(.65); transform-origin: center; } to { opacity: 1; transform: scale(1); } }
.trendTable { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.trendTable th, .trendTable td { border-color: var(--line); color: var(--muted); }
.trendTable th { color: var(--ink); font-weight: 650; }
#trend-content details { margin-top: 16px; color: var(--muted); }
#trend-content summary { cursor: pointer; color: var(--blue); }

html[data-theme="dark"] .scheduleBar { background: linear-gradient(145deg, #101b23, #0d171e); }
html[data-theme="dark"] #trend-dialog { background: #0b131a; }
html[data-theme="dark"] .trendChart { box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 18px 42px rgba(0,0,0,.20); }
html[data-theme="dark"] .trendTable { background: #0e171f; }

@media (max-width: 620px) {
  .topbarUtilities { gap: 6px; }
  .themeToggle { min-height: 40px; padding: 0 9px; }
  .themeToggleText { display: none; }
  .loginThemeToggle .themeToggleText { display: inline; }
  .loginThemeToggle { right: 16px; top: 18px; }
  #trend-dialog { padding: 16px; border-radius: 16px; }
  .trendChart { padding: 14px 10px 7px; border-radius: 13px; }
  .trendChart h3 span { font-size: 17px; }
}
.trendGradientStart { stop-color: var(--trend-color); stop-opacity: .34; }
.trendGradientMid { stop-color: var(--trend-color); stop-opacity: .10; }
.trendGradientEnd { stop-color: var(--trend-color); stop-opacity: 0; }

/* v1.1 — 精简结果页首屏：保留数据与采集逻辑，只隐藏低频概览区 UI */
#results > .dashboardHeading,
#results > .overviewGrid,
#results > .refreshNotice,
#results > .scheduleBar {
  display: none !important;
}

/* 隐藏概览后让筛选工具条自然贴近结果区顶部 */
#results > .toolbar {
  margin-top: 0;
}


/* v1.2 — 趋势弹框：单屏紧凑布局、在线人数优先、无外层滚动条 */
#trend-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 20px 24px 18px;
  border-radius: 18px;
}
#trend-dialog[open] {
  display: flex;
  flex-direction: column;
}
.trendHeader {
  flex: none;
  gap: 16px;
  margin-bottom: 6px;
}
.trendHeader h2 {
  max-width: min(860px, 76vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.35;
}
.trendHeader p {
  margin: 5px 0 0;
  font-size: 11px;
}
#trend-dialog > label {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 4px;
}
#trend-range {
  margin: 0;
  padding: 6px 28px 6px 9px;
}
#trend-content {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
}
.trendChart {
  margin-top: 10px;
  padding: 12px 16px 7px;
  border-radius: 14px;
  box-shadow: 0 10px 28px var(--chart-shadow);
}
.trendChart h3 {
  margin-bottom: 0;
  font-size: 12px;
}
.trendChart h3 span {
  font-size: 17px;
}
.trendChart svg {
  width: 100%;
  max-height: min(22.5vh, 210px);
}
.trendChart text { font-size: 10px; }
.trendLine { stroke-width: 2.7; }
.trendFooterMeta {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.trendFooterMeta > span { min-width: 0; }
.trendFooterMeta details { margin: 0 !important; flex: none; }
.trendFooterMeta summary {
  list-style: none;
  white-space: nowrap;
}
.trendFooterMeta summary::-webkit-details-marker { display: none; }
/* 展开原始记录时改为弹框内覆盖层，不推高两张图，也不会让 dialog 自己出现滚动条 */
.trendFooterMeta details[open] {
  position: absolute;
  inset: 0;
  z-index: 20;
  padding: 42px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.trendFooterMeta details[open] > summary {
  position: absolute;
  top: 12px;
  right: 16px;
}
.trendFooterMeta details[open] > summary::after { content: " 关闭 ×"; }
.trendFooterMeta details[open] .trendTable {
  height: 100%;
  max-height: none;
  overflow: auto;
  margin: 0;
}

@media (max-height: 760px) and (min-width: 621px) {
  #trend-dialog { padding-top: 14px; padding-bottom: 12px; }
  .trendHeader p { display: none; }
  .trendChart { margin-top: 7px; padding-top: 9px; }
  .trendChart svg { max-height: 20.5vh; }
  .trendFooterMeta { min-height: 24px; margin-top: 4px; }
}
@media (max-width: 620px) {
  #trend-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 13px 12px 10px;
  }
  .trendHeader h2 { max-width: calc(100vw - 118px); font-size: 15px; }
  .trendHeader p { display: none; }
  .trendChart { margin-top: 7px; padding: 9px 8px 4px; }
  .trendChart svg { max-height: 21vh; }
  .trendChart h3 span { font-size: 15px; }
  .trendFooterMeta > span { display: none; }
  .trendFooterMeta { justify-content: flex-end; min-height: 24px; margin-top: 3px; }
}

/* ================================================================
   v1.3 trend-axis + card cover trend preview
   ================================================================ */
.trendXAxisTick { stroke: var(--chart-grid); stroke-width: 1; opacity: .68; }

.coverLink { position: relative; isolation: isolate; }
.coverLink img { transition: transform .35s ease, filter .35s ease, opacity .35s ease; }
.duration { z-index: 3; }
.coverLink::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(5, 12, 18, .10), rgba(5, 12, 18, .62) 56%, rgba(5, 12, 18, .90));
  transition: opacity .26s ease;
}
.coverTrendPreview {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 14px 14px 10px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .24s ease, transform .24s ease;
  color: var(--chart-online);
}
.coverTrendPreviewInner {
  width: 100%;
  padding: 10px 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(141, 181, 220, .18);
  background: linear-gradient(180deg, rgba(12, 21, 29, .18), rgba(12, 21, 29, .62));
  box-shadow: 0 12px 28px rgba(0,0,0,.20);
  backdrop-filter: blur(6px);
}
.coverTrendPreviewHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
}
.coverTrendPreviewHead span {
  color: rgba(228, 238, 245, .76);
  letter-spacing: .02em;
}
.coverTrendPreviewHead strong {
  color: #f4fbff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.coverTrendPreview svg { display: block; width: 100%; height: auto; overflow: visible; }
.coverSparkGrid { stroke: rgba(255,255,255,.13); stroke-width: 1; }
.coverSparkArea { opacity: .94; }
.coverSparkLine {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 45%, transparent));
}
.coverSparkPoint { fill: #112130; stroke: currentColor; stroke-width: 2; }
.coverSparkLatest { fill: currentColor; filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 60%, transparent)); }
.coverSparkLabel { font-size: 9px; fill: rgba(226, 237, 245, .76); }
.coverLink.preview-ready:hover::after,
.coverLink.preview-active::after { opacity: 1; }
.coverLink.preview-ready:hover .coverTrendPreview,
.coverLink.preview-active .coverTrendPreview { opacity: 1; transform: translateY(0); }
.coverLink.preview-ready:hover img,
.coverLink.preview-active img {
  opacity: .23;
  transform: scale(1.03);
  filter: saturate(.7) brightness(.72) blur(.2px);
}
html[data-theme="light"] .coverLink::after {
  background: linear-gradient(180deg, rgba(9, 17, 25, .06), rgba(9, 17, 25, .52) 56%, rgba(9, 17, 25, .78));
}
html[data-theme="light"] .coverTrendPreviewInner {
  border-color: rgba(132, 161, 190, .24);
  background: linear-gradient(180deg, rgba(12, 20, 29, .08), rgba(12, 20, 29, .62));
}
html[data-theme="dark"] .coverTrendPreviewInner {
  border-color: rgba(141, 181, 220, .16);
  background: linear-gradient(180deg, rgba(7, 14, 20, .18), rgba(7, 14, 20, .64));
}

/* v1.4: adaptive value labels on trend nodes */
.trendValueLabel {
  fill: var(--ink) !important;
  font-size: 10px !important;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--chart-card);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: .88;
}
html[data-theme="dark"] .trendValueLabel {
  fill: #dce9f2 !important;
  stroke: #0c151c;
}

/* ================================================================
   v1.5 online-focus chart + compact card layout
   ================================================================ */
#trend-close {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}
#trend-floating-tooltip {
  position: fixed;
  z-index: 9999;
  min-width: 132px;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 17, 24, .92);
  color: #eaf4fb;
  box-shadow: 0 18px 36px rgba(0,0,0,.24);
  pointer-events: none;
  backdrop-filter: blur(8px);
}
#trend-floating-tooltip strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}
#trend-floating-tooltip span {
  display: block;
  font-size: 11px;
  color: #a9bdcb;
}
.trendTooltipPoint { cursor: pointer; }

.cardMedia { position: relative; }
.cardMedia .coverLink { display: block; }
.coverQuickActions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  gap: 8px;
}
.coverIconButton {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(10, 17, 24, .72);
  color: #f5fbff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.coverIconButton:hover { transform: translateY(-1px); }
.coverIconButton:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.coverIconButton.isActive {
  border-color: rgba(114, 237, 189, .34);
  color: var(--acid);
  background: rgba(15, 39, 34, .82);
}
.coverIconButton span { font-size: 16px; line-height: 1; }
.compactCardControl { margin-top: 14px; }
.primaryActionRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.primaryActionRow > .trendButton,
.primaryActionRow > .onlineButton {
  width: auto;
  margin: 0;
  min-height: 42px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  justify-content: center;
}
.primaryActionRow > .onlineButton i { margin-right: 6px; }
.coverTrendInline {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--chart-online) 5%, var(--card)), var(--card));
  color: var(--chart-online);
}
.coverTrendInlineInner {
  border: 1px solid color-mix(in srgb, var(--chart-online) 22%, var(--line));
  border-radius: 12px;
  padding: 10px 10px 7px;
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.coverTrendInlineHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.coverTrendInlineHead span {
  font-size: 11px;
  color: var(--muted);
}
.coverTrendInlineHead strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.coverTrendInline svg { display: block; width: 100%; height: auto; overflow: visible; }
.coverSparkGrid { stroke: color-mix(in srgb, var(--muted) 30%, transparent); stroke-width: 1; }
.coverSparkArea { opacity: .94; }
.coverSparkLine {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 40%, transparent));
}
.coverSparkPoint { fill: var(--card); stroke: currentColor; stroke-width: 2; }
.coverSparkLatest { fill: currentColor; filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 60%, transparent)); }
.coverSparkValue {
  fill: var(--ink);
  font-size: 9px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.coverSparkLabel { font-size: 9px; fill: var(--muted); }
.coverTrendEmpty {
  padding: 12px 4px 4px;
  font-size: 12px;
  color: var(--muted);
}
html[data-theme="dark"] .coverTrendInline {
  background: linear-gradient(180deg, rgba(18, 33, 46, .96), rgba(12, 21, 29, .96));
}
html[data-theme="dark"] .coverTrendInlineInner {
  background: rgba(10, 19, 27, .9);
}
html[data-theme="dark"] .coverIconButton {
  border-color: rgba(255,255,255,.14);
  background: rgba(8, 14, 20, .72);
}
html[data-theme="dark"] .coverSparkValue { stroke: #0e171f; }

@media (max-width: 620px) {
  .coverQuickActions { top: 8px; right: 8px; }
  .coverIconButton { width: 32px; height: 32px; }
  .primaryActionRow { gap: 8px; }
  .primaryActionRow > .trendButton,
  .primaryActionRow > .onlineButton { min-height: 40px; font-size: 12px; }
  .coverTrendInline { padding: 8px 10px 10px; }
}

/* ================================================================
   v1.6: 24h trend backend support + denser card body
   ================================================================ */
.videoGrid .videoCard .cardBody {
  min-height: 0;
  padding: 16px 18px 18px;
}
.videoGrid .videoCard .cardBody h3 {
  min-height: 0;
  margin: 7px 0 14px;
}
.videoGrid .videoCard .metrics {
  margin-top: 0;
  padding-top: 12px;
}
.videoGrid .videoCard .compactCardControl {
  margin-top: 14px;
}

/* ================================================================
   v1.7 live online button + automatic trend refresh
   ================================================================ */
.primaryActionRow > .onlineButton {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
}
.onlineButtonLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.onlineRefreshGlyph {
  flex: none;
  display: inline-block;
  font-size: 17px;
  line-height: 1;
  opacity: .78;
  transition: transform .2s ease, opacity .2s ease;
}
.primaryActionRow > .onlineButton:not(:disabled):hover .onlineRefreshGlyph {
  transform: rotate(24deg);
  opacity: 1;
}
.primaryActionRow > .onlineButton.hasValue:disabled {
  opacity: 1;
  color: #78b69a;
  cursor: default;
}
.primaryActionRow > .onlineButton.hasValue:disabled .onlineRefreshGlyph { opacity: .42; }
html[data-theme="dark"] .primaryActionRow > .onlineButton.hasValue:disabled {
  color: #7eb99e;
  background: rgba(67, 172, 123, .09);
}

/* ================================================================
   v1.8 — ECharts interactive trend chart
   ================================================================ */
.trendChartEcharts {
  margin-top: 12px;
  padding: 14px 16px 10px;
  overflow: hidden;
}
.trendChartTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
}
.trendChartTop > div { min-width: 0; }
.trendChartTop h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.trendChartTop p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  opacity: .82;
}
.trendChartTop > span {
  flex: none;
  color: var(--ink);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.025em;
}
.trendEchart {
  width: 100%;
  height: clamp(380px, 52vh, 540px);
  margin-top: 2px;
  cursor: crosshair;
  touch-action: none;
}
.trendLoading,
.trendLibraryError {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: var(--muted);
  font-size: 13px;
}
.trendLibraryError { color: #cf6d64; }
.echartsTooltip {
  display: grid;
  gap: 3px;
  white-space: nowrap;
}
.echartsTooltip strong {
  color: inherit;
  font-size: 14px;
  font-weight: 750;
}
.echartsTooltip span {
  color: var(--muted);
  font-size: 11px;
}

/* 主图只剩一张后，弹框可以把更多纵向空间给图表 */
#trend-dialog {
  width: min(1180px, calc(100vw - 28px));
}
#trend-content {
  overflow: visible;
}
.trendFooterMeta {
  margin-top: 6px;
}

@media (max-height: 800px) and (min-width: 621px) {
  .trendEchart { height: clamp(330px, 47vh, 410px); }
  .trendChartTop p { display: none; }
}
@media (max-width: 620px) {
  .trendChartEcharts { padding: 11px 8px 8px; }
  .trendChartTop { padding: 0 4px; }
  .trendChartTop > span { font-size: 17px; }
  .trendChartTop p { display: none; }
  .trendEchart { height: clamp(320px, 48vh, 430px); }
}

/* v1.10 mobile trend tap reliability */
.trendButton,
.primaryActionRow > .trendButton,
.primaryActionRow > .onlineButton {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.primaryActionRow > .trendButton {
  position: relative;
  z-index: 1;
}

/* ================================================================
   v1.12 — always show peak online value
   ================================================================ */
.trendChartStats {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 22px;
}
.trendChartStats > span {
  display: grid;
  gap: 2px;
  text-align: right;
}
.trendChartStats small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.trendChartStats strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.trendChartStats .peak strong { color: var(--chart-online); }

.coverTrendInlineStats {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.coverTrendInlineStats > span {
  display: grid;
  gap: 1px;
  text-align: right;
}
.coverTrendInlineStats small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.1;
}
.coverTrendInlineStats strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.coverTrendInlineStats > span:first-child strong { color: var(--chart-online); }
.coverSparkPeak {
  fill: var(--chart-online);
  stroke: var(--card);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--chart-online) 62%, transparent));
}
.coverSparkPeakLabel {
  fill: var(--ink);
  font-size: 9px;
  font-weight: 800;
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 4px;
  stroke-linejoin: round;
}
html[data-theme="dark"] .coverSparkPeakLabel { stroke: #0e171f; }

@media (max-width: 620px) {
  .trendChartStats { gap: 12px; }
  .trendChartStats strong { font-size: 16px; }
  .trendChartStats small { font-size: 9px; }
  .coverTrendInlineStats { gap: 7px; }
  .coverTrendInlineStats strong { font-size: 10px; }
}

/* ================================================================
   v1.13 — unified max/latest positions
   Rule: MAX always left, LATEST always right (large + small charts)
   ================================================================ */
.trendChartStats,
.coverTrendInlineStats {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.trendChartStats {
  margin: 4px 0 2px;
}
.trendChartStats > span,
.coverTrendInlineStats > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.trendChartStats > .peak,
.coverTrendInlineStats > .peak {
  text-align: left;
  margin-right: auto;
}
.trendChartStats > .latest,
.coverTrendInlineStats > .latest {
  text-align: right;
  margin-left: auto;
}
.trendChartStats .peak strong,
.coverTrendInlineStats .peak strong {
  color: var(--chart-online);
}
.coverTrendInlineStats {
  margin: 4px 0 2px;
}
.coverTrendInlineHead {
  display: block;
  margin-bottom: 0;
}
.coverTrendInlineHead > span {
  display: block;
}
@media (max-width: 620px) {
  .trendChartStats,
  .coverTrendInlineStats { gap: 10px; }
}

/* ================================================================
   v1.14 instant trend paint: cached/fallback chart before ECharts/API
   ================================================================ */
.trendEchartFallback {
  display: block;
  color: var(--chart-online);
  overflow: hidden;
}
.trendFallbackSvg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  color: var(--chart-online);
}
.trendFallbackGrid line {
  stroke: var(--line);
  stroke-width: 1;
}
.trendFallbackGrid text,
.trendFallbackTicks text {
  fill: var(--muted);
  font-size: 12px;
}
.trendFallbackArea {
  fill: url(#trend-fallback-fill);
}
.trendFallbackLine {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 36%, transparent));
}
.trendFallbackDots circle {
  fill: var(--chart-card);
  stroke: currentColor;
  stroke-width: 2.5;
}
.trendLoadingSkeleton {
  position: relative;
  min-height: clamp(380px, 52vh, 540px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--chart-card);
}
.trendLoadingSkeleton > span {
  position: absolute;
  left: 7%;
  right: 4%;
  height: 1px;
  background: var(--line);
}
.trendLoadingSkeleton > span:nth-child(1) { top: 26%; }
.trendLoadingSkeleton > span:nth-child(2) { top: 50%; }
.trendLoadingSkeleton > span:nth-child(3) { top: 74%; }
.trendLoadingSkeleton::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 5%;
  top: 44%;
  height: 22%;
  border-top: 3px solid color-mix(in srgb, var(--chart-online) 55%, transparent);
  border-radius: 50%;
  opacity: .35;
  animation: trendSkeletonPulse 1.1s ease-in-out infinite alternate;
}
.trendLoadingSkeleton em {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: 34px;
  font-style: normal;
}
@keyframes trendSkeletonPulse {
  from { opacity: .18; transform: translateY(3px); }
  to { opacity: .46; transform: translateY(-2px); }
}
@media (max-width: 620px) {
  .trendLoadingSkeleton { min-height: clamp(320px, 48vh, 430px); }
}

/* ================================================================
   v1.15 — fallback chart must occupy the exact ECharts viewport
   Fix old .trendChart svg max-height rules squeezing the instant SVG.
   ================================================================ */
.trendChartEcharts .trendEchart.trendEchartFallback {
  height: clamp(380px, 52vh, 540px);
  min-height: 380px;
}
.trendChartEcharts .trendEchart.trendEchartFallback > .trendFallbackSvg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}
@media (max-height: 800px) and (min-width: 621px) {
  .trendChartEcharts .trendEchart.trendEchartFallback {
    height: clamp(330px, 47vh, 410px);
    min-height: 330px;
  }
}
@media (max-width: 620px) {
  .trendChartEcharts .trendEchart.trendEchartFallback {
    height: clamp(320px, 48vh, 430px);
    min-height: 320px;
  }
}
