/* AI走势预测分析面板样式 */

/* ── AI分析区域（上下左右布局） ── */
.ai-analysis-section {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  margin-top: 20px;
  min-height: 400px;
}

/* ── 控制区（下左） ── */
.ai-controls {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
}

.ai-controls-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 350px;
}

.ai-controls .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ai-controls .section-header h3 {
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── 详情区（下右） ── */
.ai-details {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 350px;
  max-height: 600px;
  overflow-y: auto;
}

/* 空状态和加载状态 */
.ai-details .empty-state,
.ai-details .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text2);
  gap: 12px;
}

.ai-details .empty-state i,
.ai-details .loading-state i {
  font-size: 48px;
  opacity: 0.5;
}

.ai-details .loading-state i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── 操作建议卡片 ── */
.action-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  border: 1px solid var(--green);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--green);
}

.action-card.short {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  border-color: var(--red);
}

.action-card.short::before {
  background: var(--red);
}

.action-card.close {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
  border-color: var(--yellow);
}

.action-card.close::before {
  background: var(--yellow);
}

.action-card.wait {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.1), rgba(148, 163, 184, 0.05));
  border-color: var(--text2);
}

.action-card.wait::before {
  background: var(--text2);
}

.action-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.action-header i {
  font-size: 28px;
}

.action-card.long .action-header i { color: var(--green); }
.action-card.short .action-header i { color: var(--red); }
.action-card.close .action-header i { color: var(--yellow); }
.action-card.wait .action-header i { color: var(--text2); }

.action-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.confidence-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.action-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.action-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-item label {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-item label i {
  font-size: 14px;
}

.price-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.price-loss { color: var(--red); }
.price-profit { color: var(--green); }

.action-warning {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--yellow);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fef3c7;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── 详情区域 ── */
.detail-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.detail-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-text {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 12px;
}

/* 指标网格 */
.ind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ind-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ind-key {
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
}

.ind-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

/* 价格位 */
.price-levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.level-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.level-item.support { border-left: 3px solid var(--green); }
.level-item.resistance { border-left: 3px solid var(--red); }

.level-item label {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-item span {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* 新闻列表 */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  transition: all 0.2s;
}

.news-item:hover {
  border-color: var(--accent);
  background: var(--bg3);
}

.news-source {
  font-size: 11px;
  color: var(--text2);
  background: rgba(255,255,255,0.05);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.news-title {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-sentiment {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.news-sentiment.positive {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green);
}

.news-sentiment.negative {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.news-sentiment.neutral {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text2);
}

/* 推理步骤 */
.reasoning-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-item {
  display: flex;
  gap: 12px;
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

/* ── 表单元素 ── */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
}

.form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-group select:hover {
  border-color: var(--accent);
  background-color: var(--bg3);
}

.form-group select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-group select option {
  background: var(--bg);
  padding: 10px;
}

.default-tag {
  color: var(--accent);
  font-size: 12px;
  margin-left: 4px;
}

/* 时间周期按钮网格 */
.tf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tf-grid button {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tf-grid button:hover {
  border-color: var(--accent);
  background: var(--bg3);
  color: var(--text);
}

.tf-grid button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Toggle开关 */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.toggle-label span {
  font-size: 14px;
  color: var(--text);
}

/* 加载徽章 */
.loading-badge {
  font-size: 11px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* 块级按钮 */
.btn-block {
  width: 100%;
  margin-top: 8px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .ai-controls {
    grid-template-columns: 1fr;
  }
  
  .action-body {
    grid-template-columns: 1fr;
  }
  
  .price-levels {
    grid-template-columns: 1fr;
  }
}