/* ========== 03-settings.css ========== */
/* 設置頁面 Hero、API 卡片、提示詞卡片 */

.settings-hero {
  margin: 0 16px 20px;
  background: linear-gradient(135deg, #1d1d1f 0%, #3a3a3c 100%);
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
}

.settings-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-hero-icon svg {
  width: 26px;
  height: 26px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.5;
}

.settings-hero-info {
  flex: 1;
  min-width: 0;
}

.settings-hero-info .sh-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.settings-hero-info .sh-sub {
  font-size: 12px;
  opacity: .65;
}

.settings-hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.settings-hero-dot.on {
  background: #34c759;
  box-shadow: 0 0 8px rgba(52, 199, 89, .5);
}

.settings-hero-dot.off {
  background: #ff3b30;
  box-shadow: 0 0 8px rgba(255, 59, 48, .3);
}

/* ===== Section Header Fancy ===== */
.section-header-fancy {
  padding: 24px 20px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header-fancy svg {
  width: 16px;
  height: 16px;
  stroke: #8e8e93;
  fill: none;
  stroke-width: 1.5;
}

.section-header-fancy span {
  font-size: 13px;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}

/* ===== API 卡片 ===== */
.api-card {
  margin: 0 16px 12px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
  border: 1px solid #ececec;
}

.api-card-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f2f2f7;
  transition: background .15s;
}

.api-card-item:last-child {
  border-bottom: none;
}

.api-card-item:active {
  background: #f9f9fb;
}

.api-card-item .aci-indicator {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}

.api-card-item .aci-indicator.active {
  background: linear-gradient(180deg, #34c759, #30b855);
}

.api-card-item .aci-indicator.inactive {
  background: #e5e5ea;
}

.api-card-item .aci-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;   /* ★ 新增 */
}

.api-card-item .aci-name {
  font-size: 16px;
  font-weight: 500;
  color: #1d1d1f;
}

.api-card-item .aci-model {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 2px;
}

.api-card-item .aci-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.api-card-item .aci-badge.on {
  background: #e8faf0;
  color: #28a745;
}

.api-card-item .aci-badge.off {
  background: #f2f2f7;
  color: #8e8e93;
}

.api-card-item .aci-edit-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #8e8e93;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.api-card-item .aci-edit-btn:hover {
  background: #f2f2f7;
  color: #1d1d1f;
}

.api-card-item .aci-edit-btn:active {
  background: #e5e5ea;
  transform: scale(.94);
}

.api-card-add {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  gap: 8px;
  cursor: pointer;
  color: #3a3a3c;
  font-size: 15px;
  font-weight: 500;
}

.api-card-add:active {
  background: #f9f9fb;
}

.api-card-add svg {
  width: 18px;
  height: 18px;
  stroke: #3a3a3c;
  fill: none;
  stroke-width: 2;
}

/* ===== Settings Section Card ===== */
.settings-section-card {
  margin: 0 16px 16px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
  border: 1px solid #ececec;
}

.settings-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f2f2f7;
  gap: 12px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-row-icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.5;
}

.settings-row-icon.dark {
  background: #1d1d1f;
}

.settings-row-label {
  flex: 1;
  font-size: 15px;
  color: #1d1d1f;
}

/* ===== Prompt 卡片 ===== */
.prompt-card {
  margin: 0 16px 16px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #ececec;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f2f2f7;
}

.prompt-card-header span {
  font-size: 15px;
  font-weight: 500;
  color: #1d1d1f;
}

.prompt-card-header button {
  background: none;
  border: none;
  font-size: 13px;
  color: #3a3a3c;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.prompt-card-header button:active {
  opacity: .6;
}

.prompt-card textarea {
  width: 100%;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 13px;
  color: #1d1d1f;
  resize: none;
  min-height: 80px;
  max-height: 200px;
  font-family: inherit;
  line-height: 1.5;
  background: transparent;
}

.prompt-card textarea::placeholder {
  color: #c7c7cc;
}

.prompt-card .prompt-info {
  padding: 6px 16px 12px;
  font-size: 11px;
  color: #8e8e93;
}

/* ===== URL Status ===== */
.url-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
}

.url-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.url-status .dot.ok {
  background: #34c759;
}

.url-status .dot.fail {
  background: #ff3b30;
}

.url-status .dot.pending {
  background: #c7c7cc;
}

.url-status span {
  color: #8e8e93;
}

/* ===== URL Progress ===== */
.url-progress {
  margin: 8px 0 0;
  background: #f2f2f7;
  border-radius: 6px;
  overflow: hidden;
  height: 4px;
}

.url-progress-bar {
  height: 100%;
  background: #1d1d1f;
  border-radius: 6px;
  transition: width .3s;
  width: 0;
}

.url-status-text {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 4px;
  text-align: center;
}

/* ===== Prompt Mode Selector (segmented) ===== */
.prompt-mode-seg {
  display: flex;
  margin: 12px 16px 8px;
  background: #e5e5ea;
  border-radius: 10px;
  padding: 3px;
}

.prompt-mode-opt {
  flex: 1;
  padding: 9px 6px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #8e8e93;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}

.prompt-mode-opt.active {
  background: #fff;
  color: #1d1d1f;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.prompt-mode-opt:active {
  opacity: .7;
}

/* ===== Custom Prompt 内联展开 ===== */
.prompt-custom-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
  border-top: 1px solid transparent;
}

.prompt-custom-wrap.open {
  max-height: 240px;
  border-top-color: #f2f2f7;
}

.prompt-custom-wrap textarea {
  width: 100%;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 13px;
  color: #1d1d1f;
  resize: none;
  min-height: 120px;
  max-height: 200px;
  font-family: inherit;
  line-height: 1.5;
  background: transparent;
  box-sizing: border-box;
}

.prompt-custom-wrap textarea::placeholder {
  color: #c7c7cc;
}

/* ═══ Version Management ═══ */
.ver-hero {
    margin: 16px 20px 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1d1d1f, #3a3a3c);
    border-radius: 20px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
}
.ver-hero-label {
    font-size: 12px;
    color: rgba(255, 255, 255, .5);
    letter-spacing: .5px;
    text-transform: uppercase;
    font-weight: 500;
}
.ver-hero-version {
    font-size: 32px;
    font-weight: 700;
    margin: 8px 0 4px;
    letter-spacing: -.5px;
    font-family: ui-monospace, 'Menlo', monospace;
}
.ver-hero-status {
    font-size: 12px;
    color: rgba(255, 255, 255, .65);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.ver-hero-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c7c7cc;
}
.ver-hero-status.checking::before { background: #ff9500; box-shadow: 0 0 6px rgba(255, 149, 0, .6); }
.ver-hero-status.up-to-date::before { background: #34c759; box-shadow: 0 0 6px rgba(52, 199, 89, .6); }
.ver-hero-status.has-update::before { background: #ff3b30; box-shadow: 0 0 6px rgba(255, 59, 48, .6); animation: verPulse 1.2s infinite; }
@keyframes verPulse { 0%,100%{opacity:1} 50%{opacity:.4} }

#versionListBody { padding: 0 16px; }
.ver-item {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #ececec;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
}
.ver-item-installed {
    border-color: #1d1d1f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
.ver-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.ver-item-version {
    font-size: 17px;
    font-weight: 700;
    color: #1d1d1f;
    font-family: ui-monospace, 'Menlo', monospace;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ver-item-date {
    font-size: 12px;
    color: #8e8e93;
    flex-shrink: 0;
    font-family: ui-monospace, 'Menlo', monospace;
}
.ver-item-notes {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}
.ver-item-notes li {
    font-size: 13px;
    color: #3a3a3c;
    line-height: 1.6;
    padding-left: 14px;
    position: relative;
}
.ver-item-notes li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c7c7cc;
}
.ver-item-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.ver-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
}
.ver-badge-installed { background: #1d1d1f; color: #fff; }
.ver-badge-latest { background: #e8faf0; color: #28a745; }
.ver-critical {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    background: #fff5f5;
    color: #ff3b30;
}
.ver-btn {
    padding: 7px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform .1s, background .15s;
    border: 1px solid #e5e5ea;
    background: #fff;
    color: #3a3a3c;
}
.ver-btn:active { transform: scale(.96); }
.ver-btn-primary { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.ver-btn-primary:active { background: #000; }
.ver-btn-disabled {
    background: #f2f2f7;
    color: #8e8e93;
    border-color: #e5e5ea;
    cursor: default;
    pointer-events: none;
}
.ver-empty {
    text-align: center;
    padding: 40px 20px;
    color: #8e8e93;
    font-size: 14px;
    line-height: 1.6;
}