/* ======================================================== */
/* 设置与 API 配置中心样式 (纯净高定黑白灰质感)             */
/* ======================================================== */

/* ========== 设置主列表 ========== */
.settings-list {
  display: flex; 
  flex-direction: column; 
  gap: 1px;
  background: #f0f0f2; 
  border-radius: 16px; 
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.settings-item {
  display: flex; 
  align-items: center; 
  gap: 14px; 
  padding: 16px;
  background: #ffffff; 
  cursor: pointer; 
  transition: background 0.15s ease;
}
.settings-item:active { 
  background: #f8f8fa; 
}

.settings-item-icon {
  width: 38px; 
  height: 38px; 
  border-radius: 10px; 
  background: #f4f4f7;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  flex-shrink: 0;
  color: #1c1c1e;
}
.settings-item-icon svg { 
  width: 20px; 
  height: 20px; 
  stroke: currentColor; 
  stroke-width: 1.6; 
  fill: none; 
  stroke-linecap: round; 
  stroke-linejoin: round; 
}

.settings-item-text { 
  flex: 1; 
  min-width: 0; 
}
.settings-item-title { 
  font-size: 15px; 
  font-weight: 700; 
  color: #1c1c1e; 
  letter-spacing: -0.2px;
}
.settings-item-desc { 
  font-size: 12px; 
  color: #8e8e93; 
  margin-top: 2px; 
}

.settings-arrow { 
  width: 16px; 
  height: 16px; 
  stroke: #c7c7cc; 
  stroke-width: 2.2; 
  fill: none; 
  stroke-linecap: round; 
  stroke-linejoin: round; 
  flex-shrink: 0; 
}

/* ========== API 配置顶部切换选项卡 ========== */
.api-tabs { 
  display: flex; 
  gap: 0; 
  background: #fafafa; 
  border: 1px solid rgba(0, 0, 0, 0.08); 
  border-radius: 11px; 
  padding: 3px; 
  margin-bottom: 12px; 
}
.api-tab { 
  flex: 1; 
  padding: 8px 0; 
  text-align: center; 
  font-size: 13px; 
  font-weight: 700; 
  color: #8e8e93; 
  border-radius: 9px; 
  cursor: pointer; 
  transition: all 0.2s ease;
}
.api-tab.active { 
  background: #ffffff; 
  color: #111111; 
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); 
}

/* 顶部贴心指引：点击球体可以直接跳转到中转站 */
.api-tips-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f7f7f9;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  font-size: 11.5px;
  color: #666668;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}
.api-tips-banner svg {
  width: 13px;
  height: 13px;
  stroke: #111111;
  stroke-width: 2;
  fill: none;
}

/* ========== API 新建/编辑卡片 ========== */
.api-section { 
  background: #ffffff; 
  border: 1px solid rgba(0, 0, 0, 0.08); 
  border-radius: 16px; 
  padding: 16px; 
  margin-bottom: 16px; 
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.api-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.api-section-title { 
  font-size: 14.5px; 
  font-weight: 800; 
  color: #111111; 
  letter-spacing: 0.3px;
}
.api-small-link-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: #555555;
  cursor: pointer;
  padding: 2px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.api-field { 
  margin-bottom: 14px; 
}
.api-field:last-child { 
  margin-bottom: 0; 
}
.api-field-label { 
  font-size: 12.5px; 
  font-weight: 700; 
  color: #3e4856; 
  margin-bottom: 6px; 
}
.api-field-row { 
  display: flex; 
  gap: 8px; 
  align-items: center; 
}

.api-input { 
  width: 100%; 
  height: 40px;
  padding: 0 12px; 
  border: 1px solid rgba(0, 0, 0, 0.1); 
  border-radius: 9px; 
  font-size: 13.5px; 
  font-family: inherit; 
  color: #111111; 
  background: #fafafa; 
  outline: none; 
  box-sizing: border-box;
}
.api-input:focus { 
  border-color: #111111; 
  background: #ffffff; 
}

.api-icon-btn { 
  width: 40px; 
  height: 40px; 
  border: 1px solid rgba(0, 0, 0, 0.1); 
  border-radius: 9px; 
  background: #fafafa; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
  flex-shrink: 0; 
  color: #111111;
}
.api-icon-btn:active {
  background: #e5e5ea;
}
.api-icon-btn svg { 
  width: 18px; 
  height: 18px; 
  stroke: currentColor; 
  stroke-width: 2; 
  fill: none; 
  stroke-linecap: round; 
  stroke-linejoin: round; 
}

.api-model-list { 
  display: none; 
  max-height: 180px; 
  overflow-y: auto; 
  margin-top: 8px; 
  border: 1px solid rgba(0, 0, 0, 0.1); 
  border-radius: 10px; 
  background: #ffffff; 
}
.api-model-list.show { 
  display: block; 
}
.api-model-item { 
  padding: 10px 14px; 
  font-size: 13px; 
  color: #111111; 
  cursor: pointer; 
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.04); 
}
.api-model-item:active {
  background: #f4f4f7;
}
.api-model-item.selected { 
  background: #111111; 
  color: #ffffff; 
  font-weight: 700; 
}
.api-model-search { 
  width: calc(100% - 16px); 
  margin: 8px; 
  padding: 8px 12px; 
  border: 1px solid rgba(0, 0, 0, 0.1); 
  border-radius: 8px; 
  font-size: 12px; 
  font-family: inherit; 
  outline: none; 
}

.api-btn-group { 
  display: flex; 
  gap: 10px; 
  margin-top: 8px; 
}
.api-btn { 
  flex: 1; 
  height: 42px; 
  border: none; 
  border-radius: 10px; 
  font-size: 14px; 
  font-weight: 700; 
  cursor: pointer; 
  font-family: inherit; 
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease; 
}
.api-btn:active {
  transform: scale(0.98);
}
.api-btn-primary { 
  background: #111111; 
  color: #ffffff; 
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* ========== 已存配置列表：纯粹黑白高定手账卡片 ========== */
.api-saved-list { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  position: relative;
  padding-bottom: 30px;
}

.arch-api-card {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  transform: translateZ(0);
}

/* 四角小十字星花 */
.card-corner {
  position: absolute;
  font-size: 9px;
  color: #c7c7cc;
  line-height: 1;
  pointer-events: none;
}
.card-corner.tl { top: 6px; left: 8px; }
.card-corner.tr { top: 6px; right: 8px; }
.card-corner.bl { bottom: 6px; left: 8px; }
.card-corner.br { bottom: 6px; right: 8px; }

/* 启用态：纯黑细边框 */
.arch-api-card.active {
  border: 1.2px solid #111111;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* 上半区：名称 + 黑白球形与跳转符号 + 启用小徽章 */
.card-upper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.api-identity-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.api-title-text {
  font-size: 15px;
  font-weight: 800;
  color: #111111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

/* 🌐 黑白色球形 + 跳转小符号组合胶囊 */
.site-portal-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 12px;
  background: #f4f4f6;
  color: #111111;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.site-portal-link:active {
  transform: scale(0.92);
  background: #111111;
  color: #ffffff;
}
.site-portal-link svg.globe-icon {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.site-portal-link svg.jump-arrow {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
}

/* 当前启用勋章 */
.active-orbit-tag {
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  background: #111111;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.active-orbit-tag span.spark {
  font-size: 8px;
  color: #ffffff;
}

/* 中半区：模型编号与手账虚线 */
.card-mid-deck {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}
.model-code-tag {
  font-size: 12px;
  font-family: monospace;
  color: #555555;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-code-tag::before {
  content: 'MODEL //';
  font-size: 9px;
  letter-spacing: 1px;
  color: #999999;
}
.serial-stamp {
  font-size: 9.5px;
  font-family: 'Caveat', cursive;
  color: #999999;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* 下半区：纯黑白按钮组（启用 / 复制 / 编辑 / 删除） */
.card-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.seal-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f8f8fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #222222;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.seal-btn:active {
  transform: scale(0.94);
  background: #e5e5ea;
}
.seal-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* 启用大按键 */
.seal-btn.primary {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}
.seal-btn.primary:active {
  background: #333333;
}

/* 优雅黑色删除按键 */
.seal-btn.delete {
  color: #111111;
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
.seal-btn.delete:active {
  background: #f0f0f3;
}

.api-empty { 
  text-align: center; 
  padding: 40px 20px; 
  color: #8e8e93; 
  font-size: 13.5px; 
}

/* ======================================================== */
/* 全景存储空间大屏 (Storage Dashboard)                      */
/* ======================================================== */
.data-storage-dashboard {
  width: 100%;
  background: #f8f9fb;
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  margin-bottom: 6px;
}

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

.storage-dash-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #1a1c22;
  letter-spacing: 0.5px;
}

.storage-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-detail-btn {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #11141a;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}
.storage-detail-btn:active {
  background: #f0f0f4;
}

.storage-refresh-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a8aa8;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.storage-refresh-btn:active { 
  opacity: 0.5; 
}
.storage-refresh-btn svg { 
  width: 13px; 
  height: 13px; 
  stroke: currentColor; 
  stroke-width: 2.2; 
  fill: none; 
}
.storage-refresh-btn.rotating svg { 
  animation: storageSpin 0.5s ease; 
}
@keyframes storageSpin { 
  from { transform: rotate(0deg); } 
  to { transform: rotate(360deg); } 
}

.storage-main-num-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.storage-used-val {
  font-size: 26px;
  font-weight: 900;
  color: #11141a;
  letter-spacing: -0.5px;
  font-family: monospace;
}

.storage-quota-sub {
  font-size: 11.5px;
  color: #8e8e93;
  font-family: monospace;
}

.storage-progress-track {
  width: 100%;
  height: 8px;
  background: #e5e5ea;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  gap: 1.5px;
}

.storage-progress-bar {
  height: 100%;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.storage-progress-bar.theme { background: #e05353 !important; } /* 已用：红色 */
.storage-progress-bar.chat { background: #e5e5ea !important; }  /* 未用：浅灰 */
.storage-progress-bar.lore { display: none !important; }

.storage-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

.storage-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.storage-cell:active {
  background: rgba(0, 0, 0, 0.04);
}

.cell-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #636366;
}
.cell-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.cell-tag.theme .dot { background: #e05353; }
.cell-tag.chat .dot { background: #8a6aa8; }
.cell-tag.lore .dot { background: #8e8e93; }

.cell-num {
  font-size: 12px;
  font-weight: 800;
  color: #1c1c1e;
  font-family: monospace;
}

/* ======================================================== */
/* 存储深度明细抽屉 (Storage Detail Drawer)                  */
/* ======================================================== */
.storage-detail-drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  display: none;
}
.storage-detail-drawer-mask.show {
  display: block;
}

.storage-detail-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 75vh;
  max-height: 580px;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.storage-detail-drawer.show {
  transform: translateY(0);
}

.storage-drawer-header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-main-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #11141a;
  letter-spacing: 0.3px;
}
.drawer-sub-title {
  font-size: 11px;
  color: #8e8e93;
}
.drawer-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: #f2f2f7;
  border-radius: 50%;
  font-size: 14px;
  color: #636366;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-close-btn:active {
  background: #e5e5ea;
}

.storage-drawer-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: #f8f9fb;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}
.storage-dtab {
  flex: 1;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #8e8e93;
  cursor: pointer;
  transition: all 0.15s ease;
}
.storage-dtab.active {
  background: #ffffff;
  color: #11141a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.storage-drawer-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 16px calc(16px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

.storage-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fafafc;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  box-sizing: border-box;
}

.detail-item-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef1f5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-item-img-ph {
  font-size: 18px;
}

.detail-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #11141a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-item-desc {
  font-size: 11px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-item-size {
  font-size: 12px;
  font-weight: 800;
  color: #1a1c22;
  font-family: monospace;
  flex-shrink: 0;
}

.drawer-empty-tip {
  padding: 30px 10px;
  text-align: center;
  font-size: 12.5px;
  color: #8e8e93;
}

/* ========== 数据页分段与条目 ========== */
.data-section { 
  background: #ffffff; 
  border: 1px solid rgba(0, 0, 0, 0.08); 
  border-radius: 16px; 
  overflow: hidden; 
  margin-bottom: 16px; 
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.data-section-title {
  padding: 10px 16px 4px;
  font-size: 12px;
  font-weight: 800;
  color: #8e8e93;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.data-item { 
  display: flex; 
  align-items: center; 
  gap: 14px; 
  padding: 14px 16px; 
  cursor: pointer; 
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.04); 
}
.data-item:last-child {
  border-bottom: none;
}
.data-item:active {
  background: #f8f8fa;
}

.data-item-icon { 
  width: 36px; 
  height: 36px; 
  border-radius: 10px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  flex-shrink: 0;
  background: #f4f4f7;
  color: #1c1c1e;
}
.data-item-icon svg { 
  width: 18px; 
  height: 18px; 
  stroke: currentColor; 
  stroke-width: 1.8; 
  fill: none; 
  stroke-linecap: round; 
  stroke-linejoin: round; 
}
.data-item-icon.danger { 
  background: #f4f4f7; 
  color: #111111; 
}

.data-item-text { 
  flex: 1; 
  min-width: 0; 
}
.data-item-title { 
  font-size: 14.5px; 
  font-weight: 700; 
  color: #1c1c1e; 
}
.data-item-desc { 
  font-size: 11.5px; 
  color: #8e8e93; 
  margin-top: 2px; 
}
.data-item-title.danger { 
  color: #111111; 
}

.api-input,
.api-model-search {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
  transform: translateZ(0);
}