/* Hallmark · macrostructure: Analysis Workbench · genre: modern-minimal
 * design-system: prototype/design.md · page: 产业分析
 */

.an-page {
  min-height: calc(100vh - var(--nav-height));
  background: var(--bg-page);
}

.an-shell {
  max-width: 1540px;
  margin: 0 auto;
  padding: 20px 22px 60px;
}

.an-command {
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--border-light);
}

.an-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 11px;
}

.an-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.an-breadcrumb a:hover { color: var(--brand); }

.an-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.an-title-row h1 {
  margin: 0;
  color: var(--text-title);
  font-size: 31px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.an-title-row > div > span {
  display: block;
  margin-top: 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.an-industry-picker { flex-shrink: 0; }

.an-description {
  max-width: 850px;
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.75;
}

.an-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.an-control-label { color: var(--text-muted); font-size: 11px; }

.an-select,
.an-btn {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-secondary);
  font-size: 11px;
}

.an-select { min-width: 110px; }
.an-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  cursor: pointer;
}

.an-btn:hover,
.an-select:focus { border-color: var(--brand); color: var(--brand); outline: none; }
.an-btn.active { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }

.an-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--white);
}

.an-kpi {
  padding: 15px;
  border-right: 1px solid var(--border-light);
}

.an-kpi:last-child { border-right: 0; }
.an-kpi span { color: var(--text-muted); font-size: 10px; }
.an-kpi b { display: block; margin-top: 7px; color: var(--text-title); font-size: 22px; }
.an-kpi small { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 10px; }

.an-workspace {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
  margin-top: 16px;
}

.an-rail,
.an-ai {
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--white);
}

.an-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-light);
}

.an-panel-head b { color: var(--text-title); font-size: 12px; }
.an-panel-head span { color: var(--text-muted); font-size: 9px; }

.an-scope-list { padding: 8px; }

.an-scope-root {
  padding: 10px;
  border-radius: 6px;
  color: var(--text-title);
  font-size: 12px;
  font-weight: 700;
}

.an-scope-group { margin-top: 5px; }
.an-scope-group > button,
.an-scope-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 11px;
  cursor: pointer;
}

.an-scope-group > button:hover,
.an-scope-item:hover { background: var(--bg-hover); }
.an-scope-item.active { background: var(--brand-50); color: var(--brand); font-weight: 700; }
.an-scope-item small { color: var(--text-muted); font-size: 9px; }

.an-main { min-width: 0; display: grid; gap: 14px; }

.an-card {
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--white);
}

.an-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-light);
}

.an-card-head h2 { margin: 0; color: var(--text-title); font-size: 15px; }
.an-card-head span { color: var(--text-muted); font-size: 10px; }

.an-trend-body { display: grid; grid-template-columns: 90px minmax(0, 1fr); min-height: 230px; padding: 15px; }
.an-trend-summary { display: flex; flex-direction: column; justify-content: center; }
.an-trend-summary b { color: var(--brand); font-size: 28px; }
.an-trend-summary span { margin-top: 5px; color: var(--text-muted); font-size: 10px; }
.an-trend-chart { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.an-trend-bar-wrap { flex: 1; min-width: 14px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 190px; }
.an-trend-value { margin-bottom: 5px; color: var(--text-muted); font-size: 9px; }
.an-trend-bar { width: 100%; max-width: 28px; border-radius: 3px 3px 0 0; background: var(--brand); }
.an-trend-year { margin-top: 6px; color: var(--text-muted); font-size: 9px; }

.an-tech-list { display: grid; gap: 9px; padding: 14px 15px; }
.an-tech-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 44px; gap: 9px; align-items: center; }
.an-tech-row span:first-child { color: var(--text-body); font-size: 11px; }
.an-tech-track { height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: var(--bg-page); }
.an-tech-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.an-tech-row span:last-child { color: var(--brand); font-size: 11px; font-weight: 700; text-align: right; }

.an-table-wrap { overflow-x: auto; }
.an-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.an-table th,
.an-table td { padding: 10px 13px; border-bottom: 1px solid var(--border-light); text-align: left; font-size: 11px; }
.an-table th { color: var(--text-muted); font-weight: 600; background: var(--bg-page); }
.an-table td { color: var(--text-secondary); }
.an-table tbody tr:last-child td { border-bottom: 0; }
.an-table b { color: var(--text-title); font-size: 11px; }

.an-ai-body { padding: 14px; }
.an-ai-section { padding: 11px 0; border-bottom: 1px solid var(--border-light); }
.an-ai-section:first-child { padding-top: 0; }
.an-ai-section:last-child { border-bottom: 0; }
.an-ai-label { margin-bottom: 7px; color: var(--text-title); font-size: 11px; font-weight: 700; }
.an-ai-copy { color: var(--text-secondary); font-size: 11px; line-height: 1.7; }
.an-ai-tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.an-ai-tag { padding: 4px 7px; border-radius: var(--radius-pill); background: var(--brand-50); color: var(--brand); font-size: 9px; }

.an-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
  gap: 14px;
  margin-top: 16px;
}

.an-region-list { display: grid; gap: 9px; padding: 14px 15px; }
.an-region-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 54px; gap: 8px; align-items: center; font-size: 10px; }
.an-region-track { height: 7px; overflow: hidden; border-radius: var(--radius-pill); background: var(--bg-page); }
.an-region-track i { display: block; height: 100%; background: var(--brand); }
.an-region-row span:last-child { color: var(--text-muted); text-align: right; }

.an-evolution {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 17px 15px;
}

.an-evolution-step {
  flex: 1 0 130px;
  min-height: 90px;
  padding: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-page);
}

.an-evolution-step b { display: block; color: var(--text-title); font-size: 11px; }
.an-evolution-step span { display: block; margin-top: 6px; color: var(--text-muted); font-size: 9px; line-height: 1.55; }
.an-evolution-arrow { color: var(--brand); font-size: 14px; flex-shrink: 0; }

.an-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 1200;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--text-title);
  color: var(--white);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.an-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .an-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .an-ai { position: static; grid-column: 1 / -1; }
  .an-bottom-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .an-shell { padding: 16px 14px 50px; }
  .an-title-row { align-items: flex-start; flex-direction: column; }
  .an-industry-picker { width: 100%; }
  .an-industry-picker .industry-picker { width: 100%; min-width: 0; }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-kpi:nth-child(2n) { border-right: 0; }
  .an-kpi:nth-child(n+3) { border-top: 1px solid var(--border-light); }
  .an-workspace { grid-template-columns: minmax(0, 1fr); }
  .an-rail,
  .an-ai { position: static; }
  .an-trend-body { grid-template-columns: minmax(0, 1fr); }
  .an-trend-summary { margin-bottom: 12px; }
  .an-tech-row { grid-template-columns: 100px minmax(0, 1fr) 36px; }
}
