/* ============================================
   AI 体验馆 - 4 大能力样式
   ============================================ */

.pg-hero {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}
.pg-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(139,92,246,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(236,72,153,0.3) 0%, transparent 50%);
  z-index: 0;
}
.pg-hero > * { position: relative; z-index: 1; }
.pg-hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  margin: 0 0 20px;
  background: linear-gradient(135deg, #a78bfa 0%, #f472b6 50%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pg-hero p { color: #cbd5e1; font-size: 18px; max-width: 720px; margin: 0 auto; }

.pg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 28px 0 0;
}
.pg-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  font-size: 13px;
  color: #e2e8f0;
}
.pg-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 4 大能力卡 */
.pg-cap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.pg-cap {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.25s;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.pg-cap:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(167,139,250,0.5);
  transform: translateY(-3px);
}
.pg-cap.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(236,72,153,0.15) 100%);
  border-color: rgba(167,139,250,0.6);
  box-shadow: 0 10px 30px -10px rgba(139,92,246,0.4);
}
.pg-cap-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  margin-bottom: 14px;
}
.pg-cap-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; color: #fff; }
.pg-cap-sub { font-size: 13px; color: #cbd5e1; margin: 0 0 8px; }
.pg-cap-desc { font-size: 12px; color: #94a3b8; line-height: 1.5; }
.pg-cap-tag {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(52,211,153,0.15);
  color: #34d399;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pg-cap-tag::before {
  content: ""; width: 5px; height: 5px;
  border-radius: 50%; background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

@media (max-width: 900px) {
  .pg-cap-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .pg-cap-grid { grid-template-columns: 1fr; }
}

/* 工作区 */
.pg-workspace {
  background: #0f172a;
  color: #fff;
  padding: 60px 0 80px;
  min-height: 600px;
}
.pg-panel { display: none; }
.pg-panel.active { display: block; }

.pg-panel-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pg-panel-desc { color: #94a3b8; margin: 0 0 28px; }

/* 绘画 */
.pg-paint {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
}
.pg-paint-form {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
}
.pg-paint-form label {
  display: block;
  font-size: 13px;
  color: #cbd5e1;
  margin: 12px 0 6px;
  font-weight: 600;
}
.pg-paint-form input, .pg-paint-form select, .pg-paint-form textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.pg-paint-form textarea { min-height: 100px; resize: vertical; }
.pg-paint-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}
.pg-paint-btn:hover { transform: translateY(-1px); }
.pg-paint-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pg-paint-canvas {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px;
  min-height: 480px;
  display: grid;
  place-items: center;
  position: relative;
}
.pg-paint-canvas img { max-width: 100%; max-height: 500px; border-radius: 8px; }
.pg-paint-canvas .placeholder { color: #64748b; text-align: center; }
.pg-paint-canvas .placeholder .big { font-size: 60px; margin-bottom: 8px; }
.pg-paint-loader {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.85);
  display: none;
  place-items: center;
  flex-direction: column;
  gap: 12px;
  border-radius: 16px;
}
.pg-paint-loader.show { display: flex; }
.pg-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 对话 */
.pg-chat-wrap {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 600px;
}
.pg-chat-config {
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 8px;
}
.pg-chat-config input, .pg-chat-config select {
  padding: 8px 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}
.pg-chat-config button {
  padding: 8px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.pg-chat-msgs {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pg-msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.pg-msg.user { background: linear-gradient(135deg, #a78bfa, #ec4899); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.pg-msg.assistant { background: rgba(255,255,255,0.08); color: #e2e8f0; align-self: flex-start; border-bottom-left-radius: 4px; }
.pg-msg.system { background: rgba(245,158,11,0.1); color: #fbbf24; align-self: center; font-size: 13px; max-width: 100%; text-align: center; }
.pg-msg.error { background: rgba(239,68,68,0.1); color: #fca5a5; align-self: center; font-size: 13px; max-width: 100%; text-align: center; }
.pg-chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.pg-chat-input textarea {
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
}
.pg-chat-input button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.pg-chat-input button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 语音 */
.pg-tts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.pg-tts-form, .pg-tts-result {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
}
.pg-tts-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 360px;
  text-align: center;
}
.pg-tts-result .icon-big { font-size: 80px; margin-bottom: 12px; }
.pg-tts-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.pg-tts-controls button {
  padding: 10px 16px;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  color: #fff;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.pg-tts-controls button:disabled { opacity: 0.5; cursor: not-allowed; }
.pg-tts-controls button.secondary { background: rgba(255,255,255,0.1); }
.pg-tts-wave {
  display: flex; gap: 3px; align-items: center; height: 60px; margin: 16px 0;
}
.pg-tts-wave span {
  width: 4px; background: linear-gradient(180deg, #a78bfa, #ec4899);
  border-radius: 4px;
  animation: wave 1s ease-in-out infinite;
}
.pg-tts-wave.silent span { animation: none; height: 4px !important; opacity: 0.3; }
@keyframes wave { 0%, 100% { height: 8px; } 50% { height: 50px; } }

/* 训练 */
.pg-train {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.pg-train-step {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px;
}
.pg-train-step h4 { margin: 0 0 8px; color: #fff; font-size: 16px; }
.pg-train-step .step-num {
  display: inline-block; width: 24px; height: 24px;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  color: #fff; border-radius: 50%;
  text-align: center; line-height: 24px;
  font-size: 13px; font-weight: 700;
  margin-right: 6px;
}
.pg-train-step p { color: #94a3b8; font-size: 13px; margin: 0 0 12px; }
.pg-train-class {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
.pg-train-class .slot {
  background: rgba(0,0,0,0.3);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.pg-train-class .slot:hover { border-color: #a78bfa; }
.pg-train-class .slot.has-image { border-style: solid; border-color: #34d399; }
.pg-train-class .slot img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; }
.pg-train-class .slot input { display: none; }
.pg-train-class .slot .placeholder { color: #64748b; font-size: 12px; padding: 20px 0; }
.pg-train-class .slot .name { font-size: 12px; color: #fff; margin-top: 4px; }
.pg-train-predict {
  text-align: center;
  padding: 20px;
}
.pg-train-predict canvas { max-width: 100%; border-radius: 8px; }
.pg-train-progress {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 12px 0;
  display: none;
}
.pg-train-progress.show { display: block; }
.pg-train-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #a78bfa, #ec4899);
  width: 0%;
  transition: width 0.2s;
}
.pg-train-status { color: #94a3b8; font-size: 13px; }

@media (max-width: 900px) {
  .pg-paint, .pg-tts, .pg-train { grid-template-columns: 1fr; }
  .pg-chat-config { grid-template-columns: 1fr; }
}
