/* 通用样式 */
:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --success-color: #4cc9f0;
  --danger-color: #f72585;
  --warning-color: #f9c74f;
  --info-color: #4895ef;
  --dark-color: #242a30;
  --light-color: #f8f9fa;
  --border-radius: 6px;
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  --transition-speed: 0.3s;
}

body {
  font-family: 'Inter', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fb;
  line-height: 1.6;
  color: #444;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 分栏布局优化 */
@media (min-width: 992px) {
  #list-panel, #detail-panel {
    min-height: 80vh;
  }
  #list-panel {
    /* border-right: 1.5px solid #e9ecef; */
    padding-right: 1px;
  }
  #detail-panel {
    padding-left: 1px;
  }
}

/* 卡片美化 */
.card, .card-body, .card-header {
  border-radius: var(--border-radius);
}
.card {
  box-shadow: 0 6px 24px rgba(67, 97, 238, 0.08);
  border: none;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  margin: 0;
  font-weight: 600;
  color: var(--dark-color);
  font-size: 1.2rem;
}

.card-body {
  padding: 20px;
}

/* 表格样式 */
.table {
  width: 100%;
  margin-bottom: 0;
  color: #212529;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px 6px;
  vertical-align: middle;
  border-top: 1px solid #e9ecef;
}

.table th {
  font-weight: 600;
  background-color: #f8f9fa;
  color: #495057;
  border-top: none;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: background-color var(--transition-speed);
}

.table tbody tr:hover {
  background-color: rgba(67, 97, 238, 0.05);
}

.table tbody tr:nth-child(even) {
  background-color: #f9fafc;
}

/* HTTP方法标签样式 */
.badge {
  padding: 9px 10px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  display: inline-block;
  white-space: nowrap;
}

.method-get {
  background-color: rgba(25, 135, 84, 0.15);
  color: #198754;
}

.method-post {
  background-color: rgba(67, 97, 238, 0.15);
  color: #4361ee;
}

.method-put {
  background-color: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.method-delete {
  background-color: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

.method-patch {
  background-color: rgba(111, 66, 193, 0.15);
  color: #6f42c1;
}

/* 状态码样式 */
.status-2xx {
  color: #198754;
  font-weight: 600;
}

.status-3xx {
  color: #fd7e14;
  font-weight: 600;
}

.status-4xx {
  color: #dc3545;
  font-weight: 600;
}

.status-5xx {
  color: #7209b7;
  font-weight: 600;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  border-radius: var(--border-radius);
  transition: all var(--transition-speed);
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(63, 55, 201, 0.3);
}

.btn-outline-primary {
  color: var(--primary-color);
  background-color: transparent;
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.76563rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}

/* 筛选面板样式 */
#filter-panel {
  display: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-speed), opacity var(--transition-speed),padding var(--transition-speed);
  opacity: 0;
}

#filter-panel.show {
  max-height: 800px;
  opacity: 1;
}

.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #495057;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  appearance: none;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-select:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* 分页样式 */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  border-radius: 0.25rem;
  justify-content: center;
}

.page-item:first-child .page-link {
  margin-left: 0;
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
}

.page-item:last-child .page-link {
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

.page-item.active .page-link {
  z-index: 1;
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.page-item.disabled .page-link {
  color: #6c757d;
  pointer-events: none;
  cursor: not-allowed;
  background-color: #fff;
  border-color: #dee2e6;
}

.page-link {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  margin-left: -1px;
  line-height: 1.25;
  color: var(--primary-color);
  background-color: #fff;
  border: 1px solid #dee2e6;
  transition: color var(--transition-speed), background-color var(--transition-speed), border-color var(--transition-speed);
}

.page-link:hover {
  z-index: 2;
  color: var(--secondary-color);
  text-decoration: none;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.page-link:focus {
  z-index: 2;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* 加载动画 */
.loading-container {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 10;
  transition: opacity var(--transition-speed);
}

.spinner {
  width: 40px;
  height: 40px;
  position: relative;
}

.double-bounce1, .double-bounce2 {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--primary-color);
  opacity: 0.6;
  position: absolute;
  top: 0;
  left: 0;
  animation: sk-bounce 2.0s infinite ease-in-out;
}

.double-bounce2 {
  animation-delay: -1.0s;
}

@keyframes sk-bounce {
  0%, 100% {
    transform: scale(0.0);
  } 50% {
    transform: scale(1.0);
  }
}

/* 详情页样式 */
.detail-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.detail-header .id {
  font-family: monospace;
  background-color: #f8f9fa;
  padding: 5px 10px;
  border-radius: var(--border-radius);
  margin-left: 10px;
  font-size: 0.9rem;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 5px;
  display: block;
}

.detail-value {
  word-break: break-word;
}

/* 详情区内容块 */
.detail-block {
  background: #f8f9fa;
  border-radius: var(--border-radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.04);
}
.detail-label {
  color: #3f37c9;
  font-weight: 600;
  margin-right: 8px;
}
.detail-value {
  color: #222;
  word-break: break-all;
}

/* 代码块美化 */
.code-block {
  background: #23272e;
  color: #e9ecef;
  border-radius: var(--border-radius);
  padding: 16px;
  font-size: 0.98rem;
  overflow-x: auto;
  margin-bottom: 0;
}

/* 复制按钮样式 */
.copy-btn {
  z-index: 2;
  font-size: 0.85rem;
}

.dine {
  padding: 15px;
}

/* JSON高亮 */
.json-key { color: #f9c74f; }
.json-string { color: #4cc9f0; }
.json-number { color: #b5179e; }
.json-boolean { color: #4895ef; }
.json-null { color: #adb5bd; }

/* alert美化 */
.alert {
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.08);
}

/* 细节优化 */
::-webkit-scrollbar {
  width: 8px;
  background: #f1f3fa;
}
::-webkit-scrollbar-thumb {
  background: #dbe4f3;
  border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header .btn {
    margin-top: 10px;
  }

  .table th, .table td {
    padding: 8px;
  }

  .table .text-truncate {
    max-width: 100px;
  }
}

@media (max-width: 576px) {
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-header .id {
    margin-left: 0;
    margin-top: 10px;
  }

  .nav-tabs {
    flex-direction: column;
  }

  .nav-item {
    margin-bottom: 5px;
  }
}

/* 日志表格列宽与横向滚动 */
.table-logs {
  min-width: 950px;
  table-layout: fixed;
}
.table-logs th, .table-logs td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-logs th:nth-child(1), .table-logs td:nth-child(1) { width: 2.1vw; }
.table-logs th:nth-child(2), .table-logs td:nth-child(2) { width: 12vw; }
.table-logs th:nth-child(3), .table-logs td:nth-child(3) { width: 10vw; }
.table-logs th:nth-child(4), .table-logs td:nth-child(4) { width: 3vw; }
.table-logs th:nth-child(5), .table-logs td:nth-child(5) { width: 10vw; }
.table-logs th:nth-child(6), .table-logs td:nth-child(6) { width: 3vw; }
.table-logs th:nth-child(7), .table-logs td:nth-child(7) { width: 4vw; }
.table-logs th:nth-child(8), .table-logs td:nth-child(8) { width: 5vw; }

.table-responsive {
  overflow-x: auto;
}

/* 列表行选中改变背景颜色淡蓝色 */
.table-logs tbody tr.selected {
  background-color: rgba(67,175,238,0.31);
}
