[data-business-agent] { flex: 1; min-height: 0; width: 100%; color: var(--text-1, var(--text-primary, #182335)); }
.view-toggle-btn { white-space: nowrap; flex-shrink: 0; }
.mobile-header .view-toggle-btn { width: auto; padding: 0 9px; font-size: 11px; }
/* Chat-first: the agent page drops the shared topbar and its own title block. */
body[data-page="reports"] .topbar { display: none; }
.agent-top { padding: 2px 4px 10px; }
.agent-toolbar { display: flex; align-items: stretch; background: var(--agent-card); border: 1px solid var(--agent-line); border-radius: 12px; overflow: hidden; }
.agent-date-inline { display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 46px; font-size: 10px; color: var(--agent-muted); border-right: 1px solid var(--agent-line); flex-shrink: 0; }
.agent-date-inline input { font: inherit; font-size: 12px; border: 0; background: transparent; color: inherit; padding: 0; }
.agent-live-overview { flex: 1 1 auto; min-width: 0; display: flex; }
.agent-toolbar .agent-metric-grid { margin: 0; gap: 0; border: 0; border-radius: 0; background: transparent; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1; }
.agent-toolbar .agent-metric-card { padding: 0 14px; border: 0; border-radius: 0; background: transparent; align-items: center; min-height: 46px; }
.agent-toolbar .agent-metric-card + .agent-metric-card { border-left: 1px solid var(--agent-line); }
.agent-toolbar .agent-reset { border: 0; border-left: 1px solid var(--agent-line); border-radius: 0; background: transparent; padding: 0 16px; font-size: 12px; display: inline-flex; align-items: center; flex-shrink: 0; }
.agent-toolbar .agent-reset:hover { background: rgba(57,117,223,.05); color: #3975df; }
.agent-live-note { margin: 9px 2px 0; font-size: 10px; color: var(--agent-muted); }
.agent-reset { background: var(--agent-card); color: inherit; border: 1px solid var(--agent-line); padding: 7px 13px; border-radius: 9px; font: inherit; font-size: 12px; cursor: pointer; }
.agent-shell { --agent-muted: var(--text-3, var(--text-secondary, #768398)); --agent-line: var(--border, #dfe6ef); --agent-card: var(--bg-card, var(--surface, #fff)); display: flex; flex-direction: column; height: 100%; max-width: 1040px; margin: auto; min-height: 480px; }
.agent-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 20px; }
.agent-eyebrow { font-size: 10px; letter-spacing: .18em; color: var(--agent-muted); font-weight: 600; }
.agent-header h2 { font-size: 26px; margin: 7px 0 0; letter-spacing: -.04em; display: flex; gap: 10px; align-items: center; }
.agent-store-line { font-size: 10px; color: var(--agent-muted); line-height: 1.7; margin: -8px 4px 14px; }
.agent-dot { width: 7px; height: 7px; background: #23a782; border-radius: 50%; }
.agent-reset { background: var(--agent-card); color: inherit; border: 1px solid var(--agent-line); padding: 7px 13px; border-radius: 9px; font: inherit; font-size: 12px; cursor: pointer; }
.agent-date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; font-size: 11px; color: var(--agent-muted); border-bottom: 1px solid var(--agent-line); padding: 0 4px 14px; }
.agent-date-row label { display: flex; align-items: center; gap: 8px; }
.agent-date-row input { font: inherit; font-size: 12px; border: 1px solid var(--agent-line); border-radius: 8px; padding: 7px; background: var(--agent-card); color: inherit; }
.agent-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 4px; scrollbar-width: thin; }
/* Empty conversation gets one quiet line instead of a blank page. */
.agent-messages:empty { display: flex; align-items: center; justify-content: center; }
.agent-messages:empty::after { content: '直接提问，或从下方快捷问题开始'; color: var(--agent-muted); font-size: 12px; letter-spacing: .02em; }
.agent-orbit { background: linear-gradient(135deg, rgba(58,121,231,.16), rgba(65,173,169,.07)); width: 48px; height: 48px; border-radius: 16px; font-size: 30px; color: #3975df; display: grid; place-items: center; }
.agent-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 26px; }
.agent-metric-card { min-width: 0; background: var(--agent-card); border: 1px solid var(--agent-line); border-radius: 12px; padding: 12px 15px; display: flex; flex-direction: row; align-items: baseline; gap: 8px; }
.agent-metric-label { color: var(--agent-muted); font-size: 10px; white-space: nowrap; }
.agent-metric-value { font-size: clamp(16px, 1.5vw, 19px); font-weight: 650; letter-spacing: -.03em; overflow-wrap: anywhere; white-space: nowrap; }
.agent-metric-note { font-size: 9px; color: var(--agent-muted); line-height: 1.5; margin-left: auto; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1400px) {
  .agent-toolbar .agent-metric-note { display: none; }
}
@media (max-width: 980px) {
  .agent-toolbar { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "date reset" "metrics metrics"; }
  .agent-date-inline { grid-area: date; border-right: 0; }
  .agent-toolbar .agent-reset { grid-area: reset; }
  .agent-live-overview { grid-area: metrics; border-top: 1px solid var(--agent-line); }
  .agent-toolbar .agent-metric-card { min-height: 52px; }
}
.agent-weather-card { display: flex; gap: 20px; align-items: center; padding: 20px; margin: 16px 0; border-radius: 15px; background: linear-gradient(120deg, rgba(67,142,233,.13), rgba(239,187,71,.08)); border: 1px solid var(--agent-line); }
.agent-weather-icon { width: 64px; flex-shrink: 0; color: #638fc7; }
.agent-weather-icon svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.agent-weather-body h4 { font-size: 11px; margin: 0 0 8px; color: var(--agent-muted); }
.agent-weather-body strong { display: block; }
.agent-weather-temperature { font-size: 28px; letter-spacing: -.04em; }
.agent-weather-measures { font-size: 12px; margin-top: 9px; }
.agent-weather-body small { display: block; font-size: 9px; line-height: 1.6; margin-top: 8px; color: var(--agent-muted); }
.agent-data-card { border: 1px solid var(--agent-line); border-radius: 14px; background: var(--agent-card); margin-top: 16px; padding: 16px; min-width: 0; }
.agent-data-card h4 { font-size: 12px; margin: 0 0 12px; }
.agent-table-wrap { overflow-x: auto; max-width: 100%; }
.agent-table-wrap table { width: 100%; border-collapse: collapse; font-size: 11px; line-height: 1.65; }
.agent-table-wrap th { color: var(--agent-muted); font-size: 10px; font-weight: 500; text-align: left; }
.agent-table-wrap td, .agent-table-wrap th { padding: 10px 9px; border-bottom: 1px solid var(--agent-line); vertical-align: top; }
.agent-table-wrap td:not(:first-child) { font-variant-numeric: tabular-nums; }
.agent-table-wrap tr:last-child td { border-bottom: 0; }
.agent-data-note { display: block; color: var(--agent-muted); font-size: 9px; line-height: 1.6; margin-top: 10px; }
/* Answer evidence: weather and cinema share a row; tables stay collapsed. */
.agent-evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; margin-top: 16px; }
.agent-evidence-grid > * { margin: 0; min-width: 0; }
.agent-details { padding: 0; overflow: hidden; }
.agent-details summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; padding: 14px 16px; font-size: 12px; font-weight: 600; list-style: none; }
.agent-details summary::-webkit-details-marker { display: none; }
.agent-details summary::after { content: '展开'; font-size: 10px; font-weight: 400; color: var(--agent-muted); }
.agent-details[open] summary { border-bottom: 1px solid var(--agent-line); }
.agent-details[open] summary::after { content: '收起'; }
.agent-details .agent-table-wrap { padding: 0 16px; }
.agent-details .agent-data-note { padding: 0 16px 14px; margin-top: 8px; }
.agent-forecast-card { background: linear-gradient(140deg, rgba(67,142,233,.09), var(--agent-card) 58%); }
.agent-forecast-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.agent-forecast-range { font-size: 24px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.agent-forecast-orders { font-size: 13px; color: var(--agent-muted); font-variant-numeric: tabular-nums; }
.agent-forecast-center { margin-top: 8px; font-size: 12px; color: var(--agent-muted); }
.agent-forecast-pace { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(67,142,233,.08); font-size: 11px; line-height: 1.7; }
.agent-forecast-unavailable { margin: 0; color: var(--agent-muted); font-size: 12px; line-height: 1.7; }
.agent-cinema-card { background: linear-gradient(140deg, rgba(239,187,71,.10), var(--agent-card) 60%); }
.agent-cinema-name { font-size: 11px; color: var(--agent-muted); margin-bottom: 8px; }
.agent-cinema-windows { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-cinema-window { font-size: 12px; padding: 5px 9px; border-radius: 8px; background: rgba(67,142,233,.08); font-variant-numeric: tabular-nums; }
.agent-cinema-late { margin-top: 8px; font-size: 10px; color: var(--agent-muted); line-height: 1.6; }
.agent-suggests { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 4px 10px; }
.agent-suggests button { font: inherit; font-size: 11px; color: var(--agent-muted); background: var(--agent-card); border: 1px solid var(--agent-line); border-radius: 999px; padding: 7px 13px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.agent-suggests button:hover { color: #3975df; border-color: #3975df; background: rgba(57,117,223,.05); }
.agent-suggests[hidden] { display: none; }
.agent-composer { flex-shrink: 0; background: var(--agent-card); border: 1px solid var(--agent-line); border-radius: 18px; padding: 13px 16px 10px; box-shadow: 0 6px 24px rgba(20,45,80,.04); margin: 0 4px 4px; }
.agent-input-label { display: block; font-size: 11px; color: var(--agent-muted); margin-bottom: 7px; }
.agent-input-row { display: flex; align-items: flex-end; gap: 10px; }
.agent-input-row textarea { width: 100%; resize: none; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; line-height: 1.6; outline: none; min-height: 48px; max-height: 150px; }
.agent-composer:focus-within { border-color: #3975df; }
.agent-send { background: #3975df; color: white; border: 0; border-radius: 12px; width: 40px; height: 40px; flex-shrink: 0; font-size: 24px; cursor: pointer; }
.agent-send:disabled, .agent-reset:disabled { opacity: .5; cursor: wait; }
.agent-composer-note { display: flex; justify-content: space-between; gap: 10px; color: var(--agent-muted); font-size: 10px; padding-top: 10px; line-height: 1.6; }
.agent-message { max-width: 850px; margin: 0 0 22px; }
.agent-message-label { color: var(--agent-muted); font-size: 10px; letter-spacing: .06em; margin: 0 0 9px; }
.agent-answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.95; }
.agent-message-user { margin-left: auto; max-width: 78%; width: fit-content; background: rgba(57,117,223,.08); border-radius: 16px 16px 4px 16px; padding: 12px 18px; }
.agent-message-user .agent-message-label { display: none; }
.agent-message-assistant { border-bottom: 1px solid var(--agent-line); padding-bottom: 20px; }
.agent-message-error { color: #b85147; }
.agent-chart { border: 1px solid var(--agent-line); background: var(--agent-card); border-radius: 14px; padding: 16px; margin-top: 16px; }
.agent-chart h4 { font-size: 12px; margin: 0 0 15px; }
.agent-chart-canvas { position: relative; height: 220px; min-width: 0; }
.agent-chart summary { font-size: 11px; color: var(--agent-muted); margin-top: 12px; cursor: pointer; }
.agent-chart-values { font-size: 11px; line-height: 1.9; padding-top: 8px; }
.agent-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.agent-sources a { font-size: 10px; padding: 5px 9px; border: 1px solid var(--agent-line); border-radius: 7px; color: #3975df; text-decoration: none; }
#page-reports { overflow: hidden; }
body[data-page="reports"] .scrape-toast { bottom: auto; top: calc(var(--topbar-h, 64px) + 8px); }
#page-more .agent-shell { height: calc(100dvh - var(--header-h, 56px) - var(--nav-h, 64px) - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 40px); min-height: 360px; }
#page-more .agent-header { padding-top: 0; }
@media (max-width: 600px) {
  .agent-header h2 { font-size: 23px; }
  .agent-header { padding-bottom: 16px; }
  .agent-date-row { gap: 7px; font-size: 10px; }
  .agent-date-row input { font-size: 12px; }
  .agent-composer { margin: 0; padding: 11px 12px 8px; border-radius: 15px; }
  .agent-input-row textarea { font-size: 16px; }
  .agent-composer-note { font-size: 9px; }
  .agent-message-user { max-width: 90%; }
  .agent-answer { font-size: 13px; line-height: 1.9; }
  .agent-chart { padding: 12px; }
  .agent-chart-canvas { height: 190px; }
  .agent-orbit { width: 36px; height: 36px; border-radius: 12px; font-size: 25px; }
  .agent-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 18px; }
  .agent-metric-card { flex-direction: column; align-items: flex-start; padding: 10px 11px; border-radius: 11px; gap: 3px; }
  .agent-metric-note { display: none; }
  .agent-metric-label { font-size: 9px; }
  .agent-metric-value { font-size: 17px; }
  .agent-metric-note { font-size: 8px; }
  .agent-suggests { padding-bottom: 8px; }
  .agent-evidence-grid { grid-template-columns: 1fr; }
  .agent-toolbar { flex-wrap: wrap; }
  .agent-date-inline { order: 1; }
  .agent-toolbar .agent-reset { order: 2; margin-left: auto; }
  .agent-live-overview { order: 3; flex-basis: 100%; margin-top: 8px; }
  .agent-weather-card { padding: 15px; gap: 12px; }
  .agent-weather-icon { width: 46px; }
  .agent-weather-temperature { font-size: 25px; }
  .agent-data-card { padding: 12px; }
  .agent-table-wrap table { min-width: 360px; }
}

/* Thinking progress: dots + elapsed seconds so slow reasoning is visible. */
.agent-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--text-3, #6b7a90);
  font-size: 13px;
}
.agent-thinking-dots { display: inline-flex; gap: 4px; }
.agent-thinking-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; display: block;
  animation: agent-thinking-dot 1s infinite ease-in-out;
}
.agent-thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.agent-thinking-dots i:nth-child(3) { animation-delay: 0.3s; }
.agent-thinking-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  opacity: 0.8;
}
@keyframes agent-thinking-dot {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Weather strip under chart labels */
.agent-chart-weather {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-3, #6b7a90);
  text-align: center;
}
.agent-chart-weather b { display: block; font-weight: 500; font-size: 12px; }
.agent-chart-weather em { font-style: normal; opacity: 0.85; display: block; }
