/* Member analysis aligned to the YoY workspace, 2026-08-20. */
.member-yoy-ui {
  --member-control-height: 48px;
  --member-segment-height: 40px;
  min-width: 0;
}

.member-yoy-ui > *,
.member-yoy-ui .member-analysis-intro,
.member-yoy-ui .member-analysis-month,
.member-yoy-ui .member-analysis-section,
.member-yoy-ui .member-growth-grid,
.member-yoy-ui .member-count-summary,
.member-yoy-ui .member-month-summary,
.member-yoy-ui .member-daily-table-wrap {
  min-width: 0;
  max-width: 100%;
}

.member-yoy-ui .member-analysis-intro {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 2.22fr);
  align-items: center;
  gap: 18px 28px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.member-yoy-ui .member-analysis-intro h2 {
  color: #0f172a;
}

.member-yoy-ui .member-analysis-intro p {
  color: #64748b;
}

.member-yoy-ui .member-analysis-month {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.member-yoy-ui .member-analysis-month label {
  display: block;
}

.member-yoy-ui .member-analysis-month label > span {
  display: none;
}

.member-yoy-ui .member-analysis-month input,
.member-yoy-ui .member-query-btn,
.member-yoy-ui .member-export-btn {
  height: var(--member-control-height) !important;
  min-height: var(--member-control-height);
}

.member-yoy-ui .member-analysis-month input {
  width: 164px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 2px solid transparent;
  outline-offset: 1px;
  background: #fff;
  color: #0f172a;
}

.member-yoy-ui .member-analysis-month input:focus-visible {
  border-color: var(--brand);
  outline-color: rgba(20, 110, 245, .32);
  box-shadow: none;
}

.member-yoy-ui .member-mode-buttons {
  display: inline-flex;
  height: var(--member-control-height) !important;
  min-height: var(--member-control-height);
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--ui-line, #dbe4ef);
  border-radius: var(--ui-radius-md, 8px);
  background: var(--ui-surface-subtle, #f1f5f9);
  box-sizing: border-box;
}

.member-yoy-ui .member-mode-buttons button {
  display: inline-flex;
  min-width: 72px;
  height: var(--member-segment-height) !important;
  min-height: var(--member-segment-height);
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm, 6px);
  background: transparent;
  color: var(--ui-muted, #52677f);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

.member-yoy-ui .member-mode-buttons button.active {
  border-color: var(--ui-brand, var(--brand));
  background: var(--ui-brand, var(--brand));
  color: #fff;
  box-shadow: none;
}

.member-yoy-ui .member-mode-buttons button:focus-visible,
.member-yoy-ui .member-query-btn:focus-visible,
.member-yoy-ui .member-export-btn:focus-visible,
.member-yoy-ui .member-growth-copy:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.member-yoy-ui .member-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-yoy-ui .member-query-btn,
.member-yoy-ui .member-export-btn {
  min-width: 106px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.member-yoy-ui .member-query-btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.member-yoy-ui .member-query-btn:hover {
  background: #0f5fd7;
  border-color: #0f5fd7;
}

.member-yoy-ui .member-export-btn {
  border: 1px solid #b9c9dc;
  background: #fff;
  color: #24415f;
}

.member-yoy-ui .member-export-btn:hover {
  border-color: var(--brand);
  background: #edf5ff;
  color: var(--brand);
}

.member-yoy-ui .member-export-btn[hidden],
.member-yoy-ui .member-analysis-month [hidden] {
  display: none !important;
}

.member-yoy-ui .member-analysis-section {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.member-yoy-ui .member-analysis-section .section-title {
  margin-bottom: 14px;
}

.member-yoy-ui .member-analysis-section .section-title h2 {
  color: #0f172a;
  font-size: 18px;
}

.member-yoy-ui .member-sales-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.member-yoy-ui .member-sales-title > div {
  min-width: 0;
}

.member-yoy-ui .member-sales-title .member-export-btn {
  flex: 0 0 auto;
}

.member-yoy-ui .member-analysis-rule {
  color: #64748b;
}

.member-yoy-ui .member-growth-copy {
  height: 38px;
  border-color: #b9c9dc;
  background: #fff;
  color: #24415f;
  box-shadow: none;
}

.member-yoy-ui .member-growth-copy:hover {
  border-color: var(--brand);
  background: #edf5ff;
  color: var(--brand);
}

.member-yoy-ui .member-growth-grid article,
.member-yoy-ui .member-count-row article,
.member-yoy-ui .member-month-summary article {
  border-top: 2px solid #cbd5e1;
  box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease;
}

.member-yoy-ui .member-count-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.member-yoy-ui .member-count-row {
  display: grid;
  gap: 10px;
}

.member-yoy-ui .member-count-row-primary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.member-yoy-ui .member-count-row-secondary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.member-yoy-ui .member-count-row article {
  min-height: 154px;
}

.member-yoy-ui .member-compare-list {
  display: grid;
  gap: 5px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.member-yoy-ui .member-compare-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.3;
}

.member-yoy-ui .member-compare-list dt,
.member-yoy-ui .member-compare-list dd {
  margin: 0;
}

.member-yoy-ui .member-compare-list dd {
  font-weight: 700;
  white-space: nowrap;
}

.member-yoy-ui .member-compare-list .is-up dd { color: #08734d; }
.member-yoy-ui .member-compare-list .is-down dd { color: #c2413b; }
.member-yoy-ui .member-compare-list .is-flat dd { color: #475569; }
.member-yoy-ui .member-compare-list .is-missing dd { color: #94a3b8; font-weight: 600; }

.member-yoy-ui .member-peak-compare-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.member-yoy-ui .member-peak-compare-list > div {
  display: contents;
}

.member-yoy-ui .member-peak-compare-list dt {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.member-yoy-ui .member-peak-compare-list dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-weight: 700;
}

.member-yoy-ui .member-peak-compare-list .peak-compare-val {
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.member-yoy-ui .member-peak-compare-list .peak-compare-date {
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
}

.member-yoy-ui .member-peak-compare-list .peak-compare-rate {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

.member-yoy-ui .member-peak-compare-list .is-up .peak-compare-rate,
.member-yoy-ui .member-peak-compare-list .is-up dd {
  color: #08734d;
}

.member-yoy-ui .member-peak-compare-list .is-up .peak-compare-rate {
  background: rgba(8, 115, 77, 0.08);
}

.member-yoy-ui .member-peak-compare-list .is-down .peak-compare-rate,
.member-yoy-ui .member-peak-compare-list .is-down dd {
  color: #c2413b;
}

.member-yoy-ui .member-peak-compare-list .is-down .peak-compare-rate {
  background: rgba(194, 65, 59, 0.08);
}

.member-yoy-ui .member-peak-compare-list .is-flat .peak-compare-rate,
.member-yoy-ui .member-peak-compare-list .is-flat dd {
  color: #475569;
}

.member-yoy-ui .member-peak-compare-list .is-flat .peak-compare-rate {
  background: #f1f5f9;
}

.member-yoy-ui .member-peak-compare-list .is-missing dd,
.member-yoy-ui .member-peak-compare-list .peak-compare-empty {
  color: #94a3b8;
  font-weight: 500;
}

.member-yoy-ui .member-level-card .member-level-breakdown {
  margin: 10px 0 0;
}

.member-yoy-ui .member-level-card .member-level-breakdown dd {
  font-size: 18px;
}

.member-yoy-ui .member-activity-card {
  border-top-color: var(--green);
  background: #eefaf5;
}

.member-yoy-ui .member-activity-card strong {
  color: #08734d;
}

.member-yoy-ui .member-growth-grid article:hover,
.member-yoy-ui .member-count-row article:hover,
.member-yoy-ui .member-month-summary article:hover {
  border-color: #94a3b8;
}

.member-yoy-ui .member-growth-grid article:first-child,
.member-yoy-ui .member-count-row-primary article:first-child,
.member-yoy-ui .member-month-summary article:nth-child(5) {
  border-top-color: var(--brand);
  background: #eaf2ff;
}

.member-yoy-ui .member-growth-grid article:last-child,
.member-yoy-ui .member-count-row-secondary article:first-child,
.member-yoy-ui .member-month-summary article:nth-child(6) {
  border-top-color: var(--green);
  background: #eefaf5;
}

.member-yoy-ui .member-count-row-secondary article:last-child,
.member-yoy-ui .member-month-summary article.is-pending {
  border-top-color: var(--orange);
  background: #fff7ed;
}

.member-yoy-ui .member-growth-grid strong,
.member-yoy-ui .member-count-summary strong,
.member-yoy-ui .member-month-summary article > strong {
  color: #0f3157;
  letter-spacing: 0;
}

.member-yoy-ui .member-daily-table-wrap {
  border-color: var(--line);
  box-shadow: none;
  scrollbar-gutter: stable;
}

.member-yoy-ui .member-daily-table thead th {
  background: #f3f7fb;
  color: #334155;
}

.member-yoy-ui .member-data-empty {
  border-color: #cbd8e8;
  background: #f8fbff;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .member-yoy-ui .member-analysis-intro {
    grid-template-columns: 1fr;
  }

  .member-yoy-ui .member-analysis-month {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .member-yoy-ui .member-analysis-month {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .member-yoy-ui .member-mode-field,
  .member-yoy-ui .member-filter-actions {
    grid-column: 1 / -1;
  }

  .member-yoy-ui .member-analysis-month label,
  .member-yoy-ui .member-analysis-month input,
  .member-yoy-ui .member-filter-actions {
    width: 100%;
  }

  .member-yoy-ui .member-filter-actions > * {
    flex: 1 1 0;
  }

  .member-yoy-ui .member-sales-title {
    align-items: flex-start;
  }

  .member-yoy-ui .member-count-row-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .member-yoy-ui .member-count-row-secondary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .member-yoy-ui {
    --member-control-height: 52px;
    --member-segment-height: 44px;
    width: 100%;
    overflow: clip;
  }

  .member-yoy-ui .member-analysis-intro {
    padding: 16px;
  }

  .member-yoy-ui .member-analysis-month {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .member-yoy-ui .member-mode-field,
  .member-yoy-ui .member-month-field,
  .member-yoy-ui .member-date-field,
  .member-yoy-ui .member-filter-actions {
    grid-column: 1;
  }

  .member-yoy-ui .member-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-yoy-ui .member-query-btn,
  .member-yoy-ui .member-export-btn {
    width: 100%;
    min-width: 0;
  }

  .member-yoy-ui .member-sales-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .member-yoy-ui .member-sales-title .member-export-btn {
    width: auto;
    min-width: 106px;
  }

  .member-yoy-ui .member-analysis-section {
    padding: 14px 12px;
  }

  .member-yoy-ui .member-count-row-primary,
  .member-yoy-ui .member-count-row-secondary {
    grid-template-columns: 1fr;
  }

  .member-yoy-ui .member-count-row article {
    min-height: 146px;
  }

  .member-yoy-ui .member-daily-table-wrap::before {
    content: "左右滑动查看完整表格";
    position: sticky;
    left: 0;
    display: block;
    width: max-content;
    margin: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #edf5ff;
    color: var(--brand);
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .member-yoy-ui .member-mode-buttons button,
  .member-yoy-ui .member-query-btn,
  .member-yoy-ui .member-export-btn,
  .member-yoy-ui .member-growth-copy,
  .member-yoy-ui .member-growth-grid article,
  .member-yoy-ui .member-count-summary article,
  .member-yoy-ui .member-month-summary article {
    transition: none;
  }
}
