/* 数据统计页 */
.analysis {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.analysis__sticky {
  position: sticky;
  top: var(--header-h);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: 12px;
  background: var(--bg);
  box-shadow: 0 2px 6px rgba(23, 33, 31, 0.06);
}

.analysis__head,
.analysis-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.analysis__head,
.analysis__tabs {
  width: 100%;
  margin-inline: 0;
}

.analysis__title,
.analysis-card__head h2 {
  margin: 0;
  color: var(--text);
}

.analysis__title { font-size: 20px; }
.analysis__note,
.analysis-card__head span { color: var(--muted); font-size: 12px; }

.analysis-card__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.analysis-card__tools input {
  width: 76px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
  text-align: center;
}

.analysis-card__tools button {
  padding: 6px 11px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-deep);
  font-size: 12px;
  cursor: pointer;
}

.analysis-card__tools button:hover {
  background: rgba(68, 148, 146, 0.10);
}

.analysis-card__tools input:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(68, 148, 146, 0.16);
}

/* 仅聚焦编辑时使用 16px，避免移动浏览器因小字号自动放大页面；失焦后恢复默认字号。 */
@media (max-width: 720px) {
  .analysis-card__tools input:focus { font-size: 16px; }
}

.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;
}

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

.analysis__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-deep);
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 600;
  white-space: nowrap;
}

.analysis__tab img {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
}

.analysis__tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.analysis-card {
  padding: 16px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfa 100%);
  box-shadow: 0 1px 2px rgba(23, 33, 31, 0.04);
}

.analysis-card__head { margin: 0 4px 14px; }
.analysis-card__head h2 { font-size: 17px; }

.analysis-card__head span { margin-left: auto; }

.analysis-pie-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 16px 8px 8px;
}

.analysis-pie {
  position: relative;
  width: 160px;
  height: 160px;
  flex: 0 0 160px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 31, 0.08);
}

.analysis-pie::after {
  content: "";
  position: absolute;
  inset: 27%;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(23, 33, 31, 0.04);
}

.analysis-pie-legend { display: grid; gap: 12px; min-width: 92px; }
.analysis-pie-legend__item { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 7px; color: var(--text); font-size: 13px; }
.analysis-pie-legend__item i { width: 10px; height: 10px; border-radius: 50%; }
.analysis-pie-legend__item strong { font-variant-numeric: tabular-nums; }

@media (max-width: 380px) {
  .analysis-card__head { align-items: flex-start; }
  .analysis-card__head h2 { font-size: 15px; }
  .analysis-card__tools { gap: 4px; }
  .analysis-card__tools input { width: 76px; }
  .analysis-card__tools button { padding-inline: 9px; }
  .analysis-pie-layout { gap: 12px; }
  .analysis-pie { width: 140px; height: 140px; flex-basis: 140px; }
}

.analysis-column-chart {
  overflow-x: scroll;
  padding: 8px 4px 2px;
  scrollbar-width: auto;
  scrollbar-color: var(--brand) #e8f0ef;
}

.analysis-column-chart::-webkit-scrollbar {
  height: 10px;
}

.analysis-column-chart::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #e8f0ef;
}

.analysis-column-chart::-webkit-scrollbar-thumb {
  border: 2px solid #e8f0ef;
  border-radius: 999px;
  background: var(--brand);
}

.analysis-columns {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  min-width: 820px;
  height: 182px;
  padding: 0 4px;
  border-bottom: 1px solid var(--border);
}

.analysis-column {
  display: flex;
  flex: 1 0 12px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}

.analysis-column__value {
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.analysis-column__track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 132px;
  border-radius: 5px 5px 0 0;
  background: #edf3f1;
}

.analysis-column__bar {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #66b9b3, var(--brand));
}

.analysis-column__label {
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.analysis-bar-row__number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.analysis-bar-row__track {
  flex: 1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f1;
}

.analysis-bar-row__bar {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #66b9b3);
  transition: width 0.25s ease;
}

.analysis-bar-row__count {
  width: 38px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.analysis-radar {
  width: min(100%, 330px);
  margin: 46px auto 0;
}

.analysis-radar svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.analysis-radar__grid circle,
.analysis-radar__grid line {
  fill: none;
  stroke: #dce9e6;
  stroke-width: 1;
}

.analysis-radar__area {
  fill: rgba(68, 148, 146, 0.22);
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linejoin: round;
}

.analysis-radar__icon {
  opacity: 1;
  filter: none;
}
.analysis-radar__label { fill: var(--text); font-size: 13px; font-weight: 500; text-anchor: middle; }

@media (max-width: 520px) {
  .analysis__title { font-size: 18px; }
}
