/* settings.css — 仿 Apple iOS Settings 风格 */

/* ===== 全屏页面通用 ===== */
.full-page {
  position: absolute;
  inset: 0;
  background: var(--c-surface);
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.sub-page { z-index: 55; }

/* ===== 滚动内容区 ===== */
.settings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sub-page .settings-scroll {
  padding-top: 12px;
}
.settings-scroll > * {
  flex-shrink: 0;
}

/* ===== 大标题"设置" ===== */
.settings-large-title {
  padding: 8px 4px 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.settings-large-title span {
  font-size: 34px; font-weight: 700;
  color: var(--c-text); letter-spacing: -0.02em;
}
.settings-large-title:active span { opacity: 0.5; }

/* ===== Account卡片 ===== */
.account-card { padding: 0; }
.account-row {
  display: flex; align-items: center;
  padding: 12px 16px; gap: 14px; cursor: pointer;
}
.account-row:active { background: var(--c-surface); }
.account-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 500; color: #fff;
  flex-shrink: 0; overflow: hidden;
}

.account-info { flex: 1; min-width: 0; }
.account-name {
  font-size: 18px; font-weight: 500;
  color: var(--c-text); line-height: 1.3;
}
.account-sub {
  font-size: 12px; color: var(--c-sub); margin-top: 2px;
}

/* ===== 设置区块卡片 ===== */
.setting-section {
  background: var(--c-bg);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.section-title {
  padding: 12px 16px 4px;
  font-size: 11px; font-weight: 500;
  color: var(--c-sub);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.section-desc {
  padding: 0 16px 8px;
  font-size: 12px; color: var(--c-hint); line-height: 1.5;
}

/* ===== 列表行（Apple Settings风格） ===== */
.setting-section .list-row {
  display: flex; align-items: center;
  padding: 11px 16px; gap: 12px;
  border-bottom: 1px solid var(--c-border);
  min-height: 44px;
}
.setting-section .list-row:last-child { border-bottom: none; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:active { background: var(--c-surface); }
.row-icon-box {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; flex-shrink: 0;
  background: var(--c-accent-dark);
}
.row-body { flex: 1; min-width: 0; }
.row-body .row-label { font-size: 16px; color: var(--c-text); line-height: 1.3; }
.row-body .row-sub { font-size: 12px; color: var(--c-sub); margin-top: 1px; }
.row-value {
  font-size: 15px; color: var(--c-sub);
  white-space: nowrap; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis;
}
.row-chevron {
  font-size: 18px; color: var(--c-hint);
  flex-shrink: 0; margin-left: 2px;
}

/* ===== 用户资料子页面 ===== */
.profile-avatar-section {
  display: flex; flex-direction: column;
  align-items: center;
  padding: 24px 16px 16px; gap: 12px;
}
.profile-avatar-large {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 500; color: #fff;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.btn-text-danger { color: var(--c-red); border-color: transparent; }

/* ===== 壁纸预览 ===== */
.wallpaper-preview-wrap { padding: 16px; }
.wallpaper-preview {
  width: 100%; height: 280px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.wallpaper-placeholder { font-size: 14px; color: var(--c-hint); }

/* ===== 表单标签 ===== */
.form-label {
  font-size: 13px; color: var(--c-sub); padding: 4px 0 2px;
}

/* ===== API表单 ===== */
.api-form {
  padding: 8px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.input-with-toggle {
  position: relative; display: flex; align-items: center;
}
.input-with-toggle .input-field { padding-right: 56px; }
.input-with-toggle .btn-icon {
  position: absolute; right: 8px; color: var(--c-sub);
}
.model-row { display: flex; gap: 8px; align-items: center; }
.model-row select { flex: 1; }
.temp-row { display: flex; align-items: center; gap: 8px; }
.temp-row input[type="range"] { flex: 1; accent-color: var(--c-accent); }
.temp-val {
  font-size: 13px; color: var(--c-accent);
  width: 28px; text-align: right;
}

/* ===== 按钮补充 ===== */
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ===== API Tab切换栏 ===== */
.api-tab-bar {
  display: flex;
  margin: 0 0 8px;
  background: var(--c-surface);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 0;
}
.api-tab {
  flex: 1;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-sub);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  font-family: var(--font);
}
.api-tab.active {
  background: var(--c-bg);
  color: var(--c-text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ===== API Tab内容区 ===== */
.api-tab-content {
  /* 无额外样式，靠display切换 */
}

/* ===== 预设栏 ===== */
.preset-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.preset-bar .preset-select {
  flex: 1;
  min-width: 0;
}

/* ===== 字体预览 ===== */
.font-preview-box {
  padding: 16px;
}
.font-preview-text {
  font-size: 18px;
  color: var(--c-text);
  line-height: 1.8;
  text-align: center;
  padding: 20px 16px;
  background: var(--c-surface);
  border-radius: var(--r-sm);
}
.font-url-sub {
  word-break: break-all;
}
.font-item {
  position: relative;
}
.font-item .font-del-btn {
  flex-shrink: 0;
  margin-left: 4px;
}
.font-active {
  background: rgba(212, 160, 176, 0.06);
}

/* ===== 文字版显示/隐藏按钮 ===== */
.btn-text-toggle {
  position: absolute;
  right: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--c-accent);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
}
.btn-text-toggle:active {
  opacity: 0.6;
}

/* ===== 数据管理按钮区 ===== */
.data-actions {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== 导出预览列表 ===== */
.export-preview { padding: 8px 20px 12px; }
.preview-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
}
.preview-row:last-child { border-bottom: none; }
.preview-row span:last-child { color: var(--c-sub); }

/* ===== 导出/导入进度条 ===== */
.export-progress-wrap { padding: 12px 20px; }
.export-progress-bar {
  height: 3px;
  background: var(--c-surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.export-progress-fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: 2px;
  transition: width 0.3s var(--ease);
  width: 0%;
}
.export-progress-text {
  font-size: 12px;
  color: var(--c-sub);
  text-align: center;
}

/* ===== Sheet标题 ===== */
.sheet-title {
  padding: 8px 20px 12px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}
.danger-title { color: var(--c-red); }

/* ===== Sheet操作按钮区 ===== */
.sheet-actions {
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== 清空确认输入框 ===== */
.clear-confirm-wrap { padding: 0 20px 12px; }
