/* Phase one: shared navigation, filters and the revenue work surface. */
:root { --sidebar-w: 200px; --bg: #f4f6f8; --border: #e2e6eb; --text: #272c34; --muted: #6d7580; }
.sidebar { background: #fff; color: var(--text); border-right: 1px solid var(--border); }
.logo { padding: 18px 14px; color: var(--text); font-size: 16px; border-color: var(--border); }
.brand-switcher { border-color: var(--border); padding: 10px 12px; }
.brand-switcher-label { color: var(--muted); }
#current-brand-btn { color: var(--text); background: #f4f6f8; border-color: var(--border); border-radius: 6px; }
.brand-switcher .logout-link { color: var(--muted); }
.nav { padding: 4px 8px 12px; overflow-y: auto; }
.nav-group { margin: 15px 10px 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.nav-item { border-radius: 5px; color: #454d58; padding: 8px 12px; margin: 1px 0; font-size: 13px; min-height: 36px; }
.nav-item:hover { background: #f1f4f8; color: #20262f; }
.nav-item.active { background: #fff0e9; color: #b93d1f; box-shadow: none; font-weight: 700; }
.sidebar-foot { border-color: var(--border); color: var(--muted); padding: 10px 14px; }
#reload-btn { color: #5c6571 !important; border-color: var(--border) !important; }
.content { min-width: 0; padding: 20px 24px 40px; }
.workspace-scope { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.workspace-scope .war-scope-btn { width: auto; margin: 0; padding: 5px 10px; border: 1px solid #d8dee6; border-radius: 5px; font-size: 12px; background: #fff; color: #505b69; box-shadow: none; }
.workspace-scope .war-scope-btn.active { background: #fff0e9; border-color: #e8532e; color: #ad381c; }
.shared-analysis .page-title { font-size: 24px; margin-bottom: 16px; }
.shared-filters { display: block; padding: 14px 0 0; border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; margin-bottom: 18px; }
.filter-row { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.shared-filters .filter-group { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; margin: 0; }
.shared-filters .filter-label { color: #626b77; font-size: 12px; white-space: nowrap; }
.shared-filters .filter-select, .shared-filters .filter-date, .shared-filters .filter-search { height: 34px; padding: 5px 9px; min-width: 0; max-width: 100%; border-radius: 5px; background: #fff; font-size: 13px; border-color: #dce1e8; }
.shared-filters .filter-date { width: 137px; }
.shared-filters .filter-search { width: 220px; }
.shared-filters .chip { padding: 5px 10px; border-radius: 5px; font-size: 12px; min-height: 32px; box-shadow: none; }
.shared-filters .chip[data-platform]::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #dfaa00; }
.shared-filters .chip[data-platform='淘宝']::before { background: #2e63c7; }
.shared-filters .chip[data-platform='京东']::before { background: #df332b; }
.shared-filters .chip.active { background: #fff0e9; color: #ad381c; border-color: #eaa58e; }
.filter-reset { padding: 5px 8px; background: transparent; border: 0; color: #4c6179; cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.filter-more { font-size: 12px; color: #596575; margin-bottom: 8px; }
.filter-more summary { cursor: pointer; width: fit-content; padding: 4px 0; }
.filter-more .filter-row { margin-top: 8px; }
.filter-summary { border-top: 1px solid var(--border); padding: 10px 0; color: #596575; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.filter-error { color: #bc3224; font-size: 12px; }
.filter-error:not(:empty) { margin-bottom: 8px; }
#page-revenue .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
#page-revenue .kpi { padding: 14px 16px; border-radius: 6px; box-shadow: none; min-width: 0; }
#page-revenue .kpi-label { font-size: 12px; }
#page-revenue .kpi-value { font-size: 26px; line-height: 1.4; margin: 6px 0; overflow-wrap: anywhere; }
#page-revenue .kpi-value.kpi-name { font-size: 15px; min-height: 36px; }
#page-revenue .kpi-sub { font-size: 12px; line-height: 1.8; }
#page-revenue > .chart-card, #page-revenue > .table-card, #page-revenue > .charts { background: transparent; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; padding: 18px 0; margin-top: 16px; }
#page-revenue .charts .chart-card { background: transparent; border: 0; border-radius: 0; padding: 0; box-shadow: none; min-width: 0; }
#page-revenue .charts { gap: 24px; }
#page-revenue .chart { background: #fff; }
#page-revenue .primary-trend .chart { height: 280px; }
#page-revenue h3 { font-size: 15px; margin-bottom: 12px; }
#page-revenue .store-ranking-band { grid-template-columns: minmax(0, 1fr); }
#page-revenue th, #page-revenue td { padding: 9px 10px; font-size: 12px; }
#page-revenue th { background: #eef1f5; color: #4d5968; }
#page-revenue .table-wrap { border-radius: 5px; }
.shared-analysis :focus-visible, .sidebar :focus-visible { outline: 2px solid #3675ce; outline-offset: 3px; }
#store-tag-section, #brand-upload-section { scroll-margin-top: 20px; }
@media (max-width: 1100px) {
  #page-revenue .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 16px; }
}
@media (max-width: 768px) {
  .layout { display: block; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: column; align-items: stretch; border-right: 0; border-bottom: 1px solid var(--border); }
  .logo { padding: 10px 14px; }
  .brand-switcher { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  #current-brand-btn { width: auto; }
  .nav { display: flex; flex-wrap: nowrap; width: 100%; min-width: 0; overflow-x: auto; padding: 6px 8px; }
  .nav-group, .sidebar-foot { display: none; }
  .nav-item { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .content { padding: 14px 12px 30px; }
  .workspace-scope { justify-content: flex-start; }
  .shared-filters .period-filter { width: 100%; }
  #page-revenue .charts { grid-template-columns: minmax(0, 1fr); }
  #page-revenue .kpi { padding: 12px; }
  #page-revenue .kpi-value { font-size: 22px; }
}
