/**
 * kimi-config.css - Kimi Code API 配置页面样式
 * 大汇通电商 - 后台配置板块
 */

/* ===== 页面容器 ===== */
.kimi-config-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.kimi-config-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* ===== 状态栏 ===== */
.kimi-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  gap: 16px;
  flex-wrap: wrap;
}

.kimi-status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  position: relative;
}

.status-dot.status-online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(82, 196, 26, 0.5);
}

.status-dot.status-offline {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(245, 34, 47, 0.3);
}

.status-indicator .status-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.status-model {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.kimi-status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kimi-status-actions .btn {
  padding: 8px 18px;
  font-size: 13px;
}

/* ===== 配置表单 ===== */
.kimi-config-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.config-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
}

.config-section .section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-section .section-title i {
  color: var(--primary);
  font-size: 14px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .config-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 配置字段 ===== */
.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-field.full-width {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-label .required {
  color: var(--danger);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 13px;
  z-index: 1;
}

.field-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.15);
}

.field-input::placeholder {
  color: var(--text-muted);
}

select.field-input,
.field-select {
  padding-right: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6b7f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 密码显示切换 */
.btn-toggle-visible {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  transition: color 0.2s;
}

.btn-toggle-visible:hover {
  color: var(--primary);
}

/* ===== 开关 ===== */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-light);
  border-radius: 24px;
  transition: background 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== 滑块 ===== */
.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.field-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  outline: none;
}

.field-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.field-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.slider-value {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  min-width: 32px;
  text-align: right;
}

/* ===== 测试结果面板 ===== */
.test-result-panel {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.test-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 12px;
}

.test-loading i {
  margin-right: 8px;
  color: var(--primary);
}

.test-success,
.test-fail {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.test-success > i {
  font-size: 28px;
  color: var(--success);
  flex-shrink: 0;
}

.test-fail > i {
  font-size: 28px;
  color: var(--danger);
  flex-shrink: 0;
}

.test-msg {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.test-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
