/* ============================================
   skills-test.css - Skill在线运行页样式
   参考api-test.css：左侧输入 + 右侧结果展示（图片生成样式）
   ============================================ */

/* ========== 页面整体 ========== */
.skill-test-page {
  padding-bottom: 60px;
  min-height: calc(100vh - 64px);
}

/* ========== 主体：左右布局 ========== */
.test-main {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

/* ========== 左侧面板 ========== */
.test-left {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ========== 右侧面板 ========== */
.test-right {
  flex: 1;
  min-width: 0;
  background: #1a1a2e;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ========== 面板头部（右侧） ========== */
.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #2a2a3e;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
}

/* 方法徽章 */
.method-badge {
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
  text-transform: uppercase;
  background: #e3f2fd;
  color: #1565c0;
}

/* URL显示 */
.url-text {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: "Consolas", "Monaco", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* 状态徽章 */
.status-badge {
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
}

.status-badge.success {
  background: #1a3a2a;
  color: #52c41a;
}

.status-badge.error {
  background: #3a1a1a;
  color: #ff4d4f;
}

/* 耗时徽章 */
.time-badge {
  font-size: 12px;
  color: #888;
}

/* 复制按钮 */
.btn-copy-result {
  margin-left: auto;
  padding: 4px 12px;
  background: rgba(255,255,255,0.1);
  color: #aaa;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-result:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ========== 左侧Tab切换 ========== */
.left-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: #f8f9fb;
}

.left-tab {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  user-select: none;
}

.left-tab:hover {
  color: var(--primary);
}

.left-tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
  background: #fff;
}

/* Tab内容切换 */
.left-tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
}

.left-tab-content.active {
  display: flex;
}

/* 请求参数Tab：发送按钮固定底部 */
.left-tab-content[data-left-tab-content="request"] .send-bar {
  margin-top: auto;
  border-top: 1px solid var(--border);
}

/* 请求信息栏 */
.request-info-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #f8f9fb;
  border-bottom: 1px solid var(--border);
}

/* ========== Skill选择下拉 ========== */
.skill-select-row {
  padding: 12px 20px;
}

.skill-select-dropdown {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
}

.skill-select-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79,110,247,0.15);
  outline: none;
}

/* ========== 参数分组 ========== */
.param-group {
  border-bottom: 1px solid var(--border);
}

.param-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.param-group-header:hover {
  background: #fafafa;
}

.param-group-header .toggle-arrow {
  font-size: 11px;
  color: var(--text-tertiary);
  transition: transform 0.3s;
}

.param-group.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.param-group.collapsed .param-group-body {
  display: none;
}

/* ========== 参数输入行（圆角卡片样式） ========== */
.param-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #eef2f7;
  margin: 8px 16px;
  transition: all 0.2s;
}

.param-row:hover {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79,110,247,0.1);
}

.param-name {
  min-width: 110px;
  font-size: 13px;
  font-family: "Consolas", "Monaco", monospace;
  color: var(--primary);
  font-weight: 600;
}

.param-required {
  color: #ff4d4f;
  font-size: 11px;
  margin-left: 2px;
  font-weight: bold;
}

.param-type {
  min-width: 56px;
  font-size: 11px;
  color: #8b5cf6;
  background: #f5f3ff;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
  text-align: center;
}

.param-input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: var(--text-primary);
  background: #fff;
  transition: all 0.2s;
}

.param-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
  outline: none;
}

.param-input::placeholder {
  color: #b0b8c9;
}

.param-desc {
  font-size: 12px;
  color: #8896ab;
  line-height: 1.5;
  max-width: 200px;
}

/* 文件上传按钮 */
.btn-upload-label {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  background: linear-gradient(135deg, #f0f4ff, #eef2ff);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
}

.btn-upload-label:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(79,110,247,0.3);
}

/* ========== 发送栏 ========== */
.send-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}

.btn-mock {
  padding: 10px 24px;
  background: #52c41a;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-mock:hover {
  background: #45a818;
}

.btn-mock:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-send {
  padding: 10px 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-send:hover {
  background: var(--primary-hover);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-clear {
  padding: 10px 20px;
  background: #fff;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-clear:hover {
  border-color: var(--text-secondary);
}

.send-hint {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ========== 结果区域 ========== */
.result-area {
  flex: 1;
  min-height: 400px;
  padding: 20px;
  position: relative;
  overflow-y: auto;
}

/* 占位提示 */
.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 360px;
  color: #555;
}

.result-placeholder p {
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

/* 加载中 */
.result-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 360px;
  color: #888;
}

.result-loading p {
  margin-top: 12px;
  font-size: 14px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 进度条 */
.progress-bar-wrap {
  width: 300px;
  margin-top: 16px;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-bar-text {
  text-align: center;
  font-size: 13px;
  color: #aaa;
  margin-top: 6px;
}

/* ========== 图片结果展示 ========== */
.result-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 4px;
}

.result-image-card {
  background: #222240;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #333355;
  transition: all 0.3s;
}

.result-image-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(79,110,247,0.2);
}

.result-image-card img {
  width: 100%;
  display: block;
  cursor: pointer;
  transition: transform 0.3s;
}

.result-image-card img:hover {
  transform: scale(1.03);
}

.result-image-label {
  padding: 10px 14px;
  font-size: 13px;
  color: #ccc;
}

.result-image-label strong {
  color: #e0e0e0;
}

/* ========== 文本结果展示 ========== */
.result-text {
  padding: 16px;
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.8;
}

.result-text h3 {
  font-size: 16px;
  color: #fff;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333355;
}

.result-text .result-item {
  padding: 10px 0;
  border-bottom: 1px solid #2a2a3e;
}

.result-text .result-item:last-child {
  border-bottom: none;
}

.result-text .result-item-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}

.result-text .result-item-value {
  font-size: 14px;
  color: #e0e0e0;
}

/* ========== JSON原始数据 ========== */
.result-json-wrap {
  margin-top: 20px;
  border-top: 1px solid #2a2a3e;
}

.result-json-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  user-select: none;
}

.result-json-header:hover {
  color: #aaa;
}

.result-json-header .toggle-arrow {
  font-size: 11px;
  transition: transform 0.3s;
}

.result-json {
  color: #d4d4d4;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

/* JSON语法高亮 */
.result-json .json-key { color: #9cdcfe; }
.result-json .json-string { color: #ce9178; }
.result-json .json-number { color: #b5cea8; }
.result-json .json-boolean { color: #569cd6; }
.result-json .json-null { color: #569cd6; }

/* 滚动条美化 */
.result-json::-webkit-scrollbar,
.result-area::-webkit-scrollbar {
  width: 6px;
}

.result-json::-webkit-scrollbar-track,
.result-area::-webkit-scrollbar-track {
  background: transparent;
}

.result-json::-webkit-scrollbar-thumb,
.result-area::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

/* ========== 文档查看样式 ========== */
.doc-view-title {
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-view-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.doc-view-title-error {
  border-bottom-color: var(--danger);
}

.doc-view-title-error::before {
  background: var(--danger);
}

.doc-view-json {
  padding: 16px 20px;
  margin: 0;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  background: #f8f9fb;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 450px;
  overflow-y: auto;
}

/* 错误码表格 */
.doc-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.doc-ref-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  background: #f8f9fb;
  border-bottom: 1px solid var(--border);
}

.doc-ref-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text-primary);
}

.doc-ref-table tr:last-child td {
  border-bottom: none;
}

/* ========== 调用流程指引 ========== */
.flow-guide {
  margin-top: 32px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px 32px;
}

.flow-guide-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 28px;
  text-align: center;
}

.flow-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
  text-align: center;
}

.flow-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f6ef7 0%, #6c5ce7 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(79,110,247,0.3);
}

.flow-step-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.flow-step-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.flow-arrow {
  display: flex;
  align-items: center;
  padding-top: 8px;
  margin: 0 8px;
  font-size: 18px;
  color: var(--primary);
  opacity: 0.6;
}
