/* Plaza UI foundation · 2026-08-20
 * Visual language only: surfaces, controls, borders, radii, shadows and states.
 * Page layouts and business-specific status colors remain local.
 */
:root {
  --ui-bg: #f5f7fb;
  --ui-surface: #ffffff;
  --ui-surface-subtle: #f8fafc;
  --ui-ink: #172033;
  --ui-ink-strong: #0f172a;
  --ui-muted: #647086;
  --ui-line: #e2e8f0;
  --ui-line-strong: #cbd5e1;
  --ui-brand: #146ef5;
  --ui-brand-hover: #0d5dd3;
  --ui-brand-soft: #eaf2ff;
  --ui-success: #0f9f6e;
  --ui-success-soft: #eefaf5;
  --ui-warning: #d97706;
  --ui-warning-soft: #fff7ed;
  --ui-danger: #dc2626;
  --ui-danger-soft: #fef2f2;
  --ui-radius-sm: 6px;
  --ui-radius-md: 8px;
  --ui-radius-lg: 10px;
  --ui-shadow-sm: 0 2px 8px rgba(18, 32, 55, .06);
  --ui-shadow-md: 0 12px 32px rgba(18, 32, 55, .08);
  --ui-control-height: 40px;
  --ui-control-height-touch: 44px;
  --ui-focus: 0 0 0 3px rgba(20, 110, 245, .18);

  /* 全站统一红涨绿跌基准变量 */
  --green: #16a34a;
  --red: #dc2626;
}

body {
  background: var(--ui-bg);
  color: var(--ui-ink);
}

.topbar {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--ui-line);
  box-shadow: var(--ui-shadow-sm);
}

.top-nav {
  border-color: var(--ui-line);
  background: var(--ui-surface-subtle);
  border-radius: var(--ui-radius-lg);
}

.top-nav a,
.top-nav summary {
  border-radius: var(--ui-radius-sm);
}

.top-nav a.active,
.top-nav a:hover,
.top-nav summary:hover {
  color: var(--ui-brand);
  background: var(--ui-brand-soft);
  border-color: rgba(20, 110, 245, .25);
  box-shadow: none;
}

.page-intro,
.panel,
.live-strip,
.yesterday-section,
.accumulated-section,
.revenue-kpi,
.yoy-kpi-card,
.member-analysis-section,
.parking-kpi,
.rank-panel,
.admin-workspace,
.admin-tool-grid > section {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius-md);
  box-shadow: var(--ui-shadow-md);
}

.page-intro,
.panel,
.live-strip,
.yesterday-section,
.accumulated-section,
.member-analysis-section,
.rank-panel,
.admin-workspace,
.admin-tool-grid > section {
  background: var(--ui-surface);
}

button,
.primary-btn,
.secondary-btn,
.revenue-btn-primary,
.revenue-btn-excel,
.toggle-btn,
.yoy-tab-btn,
.revenue-mom-trigger,
.revenue-pagination button {
  min-height: var(--ui-control-height);
  height: var(--ui-control-height) !important;
  border-radius: var(--ui-radius-sm) !important;
  font-family: inherit;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.primary-btn,
.revenue-btn-primary {
  border-color: var(--ui-brand);
  background: var(--ui-brand);
  color: #fff;
}

.primary-btn:hover,
.revenue-btn-primary:hover {
  border-color: var(--ui-brand-hover);
  background: var(--ui-brand-hover);
}

.secondary-btn,
.revenue-btn-excel {
  border: 1px solid var(--ui-line-strong);
  background: var(--ui-surface);
  color: var(--ui-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.secondary-btn:hover,
.revenue-btn-excel:hover {
  border-color: var(--ui-brand);
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: var(--ui-control-height);
  height: var(--ui-control-height) !important;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm) !important;
  background: var(--ui-surface);
  color: var(--ui-ink);
  font-family: inherit;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--ui-line-strong);
}

input:not([type="checkbox"]):not([type="radio"]):focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ui-brand);
  outline-offset: 2px;
  box-shadow: var(--ui-focus);
}

.traffic-date-mode,
.toggle-buttons,
.yoy-tab-buttons {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface-subtle);
}

.traffic-date-mode button,
.toggle-btn,
.yoy-tab-btn {
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  color: var(--ui-muted);
}

.traffic-date-mode button.active,
.toggle-btn.active,
.yoy-tab-btn.active {
  border-color: var(--ui-brand);
  background: var(--ui-brand);
  color: #fff;
  box-shadow: none;
}

.traffic-date-mode button:hover:not(.active),
.toggle-btn:hover:not(.active),
.yoy-tab-btn:hover:not(.active) {
  border-color: rgba(20, 110, 245, .2);
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
}

.data-table,
.yoy-table,
.yoy-summary-table {
  border-color: var(--ui-line);
}

.data-table th,
.yoy-table th,
.yoy-summary-table th,
.revenue-table-head {
  background: var(--ui-surface-subtle);
  color: var(--ui-muted);
}

.data-table td,
.data-table th,
.yoy-table td,
.yoy-table th,
.yoy-summary-table td,
.yoy-summary-table th {
  border-color: var(--ui-line);
}

.kpi.primary,
.revenue-kpi:nth-child(1),
.yoy-kpi-card:nth-child(1) {
  border-color: rgba(20, 110, 245, .38);
  background: var(--ui-brand-soft);
}

.status-success,
.success {
  color: var(--ui-success);
}

.status-warning {
  color: var(--ui-warning);
}

.status-danger,
.danger {
  color: var(--ui-danger);
}

/* 红涨绿跌规范：上涨/增幅为红，下跌/下滑为绿 */
.yoy-trend-up,
.mom-up,
.compare.up,
.diff-up {
  color: var(--ui-danger) !important;
}

.yoy-trend-down,
.mom-down,
.compare.down,
.diff-down {
  color: var(--ui-success) !important;
}

/* Wide operational tables stay inside their own scroll viewport. */
.parking-detail-panel,
.parking-member-detail,
.parking-table-wrap {
  min-width: 0;
  max-width: 100%;
}

.parking-detail-panel,
.parking-member-detail {
  overflow: hidden;
}

.parking-table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.parking-mode-buttons {
  height: var(--ui-control-height) !important;
  overflow: hidden;
}

.parking-mode-buttons button {
  height: calc(var(--ui-control-height) - 8px) !important;
  min-height: calc(var(--ui-control-height) - 8px);
}

@media (max-width: 720px) {
  .parking-subnav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .parking-subnav a {
    padding-inline: 8px;
  }

  .parking-filter-panel,
  .parking-filter,
  .parking-filter-actions {
    min-width: 0;
    max-width: 100%;
  }

  .parking-filter-actions > * {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 620px) {
  .parking-mode-buttons {
    height: var(--ui-control-height-touch) !important;
  }

  .parking-mode-buttons button {
    height: calc(var(--ui-control-height-touch) - 8px) !important;
    min-height: calc(var(--ui-control-height-touch) - 8px);
  }

  button,
  .primary-btn,
  .secondary-btn,
  .revenue-btn-primary,
  .revenue-btn-excel,
  .toggle-btn,
  .yoy-tab-btn {
    min-height: var(--ui-control-height-touch);
    height: var(--ui-control-height-touch) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
  }
}
