:root {
  --green: #00b86b;
  --blue: #2474ff;
  --orange: #ff9f1c;
  --red: #ef4444;
  --ink: #152238;
  --muted: #6b7a90;
  --line: #dfe7f1;
  --soft: #f4f8fb;
  --panel: #ffffff;
  --panel-2: #f9fcff;
  --shadow: 0 16px 40px rgba(21, 34, 56, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: #edf5f9;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef9f6 0, #f6fbff 280px, #edf5f9 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(0, 184, 107, 0.13), transparent 34%),
    linear-gradient(180deg, #eef9f6 0, #f6fbff 48%, #edf5f9 100%);
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(21, 34, 56, 0.13);
}

.login-brand {
  padding: 0 0 16px;
}

.login-copy {
  display: grid;
  gap: 6px;
}

.login-copy p {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  gap: 4px;
  border-radius: 9px;
  background: var(--soft);
}

.login-mode-tab {
  min-height: 36px;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-weight: 800;
}

.login-mode-tab.active {
  color: #073c2a;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(21, 34, 56, 0.08);
}

.login-submit {
  width: 100%;
  min-height: 42px;
}

.login-status {
  min-height: 20px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.login-status.good {
  color: var(--green);
}

.base-inline-status {
  margin: 0 0 12px;
}

.login-demo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.login-demo span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-demo button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #31415a;
  background: #f8fcff;
  font-weight: 800;
}

.login-demo button:hover {
  color: #0d6c44;
  background: #e8fbf3;
  border-color: #c9f3e0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 24px rgba(21, 34, 56, 0.04);
  z-index: 3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 184, 107, 0.28);
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span,
.sidebar-foot span,
.mini-label,
.eyebrow,
.meta,
.panel p,
.section-heading p,
.select-control span {
  color: var(--muted);
}

.brand span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  color: #31415a;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
}

.nav-item:hover {
  background: #f3f8fb;
}

.nav-item.active {
  color: #073c2a;
  background: #e9fbf3;
  font-weight: 700;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 7px;
  background: #eef5fa;
  color: var(--blue);
  font-weight: 800;
}

.nav-item.active .nav-icon {
  background: var(--green);
  color: #ffffff;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcff;
}

.sidebar-logout {
  width: 100%;
  margin-top: 10px;
}

.sidebar-foot strong,
.sidebar-foot span,
.mini-label {
  display: block;
}

.mini-label {
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 22px 24px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  min-height: 76px;
  margin: -22px -24px 22px;
  padding: 18px 24px;
  background: rgba(246, 251, 255, 0.92);
  border-bottom: 1px solid rgba(223, 231, 241, 0.8);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
}

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

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 15px;
}

.top-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.segmented {
  display: inline-flex;
  min-height: 38px;
  padding: 3px;
  background: #eaf2f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment {
  min-width: 46px;
  border: 0;
  border-radius: 6px;
  color: #44546a;
  background: transparent;
  font-weight: 700;
}

.segment.active {
  color: #ffffff;
  background: var(--green);
}

.select-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.select-control span {
  font-size: 12px;
  white-space: nowrap;
}

.select-control select {
  min-width: 104px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.date-picker-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-control input {
  min-width: 150px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.date-control.clickable input {
  cursor: pointer;
}

.date-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 8;
  width: min(420px, calc(100vw - 48px));
  max-height: 420px;
  padding: 14px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(21, 34, 56, 0.16);
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.picker-head strong {
  min-width: 150px;
  text-align: center;
  font-size: 18px;
  letter-spacing: 0;
}

.picker-close,
.picker-nav {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fcff;
  font-weight: 800;
}

.picker-nav {
  border-color: transparent;
  background: transparent;
  color: #4a5b72;
  font-size: 18px;
}

.picker-grid {
  display: grid;
  gap: 6px;
}

.picker-weekdays,
.picker-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.picker-weekdays {
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.picker-day {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  color: #26364d;
  background: transparent;
  font-weight: 700;
}

.picker-day.muted {
  color: #b4bfcd;
}

.picker-day.in-range {
  color: var(--blue);
  background: #eaf2ff;
}

.picker-day.range-start,
.picker-day.range-end {
  color: #ffffff;
  background: var(--blue);
}

.picker-months {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 24px;
  padding: 18px 18px 10px;
}

.picker-option {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #26364d;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
}

.picker-option:hover,
.picker-option.active {
  color: var(--blue);
  background: #eaf2ff;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(0, 184, 107, 0.18);
}

.filter-button:hover {
  background: #00a861;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

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

.section-heading p {
  margin-top: 5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #24615b;
  background: #e8fbf3;
  border: 1px solid #c9f3e0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.good {
  color: #0d6c44;
}

.status-pill.warn {
  color: #8a5b00;
  background: #fff5db;
  border-color: #ffe1a3;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

#overviewKpis,
#architectureKpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  position: relative;
  min-height: 116px;
  padding: 16px;
  overflow: hidden;
}

.kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-value {
  margin-top: 12px;
  font-size: 27px;
  line-height: 1;
  font-weight: 800;
}

.kpi-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.delta {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.delta.down {
  color: var(--red);
}

.dashboard-grid,
.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.upload-grid {
  grid-template-columns: 2fr 1fr;
  margin-bottom: 16px;
}

.external-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  align-items: start;
}

.external-upload-card {
  display: grid;
  gap: 14px;
}

.upload-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.upload-meta-grid div {
  min-height: 68px;
  padding: 10px;
  background: #f7fbff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.upload-meta-grid span,
.upload-meta-grid strong,
.upload-picker strong,
.upload-picker em {
  display: block;
}

.upload-meta-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.upload-meta-grid strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 13px;
}

.upload-picker {
  display: grid;
  place-items: center;
  min-height: 178px;
  padding: 20px;
  text-align: center;
  background: #fbfdff;
  border: 1px dashed #9ab4cf;
  border-radius: 8px;
  cursor: pointer;
}

.upload-picker input {
  display: none;
}

.upload-picker em {
  max-width: 520px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.6;
}

.panel {
  min-height: 0;
  padding: 15px;
}

.page > .panel + .panel {
  margin-top: 16px;
}

.panel.wide {
  grid-column: span 2;
}

.panel.full {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  margin-bottom: 12px;
}

.panel-head p {
  margin-top: 4px;
  font-size: 12px;
}

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

.history-actions {
  align-items: end;
}

.mini-date-field {
  display: grid;
  gap: 4px;
}

.mini-date-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mini-date-field input {
  min-width: 142px;
  min-height: 30px;
  padding: 0 8px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  font-weight: 700;
}

.mini-date-field.clickable input {
  cursor: pointer;
}

.history-date-picker {
  align-items: end;
}

.history-date-picker .date-popover {
  right: 0;
  left: auto;
}

.chart-wrap {
  width: 100%;
  min-height: 278px;
}

.line-chart {
  width: 100%;
  height: 278px;
  display: block;
}

.axis-label,
.chart-label {
  fill: var(--muted);
  font-size: 12px;
}

.chart-point-group {
  cursor: default;
  outline: none;
}

.chart-point-hit {
  fill: transparent;
  pointer-events: all;
}

.chart-point-tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.chart-point-tooltip rect {
  fill: rgba(18, 32, 54, 0.94);
}

.chart-point-tooltip text {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.chart-point-group:hover .chart-point-tooltip,
.chart-point-group:focus .chart-point-tooltip {
  opacity: 1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.analysis-card {
  min-height: 72px;
  padding: 12px;
  background: #f7fbff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.analysis-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.analysis-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}

.analysis-card.warn {
  background: #fff8e8;
  border-color: #ffe2a9;
}

.analysis-card.danger {
  background: #fff1f0;
  border-color: #ffd7d4;
}

.analysis-card.good {
  background: #eefdf6;
  border-color: #c7f4df;
}

.city-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.city-diagnostic-card {
  display: grid;
  gap: 9px;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  background: #fbfdff;
}

.city-diagnostic-card.warn {
  background: #fff8e8;
  border-color: #ffe2a9;
}

.city-diagnostic-card.danger {
  background: #fff1f0;
  border-color: #ffd7d4;
}

.city-diagnostic-card.good {
  background: #eefdf6;
  border-color: #c7f4df;
}

.city-diagnostic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.city-diagnostic-top strong {
  font-size: 16px;
}

.city-diagnostic-card .tag {
  white-space: nowrap;
}

.city-diagnostic-metric {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  color: #607089;
  font-size: 12px;
  font-weight: 800;
}

.city-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.city-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.city-bar.warn span {
  background: var(--orange);
}

.city-bar.danger span {
  background: var(--red);
}

.city-diagnostic-note {
  color: #607089;
  font-size: 12px;
  font-weight: 750;
}

.base-summary {
  margin-bottom: 16px;
}

.metric-tile {
  min-height: 86px;
  padding: 11px 12px;
  background: #f7fbff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.metric-tile span,
.metric-tile em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.metric-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1;
}

.metric-tile em {
  margin-top: 8px;
}

.boss-filter-bar {
  display: grid;
  grid-template-columns: minmax(360px, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.competitor-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.competitor-filter-bar .filter-button {
  width: 100%;
  min-height: 38px;
}

.explain-panel {
  padding: 0;
  overflow: hidden;
}

.explain-panel summary,
.panel-explain summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #31415a;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.explain-panel summary {
  padding: 0 15px;
}

.panel-explain {
  margin: -2px 0 12px;
  padding: 0 10px;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  background: #f8fcff;
}

.panel-explain summary {
  color: #607089;
  font-size: 12px;
}

.explain-panel summary::-webkit-details-marker,
.panel-explain summary::-webkit-details-marker {
  display: none;
}

.explain-panel summary::after,
.panel-explain summary::after {
  content: "展开";
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #0d6c44;
  background: #e8fbf3;
  font-size: 12px;
  font-weight: 800;
}

.explain-panel[open] summary::after,
.panel-explain[open] summary::after {
  content: "收起";
}

.explain-panel .rule-grid {
  padding: 0 15px 15px;
}

.panel-explain p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.panel-explain .upload-meta-grid {
  margin-bottom: 10px;
}

.boss-date-picker {
  width: 100%;
}

.boss-date-picker .form-field {
  min-width: 0;
  margin: 0;
}

.boss-date-picker .date-control input {
  min-width: 118px;
}

.chart-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chart-toggle {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: #43546b;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.chart-toggle span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.chart-toggle.active {
  color: #0d6c44;
  background: #e8fbf3;
  border-color: #c9f3e0;
}

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

.rule-grid div {
  min-height: 66px;
  padding: 12px;
  background: #f7fbff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.rule-grid strong,
.rule-grid span {
  display: block;
}

.rule-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.decision-tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  color: #43546b;
  background: #eef5fa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.decision-tag.good {
  color: #0d6c44;
  background: #e8fbf3;
}

.decision-tag.warn {
  color: #875600;
  background: #fff3d6;
}

.decision-tag.bad {
  color: #a91e2c;
  background: #ffe8ec;
}

.boss-coverage-table {
  min-width: 1040px;
}

.rank-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.rank-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(78px, auto);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.rank-item strong,
.compact-item strong {
  display: block;
}

.rank-item span,
.compact-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.rank-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.rank-item:first-child .rank-number {
  background: var(--green);
}

.people-ranking .rank-item {
  min-height: 58px;
}

.overview-board-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.overview-board-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.overview-board-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e6edf5;
  border-radius: 8px;
}

.overview-board-card.layer-card {
  border-left: 4px solid #d8e6ff;
}

.overview-board-card.layer-card.warning {
  border-left-color: #ffe1a3;
}

.board-card-head,
.period-board header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.board-card-head strong,
.period-board header {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.board-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.period-board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.period-board {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: #f8fcff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.board-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.board-lane {
  min-width: 0;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.board-lane.good {
  border-color: #c9f3e0;
}

.board-lane.warn {
  border-color: #ffe1a3;
}

.board-label {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.board-label.good {
  color: #0d6c44;
  background: #e8fbf3;
}

.board-label.warn {
  color: #875600;
  background: #fff3d6;
}

.board-list,
.warning-list {
  display: grid;
  gap: 10px;
}

.board-rank-item {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 126px;
  padding: 10px;
  background: #f8fcff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.board-rank-item.good {
  background: #f7fffb;
}

.board-rank-item.warn {
  background: #fffdf7;
}

.board-rank-top,
.warning-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.board-rank-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  color: #607089;
  background: #eef5fa;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.board-rank-no {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--green);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.board-rank-no.warn {
  background: var(--orange);
}

.board-rank-main strong,
.warning-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-rank-main em,
.warning-card em {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-rank-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.board-rank-metrics span:nth-child(3) {
  grid-column: 1 / -1;
}

.board-rank-metrics span {
  min-height: 46px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.board-rank-metrics b {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.board-rank-metrics em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.warning-card {
  display: grid;
  gap: 12px;
  min-height: 136px;
  padding: 12px;
  background: #fffdf7;
  border: 1px solid #ffe1a3;
  border-radius: 8px;
}

.warning-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.warning-metrics span {
  min-height: 32px;
  padding: 6px 8px;
  color: #607089;
  background: #ffffff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.warning-metrics b {
  color: var(--ink);
}

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

.board-empty {
  min-height: 46px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f8fcff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.advice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.advice-panel .panel-head {
  min-height: 34px;
}

.advice-card {
  display: grid;
  grid-template-columns: minmax(74px, max-content) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #e4edf5;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #f9fcff;
}

.advice-card.warn {
  border-left-color: var(--orange);
}

.advice-card.danger {
  border-left-color: var(--red);
}

.advice-title {
  margin-top: 1px;
  margin-bottom: 0;
  font-weight: 800;
  white-space: nowrap;
}

.advice-card p {
  min-width: 0;
  color: #38475d;
  font-size: 13px;
  line-height: 1.5;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--blue);
  font-weight: 900;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 288px;
  padding: 26px;
  text-align: center;
  border: 1px dashed #9ab4cf;
  border-radius: 8px;
  background: #f7fbff;
}

.drop-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.drop-zone p {
  max-width: 520px;
  margin-top: 8px;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 18px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action input {
  display: none;
}

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

.form-date-picker,
.form-date-picker .date-control {
  width: 100%;
}

.form-date-picker .date-control input {
  width: 100%;
  min-width: 0;
  min-height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

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

.query-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(128px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: #f7fbff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.query-summary {
  margin-bottom: 14px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-field.required span::after {
  content: " *";
  color: var(--red);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.form-field textarea {
  min-height: 142px;
  padding: 10px;
  line-height: 1.5;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 184, 107, 0.12);
}

.form-date-picker .date-control input:focus {
  border: 0;
  box-shadow: none;
}

.form-wide {
  grid-column: span 2;
}

.form-submit {
  align-self: end;
  min-height: 38px;
  width: 100%;
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.feedback-card {
  display: grid;
  gap: 14px;
}

.feedback-field {
  min-height: 180px;
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-actions .filter-button {
  min-width: 112px;
}

.feedback-summary-panel td:nth-child(4),
.feedback-summary-panel td:nth-child(7) {
  min-width: 320px;
  white-space: normal;
}

.mini-upload {
  display: grid;
  place-items: center;
  min-height: 238px;
  padding: 22px;
  text-align: center;
  background: #f7fbff;
  border: 1px dashed #b7cbe1;
  border-radius: 8px;
}

.mini-upload strong,
.mini-upload span {
  display: block;
}

.mini-upload span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-row span {
  color: var(--muted);
  font-size: 12px;
}

.check-flow {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-flow li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 8px 10px;
  background: #f7fbff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.check-flow span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-spacing: 0;
  border-collapse: separate;
}

.org-permission-table {
  min-width: 1120px;
}

.permission-matrix-table {
  min-width: 860px;
}

.clerk-follow-table {
  min-width: 1280px;
}

th,
td {
  min-height: 42px;
  padding: 11px 10px;
  border-bottom: 1px solid #e8eef6;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #607089;
  background: #f7fbff;
  font-size: 12px;
  font-weight: 800;
}

td {
  color: #26364d;
}

.status-cell {
  text-align: center;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.table-button.good {
  color: #0d6c44;
  background: #e8fbf3;
  border-color: #c9f3e0;
}

.table-button.warn {
  color: #875600;
  background: #fff3d6;
  border-color: #ffe1a3;
}

.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef5fa;
  color: #43546b;
  font-size: 12px;
  font-weight: 700;
}

.tag.good {
  color: #0d6c44;
  background: #e8fbf3;
}

.tag.warn {
  color: #875600;
  background: #fff3d6;
}

.tag.bad {
  color: #a91e2c;
  background: #ffe8ec;
}

.service-breakdown-cell {
  min-width: 320px;
  white-space: normal;
}

.merchant-service-breakdown {
  display: flex;
  max-width: 560px;
  flex-wrap: wrap;
  gap: 6px;
}

.service-share-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: #26364d;
  background: #f7fbff;
  border: 1px solid #dce8f4;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.service-share-chip em {
  color: #607089;
  font-style: normal;
  font-weight: 750;
}

.service-share-chip.qinghao {
  color: #0d6c44;
  background: #e8fbf3;
  border-color: #bfeeda;
}

.service-share-chip.qinghao em {
  color: #217652;
}

.service-share-chip.qinghao.muted {
  color: #607089;
  background: #f3f7fb;
  border-color: #dce8f4;
}

.service-share-chip.qinghao.muted em {
  color: #607089;
}

.service-share-muted {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 8px;
  color: #607089;
  background: #eef5fa;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
}

.table-select {
  width: 100%;
  min-width: 108px;
  min-height: 32px;
  padding: 0 8px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  outline: 0;
  text-align: center;
  text-align-last: center;
}

.table-input {
  width: 100%;
  min-width: 150px;
  min-height: 32px;
  padding: 0 9px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  outline: 0;
}

.station-search-input {
  padding-right: 30px;
}

.table-select:focus,
.table-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 184, 107, 0.1);
}

.status-select.good {
  color: #0d6c44;
  background: #e8fbf3;
  border-color: #c9f3e0;
  font-weight: 700;
}

.status-select.warn {
  color: #875600;
  background: #fff3d6;
  border-color: #ffe1a3;
  font-weight: 700;
}

.mind-map {
  min-height: 180px;
}

.mind-map-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.mind-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.mind-node {
  display: grid;
  align-content: center;
  min-height: 72px;
  padding: 13px 14px;
  background: #f7fbff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.mind-node.root {
  background: #e9fbf3;
  border-color: #c9f3e0;
}

.mind-node.level {
  min-height: 54px;
  background: #eef5ff;
  border-color: #d8e6ff;
}

.mind-node strong,
.mind-branch-card strong {
  display: block;
}

.mind-node span,
.mind-branch-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mind-branches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.mind-branch-card {
  min-width: 0;
  min-height: 96px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e4edf5;
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.mind-branch-card.compact {
  min-height: 70px;
}

.mind-leaves {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mind-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  color: #31415a;
  background: #eef5fa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.quality-card {
  min-height: 118px;
  padding: 14px;
  background: #f7fbff;
  border: 1px solid #e8eef6;
  border-radius: 8px;
}

.quality-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

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

  #overviewKpis,
  #architectureKpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .boss-date-picker {
    grid-column: 1 / -1;
  }

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

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

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

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

  .dashboard-grid,
  .upload-grid,
  .external-upload-grid,
  .feedback-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .panel.wide {
    grid-column: span 2;
  }

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

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .overview-board-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 12px;
  }

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

  .nav-item {
    justify-content: center;
  }

  .nav-item span:last-child {
    display: none;
  }

  .sidebar-foot {
    display: none;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .topbar {
    position: relative;
    margin: 0 0 16px;
    padding: 0 0 14px;
    background: transparent;
    border-bottom: 0;
  }

  .kpi-grid,
    .boss-filter-bar,
    .competitor-filter-bar,
    .rule-grid,
    .dashboard-grid,
  .upload-grid,
    .external-upload-grid,
    .feedback-grid,
    .clerk-form,
    .base-form,
    .query-bar,
    .advice-grid,
    .quality-grid {
    grid-template-columns: 1fr;
  }

  #overviewKpis,
  #architectureKpis {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

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

  .city-diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .upload-meta-grid {
    grid-template-columns: 1fr;
  }

  .board-split,
  .period-board-grid,
  .warning-list,
  .warning-card,
  .board-rank-metrics,
  .warning-metrics {
    grid-template-columns: 1fr;
  }

  .board-rank-data {
    text-align: left;
  }

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

  .mind-branches,
  .mind-branches.four {
    grid-template-columns: 1fr;
  }

  .form-wide {
    grid-column: auto;
  }

  .panel.wide {
    grid-column: auto;
  }

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

  .select-control {
    width: 100%;
  }

  .date-picker-group {
    width: 100%;
    flex-direction: column;
  }

  .filter-button {
    width: 100%;
  }

  .top-actions {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }
}
