/* ========================================
   Schedule API Settings CSS
   行程专属 API 设置页 · 黑白简洁配色
   参考聊天设置页风格
   ======================================== */

/* ================================================
   1. 全屏容器
   ================================================ */
.schedule-api-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: #ffffff;
  z-index: var(--z-chat);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              visibility 0s linear 0.3s;
  will-change: transform;
}

.schedule-api-screen.is-active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              visibility 0s linear 0s;
}

/* ================================================
   2. 顶部导航栏
   ================================================ */
.schedule-api-header {
  height: 56px;
  margin-top: var(--safe-area-top);
  display: flex;
  align-items: center;
  padding: 0 12px;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.schedule-api-header__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: none; border: none;
  cursor: pointer;
  color: var(--color-text-primary);
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}
.schedule-api-header__back:active {
  background-color: rgba(0, 0, 0, 0.05);
}
.schedule-api-header__back svg {
  width: 22px; height: 22px;
}

.schedule-api-header__title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  letter-spacing: 0.2px;
}

.schedule-api-header__right {
  width: 36px; height: 36px;
  flex-shrink: 0;
}

/* ================================================
   3. 可滚动内容区
   ================================================ */
.schedule-api-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
}
.schedule-api-body::-webkit-scrollbar {
  width: 0; display: none;
}

/* ================================================
   4. 说明卡片
   ================================================ */
.schedule-api-hint {
  margin: 16px 0 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
}

.schedule-api-hint__text {
  font-size: 13px;
  color: var(--color-text-secondary, #666);
  line-height: 1.6;
  font-weight: var(--font-weight-regular);
}

/* ================================================
   5. 表单区域
   ================================================ */
.schedule-api-form {
  padding: 8px 0 20px;
}

.schedule-api-field {
  margin-bottom: 18px;
}

.schedule-api-field__label {
  display: block;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: 8px;
  padding-left: 2px;
}

.schedule-api-field__input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--color-text-primary);
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.schedule-api-field__input::placeholder {
  color: var(--color-text-hint, #bbb);
  font-weight: var(--font-weight-light);
}
.schedule-api-field__input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
}

/* 模型输入行（带拉取按钮） */
.schedule-api-field__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.schedule-api-field__row .schedule-api-field__input {
  flex: 1;
}

.schedule-api-field__fetch-btn {
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: #ffffff;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  color: var(--color-accent);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.schedule-api-field__fetch-btn:active {
  background: rgba(0, 0, 0, 0.03);
}

/* Temperature 滑条 */
.schedule-api-field__slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schedule-api-field__slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.08);
  outline: none;
  cursor: pointer;
}
.schedule-api-field__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}
.schedule-api-field__slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.schedule-api-field__slider-value {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  min-width: 32px;
  text-align: center;
}

/* ================================================
   6. 按钮区域
   ================================================ */
.schedule-api-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 16px;
}

.schedule-api-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.schedule-api-btn:active {
  transform: scale(0.97);
}

.schedule-api-btn--save {
  background: var(--color-text-primary, #000);
  color: #ffffff;
}

.schedule-api-btn--test {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-primary);
}
.schedule-api-btn--test:active {
  background: rgba(0, 0, 0, 0.08);
}

.schedule-api-btn--clear {
  background: none;
  color: var(--color-text-hint, #999);
  font-size: 13px;
  height: 36px;
}
.schedule-api-btn--clear:active {
  color: var(--color-text-primary);
}

/* ================================================
   7. 状态提示
   ================================================ */
.schedule-api-status {
  margin: 12px 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.schedule-api-status__text {
  font-size: 12px;
  color: var(--color-text-secondary, #666);
  line-height: 1.5;
}

.schedule-api-status__text--active {
  color: #34c759;
}

.schedule-api-status__text--fallback {
  color: var(--color-text-hint, #999);
}

/* ================================================
   8. 底部安全区
   ================================================ */
.schedule-api-bottom-spacer {
  height: calc(32px + var(--safe-area-bottom));
}

/* ================================================
   9. 模型选择下拉列表
   ================================================ */
.schedule-api-model-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 8px;
}

.schedule-api-model-list.is-open {
  max-height: 200px;
  overflow-y: auto;
}

.schedule-api-model-list::-webkit-scrollbar {
  width: 0; display: none;
}

.schedule-api-model-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-family: var(--font-family);
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.12s ease;
}
.schedule-api-model-item:last-child {
  border-bottom: none;
}
.schedule-api-model-item:active {
  background-color: rgba(0, 0, 0, 0.04);
}
