:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --surface: #fffefb;
  --surface-muted: #f0f2f1;
  --ink: #172b3a;
  --ink-soft: #52616b;
  --navy: #17354a;
  --navy-deep: #102a3c;
  --line: #d9dedd;
  --line-strong: #bcc7c8;
  --accent: #c84c31;
  --accent-dark: #a83c25;
  --accent-soft: #faeae4;
  --success: #23705a;
  --success-soft: #e8f3ee;
  --warning: #946214;
  --warning-soft: #fbf2df;
  --danger: #b33b32;
  --danger-soft: #fbece9;
  --shadow: 0 8px 28px rgba(23, 43, 58, 0.07);
  --radius: 6px;
  --number-font: "Bahnschrift", "DIN Alternate", "Arial Narrow", Consolas, monospace;
  --ui-font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--ui-font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button,
select,
input[type="checkbox"],
input[type="radio"],
input[type="file"] {
  cursor: pointer;
}

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

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(200, 76, 49, 0.3);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  color: #fff;
  background: var(--navy-deep);
  border-radius: 4px;
  transform: translateY(-150%);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  color: #fff;
  background: var(--navy-deep);
  border-bottom: 3px solid var(--accent);
}

.topbar-inner {
  display: flex;
  align-items: center;
  min-height: 68px;
  max-width: 1680px;
  padding: 10px 28px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: inherit;
  text-decoration: none;
  gap: 11px;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  margin-top: 4px;
  color: #cbd6dc;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
}

.topbar-meta {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 16px;
}

.shared-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  color: #d8e1e5;
  font-size: 12px;
  gap: 7px 16px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #8fa4ae;
  border-radius: 50%;
}

.status-dot.is-ok {
  background: #72c5a5;
}

.status-dot.is-warning {
  background: #efba66;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.topbar .button-ghost {
  color: #f3f6f7;
  background: transparent;
  border-color: #607585;
}

.topbar .button-ghost:hover {
  color: #fff;
  background: #23475e;
  border-color: #8ca0ac;
}

.page-shell {
  max-width: 1680px;
  padding: 22px 28px 36px;
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.page-heading h1,
.page-heading h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 22px;
  line-height: 1.35;
}

.page-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.section-label {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.filter-panel {
  padding: 16px 18px 13px;
  box-shadow: 0 2px 10px rgba(23, 43, 58, 0.03);
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(230px, 1.35fr) minmax(150px, 0.9fr) minmax(150px, 0.9fr) minmax(190px, 1.15fr);
  gap: 12px;
}

.field {
  min-width: 0;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 5px;
  color: #3d505c;
  font-size: 12px;
  font-weight: 650;
}

.input,
.select,
.branch-trigger {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input:hover,
.select:hover,
.branch-trigger:hover {
  border-color: #879ba4;
}

.input:focus,
.select:focus,
.branch-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 76, 49, 0.09);
}

.input::placeholder {
  color: #8a969c;
}

.select {
  padding-right: 28px;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  grid-column: span 6;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.button-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:hover {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button-secondary {
  color: var(--navy);
  background: #fff;
  border-color: var(--line-strong);
}

.button-secondary:hover {
  color: var(--navy-deep);
  background: var(--surface-muted);
  border-color: #8fa0a8;
}

.button-ghost {
  color: var(--navy);
  background: transparent;
  border-color: var(--line);
}

.button-small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.button-text {
  min-height: auto;
  padding: 2px 0;
  color: var(--navy);
  background: none;
  border: 0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button-text:hover {
  color: var(--accent-dark);
}

.filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 11px;
  margin-top: 12px;
  color: var(--ink-soft);
  border-top: 1px solid #e8e9e5;
  font-size: 12px;
  gap: 12px;
}

.active-filters {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-picker {
  position: relative;
}

.branch-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 8px;
}

.branch-trigger::after {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
}

.branch-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  width: max(100%, 310px);
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.branch-menu-tools {
  display: flex;
  align-items: center;
  margin-top: 7px;
  gap: 14px;
}

.branch-options {
  max-height: 250px;
  padding: 4px 2px 0;
  margin-top: 5px;
  overflow-y: auto;
  border-top: 1px solid #e9ecea;
}

.check-option {
  display: flex;
  align-items: flex-start;
  padding: 7px 5px;
  border-radius: 3px;
  cursor: pointer;
  gap: 8px;
}

.check-option:hover {
  background: var(--surface-muted);
}

.check-option input {
  flex: 0 0 auto;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.check-option-copy {
  min-width: 0;
}

.check-option-title {
  display: block;
  line-height: 1.4;
}

.check-option-code {
  display: block;
  margin-top: 1px;
  color: var(--ink-soft);
  font-family: var(--number-font);
  font-size: 11px;
}

.menu-empty {
  padding: 18px 8px;
  color: var(--ink-soft);
  text-align: center;
}

.notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 13px;
  margin: 12px 0;
  color: var(--navy);
  background: #edf3f5;
  border: 1px solid #cddde3;
  border-left: 3px solid var(--navy);
  border-radius: 4px;
  gap: 12px;
}

.notice-error {
  color: #7d2924;
  background: var(--danger-soft);
  border-color: #edc8c1;
  border-left-color: var(--danger);
}

.notice-success {
  color: #175542;
  background: var(--success-soft);
  border-color: #c9e0d6;
  border-left-color: var(--success);
}

.notice-warning {
  color: #6d4b13;
  background: var(--warning-soft);
  border-color: #ead8b4;
  border-left-color: var(--warning);
}

.metrics {
  display: grid;
  margin: 16px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
  position: relative;
  min-width: 0;
  padding: 14px 18px 13px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.metric-value {
  display: block;
  overflow: hidden;
  color: var(--navy-deep);
  font-family: var(--number-font);
  font-size: clamp(20px, 1.7vw, 28px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value.is-money {
  color: var(--accent-dark);
}

.metric-note {
  display: block;
  margin-top: 4px;
  color: #73818a;
  font-size: 11px;
}

.workspace {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 53px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.tabs {
  display: flex;
  align-self: stretch;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0 17px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-weight: 650;
  white-space: nowrap;
}

.tab::after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 3px;
  background: transparent;
  content: "";
}

.tab:hover {
  color: var(--navy);
  background: #f7f8f6;
}

.tab[aria-selected="true"] {
  color: var(--accent-dark);
}

.tab[aria-selected="true"]::after {
  background: var(--accent);
}

.workspace-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.result-count {
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.tab-panel {
  min-width: 0;
}

.insights {
  display: grid;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(300px, 0.8fr) minmax(480px, 1.4fr);
}

.insight-section {
  min-width: 0;
  padding: 16px 18px;
}

.insight-section + .insight-section {
  border-left: 1px solid var(--line);
}

.insight-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.insight-heading h3 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 14px;
}

.insight-heading span {
  color: var(--ink-soft);
  font-size: 11px;
}

.share-list {
  display: grid;
  gap: 9px;
}

.share-row {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(68px, 0.75fr) minmax(90px, 1.7fr) 65px;
  gap: 10px;
}

.share-name {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-track {
  height: 8px;
  overflow: hidden;
  background: #e9ece9;
  border-radius: 2px;
}

.share-bar {
  height: 100%;
  min-width: 1px;
  background: var(--navy);
  border-radius: 2px;
}

.share-row:first-child .share-bar {
  background: var(--accent);
}

.share-value {
  font-family: var(--number-font);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.trend-wrap {
  width: 100%;
  min-height: 160px;
}

.trend-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 155px;
  overflow: visible;
}

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

.trend-axis-text {
  fill: #73818a;
  font-family: var(--number-font);
  font-size: 10px;
}

.trend-money-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.trend-qty-line {
  fill: none;
  stroke: var(--navy);
  stroke-dasharray: 4 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.trend-money-point {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 1.8;
}

.trend-legend {
  display: flex;
  justify-content: flex-end;
  margin-top: -3px;
  color: var(--ink-soft);
  font-size: 11px;
  gap: 16px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-line {
  width: 16px;
  height: 2px;
  background: var(--accent);
}

.legend-line.is-qty {
  background: var(--navy);
}

.table-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 8px 16px;
  border-bottom: 1px solid #e8e9e5;
  gap: 12px;
}

.table-options-copy {
  color: var(--ink-soft);
  font-size: 12px;
}

.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 6px;
}

.inline-check input {
  margin: 0;
  accent-color: var(--accent);
}

.table-scroll {
  width: 100%;
  max-height: 68vh;
  overflow: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #aab7ba #eef0ed;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  min-width: 1100px;
  border-spacing: 0;
  border-collapse: separate;
  color: #273d4b;
  font-size: 12px;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  height: 39px;
  padding: 8px 12px;
  border-bottom: 1px solid #e7e9e6;
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 40px;
  color: #405661;
  background: #eef1ef;
  border-bottom: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #faf7f2;
}

.data-table .number,
.data-table th.number {
  font-family: var(--number-font);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.data-table .money {
  color: #893d2d;
  font-weight: 600;
}

.data-table .muted-cell {
  color: #8a969c;
}

.data-table .product-name {
  max-width: 250px;
  overflow: hidden;
  color: var(--navy-deep);
  font-weight: 650;
  text-overflow: ellipsis;
}

.table-primary {
  color: var(--navy-deep);
  font-weight: 650;
}

.table-state {
  height: 180px !important;
  color: var(--ink-soft);
  text-align: center !important;
  white-space: normal;
}

.table-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  color: #435661;
  background: #edf0ef;
  border: 1px solid #dce2df;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.5;
}

.badge-success {
  color: #1b5d49;
  background: var(--success-soft);
  border-color: #d0e4da;
}

.badge-warning {
  color: #7d5415;
  background: var(--warning-soft);
  border-color: #ecdfc3;
}

.badge-danger {
  color: #8b332b;
  background: var(--danger-soft);
  border-color: #eed2cc;
}

.pagination {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  color: var(--ink-soft);
  background: #fafaf7;
  border-top: 1px solid var(--line);
  font-size: 12px;
  gap: 12px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-status {
  min-width: 118px;
  font-family: var(--number-font);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.empty-chart {
  display: grid;
  min-height: 130px;
  place-items: center;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

/* 登录与初始化 */
.auth-page {
  display: grid;
  min-height: 100vh;
  padding: 36px;
  place-items: center;
}

.auth-shell {
  display: grid;
  width: min(960px, 100%);
  min-height: 540px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
}

.auth-aside {
  display: flex;
  flex-direction: column;
  padding: 46px 44px;
  background: #edf0ee;
  border-right: 1px solid var(--line);
}

.auth-aside .brand {
  color: var(--navy-deep);
}

.auth-aside .brand-subtitle {
  color: var(--ink-soft);
}

.auth-intro {
  margin: auto 0;
}

.auth-eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.auth-intro h1 {
  max-width: 390px;
  margin: 0;
  color: var(--navy-deep);
  font-size: 30px;
  line-height: 1.4;
}

.auth-intro > p {
  max-width: 410px;
  margin: 16px 0 26px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.auth-points {
  padding: 0;
  margin: 0;
  list-style: none;
  gap: 10px;
}

.auth-points li {
  position: relative;
  padding-left: 18px;
  margin: 10px 0;
  color: #3e535f;
}

.auth-points li::before {
  position: absolute;
  top: 9px;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 1px;
  content: "";
}

.auth-footnote {
  margin: 0;
  color: #718087;
  font-size: 11px;
}

.auth-form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px 40px;
}

.auth-form-wrap h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 22px;
}

.auth-form-lead {
  margin: 8px 0 24px;
  color: var(--ink-soft);
  font-size: 13px;
}

.auth-form .field {
  margin-bottom: 16px;
}

.auth-form .input {
  min-height: 42px;
}

.auth-form .button-primary {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
}

.form-help {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.auth-switch {
  padding-top: 18px;
  margin-top: 20px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 12px;
  text-align: center;
}

/* 管理页 */
.admin-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.admin-section {
  padding: 18px;
}

.admin-section h2,
.product-section h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 16px;
}

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

.admin-section-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.admin-stats {
  display: flex;
  margin-bottom: 15px;
  gap: 34px;
}

.admin-stat-label {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
}

.admin-stat-value {
  display: block;
  margin-top: 3px;
  color: var(--navy-deep);
  font-family: var(--number-font);
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.admin-form-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.admin-form-row .field {
  flex: 1;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.admin-divider {
  margin: 17px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.sync-copy {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.file-input {
  width: min(100%, 340px);
  padding: 5px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 12px;
}

.file-input::file-selector-button {
  padding: 5px 10px;
  margin-right: 9px;
  color: var(--navy);
  background: #edf0ef;
  border: 0;
  border-radius: 3px;
  font-family: var(--ui-font);
  cursor: pointer;
}

.shared-note {
  padding: 10px 12px;
  margin: 14px 0 0;
  color: #405761;
  background: #edf3f2;
  border-left: 3px solid var(--success);
  font-size: 12px;
}

.product-section {
  margin-top: 16px;
  overflow: hidden;
}

.product-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.product-search {
  display: flex;
  min-width: 280px;
  gap: 8px;
}

.product-search .input {
  min-width: 0;
}

.admin-table {
  min-width: 1280px;
}

.admin-table .input,
.admin-table .select {
  min-width: 118px;
  min-height: 31px;
  padding: 4px 7px;
  font-size: 12px;
}

.admin-table .product-name-input {
  min-width: 180px;
}

.row-save-status {
  display: block;
  max-width: 120px;
  margin-top: 3px;
  color: var(--success);
  font-size: 11px;
  white-space: normal;
}

.row-save-status.is-error {
  color: var(--danger);
}

.import-result {
  margin-top: 12px;
  font-size: 12px;
}

.import-result ul {
  max-height: 150px;
  padding-left: 20px;
  overflow-y: auto;
}

@media (min-width: 1450px) {
  .filter-grid {
    grid-template-columns: minmax(140px, 0.75fr) minmax(140px, 0.75fr) minmax(250px, 1.3fr) minmax(160px, 0.85fr) minmax(160px, 0.85fr) minmax(210px, 1.1fr) auto;
  }

  .filter-actions {
    grid-column: auto;
  }
}

@media (max-width: 1180px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-actions {
    grid-column: span 3;
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  .topbar-meta {
    flex: 1 1 500px;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric:nth-child(3) {
    border-right: 0;
  }

  .metric:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .metric:nth-child(4) {
    grid-column: span 1;
  }

  .metric:nth-child(5) {
    grid-column: span 2;
    border-right: 0;
  }

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

  .insight-section + .insight-section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar-inner,
  .page-shell {
    padding-right: 16px;
    padding-left: 16px;
  }

  .topbar-inner {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topbar-meta {
    flex-basis: 100%;
    justify-content: space-between;
  }

  .shared-meta {
    justify-content: flex-start;
  }

  .page-shell {
    padding-top: 16px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .filter-actions {
    grid-column: span 2;
  }

  .filter-actions .button-primary {
    flex: 1;
  }

  .filter-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .active-filters {
    width: 100%;
    white-space: normal;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric,
  .metric:nth-child(3) {
    border-right: 1px solid var(--line);
  }

  .metric:nth-child(even) {
    border-right: 0;
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .metric:nth-child(5) {
    grid-column: span 2;
  }

  .workspace-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  .tabs {
    min-height: 52px;
    border-bottom: 1px solid var(--line);
  }

  .workspace-actions {
    justify-content: space-between;
    padding: 9px 12px;
  }

  .table-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-controls {
    width: 100%;
    justify-content: space-between;
  }

  .auth-page {
    padding: 16px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    padding: 26px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-intro {
    margin-top: 32px;
  }

  .auth-intro h1 {
    font-size: 25px;
  }

  .auth-points,
  .auth-footnote {
    display: none;
  }

  .auth-intro > p {
    margin-bottom: 0;
  }

  .auth-form-wrap {
    padding: 28px 26px;
  }

  .product-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-search {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .brand-subtitle {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .shared-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

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

  .filter-actions {
    grid-column: auto;
  }

  .branch-menu {
    width: min(310px, calc(100vw - 52px));
  }

  .metric {
    padding: 12px;
  }

  .metric-value {
    font-size: 21px;
  }

  .insight-section {
    padding: 14px 12px;
  }

  .share-row {
    grid-template-columns: minmax(58px, 0.7fr) minmax(70px, 1.4fr) 56px;
    gap: 7px;
  }

  .admin-form-row {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-stats {
    flex-direction: column;
    gap: 10px;
  }

  .product-search {
    flex-direction: column;
  }
}

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

@media print {
  .topbar-actions,
  .filter-panel,
  .workspace-actions,
  .pagination,
  .table-options,
  .skip-link {
    display: none !important;
  }

  body,
  html {
    background: #fff;
  }

  .page-shell {
    max-width: none;
    padding: 12px;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
  }

  .data-table {
    min-width: 0;
    font-size: 9px;
  }
}

/* 看板分表、共享口径与管理配置 */
.filter-foot-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 14px;
}

.filter-foot-hint {
  color: var(--ink-soft);
}

.store-days-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  color: var(--navy);
  background: #edf3f2;
  border: 1px solid #d6e3df;
  border-radius: 999px;
  font-family: var(--number-font);
  font-size: 12px;
  white-space: nowrap;
}

.caliber-warnings {
  padding: 9px 12px;
  margin-top: 12px;
  color: #6d4b13;
  background: var(--warning-soft);
  border: 1px solid #ead8b4;
  border-left: 3px solid var(--warning);
  border-radius: 4px;
  font-size: 12px;
}

.caliber-warnings strong {
  display: block;
  margin-bottom: 2px;
}

.caliber-warnings ul {
  padding-left: 18px;
  margin: 0;
}

.caliber-warnings li + li {
  margin-top: 2px;
}

.params-note {
  padding: 9px 16px;
  color: #405761;
  background: #edf3f2;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.board-section + .board-section {
  border-top: 1px solid var(--line);
}

.board-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 6px 12px;
}

.board-heading h3 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 13px;
}

.board-formula {
  color: var(--ink-soft);
  font-size: 11px;
}

.board-table {
  min-width: 1180px;
}

.board-table .total-row td {
  color: var(--navy-deep);
  background: #eef1ef;
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
  font-weight: 700;
}

.board-table .series-tag {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 400;
}

.board-pagination {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  color: var(--ink-soft);
  background: #fafaf7;
  border-top: 1px solid var(--line);
  font-size: 12px;
  gap: 12px;
}

.board-pagination .pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-pagination .pagination-status {
  min-width: 118px;
  font-family: var(--number-font);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.admin-layout-secondary {
  margin-top: 16px;
}

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

.admin-params-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  gap: 10px 14px;
}

.admin-params-actions .form-help {
  margin: 0;
}

.branch-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  gap: 6px;
}

.branch-current-label,
.branch-current-more,
.branch-current-empty {
  color: var(--ink-soft);
}

.branch-chip {
  display: inline-flex;
  padding: 2px 7px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.branch-textarea {
  min-height: 96px;
  font-family: var(--number-font);
  line-height: 1.6;
  resize: vertical;
}

.admin-stat-datetime {
  font-size: 16px;
}

.admin-table .series-input,
.admin-table .number-input {
  min-width: 118px;
  min-height: 31px;
  padding: 4px 7px;
  font-size: 12px;
}

.admin-table .number-input {
  min-width: 88px;
  max-width: 110px;
  text-align: right;
}

.admin-table .section-editor {
  min-width: 92px;
}

@media (max-width: 1180px) {
  .params-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-foot-right {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .board-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .board-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .board-pagination .pagination-controls {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .params-grid {
    grid-template-columns: 1fr;
  }
}

.user-params-panel {
  margin-top: 16px;
}

.user-params-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.user-params-subtitle {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.user-params-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.param-field {
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.param-label {
  display: block;
  font-weight: 700;
  font-size: 12px;
  color: var(--navy);
}

.param-hint {
  display: block;
  margin: 2px 0 8px;
  color: var(--ink-soft);
  font-size: 11px;
}

.param-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.param-input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
}

.param-calc-toggle {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 11px;
}

.param-calc {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-strong);
}

.param-calc-input {
  width: 64px;
  min-width: 0;
  padding: 5px 6px;
  font-size: 12px;
}

.param-calc-equals {
  flex: 1 1 auto;
  min-width: 44px;
  font-family: var(--number-font);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.param-calc .button-text {
  white-space: nowrap;
  font-size: 11px;
}

.user-params-status {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .user-params-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .user-params-heading {
    flex-direction: column;
  }

  .user-params-actions {
    justify-content: flex-start;
  }

  .user-params-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .user-params-grid {
    grid-template-columns: 1fr;
  }
}

.comparison-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.comparison-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.comparison-bar-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 100px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.comparison-bar-track {
  height: 12px;
  background: var(--surface-muted);
  border-radius: 6px;
  overflow: hidden;
}

.comparison-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
}

.comparison-bar-value {
  font-family: var(--number-font);
  text-align: right;
}

td.up {
  color: var(--danger);
}

td.down {
  color: var(--success);
}

@media (max-width: 900px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}
