/* ===========================================
   练习场样式
   =========================================== */

.playground-hero {
  background: var(--gradient-soft);
  padding: 50px 0;
}

.playground-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.playground-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.panel-title {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.panel-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.panel-btn:hover {
  color: var(--primary);
  border-color: var(--primary-light);
}

.panel-btn.primary {
  background: var(--gradient);
  color: white;
  border: none;
}

.panel-btn.primary:hover {
  color: white;
  filter: brightness(1.1);
}

.prompt-area {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.prompt-input {
  flex: 1;
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  min-height: 200px;
  background: var(--bg-alt);
  transition: border-color 0.2s;
}

.prompt-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
}

.prompt-helpers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.prompt-chip {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.prompt-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-alt);
}

.code-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1f2937;
}

.code-textarea {
  flex: 1;
  background: #1f2937;
  color: #e5e7eb;
  border: none;
  padding: 16px;
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  width: 100%;
}

.code-textarea:focus {
  outline: none;
}

/* 预览 */
.preview-area {
  flex: 1;
  background: white;
  position: relative;
}

.preview-frame {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: none;
  background: white;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-light);
  gap: 16px;
  padding: 40px;
  text-align: center;
}

.preview-placeholder-icon {
  font-size: 56px;
  opacity: 0.5;
}

.preview-placeholder-text {
  font-size: 15px;
}

/* 任务卡 */
.task-card {
  background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

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

.task-icon {
  font-size: 28px;
}

.task-title {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary-dark);
}

.task-desc {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 12px;
}

.task-requirements {
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 12px;
}

.task-requirements-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-requirements ul {
  list-style: none;
  font-size: 14px;
}

.task-requirements li {
  padding: 3px 0;
}

.task-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* 示例项目库 */
.example-projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.project-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.project-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.project-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

/* 提示区 */
.ai-tips {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ai-tips-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.ai-tips-content {
  flex: 1;
}

.ai-tips-title {
  font-weight: 800;
  margin-bottom: 6px;
  color: #92400e;
}

.ai-tips-text {
  font-size: 14px;
  color: #78350f;
  line-height: 1.6;
}

/* 标签页切换 */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 4px;
}

.mode-tab {
  flex: 1;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.mode-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* 响应式 */
@media (max-width: 900px) {
  .playground-grid {
    grid-template-columns: 1fr;
  }

  .playground-panel {
    min-height: 400px;
  }
}
