/* 博主分析：作者视角的多维研究工作台 */
#author-analysis[hidden] {
  display: none;
}

.ba-picker-hint {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px dashed var(--border, #e9ecf3);
  border-radius: var(--radius, 14px);
  background: #fafbfe;
  color: var(--muted, #637180);
  font-size: calc(13px * var(--ui-font-scale, 1.14));
}

.ba-loading {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted, #637180);
}

.ba-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 24px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.ba-head h3 {
  margin: 0;
  color: var(--text, #111820);
  font-size: calc(19px * var(--ui-font-scale, 1.14));
  line-height: 1.3;
}

.ba-head p {
  margin: 4px 0 0;
  color: var(--muted, #637180);
  font-size: calc(12.5px * var(--ui-font-scale, 1.14));
}

.ba-head label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted, #637180);
  font-size: calc(12px * var(--ui-font-scale, 1.14));
  font-weight: 700;
  white-space: nowrap;
}

.ba-head select {
  width: min(310px, 34vw);
  min-width: 0;
  height: 40px;
  padding: 7px 10px;
  font-size: calc(13px * var(--ui-font-scale, 1.14));
}

.ba-head .ba-notice {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--amber-soft, #faf3e2);
  color: #79520f;
  line-height: 1.55;
}

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

.ba-panel {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border-color: var(--border, #e9ecf3);
  box-shadow: 0 5px 18px rgba(36, 49, 70, .045);
}

.ba-panel.ba-wide {
  grid-column: 1 / -1;
}

.ba-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-soft, #eef1f8);
}

.ba-panel > header h4 {
  margin: 0;
  color: var(--text, #111820);
  font-size: calc(15px * var(--ui-font-scale, 1.14));
  line-height: 1.35;
}

.ba-panel > header > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft, #faf3e2);
  color: var(--primary, #b8862b);
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
  font-weight: 700;
  white-space: nowrap;
}

.ba-panel > header label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted, #637180);
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
  white-space: nowrap;
}

.ba-panel > header select {
  width: min(220px, 28vw);
  min-width: 0;
  height: 36px;
  padding: 5px 8px;
  font-size: calc(12px * var(--ui-font-scale, 1.14));
}

.ba-panel > p {
  margin: 9px 0 11px;
  color: var(--muted, #637180);
  font-size: calc(11.75px * var(--ui-font-scale, 1.14));
  line-height: 1.55;
}

.ba-empty {
  margin: 0;
  padding: 22px 12px !important;
  border: 1px dashed var(--border, #e9ecf3);
  border-radius: 9px;
  background: #fbfcfe;
  color: var(--muted, #637180) !important;
  text-align: center;
}

.ba-items {
  display: grid;
  gap: 9px;
}

.ba-heat {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name total"
    "bar bar";
  gap: 4px 8px;
  padding: 8px 9px;
  border: 1px solid var(--border-soft, #eef1f8);
  border-radius: 9px;
  background: #fff;
  color: var(--text, #111820);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .12s;
}

.ba-heat:hover {
  border-color: #d9bc83;
  background: #fffdf7;
  transform: translateY(-1px);
}

.ba-heat[aria-pressed="true"] {
  border-color: var(--primary, #b8862b);
  background: var(--primary-soft, #faf3e2);
  box-shadow: inset 3px 0 0 var(--primary, #b8862b);
}

.ba-heat:focus-visible,
.ba-more:focus-visible,
.ba-source summary:focus-visible,
.ba-event details summary:focus-visible {
  outline: 2px solid var(--primary, #b8862b);
  outline-offset: 2px;
}

.ba-heat strong {
  grid-area: name;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: calc(13px * var(--ui-font-scale, 1.14));
}

.ba-heat > span:last-child {
  grid-area: total;
  color: var(--muted, #637180);
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ba-bar {
  grid-area: bar;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.ba-bar::before {
  content: "";
  display: block;
  width: max(4px, var(--ba-width, 0%));
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c79a43, #b8862b);
}

.ba-event {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-soft, #eef1f8);
  border-radius: 9px;
  background: #fbfcfe;
}

.ba-event > strong {
  display: block;
  margin: 5px 0 4px;
  color: var(--text, #111820);
  font-size: calc(12.5px * var(--ui-font-scale, 1.14));
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ba-event > p {
  margin: 0;
  color: #354253;
  font-size: calc(12px * var(--ui-font-scale, 1.14));
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ba-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted, #637180);
  font-size: calc(11px * var(--ui-font-scale, 1.14));
}

.ba-meta span {
  padding: 1px 7px;
  border-radius: 999px;
  background: #edf1f7;
  white-space: nowrap;
}

.ba-conditions {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 8px;
  margin: 9px 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f3f6fa;
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
}

.ba-conditions dt {
  color: var(--muted, #637180);
  font-weight: 700;
}

.ba-conditions dd {
  min-width: 0;
  margin: 0;
  color: #354253;
  overflow-wrap: anywhere;
}

.ba-more {
  min-height: 40px;
  width: 100%;
  margin-top: 9px;
  padding: 7px 12px;
  border: 1px solid #dfcdb0;
  border-radius: 8px;
  background: #fff;
  color: var(--primary, #b8862b);
  font: inherit;
  font-size: calc(12px * var(--ui-font-scale, 1.14));
  font-weight: 700;
  cursor: pointer;
}

.ba-more:hover {
  background: var(--primary-soft, #faf3e2);
}

.ba-source {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border-soft, #eef1f8);
  border-radius: 8px;
  background: #fff;
}

.ba-source > summary {
  min-height: 28px;
  color: var(--primary, #b8862b);
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
  font-weight: 700;
  cursor: pointer;
}

.ba-source > a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  margin: 3px 0 7px;
  color: var(--primary, #b8862b);
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
  font-weight: 700;
  text-decoration: none;
}

.ba-source .post-content-shell {
  margin: 5px 0;
}

.ba-source .content {
  padding: 8px 9px;
  border-radius: 7px;
  background: #f8fafc;
  color: #354253;
  font-size: calc(11.75px * var(--ui-font-scale, 1.14));
  line-height: 1.6;
}

.ba-source .content-actions {
  margin-top: 5px;
}

.ba-source .content-action {
  min-height: 34px;
  padding: 5px 9px;
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
}

.ba-market-note {
  min-height: 20px;
  margin-bottom: 7px;
  color: var(--muted, #637180);
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
  line-height: 1.5;
}

.ba-price {
  margin: 3px 0 10px;
  padding: 8px 10px;
  border: 1px solid #dce5f1;
  border-radius: 9px;
  background: #fff;
}

.ba-price[hidden] {
  display: none;
}

.ba-price .ok-plot {
  height: 214px;
}

.ba-price .ok-chart-note {
  margin: 4px 0 0;
  color: var(--muted, #637180);
  font-size: calc(11px * var(--ui-font-scale, 1.14));
}

.ba-result {
  padding: 9px 10px;
  border: 1px solid var(--border-soft, #eef1f8);
  border-radius: 9px;
  background: #fbfcfe;
}

.ba-result + .ba-result {
  margin-top: 8px;
}

.ba-result > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: #354253;
  font-size: calc(12px * var(--ui-font-scale, 1.14));
  font-weight: 700;
  cursor: pointer;
}

.ba-result > summary > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ba-result > summary small {
  color: var(--muted, #637180);
  font-size: calc(10.5px * var(--ui-font-scale, 1.14));
  font-weight: 500;
}

.ba-result > p {
  margin: 8px 0 0;
  color: #354253;
  font-size: calc(11.75px * var(--ui-font-scale, 1.14));
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ba-moves {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.ba-moves > span {
  min-width: 58px;
  display: grid;
  justify-items: center;
  padding: 4px 5px;
  border-radius: 7px;
  background: #edf1f7;
  color: var(--muted, #637180);
  font-size: calc(11px * var(--ui-font-scale, 1.14));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ba-moves .ba-up {
  background: var(--red-soft, #fff0ee);
  color: var(--red, #e23b48);
}

.ba-moves .ba-down {
  background: var(--green-soft, #eaf7f0);
  color: var(--green, #087348);
}

.ba-evidence {
  padding: 10px 11px;
  border: 1px solid var(--border-soft, #eef1f8);
  border-radius: 9px;
  background: #fbfcfe;
}

.ba-evidence + .ba-evidence {
  margin-top: 8px;
}

.ba-evidence > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #354253;
  font-size: calc(12.5px * var(--ui-font-scale, 1.14));
  cursor: pointer;
}

.ba-evidence > summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ba-evidence > summary span {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-soft, #faf3e2);
  color: var(--primary, #b8862b);
  font-size: calc(10.5px * var(--ui-font-scale, 1.14));
  font-weight: 700;
}

.ba-evidence > p {
  margin: 8px 0;
  color: #354253;
  font-size: calc(11.75px * var(--ui-font-scale, 1.14));
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ba-case-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ba-case-actions .ba-more {
  width: auto;
  margin: 0;
}

.ba-case-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 7px 4px;
  color: var(--primary, #b8862b);
  font-size: calc(11.5px * var(--ui-font-scale, 1.14));
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 900px) {
  .ba-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .ba-price .ok-plot {
    height: 230px;
  }
}

@media (max-width: 680px) {
  #author-analysis button,
  #author-analysis select {
    min-height: 40px;
  }

  .ba-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
    padding: 13px;
  }

  .ba-head label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ba-head select,
  .ba-panel > header select {
    width: 100%;
    max-width: 100%;
  }

  .ba-panel {
    padding: 12px;
  }

  .ba-panel > header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ba-panel > header label {
    width: 100%;
  }

  .ba-source > summary,
  .ba-result > summary,
  .ba-evidence > summary {
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  .ba-result > summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .ba-moves {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .ba-moves > span {
    min-width: 70px;
  }

  .ba-conditions {
    grid-template-columns: minmax(0, 1fr);
  }

  .ba-conditions dt:not(:first-child) {
    margin-top: 4px;
  }

  .ba-evidence > summary {
    align-items: flex-start;
  }
}

@media (max-width: 390px) {
  .ba-head h3 {
    font-size: calc(17px * var(--ui-font-scale, 1.14));
  }

  .ba-panel > header h4 {
    font-size: calc(14px * var(--ui-font-scale, 1.14));
  }

  .ba-heat {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "name"
      "bar"
      "total";
  }

  .ba-heat > span:last-child {
    white-space: normal;
  }

  .ba-moves > span {
    flex: 1 1 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ba-heat,
  .ba-more {
    transition: none;
  }
}
