:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #101828;
  --muted: #667085;
  --border: #e4e7ec;
  --primary: #2563eb;
  --primary-weak: #eff6ff;
  --dark: #171717;
  --success: #039855;
  --warning: #dc6803;
  --danger: #d92d20;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
code { color: #1d4ed8; background: #eff6ff; border-radius: 0.35rem; padding: 0.1rem 0.35rem; }

.app-shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.74);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1.25rem; }
.brand-mark { width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; display: grid; place-items: center; color: white; background: #171717; font-weight: 800; }
.brand strong { display: block; font-size: 1rem; }
.brand span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.1rem; }
.nav-list { display: grid; gap: 0.2rem; }
.nav-item { text-decoration: none; color: #344054; border-radius: 0.5rem; padding: 0.58rem 0.7rem; transition: background .18s ease, color .18s ease; }
.nav-item:hover, .nav-item.active { background: var(--primary-weak); color: #1d4ed8; }
.sidebar-note { margin-top: 1rem; padding: 0.75rem; border-radius: 0.5rem; background: #f8fafc; color: var(--muted); font-size: 0.78rem; line-height: 1.45; border: 1px solid var(--border); }
.sidebar-note p { margin: 0; }
.dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--success); margin-right: 0.35rem; }

.content { padding: 1.25rem; max-width: 100rem; width: 100%; min-width: 0; }
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) 26rem; gap: 1rem; align-items: start; margin-bottom: 0.75rem; }
.eyebrow { margin: 0 0 0.25rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0; color: var(--primary); text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.35rem; font-size: 2.05rem; line-height: 1.1; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: 0; }
h3 { font-size: 0.95rem; margin-bottom: 0.45rem; }
.muted, .hint { color: var(--muted); }
.hint { margin: 0.45rem 0 0; font-size: 0.8rem; }

.panel, .stat-card, .token-card {
  background: var(--panel);
  border: 1px solid rgba(228, 231, 236, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.token-card { padding: 0.8rem; }
.token-card label, .form-panel label, .result-panel label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.35rem; color: #344054; }
.token-row { display: flex; gap: 0.5rem; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.62rem 0.75rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { resize: vertical; min-height: 4.25rem; }
input:focus, textarea:focus, select:focus { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11); }

.btn, .copy-btn {
  min-height: 2.45rem;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.56rem 0.85rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.btn:hover, .copy-btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-dark { background: var(--dark); color: white; }
.btn-primary { background: var(--primary); color: white; }
.btn-soft, .copy-btn { background: var(--primary-weak); color: #1d4ed8; }
.btn-ghost { background: #f8fafc; color: #344054; border: 1px solid var(--border); }

.stats-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 0.65rem; }
.stat-card { padding: 0.8rem; }
.stat-card span { color: #1d4ed8; font-weight: 900; font-size: 0.8rem; }
.stat-card strong { display: block; margin: 0.25rem 0; font-size: 1rem; }
.stat-card p { color: var(--muted); margin: 0; font-size: 0.8rem; line-height: 1.4; }

.panel { padding: 1rem; margin-bottom: 0.7rem; min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.7rem; }
.panel-header.compact { margin-bottom: 0.65rem; }
.endpoint-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.endpoint-card { border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem; background: #fff; min-width: 0; }
.endpoint-card h3, .endpoint-card code { overflow-wrap: anywhere; word-break: break-word; }
.endpoint-card p { margin-bottom: 0.65rem; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.endpoint-card .copy-btn { min-height: 2.2rem; font-size: 0.76rem; }

.query-layout { display: grid; grid-template-columns: minmax(20rem, 0.85fr) minmax(0, 1.15fr); gap: 0.7rem; align-items: stretch; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.7rem; }
.music-config-layout { display: grid; grid-template-columns: minmax(17rem, 0.68fr) minmax(0, 2fr); gap: 0.9rem; align-items: start; }
.music-source-column { min-width: 0; }
.music-settings-column { min-width: 0; padding-left: 0.9rem; border-left: 1px solid var(--border); }
.parameter-group + .parameter-group { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.parameter-group-header { display: grid; grid-template-columns: minmax(7rem, 0.3fr) minmax(0, 1fr); gap: 0.65rem; align-items: baseline; margin-bottom: 0.55rem; }
.parameter-group-header h3, .parameter-group-header p { margin: 0; }
.parameter-group-header h3 { font-size: 0.92rem; }
.parameter-group-header p { color: var(--muted); font-size: 0.76rem; line-height: 1.4; }
.parameter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.parameter-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.parameter-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-block { display: flex; min-width: 0; flex-direction: column; }
.field-block input, .field-block select { min-height: 2.5rem; }
.field-help { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.input-scope-note { display: grid; gap: 0.2rem; margin-top: 0.55rem; padding: 0.6rem 0.7rem; border-left: 3px solid #12b76a; background: #f0fdf4; color: #166534; font-size: 0.74rem; line-height: 1.4; }
.input-scope-note strong { color: #14532d; }
.discovery-query-grid { display: grid; grid-template-columns: repeat(3, minmax(9rem, 1fr)) minmax(13rem, 1.25fr); gap: 0.8rem; align-items: end; }
.checkbox-field { min-height: 2.5rem; display: flex !important; align-items: center; gap: 0.55rem; margin: 0 !important; padding: 0.5rem 0; }
.checkbox-field input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; accent-color: var(--primary); }
.inline-checkbox { min-height: 2.75rem; padding: 0.55rem 0.25rem; }
.inline-checkbox span { display: grid; gap: 0.15rem; }
.inline-checkbox small { color: var(--muted); font-size: 0.74rem; font-weight: 500; line-height: 1.4; }
.music-input-field textarea { min-height: 9rem; flex: 1; }
.music-runbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.music-runbar .action-row { flex: 0 0 auto; margin-top: 0; }
.run-options { display: grid; grid-template-columns: repeat(2, minmax(13rem, 1fr)); gap: 0.6rem 0.8rem; }
.run-note { max-width: 42rem; margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.45; }
.music-result-space { margin: 0.7rem 0; }
.kugou-query-bar { display: grid; grid-template-columns: repeat(2, minmax(10rem, 1fr)) repeat(2, minmax(7rem, 0.55fr)) auto; gap: 0.65rem; align-items: end; }
.kugou-query-bar .btn { min-width: 8.5rem; }
.kugou-fixed-setting { min-height: 2.5rem; display: flex; flex-direction: column; justify-content: center; padding: 0.48rem 0.7rem; border: 1px solid var(--border); border-radius: 0.5rem; background: #f8fafc; }
.kugou-fixed-setting span { color: var(--muted); font-size: 0.7rem; }
.kugou-fixed-setting strong { margin-top: 0.1rem; font-size: 0.84rem; }
.kugou-history-results { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.kugou-snapshot-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.7rem; }
.kugou-snapshot-toolbar h3 { margin: 0; }
.kugou-snapshot-select { width: min(25rem, 100%); }
.kugou-snapshot-meta { margin-bottom: 0.7rem; }
.kugou-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 0.5rem; }
.kugou-table { width: 100%; border-collapse: collapse; background: #fff; table-layout: fixed; }
.kugou-table th, .kugou-table td { padding: 0.58rem 0.7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.kugou-table th { background: #f8fafc; color: #475467; font-size: 0.72rem; }
.kugou-table th:nth-child(1), .kugou-table td:nth-child(1) { width: 4.5rem; text-align: center; }
.kugou-table th:nth-child(2), .kugou-table td:nth-child(2) { width: 38%; }
.kugou-table th:nth-child(4), .kugou-table td:nth-child(4), .kugou-table th:nth-child(5), .kugou-table td:nth-child(5) { width: 5rem; text-align: center; }
.kugou-table tbody tr:last-child td { border-bottom: 0; }
.kugou-table tbody tr:hover { background: #f8fafc; }
.kugou-rank { color: #1d4ed8; font-variant-numeric: tabular-nums; }
.kugou-song-cell { display: grid; grid-template-columns: 2.35rem minmax(0, 1fr); gap: 0.6rem; align-items: center; min-width: 0; }
.kugou-song-cell img, .kugou-cover-placeholder { width: 2.35rem; height: 2.35rem; border-radius: 0.35rem; object-fit: cover; background: #e4e7ec; }
.kugou-song-cell strong, .kugou-song-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kugou-song-cell strong { font-size: 0.82rem; }
.kugou-song-cell small { min-height: 1rem; margin-top: 0.12rem; color: var(--muted); font-size: 0.68rem; }
.section-divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.related-results, .search-results, .standalone-search-results { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.music-results-workspace { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.workspace-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.7rem; }
.workspace-header h3 { margin-bottom: 0; font-size: 1.12rem; }
.result-view-tabs { display: inline-grid; grid-template-columns: repeat(4, minmax(7.5rem, 1fr)); padding: 0.2rem; border: 1px solid var(--border); border-radius: 0.5rem; background: #f8fafc; }
.result-view-tab { min-height: 2.35rem; border: 0; border-radius: 0.35rem; padding: 0.45rem 0.65rem; background: transparent; color: #475467; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.result-view-tab span { display: inline-flex; min-width: 1.5rem; justify-content: center; margin-left: 0.3rem; padding: 0.08rem 0.35rem; border-radius: 999px; background: #e4e7ec; color: #344054; font-size: 0.72rem; }
.result-view-tab:hover:not(:disabled) { color: #1d4ed8; }
.result-view-tab:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.2); outline-offset: 1px; }
.result-view-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1); }
.result-view-tab.active span { background: #dbeafe; color: #1d4ed8; }
.result-view-tab:disabled { opacity: 0.45; cursor: not-allowed; }
.result-view-panel { min-width: 0; padding-top: 0.25rem; }
.result-list-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.result-list-header h3 { margin-bottom: 0; font-size: 1.1rem; }
.result-count { flex: 0 0 auto; border-radius: 999px; padding: 0.4rem 0.7rem; background: #ecfdf3; color: #027a48; font-size: 0.8rem; font-weight: 800; }
.result-count.warning { background: #fffaeb; color: #b54708; }
.related-results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.related-results-toolbar .summary-line { margin: 0; }
.merged-related-results { margin-top: 0; padding-top: 0; border-top: 0; }
.segmented-control { display: inline-grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 0 0 auto; padding: 0.2rem; border: 1px solid var(--border); border-radius: 0.5rem; background: #f8fafc; }
.segment-button { min-height: 2.5rem; border: 0; border-radius: 0.35rem; padding: 0.55rem 0.75rem; background: transparent; color: #475467; font-size: 0.8rem; font-weight: 800; white-space: nowrap; }
.segment-button:hover { color: #1d4ed8; }
.segment-button:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.2); outline-offset: 1px; }
.segment-button.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1); }
.segment-button span { display: inline-flex; min-width: 1.35rem; justify-content: center; margin-left: 0.25rem; padding: 0.05rem 0.3rem; border-radius: 999px; background: #e4e7ec; color: #344054; font-size: 0.68rem; }
.segment-button.active span { background: #dbeafe; color: #1d4ed8; }
.search-relevance-controls { grid-template-columns: repeat(3, minmax(6.5rem, 1fr)); }
.count-note { margin: 0.85rem 0 0; padding: 0.65rem 0.75rem; border-left: 3px solid #12b76a; background: #ecfdf3; color: #027a48; line-height: 1.5; }
.count-note.warning { border-left-color: #f79009; background: #fffaeb; color: #b54708; }
.music-batch-list { display: grid; gap: 1.5rem; }
.music-batch-group { padding-top: 0.25rem; }
.music-batch-group + .music-batch-group, .music-batch-errors { padding-top: 1.5rem; border-top: 1px solid var(--border); }
.music-batch-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.music-batch-title { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.music-batch-title h3, .music-batch-title p { margin-bottom: 0.2rem; overflow-wrap: anywhere; }
.batch-music-cover { width: 3.5rem; height: 3.5rem; flex: 0 0 auto; object-fit: cover; border-radius: 0.5rem; background: #eef2ff; }
.music-batch-group > .video-grid { margin-top: 0.85rem; }
.music-batch-errors { display: grid; gap: 0.6rem; }
.batch-account-details { margin-top: 0.85rem; }
.batch-account-details summary, .batch-search-details summary { color: #1d4ed8; cursor: pointer; font-weight: 800; }
.batch-search-details, .batch-related-details, .batch-alias-details { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.batch-related-details summary, .batch-alias-details summary { color: #1d4ed8; cursor: pointer; font-weight: 800; }
.batch-search-details > .video-grid, .batch-search-details > .empty-state, .batch-related-details > .video-grid, .batch-related-details > .empty-state { margin-top: 0.85rem; }
.batch-alias-list { display: grid; gap: 0.55rem; margin-top: 0.85rem; }
.batch-alias-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.7rem; border: 1px solid var(--border); border-radius: 0.5rem; background: #fff; }
.batch-alias-row strong, .batch-alias-row span { display: block; overflow-wrap: anywhere; }
.batch-alias-row span { margin-top: 0.2rem; color: var(--muted); font-size: 0.75rem; }
.batch-alias-row .btn { min-height: 2.35rem; font-size: 0.76rem; }
.batch-error { display: grid; grid-template-columns: minmax(8rem, 0.4fr) minmax(0, 1fr); gap: 0.75rem; padding: 0.75rem; border: 1px solid #fecdca; border-radius: 0.5rem; background: #fef3f2; color: #b42318; }
.batch-error strong, .batch-error span { overflow-wrap: anywhere; }
.account-toolbar { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 0.28fr); gap: 0.75rem; align-items: end; margin-bottom: 0.85rem; }
.account-toolbar label { font-size: 0.76rem; }
.account-explorer { display: grid; grid-template-columns: minmax(18rem, 0.68fr) minmax(0, 1.55fr); min-height: 31rem; overflow: hidden; border: 1px solid var(--border); border-radius: 0.5rem; background: #fff; }
.account-list { max-height: 48rem; overflow-y: auto; border-right: 1px solid var(--border); background: #f8fafc; }
.account-row { width: 100%; min-height: 5.25rem; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0.7rem; align-items: center; border: 0; border-bottom: 1px solid var(--border); padding: 0.75rem; text-align: left; background: transparent; color: var(--text); }
.account-row:hover { background: #f1f5f9; }
.account-row:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(37, 99, 235, 0.2); outline-offset: -3px; }
.account-row.active { background: #eff6ff; box-shadow: inset 3px 0 0 var(--primary); }
.account-row img, .account-row-avatar { width: 2.5rem; height: 2.5rem; border-radius: 0.4rem; object-fit: cover; background: #e4e7ec; }
.account-row-main { min-width: 0; }
.account-row-title { display: flex; align-items: baseline; justify-content: space-between; gap: 0.55rem; }
.account-row-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row-title span { flex: 0 0 auto; color: #1d4ed8; font-size: 0.74rem; font-weight: 800; }
.account-row-id { display: block; margin-top: 0.18rem; overflow: hidden; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.account-row-metrics { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; margin-top: 0.4rem; color: #475467; font-size: 0.72rem; }
.account-detail { min-width: 0; padding: 1rem; }
.account-detail-header { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; gap: 0.8rem; align-items: center; margin-bottom: 0.85rem; }
.account-detail-header img, .account-detail-avatar { width: 3.25rem; height: 3.25rem; border-radius: 0.5rem; object-fit: cover; background: #e4e7ec; }
.account-detail-header h4 { margin: 0 0 0.2rem; font-size: 1rem; overflow-wrap: anywhere; }
.account-detail-header p { margin: 0; color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.account-detail .metric-row { margin-bottom: 0.9rem; }
.account-video-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin: 1rem 0 0.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.account-video-heading h4, .account-video-heading p { margin: 0; }
.account-video-heading p { color: var(--muted); font-size: 0.78rem; }
.account-video-grid { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.skeleton-card { min-height: 18rem; border-color: transparent; background: linear-gradient(90deg, #f2f4f7 25%, #e4e7ec 37%, #f2f4f7 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; }
@keyframes skeleton-loading { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.rank-label { display: inline-flex; align-items: center; min-height: 1.7rem; padding: 0.2rem 0.5rem; border-radius: 999px; background: #171717; color: #fff; font-size: 0.75rem; font-weight: 800; margin-bottom: 0.65rem; }
.rank-label.viral { background: #b42318; }
.rank-label.keyword-related { background: #b54708; }
.rank-label.alias { background: #027a48; }
.action-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.status-pill { border-radius: 999px; padding: 0.35rem 0.65rem; font-size: 0.78rem; font-weight: 800; }
.status-pill.idle { background: #f2f4f7; color: #667085; }
.status-pill.loading { background: #eff6ff; color: #1d4ed8; }
.status-pill.ok { background: #ecfdf3; color: #027a48; }
.status-pill.warning { background: #fffaeb; color: #b54708; }
.status-pill.error { background: #fef3f2; color: #b42318; }
.empty-state { color: var(--muted); border: 1px dashed #cbd5e1; border-radius: 0.5rem; padding: 0.75rem; line-height: 1.45; }
.profile-card { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.profile-card.no-avatar { grid-template-columns: minmax(0, 1fr); }
.profile-card p, .video-body h3 { overflow-wrap: anywhere; }
.coverage-note { color: #b54708; background: #fffaeb; border-left: 3px solid #f79009; padding: 0.65rem 0.75rem; margin-bottom: 0; line-height: 1.55; }
.graph-breakdown { margin: 0.85rem 0 0; }
.account-results { margin: 0.8rem 0; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.account-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 0.5rem; background: #fff; }
.account-table { width: 100%; min-width: 74rem; border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.account-table th, .account-table td { padding: 0.7rem 0.75rem; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.account-table th { position: sticky; top: 0; color: #475467; background: #f8fafc; font-size: 0.75rem; }
.account-table th:first-child, .account-table td:first-child { position: sticky; left: 0; z-index: 1; min-width: 15rem; text-align: left; background: #fff; }
.account-table th:first-child { z-index: 2; background: #f8fafc; }
.account-table tbody tr:last-child td { border-bottom: 0; }
.account-table tbody tr:hover td { background: #f9fafb; }
.account-identity { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: center; gap: 0.65rem; min-width: 0; }
.account-identity img, .account-avatar-placeholder { width: 2.25rem; height: 2.25rem; border-radius: 0.4rem; object-fit: cover; background: #eef2ff; }
.account-identity strong, .account-identity span { display: block; max-width: 13rem; overflow: hidden; text-overflow: ellipsis; }
.account-identity span { margin-top: 0.15rem; color: var(--muted); font-size: 0.74rem; }
.account-links { display: flex; align-items: center; gap: 0.65rem; }
.account-links a, .video-author a { color: #1d4ed8; text-decoration: none; font-weight: 700; }
.account-links a:hover, .video-author a:hover { text-decoration: underline; }
.video-author { margin: -0.15rem 0 0.5rem; color: var(--muted); font-size: 0.8rem; }
.video-author-row { display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: 0.5rem; align-items: center; margin: -0.1rem 0 0.65rem; }
.video-author-row img, .video-author-avatar { width: 1.9rem; height: 1.9rem; border-radius: 0.35rem; object-fit: cover; background: #e4e7ec; }
.video-author-row a, .video-author-row strong { display: block; overflow: hidden; color: #1d4ed8; font-size: 0.8rem; font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.video-author-row span { display: block; margin-top: 0.08rem; overflow: hidden; color: var(--muted); font-size: 0.69rem; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 4.5rem; height: 4.5rem; border-radius: 0.5rem; object-fit: cover; background: #eef2ff; }
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; margin-top: 0.7rem; }
.metric-row-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-row-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric { background: #f8fafc; border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.6rem; }
.metric span { color: var(--muted); font-size: 0.78rem; }
.metric strong { display: block; margin-top: 0.25rem; }
.summary-line { color: var(--muted); margin-bottom: 0.55rem; }
.metrics-detail { margin-top: 1rem; overflow-wrap: anywhere; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.65rem; }
.video-card { border: 1px solid var(--border); border-radius: 0.5rem; overflow: hidden; background: #fff; min-width: 0; }
.cover { aspect-ratio: 16 / 10; background: #eef2ff; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-body { padding: 0.7rem; }
.video-body h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5rem; }
.video-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; }
.video-meta span { font-size: 0.78rem; color: #344054; background: #f8fafc; border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.45rem; }
.video-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0.5rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.video-stat { min-width: 0; padding: 0.42rem 0.3rem; text-align: center; }
.video-stat:nth-child(even) { border-left: 1px solid var(--border); }
.video-stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
.video-stat span, .video-stat strong { display: block; }
.video-stat span { color: var(--muted); font-size: 0.68rem; }
.video-stat strong { margin-top: 0.15rem; color: #1f2937; font-size: 0.78rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.video-source-row { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.45rem; align-items: start; margin: 0 0 0.4rem; }
.source-channel { display: inline-flex; align-items: center; min-height: 1.45rem; padding: 0.15rem 0.4rem; border: 1px solid #b2ccff; border-radius: 0.35rem; background: #eff4ff; color: #1849a9; font-size: 0.68rem; font-weight: 800; white-space: nowrap; }
.source-channel.alias { border-color: #a6f4c5; background: #ecfdf3; color: #027a48; }
.video-source-row a, .video-source-row strong { display: -webkit-box; overflow: hidden; color: #344054; font-size: 0.75rem; font-weight: 700; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.video-source-row a:hover { color: #1d4ed8; text-decoration: underline; }
.video-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; margin-top: 0.55rem; }
.video-card-actions .btn:only-child { grid-column: 1 / -1; }
.video-card-actions .btn { width: 100%; min-height: 2.35rem; padding: 0.55rem 0.65rem; font-size: 0.76rem; }
.result-pager { display: grid; grid-template-columns: auto minmax(7rem, 1fr) auto; gap: 0.55rem; align-items: center; width: min(28rem, 100%); margin: 0.8rem auto 0; }
.result-pager .btn { min-width: 6rem; }
.result-page-info { color: var(--muted); font-size: 0.78rem; font-weight: 800; text-align: center; }
.search-metrics { margin: 0 0 0.85rem; }
.id-line { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; overflow-wrap: anywhere; }
.audio-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 0.75rem; padding: 0.7rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.audio-metrics span { color: var(--muted); font-size: 0.75rem; min-width: 0; overflow-wrap: anywhere; }
.audio-metrics strong { color: var(--text); display: block; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.music-alias-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.85rem; }
.music-alias-card { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 0.5rem; background: #fff; }
.music-alias-card.target { border-left: 3px solid var(--primary); }
.music-alias-card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.music-alias-card-header .rank-label { margin-bottom: 0; }
.alias-score { color: var(--muted); font-size: 0.74rem; font-weight: 700; }
.music-alias-card h3 { margin: 0.8rem 0 0.25rem; overflow-wrap: anywhere; }
.music-alias-card .muted { margin-bottom: 0.55rem; }
.alias-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0.75rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.alias-metric-grid span { min-width: 0; padding: 0.65rem 0.25rem; color: var(--muted); font-size: 0.7rem; text-align: center; }
.alias-metric-grid span + span { border-left: 1px solid var(--border); }
.alias-metric-grid strong { display: block; margin-top: 0.2rem; overflow: hidden; color: var(--text); font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.alias-sample { display: -webkit-box; margin: 0.75rem 0 0; overflow: hidden; color: #475467; font-size: 0.78rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.raw-panel pre { max-height: 32rem; overflow: auto; margin: 0; padding: 1rem; background: #0b1220; color: #d1e7ff; border-radius: 0.5rem; font-size: 0.82rem; line-height: 1.55; }
.toast { position: fixed; right: 1rem; bottom: 1rem; padding: 0.85rem 1rem; border-radius: 0.5rem; background: #111827; color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(0.8rem); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .music-config-layout { grid-template-columns: 1fr; }
  .music-settings-column { padding-left: 0; padding-top: 0.75rem; border-left: 0; border-top: 1px solid var(--border); }
  .music-input-field textarea { min-height: 6.5rem; }
  .music-runbar { align-items: stretch; flex-direction: column; }
  .kugou-query-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kugou-query-bar .btn { width: 100%; }
}

@media (max-width: 980px) {
  .app-shell { width: 100%; max-width: 100%; grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    height: auto;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand { flex: 0 0 auto; margin: 0; }
  .brand-mark { width: 2.25rem; height: 2.25rem; }
  .brand span { display: none; }
  .nav-list { display: flex; flex: 1 1 0; min-width: 0; gap: 0.15rem; overflow-x: auto; scrollbar-width: thin; }
  .nav-item { flex: 0 0 auto; padding: 0.48rem 0.62rem; font-size: 0.82rem; white-space: nowrap; }
  .sidebar-note { display: none; }
  .content { max-width: 100%; padding: 0.75rem; }
  .topbar, .query-layout, .endpoint-grid { grid-template-columns: 1fr; }
  .topbar { gap: 0.65rem; margin-bottom: 0.65rem; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  h1 { font-size: 1.75rem; }
  .field-grid, .discovery-query-grid { grid-template-columns: 1fr; }
  .parameter-grid, .parameter-grid-two, .parameter-grid-four { grid-template-columns: 1fr; }
  .parameter-group-header { grid-template-columns: 1fr; gap: 0.25rem; }
  .music-input-field textarea { min-height: 5.75rem; }
  .profile-card { grid-template-columns: 1fr; align-items: start; }
  .avatar { width: 3.5rem; height: 3.5rem; }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-row-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-row-six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audio-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-results-toolbar { align-items: stretch; flex-direction: column; }
  .segmented-control { width: 100%; }
  .workspace-header { align-items: stretch; flex-direction: column; }
  .result-view-tabs { width: 100%; }
  .account-explorer { grid-template-columns: 1fr; }
  .account-list { max-height: 24rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .music-batch-header { align-items: flex-start; flex-direction: column; }
  .batch-alias-row { grid-template-columns: 1fr; }
  .batch-alias-row .btn { width: 100%; }
  .batch-error { grid-template-columns: 1fr; }
  .kugou-snapshot-toolbar { align-items: stretch; flex-direction: column; }
  .kugou-snapshot-select { width: 100%; }
}

.docs-body { min-height: 100vh; padding: 2rem; }
.docs-main { max-width: 68rem; margin: 0 auto; }
.docs-hero { margin-top: 1rem; }
.docs-table { width: 100%; border-collapse: collapse; margin: 1rem 0; overflow: hidden; border-radius: 0.5rem; }
.docs-table th, .docs-table td { text-align: left; border-bottom: 1px solid var(--border); padding: 0.8rem; background: #fff; }
.docs-table th { background: #f8fafc; color: #344054; }
.docs-list { color: var(--muted); line-height: 1.8; }
.docs-main pre { overflow: auto; padding: 1rem; border-radius: 0.5rem; background: #0b1220; color: #d1e7ff; }
.docs-main pre code { background: transparent; color: inherit; padding: 0; }

@media (max-width: 640px) {
  section[id] { scroll-margin-top: 4rem; }
  .sidebar { gap: 0.55rem; padding: 0.45rem 0.6rem; }
  .brand { gap: 0.45rem; }
  .brand-mark { width: 2rem; height: 2rem; font-size: 0.85rem; }
  .brand strong { font-size: 0.86rem; white-space: nowrap; }
  .nav-item { padding: 0.42rem 0.55rem; font-size: 0.78rem; }
  .content { padding: 0.6rem; }
  .topbar { gap: 0.55rem; }
  .topbar > div:first-child .muted { margin-bottom: 0; font-size: 0.78rem; line-height: 1.4; }
  h1 { margin-bottom: 0.25rem; font-size: 1.5rem; }
  h2 { font-size: 1.05rem; }
  .token-card { padding: 0.65rem; }
  .token-card .hint { font-size: 0.72rem; }
  .token-row { gap: 0.4rem; }
  .token-row .btn { flex: 0 0 auto; padding-inline: 0.7rem; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; margin-bottom: 0.5rem; }
  .stat-card { min-height: 4.4rem; padding: 0.55rem; }
  .stat-card span { font-size: 0.68rem; }
  .stat-card strong { margin: 0.18rem 0 0; font-size: 0.84rem; line-height: 1.3; }
  .stat-card p { display: none; }
  .panel { padding: 0.75rem; margin-bottom: 0.55rem; }
  .panel-header { gap: 0.5rem; margin-bottom: 0.55rem; }
  .panel-header .btn { min-height: 2.2rem; padding: 0.45rem 0.65rem; font-size: 0.76rem; }
  .endpoint-grid {
    display: grid;
    grid-auto-columns: minmax(15rem, 82%);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
  }
  .endpoint-card { padding: 0.65rem; scroll-snap-align: start; }
  .endpoint-card h3 { display: -webkit-box; min-height: 2.35rem; overflow: hidden; font-size: 0.82rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .endpoint-card p { display: -webkit-box; min-height: 2.25rem; overflow: hidden; font-size: 0.74rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-panel > .action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-panel > .action-row .btn { min-width: 0; padding-inline: 0.55rem; font-size: 0.76rem; }
  .parameter-grid, .parameter-grid-two, .parameter-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parameter-group-header p { display: none; }
  .parameter-grid .field-help { display: none; }
  .music-settings-column { padding-top: 0.6rem; }
  .music-input-field textarea { min-height: 5rem; }
  .input-scope-note { padding: 0.5rem 0.6rem; font-size: 0.7rem; }
  .music-runbar { gap: 0.45rem; margin-top: 0.6rem; padding-top: 0.6rem; }
  .music-runbar > .action-row { display: grid; grid-template-columns: 1fr; margin-top: 0; }
  .music-runbar > .action-row .btn { width: 100%; }
  .run-options, .account-toolbar { grid-template-columns: 1fr; }
  .result-view-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-view-tab { min-width: 0; white-space: normal; }
  .account-detail-header { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .account-detail-header img, .account-detail-avatar { width: 2.75rem; height: 2.75rem; }
  .account-detail-header .btn { grid-column: 1 / -1; width: 100%; }
  .segmented-control { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .segment-button { min-width: 0; padding-inline: 0.35rem; white-space: normal; }
  .result-list-header { align-items: center; gap: 0.5rem; }
  .result-list-header h3 { font-size: 0.95rem; }
  .result-count { max-width: 45%; padding: 0.32rem 0.5rem; font-size: 0.72rem; white-space: nowrap; }
  .metric-row { gap: 0.4rem; }
  .metric { padding: 0.5rem; }
  .video-card { display: grid; grid-template-columns: 7.25rem minmax(0, 1fr); align-items: stretch; }
  .video-card.no-cover { grid-template-columns: 1fr; }
  .cover { min-height: 12rem; height: 100%; aspect-ratio: auto; }
  .video-body { padding: 0.6rem; }
  .video-body h3 { min-height: 2.25rem; font-size: 0.88rem; }
  .rank-label { max-width: 100%; margin-bottom: 0.45rem; font-size: 0.68rem; line-height: 1.35; }
  .video-card-actions .btn { min-height: 2.2rem; padding: 0.45rem 0.35rem; font-size: 0.7rem; }
  .account-video-grid { grid-template-columns: 1fr; }
  .kugou-query-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kugou-query-bar .btn { grid-column: 1 / -1; }
  .kugou-snapshot-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kugou-table-wrap { overflow: visible; border: 0; }
  .kugou-table, .kugou-table tbody { display: block; }
  .kugou-table thead { display: none; }
  .kugou-table tr { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: 0.25rem 0.55rem; align-items: center; padding: 0.55rem; border: 1px solid var(--border); border-radius: 0.5rem; background: #fff; }
  .kugou-table tr + tr { margin-top: 0.45rem; }
  .kugou-table td { display: block; width: auto !important; padding: 0 !important; border: 0; text-align: left !important; }
  .kugou-table td:nth-child(1) { grid-row: 1 / 3; align-self: stretch; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--border); }
  .kugou-table td:nth-child(2) { grid-column: 2 / 4; }
  .kugou-table td:nth-child(3) { grid-column: 2; color: #475467; font-size: 0.74rem; }
  .kugou-table td:nth-child(4), .kugou-table td:nth-child(5) { display: none; }
  .kugou-song-cell { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .kugou-song-cell img, .kugou-cover-placeholder { width: 2.2rem; height: 2.2rem; }
  .docs-body { padding: 1rem; }
  .docs-table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skeleton-card { animation: none; }
}
