* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #fff;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(99,102,241,.22), transparent 32%),
    radial-gradient(circle at top right, rgba(236,72,153,.18), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #111827 45%, #020617 100%);
}

button, input, textarea, select { font-family: inherit; }

button { cursor: pointer; }

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.hidden {
  display: none !important;
}

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.subtitle {
  max-width: 860px;
  margin: 16px auto 0;
  color: #cbd5e1;
  line-height: 1.7;
  font-size: 15px;
}

.api-key-panel {
  max-width: 900px;
  margin: 0 auto 24px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(15,23,42,.72);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 18px 60px rgba(0,0,0,.2);
}

.api-key-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.api-key-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

.api-key-desc {
  margin: 5px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
}

.api-key-status-group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.api-key-status,
.key-info-pill,
.get-key-btn {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.api-key-status {
  border: 1px solid rgba(248,113,113,.28);
  background: rgba(239,68,68,.12);
  color: #fecaca;
}

.api-key-status.ready {
  border-color: rgba(52,211,153,.28);
  background: rgba(16,185,129,.12);
  color: #bbf7d0;
}

.key-info-pill {
  border: 1px solid rgba(148,163,184,.26);
  background: rgba(255,255,255,.07);
  color: #cbd5e1;
}

.key-info-pill.usage {
  border-color: rgba(96,165,250,.28);
  background: rgba(59,130,246,.12);
  color: #bfdbfe;
}

.key-info-pill.expire {
  border-color: rgba(168,85,247,.28);
  background: rgba(168,85,247,.12);
  color: #e9d5ff;
}

.key-info-pill.warning {
  border-color: rgba(251,191,36,.32);
  background: rgba(245,158,11,.14);
  color: #fde68a;
}

.key-info-pill.danger {
  border-color: rgba(248,113,113,.32);
  background: rgba(239,68,68,.14);
  color: #fecaca;
}

.get-key-btn {
  justify-content: center;
  border: 1px solid rgba(96,165,250,.35);
  background: rgba(59,130,246,.14);
  color: #bfdbfe;
  transition: .18s;
}

.get-key-btn:hover {
  background: rgba(59,130,246,.24);
  border-color: rgba(96,165,250,.65);
  color: #dbeafe;
}

.api-key-row {
  display: flex;
  gap: 10px;
}

.api-key-input {
  flex: 1;
  height: 46px;
  border-radius: 15px;
  border: 1px solid #334155;
  background: rgba(2,6,23,.72);
  color: #f8fafc;
  outline: none;
  padding: 0 14px;
  font-size: 14px;
  min-width: 0;
}

.api-key-input:focus,
.input:focus,
.textarea:focus,
.select:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129,140,248,.18);
}

.api-key-btn,
.api-key-clear-btn {
  height: 46px;
  padding: 0 18px;
  border-radius: 15px;
  border: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(90deg,#6366f1,#a855f7);
  white-space: nowrap;
}

.api-key-clear-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid #475569;
  color: #e2e8f0;
}

.layout {
  display: grid;
  grid-template-columns: 420px minmax(0,1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: rgba(15,23,42,.72);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
}

.form-panel {
  padding: 24px;
  position: sticky;
  top: 20px;
}

.form-panel.locked {
  position: relative;
}

.form-panel.locked::after {
  content: "请先激活后使用";
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #e2e8f0;
  font-weight: 800;
  font-size: 18px;
  border-radius: 28px;
  background: rgba(2,6,23,.56);
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.history-panel {
  padding: 24px;
  min-height: 680px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

label,
.label {
  display: block;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
}

.label-note {
  margin-left: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 400;
}

.count,
.hint {
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.hint {
  margin: 6px 0 0;
}

.upload-zone {
  min-height: 112px;
  border: 1px dashed rgba(148,163,184,.42);
  background: rgba(2,6,23,.42);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  transition: .18s;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: rgba(96,165,250,.9);
  background: rgba(59,130,246,.1);
}

.upload-zone.disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

.upload-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.1);
  color: #e2e8f0;
  margin-bottom: 8px;
}

.upload-title {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
}

.upload-desc {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.preview-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(2,6,23,.65);
  border: 1px solid rgba(255,255,255,.1);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-tag {
  position: absolute;
  left: 5px;
  top: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

.remove-ref-btn {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-ref-btn:hover {
  background: #ef4444;
}

.url-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid #334155;
  background: rgba(2,6,23,.72);
  color: #f8fafc;
  outline: none;
  transition: .18s;
}

.input {
  height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 12px;
  min-width: 0;
}

.textarea {
  min-height: 142px;
  border-radius: 18px;
  padding: 14px 16px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.7;
}

.select {
  height: 46px;
  border-radius: 14px;
  padding: 0 12px;
  font-size: 14px;
}

.select option {
  background: #020617;
  color: #f8fafc;
}

.small-btn {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #475569;
  background: transparent;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.small-btn:hover {
  background: rgba(255,255,255,.08);
}

.ratio-selected {
  color: #60a5fa;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ratio-select-head {
  margin-bottom: 10px;
}

.ratio-select {
  cursor: pointer;
  appearance: auto;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.submit-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(90deg,#6366f1,#a855f7,#ec4899);
  box-shadow: 0 16px 40px rgba(79,70,229,.28);
  transition: .18s;
}

.submit-btn:hover {
  filter: brightness(1.06);
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.history-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.status-text {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.6;
}

.history-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.clear-btn,
.sort-select {
  border: 1px solid #475569;
  background: rgba(2,6,23,.42);
  color: #e2e8f0;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  outline: none;
}

.clear-btn:hover,
.sort-select:hover {
  background: rgba(255,255,255,.08);
}

.sort-select option {
  background: #020617;
  color: #f8fafc;
}

.history-box {
  min-height: 610px;
  border-radius: 24px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border: 1px solid rgba(148,163,184,.16);
}

.empty-state {
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #cbd5e1;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.1);
  color: #cbd5e1;
}

.empty-title {
  margin: 0;
  font-weight: 700;
}

.empty-desc {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.history-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 800;
  letter-spacing: .02em;
}

.section-count {
  color: #64748b;
  font-size: 12px;
}

.running-list {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(230px,1fr));
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.running-mini-card {
  min-height: 112px;
  border-radius: 16px;
  padding: 11px 12px;
  background: rgba(2,6,23,.5);
  border: 1px solid rgba(129,140,248,.22);
}

.running-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.running-mini-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 800;
}

.mini-loader {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,.28);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.running-mini-percent {
  color: #a5b4fc;
  font-size: 11px;
  font-weight: 800;
}

.mini-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(30,41,59,.95);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 7px;
}

.mini-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg,#6366f1,#a855f7);
  border-radius: inherit;
  transition: width .2s;
}

.running-mini-prompt {
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 7px;
}

.running-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 12px;
}

.image-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(2,6,23,.56);
  transition: .18s;
}

.image-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(96,165,250,.55);
  box-shadow: 0 14px 32px rgba(0,0,0,.25);
}

.tile-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
  transition: .16s;
}

.tile-delete-btn:hover {
  background: #ef4444;
  transform: scale(1.06);
}

.thumb-btn {
  position: relative;
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: rgba(0,0,0,.25);
  aspect-ratio: 1/1;
  overflow: hidden;
  cursor: zoom-in;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: .25s;
}

.image-tile:hover .thumb-btn img {
  transform: scale(1.04);
}

.thumb-overlay {
  position: absolute;
  inset: auto 6px 6px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  color: #fff;
  padding: 5px 8px;
  font-size: 10px;
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  transition: .18s;
}

.image-tile:hover .thumb-overlay {
  opacity: 1;
  transform: translateY(0);
}

.tile-body {
  padding: 8px;
}

.download-btn,
.modal-download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #020617;
  font-size: 12px;
  font-weight: 800;
  transition: .18s;
}

.download-btn:hover,
.modal-download:hover {
  background: #e2e8f0;
}

.task-card {
  border-radius: 20px;
  padding: 14px;
  background: rgba(2,6,23,.48);
  border: 1px solid rgba(248,113,113,.34);
}

.task-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.tag-error {
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  border-color: rgba(248,113,113,.25);
}

.tag-soft {
  background: rgba(255,255,255,.06);
  color: #cbd5e1;
}

.task-prompt {
  margin: 10px 0 0;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.delete-btn {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
}

.delete-btn:hover {
  background: rgba(255,255,255,.08);
}

.error-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error-box {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(248,113,113,.22);
  background: rgba(239,68,68,.1);
  padding: 12px;
  color: #fecaca;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.modal,
.key-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2,6,23,.82);
  backdrop-filter: blur(14px);
}

.key-qr-modal {
  z-index: 1200;
}

.modal.show,
.key-qr-modal.show {
  display: flex;
}

.modal-card {
  width: min(1120px,100%);
  max-height: calc(100vh - 44px);
  border-radius: 24px;
  background: rgba(15,23,42,.96);
  border: 1px solid rgba(148,163,184,.24);
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid rgba(148,163,184,.16);
}

.modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
  color: #e2e8f0;
}

.modal-close,
.key-qr-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

.modal-close:hover,
.key-qr-close:hover {
  background: rgba(239,68,68,.2);
  border-color: rgba(248,113,113,.45);
}

.modal-body {
  padding: 16px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
  background: rgba(2,6,23,.5);
}

.modal-body img {
  max-width: 100%;
  max-height: calc(100vh - 230px);
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  background: #000;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(148,163,184,.16);
}

.modal-download {
  width: auto;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 13px;
}

.key-qr-card {
  position: relative;
  width: min(360px, 100%);
  border-radius: 24px;
  padding: 26px 24px 24px;
  background: rgba(15,23,42,.96);
  border: 1px solid rgba(148,163,184,.24);
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
  text-align: center;
}

.key-qr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
}

.key-qr-title {
  margin: 0;
  color: #f8fafc;
  font-size: 20px;
  font-weight: 900;
}

.key-qr-desc {
  margin: 10px 0 18px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.7;
}

.key-qr-image {
  display: block;
  width: min(240px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
}

@media (max-width: 1260px) {
  .gallery-grid {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }
}

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

  .form-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .gallery-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media (max-width: 720px) {
  .page {
    padding: 24px 12px 36px;
  }

  .form-panel,
  .history-panel {
    padding: 16px;
    border-radius: 22px;
  }

  .api-key-row,
  .api-key-head,
  .history-head,
  .task-top {
    flex-direction: column;
  }

  .api-key-status-group {
    justify-content: flex-start;
  }

  .api-key-status {
    align-self: flex-start;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .running-list {
    grid-template-columns: 1fr;
    max-height: 260px;
  }

  .history-actions {
    width: 100%;
    justify-content: stretch;
  }

  .clear-btn,
  .sort-select {
    flex: 1;
  }

  .delete-btn {
    width: 100%;
  }

  .modal,
  .key-qr-modal {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .modal-body img {
    max-height: calc(100vh - 250px);
  }
}
.clarity-field {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(96,165,250,.22);
  background: rgba(59,130,246,.08);
}

.clarity-field .hint {
  color: #93c5fd;
}

.clarity-field .select {
  border-color: rgba(96,165,250,.38);
}

.clarity-field .select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,.16);
}
.form-api-key-panel {
    width: 100%;
    max-width: none;
    margin: 0 0 22px;
    padding: 16px;
    border-radius: 20px;
    position: relative;
    z-index: 10;
  }

  .form-api-key-panel .api-key-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .form-api-key-panel .api-key-status-group {
    justify-content: flex-start;
  }

  .form-api-key-panel .api-key-row {
    flex-wrap: wrap;
  }

  .form-api-key-panel .api-key-input {
    flex: 1 1 100%;
    width: 100%;
  }

  .form-api-key-panel .api-key-btn,
  .form-api-key-panel .api-key-clear-btn {
    flex: 1 1 calc(50% - 5px);
  }

  .form-panel.locked::after {
    z-index: 5;
  }

  .form-panel > .form {
    position: relative;
    z-index: 1;
  }

  /* 用户中心标题行 */
  .api-key-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }

  .api-key-title-row .api-key-title {
    margin: 0;
    flex: 0 0 auto;
  }

  /* 续费、退出按钮容器，紧跟在“用户中心”后面 */
  .api-key-title-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex: 0 0 auto;
  }

  /* 覆盖原来的大按钮样式，避免被 api-key-clear-btn 拉宽 */
  .form-api-key-panel .api-key-title-row .api-key-renew-btn,
  .form-api-key-panel .api-key-title-row .api-key-logout-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 4px 10px;
    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;

    box-shadow: none !important;
    cursor: pointer;
    transition: all 0.18s ease;
  }

  /* 续费按钮 */
  .form-api-key-panel .api-key-title-row .api-key-renew-btn {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(96, 165, 250, 0.45);
  }

  .form-api-key-panel .api-key-title-row .api-key-renew-btn:hover {
    color: #ffffff;
    background: rgba(37, 99, 235, 0.85);
    border-color: rgba(147, 197, 253, 0.9);
  }

  /* 退出按钮 */
  .form-api-key-panel .api-key-title-row .api-key-logout-btn {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.35);
  }

  .form-api-key-panel .api-key-title-row .api-key-logout-btn:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(248, 113, 113, 0.9);
  }

  .form-api-key-panel .api-key-title-row .api-key-renew-btn:active,
  .form-api-key-panel .api-key-title-row .api-key-logout-btn:active {
    transform: scale(0.96);
  }

  .api-key-renew-btn.hidden,
  .api-key-logout-btn.hidden {
    display: none !important;
  }