:root {
  --paper: #f4f0e8;
  --paper-soft: #faf8f3;
  --panel: #fffdf8;
  --ink: #24231f;
  --muted: #77736b;
  --line: #ded9cf;
  --line-soft: #ebe7de;
  --accent: #e0523f;
  --accent-deep: #b9362d;
  --accent-soft: #f8dfd9;
  --sage: #4e7965;
  --sage-soft: #dfe9e2;
  --gold: #b77a23;
  --gold-soft: #f4e5c9;
  --blue: #4f7095;
  --blue-soft: #e1e9f1;
  --danger: #ba3b35;
  --sidebar: #252b27;
  --sidebar-2: #303832;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --shadow: 0 18px 50px rgba(54, 47, 35, 0.08);
  --shadow-soft: 0 8px 24px rgba(54, 47, 35, 0.06);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 10%, rgba(224, 82, 63, 0.07), transparent 28%),
    linear-gradient(90deg, rgba(36, 35, 31, 0.016) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 24px 24px, auto;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 520px);
  grid-template-rows: auto 1fr;
  gap: 40px 8vw;
  align-items: center;
  padding: clamp(28px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(36, 43, 39, 0.96) 0 54%, rgba(244, 240, 232, 0.96) 54%),
    var(--paper);
}

.auth-brand { align-self: start; display: flex; align-items: center; gap: 12px; color: white; }
.auth-brand img { width: 42px; height: 42px; }
.auth-brand strong { display: block; font-family: STSong, "Songti SC", serif; font-size: 23px; letter-spacing: 0.08em; }
.auth-brand small { color: rgba(255,255,255,.52); font-size: 10px; }
.auth-copy { max-width: 560px; color: white; }
.auth-copy h1 { margin: 10px 0 18px; color: white; font-size: clamp(44px, 5vw, 72px); line-height: 1.06; letter-spacing: 0; }
.auth-copy > p:last-child { max-width: 430px; color: rgba(255,255,255,.58); font-size: 13px; line-height: 1.8; }
.login-panel { width: 100%; border: 1px solid var(--line); border-radius: 18px; padding: clamp(26px, 4vw, 42px); background: var(--panel); box-shadow: var(--shadow); }
.login-panel h2 { margin-bottom: 6px; font-size: 28px; }
.login-panel > div > p:last-child, .dialog-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.login-panel label { display: grid; gap: 7px; margin-top: 20px; color: var(--muted); font-size: 10px; }
.login-panel input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; color: var(--ink); background: var(--paper-soft); cursor: text; }
.login-panel .primary-button { width: 100%; min-height: 48px; margin-top: 6px; }
.login-panel > small { display: block; margin-top: 15px; color: var(--muted); font-size: 9px; text-align: center; }
.login-error { min-height: 18px; margin: 10px 0 0; color: var(--danger); font-size: 10px; }

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

button,
select,
input[type="date"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(224, 82, 63, 0.28);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  color: #f7f3e9;
  background:
    radial-gradient(circle at 20% 10%, rgba(224, 82, 63, 0.15), transparent 22%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 6px),
    var(--sidebar);
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -78px;
  bottom: 8%;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.018), 0 0 0 44px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 12px rgba(224, 82, 63, 0.22));
}

.brand-block strong {
  display: block;
  font-family: STSong, "Songti SC", serif;
  font-size: 21px;
  letter-spacing: 0.08em;
}

.brand-block small,
.profile-button small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 14px;
  scrollbar-width: none;
}

.nav-list::-webkit-scrollbar { display: none; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  text-align: left;
  transition: 220ms var(--ease);
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.nav-item .nav-badge {
  margin-left: auto;
  min-width: 21px;
  border-radius: 12px;
  padding: 2px 6px;
  color: white;
  background: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.sidebar-foot {
  z-index: 1;
  margin-top: auto;
  padding: 14px;
}

.data-health-mini {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.04);
}

.mini-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.mini-head strong { color: #f2b79e; }

.progress-track {
  height: 5px;
  margin: 9px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ee765e, #f2b267);
}

.data-health-mini p {
  margin: 0;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

.profile-button {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 9px;
  color: white;
  background: transparent;
  text-align: left;
}

.profile-button:hover { background: rgba(255, 255, 255, 0.05); }

.profile-button strong { font-size: 12px; font-weight: 600; }

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: var(--sidebar);
  background: #eed6b1;
  font-family: STSong, "Songti SC", serif;
  font-weight: 700;
}

.main-shell { min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 17px 34px;
  border-bottom: 1px solid rgba(36, 35, 31, 0.08);
  background: rgba(244, 240, 232, 0.83);
  backdrop-filter: blur(14px);
}

.topbar-leading,
.topbar-actions,
.last-update {
  display: flex;
  align-items: center;
}

.topbar-leading { gap: 14px; }
.topbar-actions { gap: 12px; }
.last-update { gap: 8px; color: var(--muted); font-size: 12px; }
.last-update strong { color: var(--ink); font-weight: 650; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-family: STSong, "Songti SC", serif;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: 0.03em;
}

h2 {
  margin-bottom: 6px;
  font-family: STSong, "Songti SC", serif;
  font-size: 21px;
}

h3 { margin-bottom: 6px; font-size: 15px; }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5e8c6c;
  box-shadow: 0 0 0 4px rgba(94, 140, 108, 0.12);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  50% { box-shadow: 0 0 0 7px rgba(94, 140, 108, 0.03); }
}

.icon-button,
.primary-button,
.secondary-button,
.text-button,
.ghost-button {
  border: 0;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
}

.icon-button:hover,
.secondary-button:hover,
.ghost-button:hover { background: white; box-shadow: var(--shadow-soft); }

.notification-ring {
  width: 13px;
  height: 15px;
  border: 1.8px solid currentColor;
  border-radius: 8px 8px 5px 5px;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -4px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 10px;
  color: white;
  background: var(--accent);
  font-size: 9px;
  font-weight: 800;
}

.notification-count[hidden] { display: none; }

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 17px;
  font-weight: 650;
}

.primary-button {
  color: white;
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(224, 82, 63, 0.17);
}

.primary-button:hover { transform: translateY(-1px); background: var(--accent-deep); }
.primary-button.compact { min-height: 42px; font-size: 12px; }
.button-plus { margin-right: 5px; font-size: 17px; font-weight: 400; }

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.text-button {
  padding: 8px;
  color: var(--accent-deep);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.filterbar {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 84px;
  padding: 14px 34px 15px;
  border-bottom: 1px solid rgba(36, 35, 31, 0.08);
  background: rgba(250, 248, 243, 0.64);
}

.filter-field {
  display: grid;
  gap: 5px;
  min-width: 120px;
}

.filter-field.brand-field { min-width: 210px; }
.filter-field.wide { min-width: 300px; }
.filter-field span { color: var(--muted); font-size: 10px; font-weight: 650; }

.filter-field select,
.filter-field input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 31px 0 11px;
  color: var(--ink);
  background: var(--panel);
  font-size: 12px;
  outline: none;
}

.filter-field input { padding-right: 9px; }

.filter-field input:disabled,
.segment-control button:disabled,
.tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.segment-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-width: 235px;
  height: 38px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
  background: rgba(255, 253, 248, 0.72);
}

.segment-control button {
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}

.segment-control button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 10px rgba(36, 35, 31, 0.08);
  font-weight: 650;
}

.segment-control button:disabled:hover,
.tabs button:disabled:hover { color: var(--muted); background: transparent; }

main { padding: 28px 34px 42px; }

.page-stack {
  display: grid;
  gap: 20px;
  max-width: 1680px;
  margin: 0 auto;
  animation: pageIn 420ms var(--ease) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 { margin-bottom: 3px; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric-card,
.panel,
.brief-card,
.alert-summary-card,
.upload-status-card {
  border: 1px solid rgba(218, 211, 199, 0.86);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 17px;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}

.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.metric-card::after {
  content: "";
  position: absolute;
  top: -26px;
  right: -24px;
  width: 86px;
  height: 86px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.platform-pill,
.status-pill,
.tag,
.delta-pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  border-radius: 99px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
}

.platform-pill.meituan { color: #8b671b; background: #fff1bd; }
.platform-pill.manager { color: #276345; background: #dcebe1; }
.platform-pill.business { color: #315b86; background: #dfe9f3; }
.platform-pill.douyin { color: #31404a; background: #dfe9ed; }
.platform-pill.xhs { color: #a9322c; background: #f7dedc; }
.platform-pill.all { color: var(--sage); background: var(--sage-soft); }

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 15px 0 8px;
}

.metric-value strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 3vw, 37px);
  line-height: 1;
  letter-spacing: -0.025em;
}

.metric-value small { color: var(--muted); font-size: 11px; }

.delta {
  font-size: 11px;
  font-weight: 700;
}

.delta.up { color: var(--sage); }
.delta.down { color: var(--danger); }
.delta.neutral { color: var(--muted); }
.metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 9px; color: var(--muted); font-size: 10px; }

.spark-bars {
  display: flex;
  align-items: end;
  gap: 3px;
  width: 44px;
  height: 20px;
}

.spark-bars span { flex: 1; min-height: 3px; border-radius: 3px 3px 1px 1px; background: var(--accent); opacity: 0.68; }

.brief-card {
  position: relative;
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 24px 26px;
}

.brief-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(var(--accent), #ef9b5d);
}

.brief-date {
  border-right: 1px solid var(--line);
}

.brief-date strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 37px;
  line-height: 1;
}

.brief-date span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }

.brief-copy h2 { margin-bottom: 8px; }
.brief-copy p { max-width: 920px; margin-bottom: 0; color: #5e5a53; font-size: 13px; line-height: 1.9; }
.brief-copy mark { border-radius: 5px; padding: 1px 4px; color: var(--accent-deep); background: var(--accent-soft); }

.brief-score {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--sage);
  background: var(--sage-soft);
}

.brief-score strong { display: block; font-family: Georgia, serif; font-size: 24px; line-height: 1; text-align: center; }
.brief-score span { display: block; margin-top: 3px; font-size: 9px; text-align: center; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 15px;
}

.dashboard-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid.left-narrow { grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.42fr); }

.panel {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 67px;
  padding: 16px 19px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h2,
.panel-head h3 { margin-bottom: 3px; }
.panel-head p { margin-bottom: 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 18px 19px 20px; }
.panel-body.flush { padding: 0; }

.panel-actions,
.legend,
.inline-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.legend { flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.chart-wrap {
  position: relative;
  min-height: 240px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line { stroke: #e9e4db; stroke-width: 1; }
.chart-axis-text { fill: #8a867e; font-size: 9px; }
.chart-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.chart-area { opacity: 0.12; }
.chart-point { stroke: white; stroke-width: 2; transition: r 160ms ease; }
.chart-point:hover { r: 5.5; }
.chart-bar { transition: opacity 160ms ease; }
.chart-bar:hover { opacity: 0.76; }

.alert-list,
.ranking-list,
.review-list,
.upload-history,
.report-list {
  display: grid;
  gap: 0;
}

.alert-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.alert-item:last-child { border-bottom: 0; }

.alert-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  font-size: 15px;
}

.alert-icon.high { color: var(--danger); background: var(--accent-soft); }
.alert-icon.medium { color: var(--gold); background: var(--gold-soft); }
.alert-icon.info { color: var(--blue); background: var(--blue-soft); }
.alert-copy strong { display: block; margin-bottom: 4px; font-size: 12px; }
.alert-copy p { margin-bottom: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.alert-time { color: #9b968c; font-size: 9px; white-space: nowrap; }

.ranking-row {
  display: grid;
  grid-template-columns: 24px minmax(105px, 0.85fr) minmax(130px, 1.45fr) 62px 58px;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
}

.ranking-row:last-child { border-bottom: 0; }
.rank-index { color: var(--muted); font-family: Georgia, serif; font-weight: 700; }
.rank-index.top { color: var(--accent); }
.rank-name strong { display: block; margin-bottom: 3px; }
.rank-name small { color: var(--muted); }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #eeeae2; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #e99161); }
.bar-fill.sage { background: linear-gradient(90deg, var(--sage), #86a68f); }
.bar-fill.gold { background: linear-gradient(90deg, var(--gold), #d6ad62); }
.rank-value { text-align: right; font-family: Georgia, serif; font-size: 15px; font-weight: 700; }

.content-preview-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.content-jump-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-jump-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--panel);
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.content-jump-links a:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }

.content-platform-section {
  display: grid;
  gap: 18px;
  scroll-margin-top: 24px;
}

.content-platform-section + .content-platform-section {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.platform-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.platform-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.platform-title-group h2 { margin-bottom: 3px; }
.platform-title-group p:last-child { margin-bottom: 0; color: var(--muted); font-size: 11px; }

.platform-emblem {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  color: white;
  background: #34454e;
  box-shadow: 0 10px 22px rgba(52, 69, 78, 0.18);
  font-family: STSong, "Songti SC", serif;
  font-size: 20px;
  font-weight: 700;
}

.content-platform-section.xhs .platform-emblem {
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(224, 82, 63, 0.18);
}

.content-platform-section.douyin .eyebrow { color: #54758a; }

.content-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: var(--paper-soft);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}

.content-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.content-cover {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 112px;
  overflow: hidden;
  padding: 12px;
  color: white;
  background: var(--cover, linear-gradient(135deg, #9c493a, #e3a46d));
}

.content-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(18, 18, 16, 0.66), transparent 70%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.22), transparent 28%);
}

.content-cover::after {
  content: "";
  position: absolute;
  top: 15%;
  right: 8%;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.07);
}

.content-cover > * { position: relative; z-index: 1; }
.cover-platform { position: absolute; top: 10px; left: 10px; border-radius: 99px; padding: 4px 7px; background: rgba(20, 20, 18, 0.52); font-size: 9px; backdrop-filter: blur(8px); }
.cover-title { max-width: 80%; margin: 0; font-family: STSong, "Songti SC", serif; font-size: 15px; line-height: 1.4; }
.content-meta { padding: 12px; }
.content-metrics { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 9px; }
.content-metrics strong { color: var(--ink); font-family: Georgia, serif; font-size: 13px; }
.content-summary { margin: 10px 0 0; color: #68645d; font-size: 10px; line-height: 1.65; }

.score-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.score-cell { border-radius: 12px; padding: 11px; background: var(--paper-soft); text-align: center; }
.score-cell strong { display: block; font-family: Georgia, serif; font-size: 20px; }
.score-cell span { color: var(--muted); font-size: 9px; }

.star-bars { display: grid; gap: 12px; }
.star-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; gap: 10px; font-size: 10px; }
.star-track { display: flex; height: 16px; overflow: hidden; border-radius: 5px; background: #eeeae2; }
.star-fill { height: 100%; background: var(--gold); }

.negative-tags { display: grid; gap: 13px; }
.tag-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 38px; align-items: center; gap: 10px; font-size: 10px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { padding: 12px 14px; color: var(--muted); background: var(--paper-soft); font-size: 9px; font-weight: 700; text-align: left; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-top: 1px solid var(--line-soft); color: #5f5b54; font-size: 10px; vertical-align: top; }
.data-table td strong { color: var(--ink); }
.data-table .review-copy { max-width: 360px; line-height: 1.65; }
.stars { color: #c48626; letter-spacing: 0.08em; }

.tabs {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  background: var(--paper-soft);
}

.tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.tabs button.active { color: var(--ink); background: white; box-shadow: 0 3px 9px rgba(36, 35, 31, 0.07); font-weight: 650; }

.heatmap-wrap { overflow-x: auto; }
.heatmap { display: grid; grid-template-columns: 130px repeat(5, minmax(78px, 1fr)); min-width: 590px; gap: 5px; }
.heatmap > div { min-height: 46px; display: grid; place-items: center; border-radius: 8px; padding: 7px; font-size: 9px; text-align: center; }
.heatmap .heat-head { color: var(--muted); background: transparent; font-weight: 700; }
.heatmap .heat-label { place-items: center start; color: var(--ink); background: var(--paper-soft); font-weight: 650; }
.heat-1 { color: #51685d; background: #e6eee9; }
.heat-2 { color: #355b49; background: #cde0d4; }
.heat-3 { color: white; background: #82ad93; }
.heat-4 { color: white; background: #4e7965; }
.heat-down { color: #92332c; background: #f5d9d4; }

.package-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.package-channel-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.package-channel-card { display: grid; grid-template-columns: 48px minmax(150px, 1fr) auto; align-items: center; gap: 14px; min-height: 112px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; color: var(--ink); background: rgba(255, 253, 248, 0.8); box-shadow: var(--shadow-soft); text-align: left; transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease); }
.package-channel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.package-channel-card.active { border-color: rgba(224, 82, 63, 0.48); box-shadow: 0 14px 34px rgba(224, 82, 63, 0.11); }
.package-channel-card.douyin.active { border-color: rgba(52, 69, 78, 0.48); box-shadow: 0 14px 34px rgba(52, 69, 78, 0.12); }
.channel-mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; color: #8a6818; background: #fff0b8; font-family: STSong, "Songti SC", serif; font-size: 20px; font-weight: 700; }
.package-channel-card.douyin .channel-mark { color: white; background: #34454e; }
.channel-copy { display: grid; gap: 3px; }
.channel-copy small { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: 0.12em; }
.package-channel-card.douyin .channel-copy small { color: #54758a; }
.channel-copy strong { font-family: STSong, "Songti SC", serif; font-size: 17px; }
.channel-copy em { color: var(--muted); font-size: 9px; font-style: normal; }
.channel-stats { display: grid; grid-template-columns: repeat(3, minmax(58px, 1fr)); gap: 13px; }
.channel-stats > span { display: block; min-width: 64px; border-left: 1px solid var(--line-soft); padding-left: 12px; }
.channel-stats strong { display: block; margin-bottom: 3px; font-family: Georgia, serif; font-size: 17px; white-space: nowrap; }
.channel-stats small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.package-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; padding: 16px; background: var(--paper-soft); }
.package-card::after { content: ""; position: absolute; right: -18px; bottom: -24px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-soft); opacity: 0.6; }
.package-card > * { position: relative; z-index: 1; }
.package-card h3 { margin-top: 11px; }
.package-card p { margin-bottom: 14px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.package-stats { display: flex; gap: 18px; }
.package-stats strong { display: block; font-family: Georgia, serif; font-size: 18px; }
.package-stats span { color: var(--muted); font-size: 9px; }

.insight-panel {
  position: relative;
  overflow: hidden;
  color: #f7f3e9;
  border: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(224, 82, 63, 0.24), transparent 30%),
    var(--sidebar);
}

.insight-panel .panel-head { border-color: rgba(255, 255, 255, 0.1); }
.insight-panel .panel-head p { color: rgba(255, 255, 255, 0.5); }
.insight-panel .eyebrow { color: #efaa8f; }
.insight-number { font-family: Georgia, serif; font-size: 44px; color: #efaa8f; }
.insight-list { display: grid; gap: 14px; }
.insight-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.insight-item span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 9px; color: #efaa8f; font-family: Georgia, serif; font-size: 12px; }
.insight-item strong { display: block; margin-bottom: 4px; font-size: 11px; }
.insight-item p { margin-bottom: 0; color: rgba(255, 255, 255, 0.58); font-size: 10px; line-height: 1.65; }

.funnel-list {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 330px;
}

.funnel-step {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.funnel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  border: 1px solid rgba(183, 122, 35, 0.2);
  border-radius: 12px;
  padding: 0 14px;
  color: #6f4a16;
  background: linear-gradient(90deg, #f6e7c9, #f3dcc0);
}

.funnel-step:nth-child(2) .funnel-bar { color: #315b4a; border-color: rgba(78, 121, 101, 0.2); background: linear-gradient(90deg, #e3eee7, #d4e5da); }
.funnel-step:nth-child(3) .funnel-bar { color: #315b86; border-color: rgba(79, 112, 149, 0.2); background: linear-gradient(90deg, #e4ebf2, #d5e1ec); }
.funnel-step:nth-child(4) .funnel-bar { color: #9b3930; border-color: rgba(224, 82, 63, 0.2); background: linear-gradient(90deg, #f8e4df, #f2d3cc); }
.funnel-bar span { font-size: 10px; font-weight: 650; }
.funnel-bar strong { font-family: Georgia, serif; font-size: 17px; }
.funnel-step small { color: var(--muted); font-size: 8px; }

.scatter-legend { display: flex; justify-content: center; gap: 18px; color: var(--muted); font-size: 9px; }

.upload-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 15px;
}

.upload-workbench { display: grid; gap: 12px; min-width: 0; }
.selected-files { display: grid; gap: 7px; }
.selected-files > div { display: grid; grid-template-columns: 42px minmax(0, 1fr) 34px; align-items: center; gap: 10px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 10px; background: var(--panel); }
.selected-files strong, .selected-files small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-files strong { font-size: 10px; }
.selected-files small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.selected-files .file-icon { width: 42px; height: 30px; font-size: 8px; }
.upload-submit-row { display: grid; grid-template-columns: minmax(200px, 1fr) auto; align-items: end; gap: 10px; border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px; background: var(--panel); }
.upload-token-field { display: grid; gap: 5px; }
.upload-token-field span { color: var(--muted); font-size: 9px; font-weight: 650; }
.upload-token-field input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; color: var(--ink); background: var(--paper-soft); outline: none; }
.upload-token-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.import-result-list { display: grid; }
.import-result-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line-soft); }
.import-result-row:first-child { border-top: 0; }
.import-result-row strong, .import-result-row small { display: block; }
.import-result-row strong { overflow: hidden; text-overflow: ellipsis; font-size: 10px; white-space: nowrap; }
.import-result-row small, .import-result-row > span:last-child { margin-top: 3px; color: var(--muted); font-size: 9px; }

.drop-zone {
  position: relative;
  display: grid;
  min-height: 285px;
  place-items: center;
  border: 1.5px dashed #cbbfb2;
  border-radius: var(--radius-lg);
  padding: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(224, 82, 63, 0.07), transparent 30%),
    rgba(255, 253, 248, 0.76);
  text-align: center;
  transition: 200ms var(--ease);
}

.drop-zone.dragging { border-color: var(--accent); background-color: var(--accent-soft); transform: scale(1.005); }
.drop-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 16px; place-items: center; border-radius: 18px; color: var(--accent); background: var(--accent-soft); font-size: 26px; }
.drop-zone h2 { margin-bottom: 8px; }
.drop-zone p { max-width: 440px; margin: 0 auto 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.drop-zone .file-hint { color: #9c978d; font-size: 9px; }

.upload-status-card { display: grid; gap: 12px; border-radius: var(--radius-lg); padding: 20px; }
.health-ring { --p: 96; display: grid; width: 116px; height: 116px; margin: 4px auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--sage) calc(var(--p) * 1%), #e9e4da 0); }
.health-ring::before { content: ""; grid-area: 1/1; width: 86px; height: 86px; border-radius: 50%; background: var(--panel); }
.health-ring strong { z-index: 1; grid-area: 1/1; font-family: Georgia, serif; font-size: 28px; }
.health-ring span { z-index: 1; grid-area: 1/1; margin-top: 38px; color: var(--muted); font-size: 9px; }
.source-status { display: grid; gap: 8px; }
.source-status-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; font-size: 10px; }
.source-status-row .progress-track { margin: 0; background: #ebe6dd; }
.source-status-row small { color: var(--muted); }

.upload-preview { display: none; }
.upload-preview.visible { display: block; animation: pageIn 260ms var(--ease); }
.file-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.file-summary > div { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px; background: var(--paper-soft); }
.file-summary span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.file-summary strong { font-size: 12px; }
.validation-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.status-pill.success { color: var(--sage); background: var(--sage-soft); }
.status-pill.warning { color: var(--gold); background: var(--gold-soft); }
.status-pill.error { color: var(--danger); background: var(--accent-soft); }

.upload-history-row {
  display: grid;
  grid-template-columns: 36px minmax(150px, 1fr) 100px 110px 110px 70px;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
}

.file-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--sage); background: var(--sage-soft); font-size: 10px; font-weight: 800; }
.file-name strong { display: block; margin-bottom: 3px; color: var(--ink); }
.file-name small, .upload-history-row > span { color: var(--muted); }

.template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.template-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; border: 1px solid var(--line-soft); border-radius: 13px; padding: 13px; background: var(--paper-soft); }
.template-card strong { display: block; margin-bottom: 3px; font-size: 11px; }
.template-card small { color: var(--muted); font-size: 9px; }

.alert-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.alert-summary-card { border-radius: 15px; padding: 15px; }
.alert-summary-card span { color: var(--muted); font-size: 10px; }
.alert-summary-card strong { display: block; margin: 8px 0 4px; font-family: Georgia, serif; font-size: 27px; }
.alert-summary-card small { color: var(--muted); font-size: 9px; }

.alert-row-large {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 120px 105px 110px;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-top: 1px solid var(--line-soft);
}

.alert-row-large h3 { font-size: 12px; }
.alert-row-large p { margin-bottom: 0; color: var(--muted); font-size: 10px; }
.alert-row-large > span { color: var(--muted); font-size: 10px; }
.severity { display: grid; width: 46px; height: 28px; place-items: center; border-radius: 9px; font-size: 9px; font-weight: 800; }
.severity.high { color: var(--danger); background: var(--accent-soft); }
.severity.medium { color: var(--gold); background: var(--gold-soft); }
.severity.low { color: var(--blue); background: var(--blue-soft); }

.report-preview {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  background: white;
  box-shadow: var(--shadow);
}

.report-preview::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 7px; background: linear-gradient(90deg, var(--accent), #efae6b 55%, var(--sage)); }
.report-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.report-brand strong { font-family: STSong, "Songti SC", serif; font-size: 19px; }
.report-brand span { color: var(--muted); font-size: 9px; }
.report-title { margin-bottom: 24px; }
.report-title h2 { font-size: 27px; }
.report-title p { color: var(--muted); font-size: 10px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.report-kpis.six { grid-template-columns: repeat(3, 1fr); }
.report-kpi { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px; background: var(--paper-soft); }
.report-kpi strong { display: block; margin: 5px 0; font-family: Georgia, serif; font-size: 20px; }
.report-kpi span, .report-kpi small { color: var(--muted); font-size: 8px; }
.report-section { margin-top: 21px; }
.report-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.report-section h3::before { content: ""; width: 4px; height: 14px; border-radius: 4px; background: var(--accent); }
.report-section p, .report-section li { color: #5e5a53; font-size: 10px; line-height: 1.8; }
.report-section ul { margin: 0; padding-left: 18px; }

.app-dialog {
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(36, 35, 31, 0.24);
}

.app-dialog::backdrop { background: rgba(26, 28, 25, 0.48); backdrop-filter: blur(5px); }
.app-dialog form { padding: 22px; }
.account-dialog-body { padding: 22px; }
.account-dialog .dialog-actions { margin-top: 28px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.close-dialog { width: 36px; height: 36px; font-size: 20px; }
.setting-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin: 22px 0; }
.setting-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; }
.setting-grid input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--ink); background: var(--paper-soft); }
.setting-grid select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--ink); background: var(--paper-soft); }
.setting-grid.single { grid-template-columns: 1fr; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }

.user-status-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.user-role-select { min-width: 92px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; color: var(--ink); background: var(--paper-soft); font-size: 9px; }

.toast-region { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: grid; gap: 9px; width: min(360px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--panel); box-shadow: var(--shadow); animation: toastIn 300ms var(--ease); }
.toast-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: var(--sage); background: var(--sage-soft); }
.toast strong { display: block; margin-bottom: 2px; font-size: 11px; }
.toast p { margin: 0; color: var(--muted); font-size: 9px; }
.toast button { border: 0; color: var(--muted); background: transparent; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.mobile-menu { display: none; }
.sidebar-scrim { display: none; }
.empty-state { display: grid; min-height: 220px; place-items: center; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

@media (max-width: 1390px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid .metric-card:nth-child(4), .metric-grid .metric-card:nth-child(5) { grid-column: span 1; }
  .filter-field:nth-of-type(2), .filter-field:nth-of-type(3) { display: none; }
  .package-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 258px; box-shadow: 20px 0 60px rgba(20, 22, 20, 0.24); transition: transform 280ms var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 30; inset: 0; display: block; pointer-events: none; opacity: 0; background: rgba(20, 22, 20, 0.4); transition: opacity 250ms ease; }
  .sidebar-scrim.visible { pointer-events: auto; opacity: 1; }
  .mobile-menu { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
  .mobile-menu span { width: 17px; height: 1.5px; border-radius: 2px; background: currentColor; }
  .topbar, .filterbar, main { padding-left: 22px; padding-right: 22px; }
  .dashboard-grid, .dashboard-grid.left-narrow { grid-template-columns: 1fr; }
  .content-preview-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-hero { grid-template-columns: 1fr; }
  .package-channel-tabs { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .auth-screen { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; gap: 28px; align-items: start; padding: 24px 18px; background: linear-gradient(180deg, var(--sidebar) 0 34%, var(--paper) 34%); }
  .auth-copy { min-height: 150px; }
  .auth-copy h1 { margin: 4px 0 10px; font-size: 36px; }
  .auth-copy > p:last-child { font-size: 11px; }
  .login-panel { align-self: start; padding: 25px 21px; }
  .topbar { min-height: 76px; }
  .last-update, .notification-button, .primary-button.compact { display: none; }
  .filterbar { align-items: center; min-height: auto; padding-top: 11px; padding-bottom: 11px; overflow-x: auto; }
  .filter-field { min-width: 132px; }
  .filter-field.wide { min-width: 150px; }
  .segment-control { min-width: 220px; margin-left: 0; }
  .reset-filters { display: none; }
  main { padding-top: 20px; padding-bottom: 30px; }
  .metric-grid, .metric-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 132px; }
  .brief-card { grid-template-columns: 75px 1fr; gap: 14px; padding: 20px; }
  .brief-score { display: none; }
  .brief-date { border-right: 0; }
  .brief-date strong { font-size: 29px; }
  .dashboard-grid.equal { grid-template-columns: 1fr; }
  .content-preview-list, .package-cards, .template-grid { grid-template-columns: 1fr; }
  .score-strip { grid-template-columns: repeat(5, minmax(52px, 1fr)); overflow-x: auto; }
  .file-summary, .alert-summary-grid, .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .upload-history-row { grid-template-columns: 36px 1fr auto; }
  .package-channel-card { grid-template-columns: 42px 1fr; }
  .channel-mark { width: 42px; height: 42px; }
  .channel-stats { grid-column: 1 / -1; width: 100%; padding-top: 9px; border-top: 1px solid var(--line-soft); }
  .upload-history-row > :nth-child(3), .upload-history-row > :nth-child(4), .upload-history-row > :nth-child(5) { display: none; }
  .import-result-row { grid-template-columns: 72px minmax(0, 1fr); }
  .import-result-row > span:last-child { grid-column: 2; }
  .alert-row-large { grid-template-columns: 50px 1fr auto; }
  .platform-section-heading { align-items: flex-start; flex-direction: column; }
  .platform-section-heading .secondary-button { width: 100%; }
  .content-jump-links { width: 100%; }
  .content-jump-links a { flex: 1; justify-content: center; }
  .alert-row-large > :nth-child(3), .alert-row-large > :nth-child(4) { display: none; }
  .setting-grid { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  .topbar, main { padding-left: 16px; padding-right: 16px; }
  .filterbar { padding-left: 16px; padding-right: 16px; }
  .metric-grid, .metric-grid.four { grid-template-columns: 1fr; }
  .metric-card { min-height: 122px; }
  .brief-card { grid-template-columns: 1fr; }
  .brief-date { display: flex; align-items: baseline; gap: 9px; }
  .brief-copy p { font-size: 12px; }
  .panel-head { align-items: start; flex-direction: column; }
  .ranking-row { grid-template-columns: 22px minmax(100px, 1fr) 55px; }
  .ranking-row .bar-track, .ranking-row .delta { display: none; }
  .report-preview { padding: 22px 16px; }
  .upload-submit-row { grid-template-columns: 1fr; }
  .upload-submit-row .primary-button { width: 100%; }
}

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

@media print {
  .sidebar, .topbar, .filterbar, .section-heading, .report-actions, .toast-region { display: none !important; }
  .app-shell { display: block; }
  main { padding: 0; }
  .page-stack > *:not(.report-print-area) { display: none !important; }
  .report-print-area { display: block !important; }
  .report-preview { border: 0; box-shadow: none; }
}
