:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #eef4f6;
  --surface-warm: #fffaf1;
  --line: #dce6ec;
  --line-strong: #c8d8e1;
  --text: #142231;
  --muted: #647386;
  --blue: #255f7d;
  --teal: #208475;
  --green: #2d7f57;
  --amber: #a96718;
  --red: #b23b35;
  --ink: #0f2d3f;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 39, 57, 0.07), 0 12px 30px rgba(15, 39, 57, 0.06);
  --shadow-hover: 0 6px 18px rgba(15, 39, 57, 0.1), 0 16px 42px rgba(15, 39, 57, 0.07);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.app-boot {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 38%, rgba(32, 132, 117, 0.08), transparent 32%),
    rgba(243, 246, 248, 0.96);
}

body.boot-loading .app-boot {
  display: grid;
}

.app-boot-card {
  min-width: min(420px, 90vw);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-boot-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dce6ec;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  flex: 0 0 auto;
}

.app-boot-card strong,
.app-boot-card span {
  display: block;
}

.app-boot-card strong {
  font-size: 15px;
}

.app-boot-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 18px;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 34px rgba(18, 48, 71, 0.12);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: var(--ink);
  color: #f7fbfc;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-block {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 4px 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #e7f5f2;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  border-radius: 6px;
}

.brand-name {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.28;
}

.brand-meta {
  margin-top: 3px;
  color: #b9cdd7;
  font-size: 12px;
}

.nav-tabs {
  display: grid;
  gap: 7px;
}

.nav-tab {
  min-height: 44px;
  border: 0;
  color: #dcebf0;
  background: transparent;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
}

.nav-tab:hover,
.nav-tab.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-tab.active {
  box-shadow: inset 3px 0 0 #7fd3c2;
}

.tab-icon,
.icon-button span,
.primary-button span {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.tab-icon svg,
.icon-button svg,
.primary-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.owner-list {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 12px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.user-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.mini-title {
  color: #b9cdd7;
  font-size: 12px;
  margin-bottom: 2px;
}

.owner-row {
  min-height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.owner-row strong {
  color: #e7f5f2;
  font-weight: 600;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 15px;
}

.subline {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.online-widget {
  position: relative;
}

.online-button {
  gap: 6px;
  min-width: 92px;
}

.online-dot,
.online-user-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
  flex: 0 0 auto;
}

.online-popover {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 38, 56, 0.16);
  overflow: hidden;
}

.online-widget.open .online-popover {
  display: block;
}

.online-popover-head {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.online-users-list {
  display: grid;
  gap: 0;
  max-height: 260px;
  overflow: auto;
}

.online-user-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid #eef2f6;
}

.online-user-row:last-child {
  border-bottom: 0;
}

.online-user-row strong {
  display: block;
  font-size: 13px;
}

.field {
  display: grid;
  gap: 4px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

.field.compact {
  grid-template-columns: auto minmax(128px, 1fr);
  align-items: center;
  gap: 7px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  color: var(--text);
  min-height: 38px;
  padding: 0 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

textarea {
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
}

.file-input-hidden {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-button,
.primary-button,
.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: 0 1px 1px rgba(18, 48, 71, 0.04);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.icon-button {
  width: 38px;
}

.icon-button.small {
  width: 32px;
  height: 32px;
}

.primary-button {
  padding: 0 13px;
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
  box-shadow: 0 8px 18px rgba(31, 128, 111, 0.16);
}

.primary-button.full {
  width: 100%;
}

.secondary-button {
  padding: 0 12px;
  background: var(--surface);
}

.secondary-button.small-inline {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.secondary-button.danger-button {
  border-color: #f0b8b0;
  color: var(--red);
  background: #fff7f6;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(18, 48, 71, 0.1);
}

.primary-button:hover {
  background: #176f61;
  border-color: #176f61;
}

.secondary-button:hover,
.icon-button:hover {
  border-color: #bed0da;
  background: #fbfdfe;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(31, 128, 111, 0.18);
  outline-offset: 1px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-grid.single {
  grid-template-columns: 1fr;
}

.full-span {
  grid-column: 1 / -1;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  box-shadow: var(--shadow);
  min-height: 94px;
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
}

.kpi-value {
  margin-top: 7px;
  font-size: 24px;
  font-weight: 800;
}

.kpi-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.mix-layout {
  grid-template-columns: minmax(360px, 0.85fr) minmax(420px, 1.15fr);
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-head {
  min-height: 52px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfe;
}

.sub-panel-head {
  min-height: 42px;
}

.performance-sections {
  display: grid;
  gap: 14px;
}

.search-field {
  display: inline-grid;
  grid-template-columns: auto minmax(150px, 220px);
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.search-field span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.search-field input {
  min-height: 32px;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.text-link:hover {
  text-decoration: underline;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
  padding: 18px;
  text-align: center;
  font-size: 13px;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  background: var(--surface-soft);
  padding: 3px;
  border-radius: 8px;
}

.segmented-control button {
  border: 0;
  background: transparent;
  min-height: 28px;
  min-width: 54px;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
}

.segmented-control button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(18, 48, 71, 0.1);
}

.table-wrap {
  overflow: auto;
  scrollbar-color: #b8c8d2 #eef3f6;
  scrollbar-width: thin;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 13px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f4f7f9;
  white-space: nowrap;
}

td {
  word-break: break-word;
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover td {
  background: #f8fbfc;
}

.empty-table-cell {
  color: var(--muted);
  text-align: center;
  padding: 24px 12px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px 0;
}

.summary-strip {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.wechat-sync-panel .panel-head {
  align-items: flex-start;
  gap: 14px;
}

.wechat-sync-panel .table-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wechat-sync-panel .primary-button,
.wechat-sync-panel .secondary-button {
  min-width: 112px;
  white-space: nowrap;
}

.wechat-sync-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.wechat-sync-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.wechat-sync-card span,
.wechat-sync-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.wechat-sync-card strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.wechat-sync-progress {
  display: none;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.wechat-sync-progress[aria-hidden="false"] {
  display: block;
}

.wechat-sync-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.wechat-sync-progress-head strong {
  min-width: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-sync-progress-head span {
  color: var(--teal);
  font-weight: 800;
}

.wechat-sync-progress .upload-progress-track {
  margin-bottom: 8px;
}

.wechat-sync-log-wrap {
  border-top: 1px solid var(--line);
  background: #f8fafc;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.wechat-sync-log-wrap.highlight {
  background: #ecfdf5;
  box-shadow: inset 0 0 0 2px rgba(31, 143, 120, 0.24);
}

.wechat-sync-log-title {
  padding: 10px 14px 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.wechat-sync-log {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  background: transparent;
}

.wechat-sync-log div + div {
  margin-top: 3px;
}

.wechat-sync-qr {
  display: none;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.wechat-sync-qr[aria-hidden="false"] {
  display: block;
}

.wechat-sync-qr img {
  width: 180px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wechat-sync-qr-placeholder {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.wechat-sync-qr-placeholder strong {
  color: var(--text);
}

.wechat-login-modal {
  width: min(1180px, calc(100vw - 28px));
}

.wechat-login-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  padding: 14px;
}

.wechat-login-shot {
  position: relative;
  min-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.wechat-login-shot img {
  display: none;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.wechat-login-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.wechat-login-side {
  display: grid;
  align-content: start;
  gap: 10px;
}

.wechat-login-status {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.wechat-login-status span,
.wechat-login-status small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wechat-login-status strong {
  display: block;
  margin: 6px 0;
  font-size: 20px;
  color: var(--text);
}

.summary-item {
  min-width: 124px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
  padding: 10px 11px;
  box-shadow: 0 1px 1px rgba(18, 48, 71, 0.03);
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.summary-item strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
}

.inline-field {
  margin: 0;
}

.inline-field.is-disabled {
  opacity: 0.55;
}

#videoHeatTitleSearch {
  min-width: 260px;
}

.video-heat-picker-field {
  flex: 1 1 300px;
  min-width: 280px;
}

.video-heat-picker-field input {
  width: 100%;
}

.video-heat-trend {
  margin: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.trend-empty {
  padding: 16px 18px;
  color: var(--muted);
  line-height: 1.5;
}

.heat-trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.heat-trend-head strong {
  display: block;
  font-size: 15px;
}

.heat-trend-head span {
  display: block;
  margin-top: 4px;
  max-width: min(760px, 58vw);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-trend-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.heat-trend-head .heat-trend-meta span {
  display: inline-flex;
  margin: 0;
  max-width: none;
  white-space: nowrap;
}

.heat-trend-legend {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.heat-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  max-width: none;
  white-space: nowrap;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.spend {
  background: #4f8ef7;
}

.legend-dot.roi {
  background: var(--teal);
}

.heat-trend-scroll {
  overflow-x: auto;
  padding: 10px 12px 14px;
}

.heat-trend-svg {
  display: block;
  min-width: 760px;
}

.heat-trend-axis,
.heat-trend-grid {
  vector-effect: non-scaling-stroke;
}

.heat-trend-axis {
  stroke: #d8e1e8;
  stroke-width: 1;
}

.heat-trend-grid {
  stroke: #edf2f6;
  stroke-width: 1;
}

.heat-trend-axis-label,
.heat-trend-axis-title,
.heat-trend-x-label {
  fill: var(--muted);
  font-size: 11px;
}

.heat-trend-axis-title {
  font-weight: 700;
}

.heat-trend-axis-title-roi,
.heat-trend-axis-label-roi {
  fill: var(--teal);
}

.heat-trend-spend-bar {
  fill: #4f8ef7;
  opacity: 0.78;
}

.heat-trend-spend-bar:hover {
  opacity: 1;
}

.heat-trend-roi-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.5;
}

.heat-trend-roi-dot {
  fill: var(--teal);
  stroke: #fff;
  stroke-width: 2;
}

.heat-trend-roi-dot:hover {
  fill: #0f6f5d;
}

.heat-trend-node-table {
  min-width: 920px;
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.heat-trend-node-table th,
.heat-trend-node-table td {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}

.video-data-table {
  min-width: 1060px;
}

.video-post-table {
  min-width: 1280px;
}

.video-heat-table {
  min-width: 2080px;
}

.wechat-map-table {
  min-width: 1180px;
}

.video-report-map-table {
  min-width: 1160px;
}

.video-live-ads-table {
  min-width: 2550px;
}

.video-data-table th,
.video-data-table td {
  white-space: nowrap;
}

.video-data-table th:nth-child(2),
.video-data-table td:nth-child(2) {
  min-width: 220px;
  white-space: normal;
}

.video-title-cell {
  width: 280px;
}

.two-line-title {
  max-width: 280px;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.two-line-title [contenteditable="true"] {
  white-space: normal;
  overflow-wrap: anywhere;
}

.video-title-cell .kpi-note {
  margin-top: 4px;
}

.wechat-map-table th:nth-child(1),
.wechat-map-table td:nth-child(1),
.wechat-map-table th:nth-child(2),
.wechat-map-table td:nth-child(2),
.wechat-map-table th:nth-child(3),
.wechat-map-table td:nth-child(3) {
  min-width: 240px;
}

.wechat-map-table .inline-input {
  width: 100%;
  min-width: 220px;
}

.video-live-ads-table th:nth-child(1),
.video-live-ads-table td:nth-child(1) {
  width: 132px;
}

.video-live-ads-table th:nth-child(2),
.video-live-ads-table td:nth-child(2) {
  width: 210px;
}

.video-live-ads-table th:nth-child(4),
.video-live-ads-table td:nth-child(4) {
  width: 300px;
}

.video-live-ads-table th:nth-child(5),
.video-live-ads-table td:nth-child(5),
.video-live-ads-table th:nth-child(6),
.video-live-ads-table td:nth-child(6),
.video-live-ads-table th:nth-child(7),
.video-live-ads-table td:nth-child(7),
.video-live-ads-table th:nth-child(8),
.video-live-ads-table td:nth-child(8),
.video-live-ads-table th:nth-child(9),
.video-live-ads-table td:nth-child(9),
.video-live-ads-table th:nth-child(10),
.video-live-ads-table td:nth-child(10),
.video-live-ads-table th:nth-child(11),
.video-live-ads-table td:nth-child(11),
.video-live-ads-table th:nth-child(12),
.video-live-ads-table td:nth-child(12),
.video-live-ads-table th:nth-child(13),
.video-live-ads-table td:nth-child(13),
.video-live-ads-table th:nth-child(14),
.video-live-ads-table td:nth-child(14),
.video-live-ads-table th:nth-child(15),
.video-live-ads-table td:nth-child(15),
.video-live-ads-table th:nth-child(16),
.video-live-ads-table td:nth-child(16),
.video-live-ads-table th:nth-child(17),
.video-live-ads-table td:nth-child(17),
.video-live-ads-table th:nth-child(18),
.video-live-ads-table td:nth-child(18) {
  min-width: 112px;
}

.video-report-cover {
  background: linear-gradient(135deg, #123047 0%, #245d7a 55%, #1f8f78 100%);
}

.wide-table-wrap {
  max-width: 100%;
}

.wide-data-table {
  width: max-content;
  table-layout: fixed;
}

.wide-data-table th,
.wide-data-table td {
  min-width: 96px;
}

.wide-data-table th:first-child,
.wide-data-table td:first-child {
  width: 52px;
  min-width: 52px;
}

.wide-data-table th:nth-child(2),
.wide-data-table td:nth-child(2),
.wide-data-table th:nth-child(9),
.wide-data-table td:nth-child(9),
.wide-data-table th:nth-child(10),
.wide-data-table td:nth-child(10),
.dy-collab-table th:nth-child(11),
.dy-collab-table td:nth-child(11),
.dy-collab-table th:nth-child(12),
.dy-collab-table td:nth-child(12) {
  width: 112px;
  min-width: 112px;
}

.wide-data-table th:nth-child(3),
.wide-data-table td:nth-child(3),
.wide-data-table th:nth-child(8),
.wide-data-table td:nth-child(8),
.dy-collab-table th:nth-child(10),
.dy-collab-table td:nth-child(10) {
  width: 150px;
  min-width: 150px;
}

.wide-data-table th:nth-child(4),
.wide-data-table td:nth-child(4) {
  width: 220px;
  min-width: 220px;
}

.wide-data-table th:nth-child(5),
.wide-data-table td:nth-child(5) {
  width: 160px;
  min-width: 160px;
}

.wide-data-table th:nth-child(6),
.wide-data-table td:nth-child(6),
.dy-collab-table th:nth-child(7),
.dy-collab-table td:nth-child(7),
.dy-collab-table th:nth-child(16),
.dy-collab-table td:nth-child(16),
.dy-collab-table th:nth-child(17),
.dy-collab-table td:nth-child(17) {
  width: 138px;
  min-width: 138px;
}

.wide-data-table th:nth-child(7),
.wide-data-table td:nth-child(7),
.dy-collab-table th:nth-child(9),
.dy-collab-table td:nth-child(9),
.dy-collab-table th:nth-child(14),
.dy-collab-table td:nth-child(14) {
  width: 124px;
  min-width: 124px;
}

.xhs-collab-table {
  min-width: 2020px;
}

.dy-collab-table {
  min-width: 2180px;
}

.xhs-collab-table th:nth-child(11),
.xhs-collab-table td:nth-child(11),
.xhs-collab-table th:nth-child(12),
.xhs-collab-table td:nth-child(12),
.xhs-collab-table th:nth-child(13),
.xhs-collab-table td:nth-child(13),
.xhs-collab-table th:nth-child(14),
.xhs-collab-table td:nth-child(14),
.xhs-collab-table th:nth-child(15),
.xhs-collab-table td:nth-child(15),
.xhs-collab-table th:nth-child(16),
.xhs-collab-table td:nth-child(16),
.dy-collab-table th:nth-child(8),
.dy-collab-table td:nth-child(8),
.dy-collab-table th:nth-child(13),
.dy-collab-table td:nth-child(13),
.dy-collab-table th:nth-child(15),
.dy-collab-table td:nth-child(15) {
  width: 110px;
  min-width: 110px;
}

.wide-data-table th:last-child,
.wide-data-table td:last-child {
  width: 92px;
  min-width: 92px;
}

[contenteditable="true"],
.inline-select,
.inline-input {
  border: 1px solid transparent;
  border-radius: 5px;
  min-height: 28px;
  padding: 4px 6px;
  background: #f8fafb;
}

[contenteditable="true"]:focus,
.inline-select:focus,
.inline-input:focus {
  outline: 2px solid rgba(31, 122, 109, 0.22);
  border-color: rgba(31, 122, 109, 0.4);
  background: #ffffff;
}

.inline-select,
.inline-input {
  width: 100%;
}

.material-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.platform-input {
  width: auto;
  min-width: 92px;
  max-width: 150px;
  min-height: 26px;
  padding: 2px 6px;
}

.progress-track {
  height: 8px;
  background: #e7edf0;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
}

.status-pill,
.rating-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e8eef2;
  color: var(--blue);
  white-space: nowrap;
}

button.rating-badge,
.rating-filter {
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.rating-filter {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef4f6;
  color: var(--muted);
  white-space: nowrap;
}

button.rating-badge.active,
.rating-filter.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(31, 122, 109, 0.12);
}

.status-pill.positive {
  background: #e7f5ef;
  color: var(--green);
}

.status-pill.warning {
  background: #fff4df;
  color: var(--amber);
}

.status-pill.danger {
  background: #fbe9e7;
  color: var(--red);
}

.stack-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.stack-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfd;
}

.stack-title {
  font-weight: 800;
  font-size: 13px;
}

.stack-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.45;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px;
}

.insight {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px;
  background: #fbfcfd;
  min-height: 86px;
}

.insight span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.insight strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.35;
}

.table-actions,
.legend-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.switch input {
  min-height: 16px;
  width: 16px;
  padding: 0;
}

.rating-badge.s {
  background: #e7f5ef;
  color: var(--green);
}

.rating-badge.a {
  background: #e7f1f7;
  color: var(--blue);
}

.rating-badge.b {
  background: #fff4df;
  color: var(--amber);
}

.rating-badge.c {
  background: #fbe9e7;
  color: var(--red);
}

.rating-badge.pending {
  background: #e8eef2;
  color: var(--muted);
}

.material-grid {
  padding: 12px 12px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 10px;
}

#materialPager, #mixPager, #xhsCollabPager, #dyCollabPager, #videoPostPager, #videoHeatPager, #videoLiveAdsPager {
  padding: 0 12px 10px;
}

.grid-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}

.material-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 11px;
  display: grid;
  gap: 8px;
  min-height: 168px;
}

.media-player,
.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #e8eef2;
}

.media-player {
  display: block;
  object-fit: contain;
}

.video-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.detail-video {
  margin-bottom: 2px;
}

.material-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.material-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.material-title-row input,
.ad-id input,
.ad-select-cell input {
  min-height: 16px;
  width: 16px;
  padding: 0;
}

.material-name {
  font-weight: 800;
  font-size: 13px;
}

.material-name [contenteditable="true"] {
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  background: #eef4f6;
  color: var(--muted);
  font-size: 12px;
}

.ad-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.ad-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 11px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.mix-layout .ad-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.mix-layout .ad-select-cell {
  grid-column: 1;
  grid-row: 1;
}

.mix-layout .ad-row-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.mix-layout .ad-row > .table-actions {
  grid-column: 3;
  grid-row: 1;
  justify-content: flex-end;
}

.mix-layout .panel-head {
  align-items: flex-start;
  display: grid;
  grid-template-columns: 1fr;
}

.mix-layout .panel-head .table-actions {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) max-content max-content;
  justify-content: stretch;
  align-items: end;
  width: 100%;
  max-width: 100%;
}

.mix-layout .panel-head .secondary-button {
  min-width: max-content;
  max-width: none;
}

.mix-layout .panel-head .search-field {
  grid-template-columns: auto minmax(180px, 1fr);
  width: 100%;
}

.mix-layout .ad-row > .status-pill {
  grid-column: 2 / -1;
  justify-self: start;
}

.ad-row.active {
  outline: 2px solid rgba(31, 122, 109, 0.28);
}

.ad-id {
  font-weight: 800;
}

.ad-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.detail-pane {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.material-id-editor {
  display: grid;
  gap: 8px;
}

.material-chip-row,
.material-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.material-add-row input {
  min-width: 220px;
  flex: 1;
}

.material-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  overflow: hidden;
}

.chip-link,
.chip-remove {
  border: 0;
  background: transparent;
  min-height: 28px;
  cursor: pointer;
}

.chip-link {
  color: var(--teal);
  font-weight: 700;
  padding: 0 8px;
}

.chip-remove {
  width: 28px;
  color: var(--muted);
  border-left: 1px solid var(--line);
}

.small-link {
  margin-left: 8px;
  font-size: 12px;
}

.material-preview-panel {
  width: min(760px, calc(100vw - 28px));
}

.detail-block {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-block:last-child {
  border-bottom: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
}

.detail-value {
  font-weight: 700;
  line-height: 1.45;
}

.brief-editor {
  width: calc(100% - 24px);
  min-height: 560px;
  margin: 12px;
  border-radius: 6px;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.upload-progress {
  position: fixed;
  right: 18px;
  bottom: 72px;
  width: min(420px, calc(100vw - 36px));
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 14px 36px rgba(16, 36, 52, 0.18);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 160ms ease;
  z-index: 30;
}

.upload-progress.show {
  opacity: 1;
  transform: translateY(0);
}

.upload-progress.error {
  border-color: rgba(195, 67, 67, 0.35);
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.upload-progress-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-head span {
  color: var(--teal);
  font-weight: 800;
}

.upload-progress-meta {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.upload-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef2;
}

.upload-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

.upload-progress.error .upload-progress-fill {
  background: var(--red);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 10px 12px;
  background: #123047;
  color: #ffffff;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: 160ms ease;
  pointer-events: none;
  font-size: 13px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 20;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 48, 71, 0.38);
}

.modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(18, 48, 71, 0.25);
}

.upload-body {
  padding: 14px;
  display: grid;
  gap: 14px;
}

.upload-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.mapping-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.mapping-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  min-width: 0;
}

.mapping-panel h3 {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}

.mapping-rows {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 520px;
  overflow: auto;
}

.mapping-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(160px, 1fr);
  gap: 8px;
  align-items: center;
}

.mapping-row label {
  color: var(--muted);
  font-size: 12px;
}

.preview-box {
  padding: 12px;
  overflow: auto;
  max-height: 560px;
}

.preview-box table {
  min-width: 620px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px;
  }

  .brand-block,
  .owner-list {
    display: none;
  }

  .nav-tabs {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .nav-tab {
    min-width: 124px;
  }

  .topbar,
  .split-layout,
  .mapping-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .panel-head {
    flex-wrap: wrap;
  }

  .search-field {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .insight-grid,
  .material-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 680px) {
  .main {
    padding: 12px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .field.compact {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    grid-column: 1 / -1;
  }

  .upload-controls {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .insight-grid,
  .material-grid {
    grid-template-columns: 1fr;
  }

  .ad-row {
    grid-template-columns: 1fr;
  }
}

/* ─── 千川数据视图 ──────────────────────────────────────────────────── */
.qc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}
.qc-toolbar label {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
}
.qc-toolbar input[type="date"] {
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #111827;
}
.qc-toolbar .btn-secondary {
  padding: 6px 16px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.qc-toolbar .btn-secondary:hover { background: #f3f4f6; }
.qc-toolbar .btn-primary {
  padding: 6px 16px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.qc-toolbar .btn-primary:hover { background: #2563eb; }
.qc-toolbar .btn-sync {
  padding: 6px 16px;
  background: #fff;
  border: 1px solid #8b5cf6;
  color: #8b5cf6;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
  transition: background .15s;
}
.qc-toolbar .btn-sync:hover { background: #f5f3ff; }

.qc-token-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.qc-token-status.ok {
  background: #dcfce7;
  color: #166534;
}

.qc-token-status.warn {
  background: #fef3c7;
  color: #92400e;
}

.qc-token-status.danger {
  background: #fee2e2;
  color: #991b1b;
}

.qc-summary-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #374151;
}
.qc-summary-bar b { color: #1d4ed8; }
.qc-summary-warning {
  color: #b45309;
}
.qc-summary-warning b {
  color: #b45309;
}

.qc-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}
#qcTable {
  width: 100%;
  min-width: 1480px;
  table-layout: fixed;       /* required for overflow:hidden on td to work */
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
#qcTable thead th {
  background: #f9fafb;
  padding: 8px 6px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #374151;
  text-align: center;
  position: sticky;
  top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#qcTable tbody td {
  padding: 7px 6px;
  border-bottom: 1px solid #f3f4f6;
  text-align: center;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* seq column */
#qcTable thead th:first-child,
#qcTable tbody td:first-child { text-align: center; width: 36px; }
/* mat-name is 2nd column — overflow handled by td.mat-name below */
#qcTable thead th:nth-child(2),
#qcTable tbody td:nth-child(2) { text-align: left; }
#qcTable tbody tr:hover { background: #f9fafb; }
#qcTable tbody tr:last-child td { border-bottom: none; }

.roi-good { color: #16a34a; font-weight: 600; }
.roi-ok   { color: #d97706; font-weight: 600; }
.roi-bad  { color: #dc2626; }

/* ─── Tooltip on mat-name cells ────────────────────────────────────── */
#qcTable td.mat-name {
  position: relative;
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
#qcTable td.mat-name .qc-material-jump {
  max-width: 100%;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
#qcTable td.mat-name::after {
  content: attr(data-tip);
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: #1f2937;
  color: #f9fafb;
  font-size: 12px;
  line-height: 1.5;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: normal;
  max-width: 320px;
  min-width: 120px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
#qcTable td.mat-name:hover::after { display: block; }

/* ─── Sortable headers ─────────────────────────────────────────────── */
.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sortable:hover { background: #f3f4f6; }
.th-sorted { color: #245d7a !important; background: #eff6ff !important; }
.sort-arrow { font-size: 10px; opacity: .6; }
.th-seq { width: 36px; text-align: center !important; }
td.td-seq { text-align: center; color: #9ca3af; font-size: 11px; }
.acct-total-row { background: #f8fafc !important; }
.qc-metric-pending {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 1px 5px;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  font-size: 11px;
  line-height: 1.5;
}

/* ─── Pagination ───────────────────────────────────────────────────── */
.qc-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}
.pg-btn {
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: background .15s;
}
.pg-btn:hover:not(:disabled) { background: #f3f4f6; }
.pg-btn.active { background: #245d7a; color: #fff; border-color: #245d7a; font-weight: 600; }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-ellipsis { padding: 0 4px; color: #9ca3af; font-size: 12px; }
.pg-info { margin-left: 8px; font-size: 11px; color: #9ca3af; }


/* ─── 复盘报告视图（全新设计）───────────────────────────────────────── */
.qcr-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100vh - 140px);
  min-height: 500px;
}
.qcr-tabbar {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #e5e7eb;
  background: transparent;
}
.qcr-tab {
  padding: 9px 22px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: all .15s;
}
.qcr-tab:hover { color: #245d7a; background: #f9fafb; }
.qcr-tab.active { color: #245d7a; border-bottom-color: #245d7a; background: #fff; font-weight: 600; }

.qcr-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.qcr-hint { font-size: 12px; color: #6b7280; }

.qcr-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 16px;
}
.qcr-empty {
  text-align: center;
  color: #9ca3af;
  padding: 60px 20px;
  font-size: 14px;
}
.qcr-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px;
  color: #6b7280;
  font-size: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qcr-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid #d1d5db;
  border-top-color: #245d7a;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ─── 报告卡片外壳 ──────────────────────────────────────────────────── */
.qcr-report-card { max-width: 900px; padding: 20px 0 48px; }

/* 封面 header */
.qcr-report-cover {
  border-radius: 14px;
  padding: 26px 28px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.qcr-cover-left { flex: 1; min-width: 0; }
.qcr-cover-right {
  text-align: right;
  flex-shrink: 0;
}
.qcr-cover-roi-v {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -1px;
}
.qcr-cover-roi-l {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  margin-top: 5px;
  letter-spacing: .5px;
}

.qcr-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.2);
  color: #fff;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.qcr-report-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.qcr-report-meta {
  font-size: 11px;
  color: rgba(255,255,255,.6);
}

/* ─── KPI 卡片 ──────────────────────────────────────────────────────── */
.qcr-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 700px) { .qcr-kpi-strip { grid-template-columns: repeat(3, 1fr); } }

.qcr-kpi {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 12px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.qcr-kpi:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
/* colored top bar */
.qcr-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
}
.qcr-kpi--blue::before   { background: linear-gradient(90deg,#3b82f6,#60a5fa); }
.qcr-kpi--orange::before { background: linear-gradient(90deg,#f97316,#fb923c); }
.qcr-kpi--green::before  { background: linear-gradient(90deg,#22c55e,#4ade80); }
.qcr-kpi--purple::before { background: linear-gradient(90deg,#a855f7,#c084fc); }
.qcr-kpi--roi::before    { background: linear-gradient(90deg,#245d7a,#3b92b8); }

.qcr-kpi-icon { display: block; font-size: 18px; margin: 2px 0 6px; line-height: 1; }
.qcr-kpi-v {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}
.qcr-kpi-l {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 5px;
  letter-spacing: .3px;
}

/* ─── Section 容器 ──────────────────────────────────────────────────── */
.qcr-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}
.qcr-section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1f2937;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ─── Top 素材表格 ──────────────────────────────────────────────────── */
.qcr-section-body { padding: 0; }
.qcr-table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.qcr-mat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.qcr-top-mat-table {
  min-width: 1280px;
  table-layout: fixed;
}
.qcr-col-rank { width: 52px; }
.qcr-col-name { width: 210px; }
.qcr-col-cost { width: 190px; }
.qcr-col-metric { width: 110px; }
.qcr-col-wide { width: 132px; }
.qcr-mat-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  font-size: 12px;
}
.qcr-mat-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
}
.qcr-mat-table tbody tr:last-child td { border-bottom: none; }
.qcr-mat-table tbody tr:hover td { background: #f8faff; }
.qcr-rank-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}
.qcr-num-cell {
  min-width: 86px;
  white-space: nowrap;
}
.qcr-cost-cell {
  overflow: hidden;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
}
.rank-badge.rank-1 { background: #fef08a; color: #713f12; }
.rank-badge.rank-2 { background: #e5e7eb; color: #374151; }
.rank-badge.rank-3 { background: #fed7aa; color: #7c2d12; }

.mat-name-cell {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.mat-name-cell[data-tip]:hover {
  overflow: visible;
}

.mat-name-cell[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 1000;
  max-width: 420px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #0f2638;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  box-shadow: 0 12px 28px rgba(15, 38, 56, 0.2);
}

/* 消耗进度条 */
.cost-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.cost-bar-track {
  width: 150px;
  max-width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}
.cost-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width .4s ease;
}
.cost-val {
  display: block;
  max-width: 100%;
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ROI pill 徽标 */
.roi-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}
.roi-pill.roi-good { background: #dcfce7; color: #166534; }
.roi-pill.roi-ok   { background: #fef3c7; color: #92400e; }
.roi-pill.roi-bad  { background: #fee2e2; color: #991b1b; }
.qcr-action-pill {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6f9;
  color: #245d7a;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── AI 分析区域 ───────────────────────────────────────────────────── */
.qcr-ai-body {
  padding: 4px 22px 20px;
  line-height: 1.85;
  color: #374151;
  font-size: 13.5px;
}

/* Markdown 排版 */
.md-h1 { font-size: 18px; font-weight: 700; color: #111827; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #e5e7eb; }
.md-h2 { font-size: 16px; font-weight: 700; color: #1f2937; margin: 24px 0 4px; padding-bottom: 6px; border-bottom: 2px solid #e5e7eb; }

/* h3 → 分节卡片：彩色左侧竖条 */
.md-h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a4c;
  margin: 20px -22px 0;
  padding: 11px 22px 11px 18px;
  background: #f0f7ff;
  border-left: 4px solid #245d7a;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* 轮流配色 */
.md-h3:nth-of-type(2) { background: #f5f3ff; border-left-color: #7c3aed; color: #3b0764; }
.md-h3:nth-of-type(3) { background: #fff7ed; border-left-color: #ea580c; color: #7c2d12; }
.md-h3:nth-of-type(4) { background: #f0fdf4; border-left-color: #16a34a; color: #14532d; }
.md-h3:nth-of-type(5) { background: #faf5ff; border-left-color: #9333ea; color: #581c87; }

.md-h4 { font-size: 13px; font-weight: 600; color: #374151; margin: 10px 0 4px; }
.md-hr { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
.md-p  { margin: 7px 0; line-height: 1.85; }
.md-ul, .md-ol { padding-left: 22px; margin: 8px 0 10px; }
.md-ul li, .md-ol li { margin: 5px 0; line-height: 1.75; }
.md-inline-code { background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: monospace; color: #1f2937; }
.md-code { background: #1e293b; color: #e2e8f0; border-radius: 8px; padding: 14px 18px; font-size: 12px; overflow-x: auto; margin: 12px 0; font-family: monospace; }
.md-table-wrap { overflow-x: auto; margin: 10px 0; }
.md-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table th { background: #f1f5f9; font-weight: 600; color: #374151; padding: 8px 12px; text-align: left; border: 1px solid #e2e8f0; white-space: nowrap; }
.md-table td { padding: 7px 12px; border: 1px solid #e2e8f0; color: #374151; }
.md-table tbody tr:nth-child(even) { background: #f8fafc; }
.md-table tbody tr:hover { background: #eff6ff; }

/* ─── 2026-06 Visual Refresh ───────────────────────────────────────── */
body {
  background:
    linear-gradient(180deg, #f7fafb 0, var(--bg) 240px),
    var(--bg);
}

.app-shell {
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, #123447 0%, #0f2d3f 58%, #15394b 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand-block {
  padding: 8px 8px 18px;
}

.brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: #ecf8f5;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.nav-tabs {
  gap: 5px;
}

.nav-tab {
  min-height: 42px;
  border-radius: var(--radius);
  color: #d8e8ee;
  font-weight: 700;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 3px 0 0 #88d8c9, 0 8px 22px rgba(0, 0, 0, 0.08);
}

.main {
  padding: 22px 26px 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  align-items: center;
  padding: 12px 0 16px;
  margin: -12px 0 18px;
  background: linear-gradient(180deg, rgba(247, 250, 251, 0.98), rgba(247, 250, 251, 0.9));
  backdrop-filter: blur(10px);
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  letter-spacing: 0;
}

.subline,
.panel-subtitle {
  color: #6c7b8c;
}

.toolbar,
.table-actions,
.qc-toolbar,
.qcr-ctrl-bar {
  gap: 9px;
}

input,
select,
textarea {
  min-height: 40px;
  border-color: var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(32, 132, 117, 0.58);
  background: #ffffff;
}

.icon-button,
.primary-button,
.secondary-button,
.btn,
.pg-btn {
  min-height: 40px;
  border-radius: var(--radius);
  font-weight: 800;
}

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(18, 48, 71, 0.04);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn.primary,
.primary-button {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(32, 132, 117, 0.18);
}

.btn.secondary,
.secondary-button,
.icon-button {
  background: #ffffff;
}

.btn:hover,
.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.pg-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(15, 39, 57, 0.11);
}

.btn.primary:hover,
.primary-button:hover {
  background: #176f61;
  border-color: #176f61;
}

.secondary-button.small-inline {
  min-height: 32px;
  padding: 0 11px;
}

.panel,
.kpi,
.login-card,
.modal-panel {
  border-radius: var(--radius);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.panel {
  background: rgba(255, 255, 255, 0.98);
}

.panel:hover,
.kpi:hover,
.material-card:hover,
.ad-row:hover {
  box-shadow: var(--shadow-hover);
}

.panel-head {
  min-height: 58px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.kpi {
  min-height: 112px;
  padding: 17px 18px;
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), #5fae95);
}

.kpi-value {
  font-size: 30px;
  letter-spacing: 0;
}

.summary-strip {
  gap: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdfe);
}

.summary-item,
.wechat-sync-card,
.insight,
.stack-item,
.material-card,
.ad-row,
.mapping-panel,
.wechat-login-status {
  border-radius: var(--radius);
  border-color: var(--line);
  background: #fbfdfe;
}

.summary-item {
  min-width: 148px;
}

.table-wrap,
.qc-table-wrap,
.qcr-table-scroll {
  border-radius: 0 0 var(--radius) var(--radius);
  scrollbar-color: #a9bdc8 #edf3f6;
}

.wide-table-wrap,
.qc-table-wrap,
.qcr-table-scroll {
  overflow-x: auto;
}

table {
  border-spacing: 0;
}

th {
  height: 46px;
  background: #f2f7f9;
  color: #526273;
  font-weight: 800;
}

td {
  height: 48px;
}

tbody tr:nth-child(even) td {
  background: rgba(248, 251, 252, 0.54);
}

tbody tr:hover td {
  background: #eef7f7;
}

.status-pill,
.rating-badge,
.rating-filter {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(36, 93, 122, 0.08);
}

.filter-bar {
  grid-template-columns: repeat(4, minmax(180px, 1fr)) max-content;
  padding: 16px 18px 2px;
}

.segmented-control {
  border: 1px solid #dce7ec;
  background: #edf4f6;
  max-width: 100%;
  overflow-x: auto;
}

.segmented-control button {
  font-weight: 800;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 14px 14px 0;
}

.material-card {
  gap: 10px;
  padding: 13px;
  content-visibility: auto;
  contain-intrinsic-size: 340px;
}

.media-player,
.video-placeholder {
  border-radius: var(--radius);
  background: #0d1d2b;
}

.media-player {
  max-height: 260px;
}

.tag {
  border-radius: var(--radius-sm);
  background: #edf4f6;
  color: #5e7082;
}

.ad-row {
  border-radius: var(--radius);
  background: #fbfdfe;
}

.detail-pane {
  padding: 14px;
}

.online-popover,
.upload-progress,
.toast {
  border-radius: var(--radius);
}

.toast {
  background: #0f2d3f;
  box-shadow: 0 14px 34px rgba(15, 45, 63, 0.22);
}

.modal-backdrop {
  background: rgba(12, 35, 50, 0.45);
  backdrop-filter: blur(2px);
}

.modal-panel > .panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
}

.upload-body,
.wechat-login-body,
.preview-box,
.mapping-rows {
  overflow: auto;
}

.qc-toolbar {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.qc-toolbar label {
  color: var(--muted);
}

.qc-toolbar input[type="date"] {
  min-height: 40px;
  border-color: var(--line);
  color: var(--text);
}

.qc-summary-bar {
  margin: 14px 16px;
  padding: 12px 14px;
  gap: 16px;
  border-color: #cfe3eb;
  background: #eef7fb;
  color: var(--text);
}

.qc-summary-bar b {
  color: var(--blue);
}

.qc-table-wrap {
  margin: 0 16px 14px;
  border-color: var(--line);
}

#qcTable thead th {
  background: #f2f7f9;
  color: #526273;
  font-weight: 800;
}

#qcTable tbody td {
  color: var(--text);
}

#qcTable tbody tr:hover {
  background: transparent;
}

#qcTable tbody tr:hover td {
  background: #eef7f7;
}

.th-sortable:hover {
  background: #e9f2f5 !important;
}

.th-sorted {
  color: var(--ink) !important;
  background: #e7f4f3 !important;
}

.pg-btn {
  min-height: 32px;
  padding: 0 11px;
  border-color: var(--line);
  color: var(--text);
}

.pg-btn.active {
  background: var(--blue);
  border-color: var(--blue);
}

.qc-pagination,
.grid-pager {
  padding: 12px 14px;
}

.qcr-layout {
  height: auto;
  min-height: calc(100vh - 168px);
}

.qcr-tabbar {
  gap: 6px;
  padding: 4px 0 0;
  border-bottom: 1px solid var(--line);
}

.qcr-tab {
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 800;
}

.qcr-tab.active {
  color: var(--ink);
  border-bottom-color: var(--teal);
}

.qcr-ctrl-bar {
  padding: 14px 0;
  border-bottom-color: var(--line);
}

.qcr-content {
  padding-top: 16px;
}

.qcr-report-card {
  max-width: 1180px;
}

.qcr-report-cover,
.qcr-section,
.qcr-kpi {
  border-radius: var(--radius);
}

.qcr-report-cover,
.video-report-cover {
  background: linear-gradient(135deg, #123447 0%, #255f7d 55%, #208475 100%);
}

.qcr-kpi {
  border-color: var(--line);
}

.qcr-kpi:hover {
  box-shadow: var(--shadow-hover);
}

.qcr-section {
  border-color: var(--line);
}

.qcr-section-title {
  background: #f6fafb;
  color: var(--text);
}

.qcr-mat-table th {
  background: #f2f7f9;
  color: #526273;
}

.qcr-mat-table tbody tr:hover td {
  background: #eef7f7;
}

.cost-bar-wrap {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.cost-bar-track {
  width: 100%;
  min-width: 72px;
}

.cost-val {
  min-width: 72px;
  text-align: right;
  overflow: visible;
}

.wechat-sync-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding: 16px 18px;
}

.wechat-sync-log {
  max-height: 220px;
  overflow: auto;
}

.video-heat-trend {
  margin: 0 16px 16px;
  border-radius: var(--radius);
}

.heat-trend-head {
  background: #fbfdfe;
}

.wide-data-table th,
.wide-data-table td,
.video-data-table th,
.video-data-table td {
  padding-left: 14px;
  padding-right: 14px;
}

[contenteditable="true"],
.inline-select,
.inline-input {
  background: #f7fbfc;
}

[contenteditable="true"]:hover,
.inline-select:hover,
.inline-input:hover {
  border-color: var(--line);
}

/* ─── 2026 UI refinement ───────────────────────────────────────────── */
body {
  background:
    linear-gradient(180deg, #f7fafb 0%, #eef3f6 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #102f42 0%, #0d2637 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand-block {
  padding-bottom: 18px;
}

.brand-mark {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.nav-tab {
  color: #cfe2e8;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-tab:hover {
  transform: translateX(1px);
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.18);
}

.main {
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  margin: -24px -24px 18px;
  padding: 22px 24px 16px;
  background: rgba(247, 250, 251, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(206, 220, 228, 0.78);
}

.topbar h1 {
  font-size: 28px;
  letter-spacing: 0;
}

.subline {
  max-width: 620px;
}

.toolbar {
  align-items: stretch;
}

.toolbar .field,
.toolbar .primary-button,
.toolbar .secondary-button,
.toolbar .icon-button,
.online-button {
  box-shadow: 0 1px 1px rgba(18, 48, 71, 0.04), 0 8px 20px rgba(18, 48, 71, 0.05);
}

input,
select,
textarea,
.inline-input,
.inline-select,
[contenteditable="true"] {
  border-color: #d6e3ea;
  background: #fbfdfe;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, #607485 50%), linear-gradient(135deg, #607485 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
  appearance: none;
}

.panel {
  border-color: #d7e4eb;
  box-shadow: 0 1px 2px rgba(15, 39, 57, 0.06), 0 16px 36px rgba(15, 39, 57, 0.055);
}

.panel-head {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
}

.panel-head h2 {
  font-size: 16px;
}

.table-actions {
  row-gap: 10px;
}

.field.compact.inline-field {
  min-height: 38px;
}

.field.compact.inline-field > span {
  font-weight: 700;
}

.summary-strip {
  padding: 12px 16px;
  overflow-x: auto;
}

.summary-item {
  background: #ffffff;
  border: 1px solid #dbe8ee;
  box-shadow: 0 1px 2px rgba(15, 39, 57, 0.04);
}

.table-wrap {
  position: relative;
  background: #ffffff;
}

.video-data-table,
.wide-data-table,
.qcr-mat-table {
  border-collapse: separate;
  border-spacing: 0;
}

.video-data-table thead th,
.wide-data-table thead th,
.qcr-mat-table thead th,
#qcTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef5f8;
  box-shadow: inset 0 -1px 0 #d7e4eb;
}

.video-data-table tbody td,
.wide-data-table tbody td,
#qcTable tbody td {
  border-top-color: #e8eff3;
}

.video-data-table tbody tr:hover td,
.wide-data-table tbody tr:hover td,
#qcTable tbody tr:hover td {
  background: #eef8f7;
}

.th-sortable {
  transition: background-color 140ms ease, color 140ms ease;
}

.th-sorted {
  background: #e2f2ef !important;
  color: #123447 !important;
}

.sort-arrow {
  margin-left: 2px;
  color: var(--teal);
  opacity: 0.85;
}

.status-pill {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.qcr-report-card {
  max-width: none;
}

.qcr-report-cover {
  box-shadow: 0 18px 42px rgba(15, 45, 63, 0.18);
}

.qcr-section {
  background: #ffffff;
}

.qcr-section-title {
  position: sticky;
  top: 0;
  z-index: 3;
}

.video-report-map-table {
  min-width: 1180px;
}

.video-report-map-table th:nth-child(1),
.video-report-map-table td:nth-child(1) {
  min-width: 320px;
}

.video-report-map-table th:nth-child(7),
.video-report-map-table td:nth-child(7) {
  min-width: 260px;
}

.video-heat-picker-field input,
#videoLiveAdsSearch {
  min-width: min(360px, 42vw);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: 220px;
  }

  .topbar {
    position: static;
    margin-top: 0;
  }

  .panel-head {
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 12px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }

  .qcr-tabbar {
    overflow-x: auto;
  }

  .qcr-tab {
    min-width: 96px;
  }
}
