body.sentiment-page {
  min-width: 1200px;
  background: #ffffff;
}

.sentiment-page .site-wrap {
  width: 1200px;
}

.sentiment-title {
  margin-bottom: 16px;
}

.sentiment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(220px, 0.7fr) minmax(0, 1.22fr);
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

.sentiment-grid > .panel {
  min-width: 0;
}

.sentiment-input-body {
  display: flex;
  flex-direction: column;
}

.sentiment-textarea {
  min-height: 360px;
  font-size: 14px;
}

.sentiment-input-toolbar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.api-config {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.api-config-row {
  margin-top: 8px;
}

.sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.sample-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-mid);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
}

.sample-chip:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.btn {
  gap: 6px;
}

.btn-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sample-chip .btn-icon {
  width: 12px;
  height: 12px;
  opacity: 0.9;
}

.sentiment-input-meta {
  margin: 0;
}

.sentiment-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.sentiment-input-limit {
  margin: 4px 0 0;
}

.sentiment-input-ad-wrap {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.sentiment-input-ad {
  width: 300px;
  height: 250px;
  max-width: 100%;
}

.sentiment-clear-btn {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  flex-shrink: 0;
}

.sentiment-options-panel .panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sentiment-summary-actions {
  display: flex;
}

.sentiment-summary-actions .btn-primary {
  width: 100%;
}

.sentiment-contour-block {
  margin-top: 8px;
  margin-bottom: 12px;
}

.sentiment-treemap-block {
  margin-top: 0;
}

.sentiment-weather-panel {
  margin-top: 0;
}

.weather-summary {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: linear-gradient(160deg, #f8fafc 0%, #ecfeff 100%);
}

.weather-icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
}

.weather-icon {
  width: 62px;
  height: 62px;
}

.weather-label {
  margin: 0;
  color: var(--ink-main);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.weather-description {
  margin: 4px 0 0;
  color: var(--ink-mid);
  font-size: 13px;
  line-height: 1.5;
}

.temperature-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #ffffff;
}

.temperature-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--ink-mid);
}

.temperature-label-row strong {
  font-size: 22px;
  line-height: 1;
  color: var(--ink-main);
}

.temperature-track {
  margin-top: 8px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #93c5fd 0%, #ffffff 50%, #fda4af 100%);
  border: 1px solid var(--line);
  overflow: hidden;
}

.temperature-fill {
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.16);
  transition: width 260ms ease;
}

.temperature-caption {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-mid);
}

.metric-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  background: #ffffff;
}

.metric-label {
  margin: 0;
  font-size: 11px;
  color: var(--ink-muted);
}

.metric-value {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-main);
}

.keyword-block {
  margin-top: 12px;
}

.keyword-title {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--ink-mid);
  font-weight: 600;
}

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.sentiment-result-panel .panel-body {
  padding-top: 12px;
}

.sentiment-lead {
  margin: 0 0 12px;
  color: var(--ink-mid);
  font-size: 13px;
  line-height: 1.6;
}

.emotion-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.sentiment-distribution-block {
  margin-top: 8px;
}

.sentiment-distribution-block .emotion-bars {
  margin-bottom: 0;
}

.emotion-bar-row {
  display: grid;
  grid-template-columns: 58px 1fr 48px;
  gap: 8px;
  align-items: center;
}

.emotion-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mid);
}

.emotion-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.emotion-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 260ms ease;
}

.emotion-bar-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-align: right;
}

.heatmap-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.vector-debug {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.vector-debug-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.vector-debug-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-main);
}

.vector-debug-meta {
  margin: 0;
  font-size: 11px;
  color: var(--ink-muted);
}

.vector-output {
  width: 100%;
  min-height: 160px;
  max-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  line-height: 1.5;
  padding: 10px;
}

.advanced-viz-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.viz-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.viz-head {
  margin-bottom: 8px;
}

.viz-title {
  margin: 0;
  font-size: 13px;
  color: var(--ink-main);
  font-weight: 700;
}

.viz-subtitle {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--ink-muted);
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--ink-mid);
  background: #f8fafc;
}

.viz-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.treemap-scale-legend {
  justify-content: flex-start;
}

.treemap-scale-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(90deg, #3b82f6 0%, #475569 50%, #ef4444 100%);
}

.treemap-scale-labels {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 10px;
  color: var(--ink-muted);
}

.viz-canvas-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 8px;
}

.viz-canvas {
  width: 100%;
  display: block;
}

.sentiment-contour-block .viz-canvas-wrap,
.sentiment-treemap-block .viz-canvas-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.viz-save-actions {
  margin-top: 8px;
  display: flex;
}

.viz-save-actions .btn {
  width: 100%;
}

.summary-card-block {
  margin-top: 12px;
}

.summary-card-wrap {
  min-height: 320px;
}

.summary-card-canvas {
  min-height: 300px;
}

.summary-card-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.heatmap-scroll {
  overflow-x: auto;
}

.heatmap-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.heatmap-table th,
.heatmap-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px 6px;
  font-size: 12px;
  text-align: center;
}

.heatmap-table th:last-child,
.heatmap-table td:last-child {
  border-right: 0;
}

.heatmap-table tr:last-child td {
  border-bottom: 0;
}

.heatmap-table thead th {
  background: #f8fafc;
  color: var(--ink-mid);
  font-weight: 600;
}

.heatmap-table th:first-child,
.heatmap-table td:first-child {
  text-align: left;
  min-width: 260px;
  max-width: 260px;
}

.heatmap-sentence {
  color: var(--ink-mid);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-cell {
  border-radius: 8px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.empty-box {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

@media (max-width: 1199px) {
  body.sentiment-page {
    min-width: 0;
  }

  .sentiment-page .site-wrap {
    width: 100%;
    min-width: 0;
  }

  .sentiment-grid {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
  }

  .sentiment-summary-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  body.sentiment-page {
    min-width: 0;
  }

  .sentiment-page .site-wrap {
    width: 100%;
    min-width: 0;
    padding: 0 10px 20px;
  }

  .sentiment-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .sentiment-textarea {
    min-height: 320px;
  }

  .sentiment-input-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advanced-viz-grid {
    grid-template-columns: 1fr;
  }
}
