:root {
  color-scheme: light;
  --bg: #f1f4f5;
  --surface: #ffffff;
  --text: #172b35;
  --muted: #536775;
  --border: #d4dfe4;
  --brand: #b8452a;
  --brand-hover: #963720;
  --brand-soft: #fbefeb;
  --chart: #009c9b;
  --danger: #a82f28;
  --radius: 8px;
  --gap: 16px;
  --sidebar: 224px;
  --scroll-thumb: #9babb4;
  --scroll-track: #edf1f3;
  --scroll-hover: #617784;
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-track {
  background: var(--scroll-track);
}
*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border: 2px solid var(--scroll-track);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-hover);
}
*::-webkit-scrollbar-thumb:active {
  background: var(--text);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.55 -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-variant-numeric: tabular-nums;
}
a {
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select {
  font: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button,
input,
select {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  min-height: 38px;
}
button {
  padding: 7px 13px;
}
button:hover:not(:disabled) {
  background: var(--bg);
  border-color: #a3b6c0;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
input,
select {
  padding: 7px 10px;
  min-width: 0;
  max-width: 100%;
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
img {
  display: block;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 20;
  padding: 10px;
  background: white;
}
.skip-link:focus {
  top: 12px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 76px;
  flex-shrink: 0;
  padding: 16px 20px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  background: var(--brand);
  color: white;
  border-radius: 7px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-size: 26px;
  flex-shrink: 0;
}
.brand-copy strong {
  display: block;
  font-size: 20px;
  line-height: 1.35;
}
.brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.sidebar nav {
  padding: 16px 8px;
  overflow-y: auto;
}
.nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 8px;
  color: var(--muted);
}
.nav-group img,
.nav-link img {
  width: 20px;
  height: 20px;
  opacity: 0.78;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  margin: 3px 0;
  padding: 9px 17px;
  color: var(--text);
  border-left: 2px solid transparent;
  border-radius: 5px;
  white-space: nowrap;
}
.nav-link.sub {
  padding-left: 31px;
}
.nav-link:hover {
  text-decoration: none;
  background: var(--bg);
}
.nav-link[aria-current="page"] {
  color: var(--brand);
  background: var(--brand-soft);
  border-left-color: var(--brand);
  font-weight: 600;
}
.sidebar-foot {
  margin-top: auto;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}
.workspace {
  margin-left: var(--sidebar);
  min-width: 0;
}
.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  background: #f9fbfc;
}
.icon-button {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-color: transparent;
  flex-shrink: 0;
  background: transparent;
}
.icon-button img {
  width: 20px;
  height: 20px;
}
.breadcrumb {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}
.breadcrumb span:last-child {
  color: var(--text);
  font-weight: 600;
}
.topbar-right {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-left: auto;
  white-space: nowrap;
}
.return-home,
.admin-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.return-home img {
  width: 17px;
  height: 17px;
}
.admin-identity {
  border-left: 1px solid var(--border);
  padding-left: 24px;
  font-weight: 500;
}
.admin-identity img {
  width: 30px;
  height: 30px;
  opacity: 0.55;
}
#current-user {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#logout {
  min-height: 34px;
  font-size: 12px;
}
main {
  padding: 24px 20px 14px;
  max-width: 1920px;
  margin: 0 auto;
}
.page-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.5px;
  line-height: 1.3;
  margin: 0;
}
h2 {
  font-size: 17px;
  margin: 0;
  line-height: 1.5;
}
h3 {
  font-size: 15px;
  margin: 0;
}
.demo-label {
  font-size: 11px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #e8eff2;
  color: var(--muted);
}
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.date-range {
  display: flex;
  gap: 5px;
  align-items: center;
}
.date-range input {
  width: 135px;
}
.filters select {
  max-width: 160px;
}
.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
.primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.with-icon img {
  width: 17px;
  height: 17px;
}
.primary img {
  filter: brightness(0) invert(1);
}
.feedback {
  font-size: 12px;
  color: var(--muted);
  min-height: 20px;
  margin: 8px 0 14px;
}
.feedback.error,
.field-error {
  color: var(--danger);
}
.field-error {
  margin: 6px 0 0;
  width: 100%;
  font-size: 12px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.panel,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.stat-card {
  padding: 19px 24px 17px;
  min-height: 132px;
}
.stat-label {
  color: var(--muted);
  font-size: 13px;
}
.stat-value {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin: 5px 0;
}
.stat-value strong {
  font-size: 40px;
  line-height: 1.25;
  letter-spacing: -0.6px;
  font-weight: 650;
}
.stat-value small {
  font-size: 13px;
  color: var(--muted);
}
.stat-note {
  color: var(--muted);
  font-size: 12px;
}
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(300px, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.panel {
  padding: 16px 20px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}
.panel-heading .muted {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--swatch, var(--chart));
  border-radius: 2px;
  flex-shrink: 0;
}
.chart-wrap {
  height: 196px;
  position: relative;
  width: 100%;
}
.chart-wrap.large {
  height: 300px;
}
.chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.chart-data {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.chart-data summary {
  width: fit-content;
}
.chart-data .table-scroll {
  margin-top: 10px;
  max-height: 300px;
}
.ranking {
  display: grid;
  gap: 23px;
  padding: 22px 0 16px;
}
.rank-row {
  display: grid;
  grid-template-columns: 82px minmax(50px, 1fr) 45px;
  gap: 12px;
  align-items: center;
}
.rank-row a {
  color: var(--text);
}
.rank-track {
  height: 15px;
  background: #edf2f4;
  border-radius: 3px;
  overflow: hidden;
}
.rank-bar {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--swatch, var(--chart));
}
.rank-value {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
}
.distribution {
  margin-bottom: var(--gap);
}
.distribution-track {
  display: flex;
  height: 18px;
  margin: 16px 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg);
}
.distribution-segment {
  height: 100%;
  background: var(--swatch);
  border-right: 1px solid white;
}
.distribution .legend {
  justify-content: space-between;
  gap: 10px 20px;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-gutter: stable;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}
th {
  background: #f5f8f9;
  color: var(--muted);
  font-weight: 500;
}
th,
td {
  padding: 8px 12px;
  border-bottom: 1px solid #e4ebef;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover {
  background: #fafcfc;
}
.number {
  text-align: right;
}
.empty-cell {
  text-align: center;
  color: var(--muted);
  height: 125px;
  white-space: normal;
}
.table-brief {
  margin: 2px 0 14px;
  font-size: 12px;
  color: var(--muted);
}
.table-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 0 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.search-wrap {
  display: flex;
  position: relative;
}
.search-wrap input {
  width: 270px;
  padding-right: 36px;
}
.search-wrap button {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 34px;
  min-height: 34px;
  height: 34px;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.location-source {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.stack {
  display: grid;
  gap: var(--gap);
}
.catalog-cover {
  width: 92px;
  height: 55px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.catalog-name {
  font-weight: 600;
}
.catalog-description {
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
  min-width: 170px;
  max-width: 320px;
}
.pill {
  display: inline-block;
  padding: 3px 8px;
  background: #edf6f3;
  border-radius: 4px;
  color: #34674f;
  font-size: 12px;
}
.description-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  margin: 0;
}
.description-grid dt,
.description-grid dd {
  padding: 12px 0;
  border-bottom: 1px solid #e4ebef;
  margin: 0;
  overflow-wrap: anywhere;
}
.description-grid dt {
  color: var(--muted);
}
.description-grid dd:last-child,
.description-grid dt:nth-last-child(2) {
  border-bottom: 0;
}
.empty-panel {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  color: var(--muted);
}
.page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  padding-top: 16px;
}
.note {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
}
.inline-scope {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 12px;
}
.chart-block {
  position: relative;
}
.header-legend > .legend {
  position: absolute;
  right: 0;
  top: -34px;
}
.recent-panel {
  padding-top: 12px;
  padding-bottom: 12px;
}
.recent-panel th,
.recent-panel td {
  padding-top: 6px;
  padding-bottom: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.mobile-only {
  display: none;
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  border: 0;
  border-radius: 0;
  background: #172b3570;
}
.collapsed {
  --sidebar: 76px;
}
.collapsed .brand {
  padding: 16px 18px;
}
.collapsed .brand-copy,
.collapsed .nav-label,
.collapsed .nav-group span,
.collapsed .sidebar-foot {
  display: none;
}
.collapsed .nav-group {
  padding: 18px 17px 8px;
}
.collapsed .nav-link,
.collapsed .nav-link.sub {
  padding-left: 17px;
}
@media (min-width: 1500px) {
  main {
    padding: 28px;
  }
  .stat-card {
    min-height: 140px;
  }
  .chart-wrap {
    height: 248px;
  }
}
@media (max-width: 1150px) {
  .page-heading {
    align-items: flex-start;
  }
  .main-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  }
  .admin-identity {
    padding-left: 12px;
  }
  .topbar-right {
    gap: 12px;
  }
  .filters {
    gap: 6px;
  }
}
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .ranking {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .topbar {
    gap: 10px;
  }
  .return-home {
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
    width: 250px;
  }
  .workspace {
    margin-left: 0;
  }
  .drawer-open .sidebar {
    display: flex;
  }
  .mobile-only {
    display: block;
  }
  #close-sidebar {
    position: absolute;
    top: 20px;
    right: 7px;
  }
  .sidebar .brand {
    padding-left: 16px;
  }
  .sidebar .brand-copy {
    display: block;
  }
  .sidebar .nav-label,
  .sidebar .nav-group span {
    display: inline;
  }
  .sidebar .sidebar-foot {
    display: block;
  }
  .sidebar .nav-link.sub {
    padding-left: 31px;
  }
  main {
    padding: 18px 14px;
  }
  h1 {
    font-size: 24px;
  }
  .topbar {
    padding: 0 12px;
  }
  .breadcrumb {
    gap: 8px;
    font-size: 12px;
  }
  .admin-identity {
    display: none;
  }
  .return-home {
    font-size: 0;
  }
  .return-home img {
    width: 20px;
    height: 20px;
  }
  .page-heading {
    gap: 14px;
  }
  #toolbar {
    width: 100%;
  }
  .filters {
    width: 100%;
  }
  .filters > select {
    flex: 1;
    max-width: none;
  }
  .date-range {
    order: 3;
    width: 100%;
  }
  .date-range input {
    flex: 1;
    width: 0;
  }
  .stats-grid {
    gap: 10px;
  }
  .stat-card {
    padding: 14px 10px;
    min-height: 135px;
  }
  .stat-value {
    gap: 3px;
  }
  .stat-value strong {
    font-size: 28px;
  }
  .stat-note {
    font-size: 10px;
    overflow-wrap: anywhere;
  }
  .stat-label {
    font-size: 11px;
  }
  .panel {
    padding: 15px 13px;
  }
  h2 {
    font-size: 16px;
  }
  .panel-heading {
    gap: 8px;
    flex-wrap: wrap;
  }
  .ranking {
    grid-template-columns: 1fr;
    padding-top: 8px;
  }
  .chart-wrap,
  .chart-wrap.large {
    height: 240px;
  }
  .distribution .legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-size: 11px;
  }
  .pagination {
    align-items: flex-start;
  }
  .description-grid {
    grid-template-columns: 110px minmax(0, 1fr);
    font-size: 12px;
  }
}
@media (max-width: 350px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stat-card {
    min-height: 108px;
  }
  .distribution .legend {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
  .swatch,
  .rank-bar,
  .distribution-segment {
    forced-color-adjust: none;
  }
  :focus-visible {
    outline-color: Highlight;
  }
}
