/* 全局样式覆盖 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fa;
}

#app {
  min-height: 100vh;
}

/* 应用容器 */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部导航 */
.app-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  height: 60px;
  display: flex;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 20px;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
}

.header-right {
  margin-left: auto;
  padding-right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right .el-button--primary {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.header-right .el-button--primary:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 主容器 */
.app-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* 左侧 API 列表 */
.sidebar {
  width: 280px;
  background: #fff;
  border-right: 1px solid #e4e7ed;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-box {
  margin-bottom: 12px;
}

.method-filters {
  margin-bottom: 12px;
}

.method-filters .el-checkbox-group {
  display: flex;
  gap: 4px;
}

.method-filters .el-checkbox-button__inner {
  padding: 6px 12px;
  font-size: 12px;
}

.api-list {
  flex: 1;
  overflow-y: auto;
}

.category-group {
  margin-bottom: 8px;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #606266;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.category-title:hover {
  background-color: #f5f7fa;
}

.category-title .count {
  font-weight: normal;
  color: #909399;
  font-size: 12px;
  margin-left: 4px;
}

.api-items {
  padding-left: 20px;
}

.api-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  margin-bottom: 2px;
}

.api-item:hover {
  background-color: #f0f2f5;
}

.api-item.active {
  background-color: #ecf5ff;
  color: #409eff;
}

.api-item .api-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 方法标签 */
.method-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  color: #fff;
}

.method-tag.get,
.method-tag.GET {
  background-color: #67c23a;
}

.method-tag.post,
.method-tag.POST {
  background-color: #409eff;
}

.method-tag.put,
.method-tag.PUT {
  background-color: #e6a23c;
}

.method-tag.delete,
.method-tag.DELETE {
  background-color: #f56c6c;
}

.required-icon {
  color: #f56c6c;
  font-size: 12px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: #f5f7fa;
}

/* 历史侧边栏 */
.history-sidebar {
  width: 260px;
  background: #fff;
  border-left: 1px solid #e4e7ed;
  display: flex;
  flex-direction: column;
}

/* API 信息卡片 */
.api-info-card {
  margin-bottom: 16px;
}

.api-info-card .el-card__header {
  padding: 12px 16px;
  background: #fafafa;
  border-bottom: 1px solid #ebeef5;
}

.api-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.api-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  color: #fff;
}

.method-badge.get,
.method-badge.GET {
  background-color: #67c23a;
}

.method-badge.post,
.method-badge.POST {
  background-color: #409eff;
}

.method-badge.put,
.method-badge.PUT {
  background-color: #e6a23c;
}

.method-badge.delete,
.method-badge.DELETE {
  background-color: #f56c6c;
}

.api-path {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  color: #303133;
}

.api-desc {
  margin: 0;
  color: #606266;
  font-size: 13px;
  line-height: 1.6;
}

/* 参数卡片 */
.params-card {
  margin-bottom: 16px;
}

.params-card .el-card__header {
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid #ebeef5;
  font-size: 14px;
  font-weight: 600;
}

.param-tip {
  font-size: 12px;
  color: #909399;
  margin-top: 4px;
  line-height: 1.4;
}

.el-form-item__label {
  font-size: 13px;
}

/* 按钮区域 */
.action-buttons {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* 响应卡片 */
.response-card {
  margin-bottom: 16px;
}

.response-card .el-card__header {
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid #ebeef5;
}

.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.response-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.response-time {
  font-size: 13px;
  color: #909399;
}

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

.response-content {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.response-content .el-textarea__inner {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  background: #fafafa;
}

/* 示例卡片 */
.example-card {
  margin-bottom: 16px;
}

.example-card .el-card__header {
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid #ebeef5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 响应文本框 */
.response-textarea .el-textarea__inner {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  background: #fafafa;
}

.example-content {
  margin: 0;
  padding: 12px;
  background: #fafafa;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
  max-height: 200px;
  overflow: auto;
}

/* 空白状态 */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
}

/* 历史记录 */
.history-sidebar {
  background: #fff;
  border-left: 1px solid #e4e7ed;
  display: flex;
  flex-direction: column;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid #ebeef5;
  font-size: 14px;
  font-weight: 600;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 4px;
  transition: background-color 0.2s;
}

.history-item:hover {
  background-color: #f0f2f5;
}

.history-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-history {
  padding: 20px;
  text-align: center;
  color: #909399;
  font-size: 13px;
}

.history-time {
  color: #909399;
  font-size: 11px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f5f7fa;
}

::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #909399;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .history-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 240px;
  }

  .header-left {
    padding-left: 12px;
  }

  .header-title {
    display: none;
  }
}

/* Token 对话框 */
.el-dialog__body {
  padding-bottom: 10px;
}

/* 加载状态 */
.el-button .el-icon {
  margin-right: 4px;
}

/* Alert 样式 */
.el-alert {
  margin-bottom: 16px;
}

/* 表格相关 */
.el-table {
  font-size: 13px;
}

/* 标签页 */
.el-tabs__header {
  margin-bottom: 16px;
}