/* 售后分析看板 */
.asa-report .asa-section {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ds-border, #e2e8f0);
}
.asa-section__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ds-text, #0f172a);
}
.asa-section__badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f766e;
  vertical-align: middle;
}
.asa-section__note {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--ds-text-secondary, #64748b);
}
.asa-peak {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  color: #134e4a;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 10px;
}
.asa-peak--empty {
  color: var(--ds-text-secondary, #64748b);
  background: #f8fafc;
  border-color: #e2e8f0;
}
.asa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.asa-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .asa-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .asa-grid,
  .asa-grid--3 {
    grid-template-columns: 1fr;
  }
}
.asa-panel {
  border: 1px solid var(--ds-border, #e2e8f0);
  border-radius: 12px;
  background: var(--ds-bg-surface, #fff);
  padding: 12px;
  min-height: 140px;
}
.asa-panel--wide {
  grid-column: 1 / -1;
}
.asa-panel__title {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ds-text-secondary, #64748b);
}
.asa-panel__hint {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--ds-text-secondary, #94a3b8);
}
.asa-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ds-text-secondary, #94a3b8);
  padding: 12px 0;
}

/* 构成：环形 + 图例 */
.asa-share {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 7.5rem;
}
.asa-share__ring {
  flex: 0 0 5.5rem;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 14px var(--ds-bg-surface, #fff);
  background: #e2e8f0;
}
.asa-share__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-height: 9.5rem;
  overflow: auto;
}
.asa-share__item {
  display: grid;
  grid-template-columns: 0.65rem minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
  font-size: 0.72rem;
  color: var(--ds-text, #334155);
}
.asa-share__swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
}
.asa-share__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asa-share__meta {
  font-variant-numeric: tabular-nums;
  color: var(--ds-text-secondary, #64748b);
  white-space: nowrap;
}
.asa-share__pct {
  margin-left: 0.35rem;
  color: var(--ds-text-secondary, #94a3b8);
}

/* 表格 */
.asa-table-wrap {
  overflow: auto;
  max-height: 16rem;
}
.asa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.asa-table th,
.asa-table td {
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--ds-border, #e2e8f0);
  text-align: left;
  vertical-align: top;
}
.asa-table th {
  position: sticky;
  top: 0;
  background: var(--ds-bg-surface, #fff);
  font-weight: 600;
  color: var(--ds-text-secondary, #64748b);
  font-size: 0.7rem;
  z-index: 1;
}
.asa-th-num,
.asa-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 3.25rem;
}
.asa-td-name {
  color: var(--ds-text, #0f172a);
  word-break: break-word;
  line-height: 1.35;
  max-width: 14rem;
}
.asa-table th:first-child,
.asa-td-name {
  min-width: 0;
}
.asa-td-reason {
  color: var(--ds-text-secondary, #475569);
  word-break: break-word;
  line-height: 1.35;
}

/* 次要维度折叠 */
.asa-more {
  margin-top: 12px;
  border: 1px solid var(--ds-border, #e2e8f0);
  border-radius: 12px;
  background: var(--ds-bg-surface-sunken, #f8fafc);
  padding: 0.35rem 0.75rem 0.65rem;
}
.asa-more > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ds-text-secondary, #475569);
  padding: 0.45rem 0;
}
.asa-more > summary::-webkit-details-marker {
  display: none;
}
.asa-more > summary::before {
  content: '▸ ';
  color: #0f766e;
}
.asa-more[open] > summary::before {
  content: '▾ ';
}
.asa-more__grid {
  margin-top: 0.35rem;
}
.asa-more .asa-panel {
  background: var(--ds-bg-surface, #fff);
}

/* 时间趋势竖柱图：外框固定，柱多则变细挤进框内，不撑高/撑宽页面 */
.asa-cols-host {
  height: 14rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.asa-cols {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.2rem;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 0.15rem 0.1rem 0;
  overflow: hidden;
}
.asa-cols__col {
  flex: 1 1 0;
  min-width: 0;
  max-width: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.asa-cols__tip {
  font-size: 0.62rem;
  line-height: 1.2;
  color: #92400e;
  font-weight: 600;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 1.1rem;
  margin-bottom: 0.15rem;
  flex-shrink: 0;
}
.asa-cols__tip--spacer {
  visibility: hidden;
}
.asa-cols__count {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--ds-text-secondary, #64748b);
  margin-bottom: 0.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.asa-cols__bar-wrap {
  width: 70%;
  max-width: 1.75rem;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 4px 4px 0 0;
  background: color-mix(in srgb, var(--ds-bg-surface-sunken, #f1f5f9) 55%, transparent);
}
.asa-cols__bar {
  display: block;
  width: 100%;
  min-width: 0;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #14b8a6, #0f766e);
}
.asa-cols__col--peak .asa-cols__bar {
  background: linear-gradient(180deg, #f59e0b, #b45309);
}
.asa-cols__col--peak .asa-cols__count {
  color: #92400e;
  font-weight: 700;
}
.asa-cols__label {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--ds-text-secondary, #64748b);
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asa-cols__col--peak .asa-cols__label {
  color: #92400e;
  font-weight: 600;
}
.pmc-plan-urgency-hint {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.65rem;
  padding: 0 4px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  vertical-align: middle;
}
