﻿:root {
  --bg: #0c0a18;
  --surface: rgba(255,255,255,0.06);
  --surface-soft: rgba(255,255,255,0.03);
  --text: #e8e4f0;
  --text-soft: #b8b0d0;
  --muted: #7a7298;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);
  --primary: #a78bfa;
  --primary-dark: #8b5cf6;
  --primary-soft: rgba(167,139,250,0.15);
  --success: #34d399;
  --success-soft: rgba(52,211,153,0.15);
  --warning: #fbbf24;
  --warning-soft: rgba(251,191,36,0.15);
  --danger: #f87171;
  --danger-soft: rgba(248,113,113,0.15);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.2);
  --radius: 10px;
}

/* ===== 全站深色炫彩背景 ===== */
html {
  min-width: 320px;
  background: #0c0a18;
}
body {
  background: transparent;
  color: #e8e4f0;
}
.app-shell {
  position: relative;
}
.app-shell::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 80% 80% at 15% 0%, rgba(190,70,255,0.55) 0%, transparent 50%),
    radial-gradient(ellipse 70% 75% at 90% 0%, rgba(255,50,130,0.5) 0%, transparent 50%),
    radial-gradient(ellipse 90% 65% at 50% 0%, rgba(0,245,245,0.5) 0%, transparent 45%),
    radial-gradient(ellipse 60% 60% at 20% 40%, rgba(50,120,255,0.45) 0%, transparent 55%),
    radial-gradient(ellipse 55% 55% at 80% 35%, rgba(255,150,40,0.45) 0%, transparent 55%),
    radial-gradient(ellipse 90% 50% at 50% 95%, rgba(120,50,240,0.5) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 10% 80%, rgba(0,240,160,0.4) 0%, transparent 55%),
    radial-gradient(ellipse 50% 45% at 90% 70%, rgba(240,70,190,0.4) 0%, transparent 55%);
  animation: siteBgPulse 10s ease-in-out infinite;
}
@keyframes siteBgPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* ===== AI 生图页面（使用全站统一背景） ===== */
.page-create {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}
.page-create .create-workspace {
  position: relative;
  z-index: 1;
}

* {
  box-sizing: border-box;
}

@keyframes bgFlow {
  0%   { background-position: 0% 0%, 0% 0%, 0% 50%; }
  50%  { background-position: 0% 0%, 0% 0%, 100% 50%; }
  100% { background-position: 0% 0%, 0% 0%, 0% 50%; }
}

@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes titleShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes barPulse {
  0%, 100% { opacity: 0.5; width: 48px; }
  50% { opacity: 1; width: 66px; }
}
@keyframes subtitleFade {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes techDrift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(80px, 80px); }
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: transparent;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

body.has-dialog,
body.is-generating {
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

button {
  border: 0;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 105px 0 40px;
}

.app-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 64px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(223, 231, 226, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  min-width: 0;
  width: fit-content;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #00efbf 0%, #00c5ef 52%, #00c5ef 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 197, 239, 0.28);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  display: block;
}

.brand-mark img,
.center-auth-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.brand-mark .icon-frame,
.brand-mark .icon-line,
.brand-mark .icon-dot {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark .ai-spark {
  fill: #a3e8ed;
  stroke: #ffffff;
  stroke-width: 0.6;
}

.brand-mark .ai-spark.small {
  fill: #ffffff;
  stroke: none;
  opacity: 0.92;
}

.brand-copy {
  min-width: 0;
}

.eyebrow,
.brand-copy .eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  overflow: hidden;
  font-size: 24px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  font-size: 20px;
  font-weight: 750;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  align-items: stretch;
}

.narrow-left {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.card {
  padding: 20px;
}

.section-card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 50px;
  margin-bottom: 16px;
}

.card-head>div {
  min-width: 0;
}

.card-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.credits-redeem-btn {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 12px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff7b25, #ff5e00, #ff7b25);
  background-size: 200% 200%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(255, 94, 0, 0.3);
  transition: transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.credits-redeem-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 94, 0, 0.45);
}

.form {
  display: grid;
  gap: 14px;
}

.field,
.field-grid {
  display: grid;
  gap: 8px;
}

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

.prompt-api-grid {
  grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 0.8fr) minmax(240px, 1fr);
}

.field span {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.settings-help-box {
  height: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  align-self: end;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: #f4fcfd;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #00efbf;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 197, 239, 0.16);
}

input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.button.primary {
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 197, 239, 0.25);
}

.button.primary:hover {
  background: linear-gradient(135deg, #00efbf 0%, #00c5ef 100%);
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text-soft);
}

.button.secondary:hover,
.button.secondary.active {
  border-color: #00efbf;
  background: var(--primary-soft);
  color: var(--primary);
}

.button.secondary.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.button.success {
  background: linear-gradient(135deg, #10b981 0%, #00efbf 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.22);
}

.button.success:hover {
  background: linear-gradient(135deg, #00efbf 0%, #10b981 100%);
}

.button.danger {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.22);
}

.button.danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

.button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.badge,
.status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status.succeeded,
.alert.success {
  background: var(--success-soft);
  color: #0098b8;
  border-color: #00efbf;
}

.status.failed,
.alert.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fbd38d;
}

[data-user-credit-transactions] .status.failed {
  background: #fff7e6;
  color: #e67e00;
  border-color: #fbd38d;
}

.status.running,
.status.queued,
.alert.warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: #fed7aa;
}

.status.deleted {
  background: #f2f4f7;
  color: var(--muted);
  border-color: var(--line-strong);
}

.alert {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
  color: var(--text-soft);
  font-weight: 650;
}

.inline-message {
  margin: 14px 0 0;
  text-align: center;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #0098b8;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  background: #f0f9ff;
}

/* ===== 全屏居中 Toast 遮罩（和域名查询页一致） ===== */
.inline-toast-mask {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  animation: inlineToastIn 0.35s ease;
}
.inline-toast-mask.toast-hide {
  animation: inlineToastOut 0.3s ease forwards;
}
@keyframes inlineToastIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes inlineToastOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.inline-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: #fff;
  border: 1px solid #fbd38d;
  border-radius: 14px;
  color: #e67e00;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.04);
  max-width: 90vw;
}
.inline-toast svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
  color: #f59e0b;
}

.inline-toast--success {
  border-color: #a7f3d0;
  color: #065f46;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}
.inline-toast--success svg {
  color: #00bfa5;
}

.generation-notice {
  color: #333;
  font-size: 12px;
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mode-toggle label {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text-soft);
  font-weight: 800;
}

.mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-toggle label:has(input:checked) {
  border-color: #00efbf;
  background: var(--primary-soft);
  color: var(--primary);
}

.edit-upload-box {
  position: relative;
  width: 50px;
  min-width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px dashed #98a2b3;
  border-radius: 10px;
  padding: 6px;
  background: #f4fcfd;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.edit-upload-box:hover {
  border-color: var(--primary);
  background: #e6faff;
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.08);
}

.edit-upload-box input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.edit-upload-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e6faff;
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.edit-upload-box strong {
  display: block;
  color: #101828;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.edit-upload-box small {
  display: none;
}

.edit-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.edit-upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

/* 旧版 grid + :has 布局规则已移除 */

.edit-preview-item {
  position: relative;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e5faf7;
}

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

.edit-preview-item button {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.generate-actions {
  display: grid;
  gap: 10px;
}

.generate-actions .button.primary {
  min-height: 48px;
  padding: 0 28px;
  font-size: 16px;
}

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

.prompt-optimize-button {
  width: auto;
  min-width: 88px;
  height: 30px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #00c5ef;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.prompt-optimize-button:hover,
.prompt-optimize-button:focus-visible {
  border-color: #00efbf;
  background: var(--primary-soft);
}

.prompt-optimize-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.auth-wrap {
  min-height: 62vh;
  display: grid;
  place-items: center;
}

.simple-auth {
  min-height: calc(100vh - 150px);
}

.auth-dashboard {
  min-height: calc(100vh - 142px);
  width: 100%;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 440px);
  gap: 24px;
  align-items: stretch;
  place-items: stretch;
}

.auth-info,
.auth-form-card {
  min-height: 520px;
}

.auth-info {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  border: 1px solid rgba(208, 213, 221, 0.92);
  border-radius: var(--radius);
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(0, 197, 239, 0.12), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #e6faff 100%);
  box-shadow: var(--shadow);
}

.auth-info::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: min(320px, 46%);
  height: 160px;
  border: 1px solid rgba(0, 197, 239, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 251, 250, 0.8)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(0, 197, 239, 0.12) 24px);
  opacity: 0.76;
}

.auth-info::before {
  content: "";
  position: absolute;
  inset: 24px 24px auto auto;
  width: min(360px, 42%);
  aspect-ratio: 1;
  border: 1px solid rgba(0, 197, 239, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(90deg, rgba(0, 197, 239, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 197, 239, 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.72;
}

.auth-info-head,
.auth-metrics {
  position: relative;
  z-index: 2;
}

.auth-tag {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #00efbf;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.auth-info h2 {
  max-width: 560px;
  margin-top: 22px;
  font-size: 42px;
  line-height: 1.08;
}

.auth-info p {
  max-width: 500px;
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 650;
}

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

.auth-metrics div {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid rgba(208, 213, 221, 0.88);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.auth-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.auth-metrics strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-card {
  width: min(440px, 100%);
}

.auth-form-card {
  width: 100%;
  display: grid;
  align-content: center;
  align-self: stretch;
  padding: 30px;
}

.auth-card.wide {
  width: min(640px, 100%);
}

.auth-card h2 {
  margin-bottom: 18px;
}

.auth-card-head {
  margin-bottom: 22px;
}

.auth-card-head h2 {
  margin-bottom: 8px;
  font-size: 26px;
  color: var(--text);
}

.auth-form-card .field input {
  background: #fff;
}

.auth-form-card .field input::placeholder {
  color: #98a2b3;
}

.auth-card-head span,
.auth-switch {
  color: var(--muted);
  font-weight: 650;
}

.auth-form-card .button.primary {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.auth-switch {
  margin: 18px 0 0;
  text-align: center;
}

.setup-card {
  width: min(920px, 100%);
  margin: 0 auto;
}

.setup-form {
  gap: 18px;
}

.setup-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #f4fcfd;
}

.setup-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.preview-card {
  display: grid;
  grid-template-rows: auto minmax(390px, 1fr);
}

.preview-stage {
  min-height: 390px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(208, 213, 221, 0.42) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(208, 213, 221, 0.42) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(208, 213, 221, 0.42) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(208, 213, 221, 0.42) 75%),
    #f4fcfd;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-stage.has-multi {
  overflow: visible;
  place-items: unset;
  padding: 20px;
}

.preview-stage img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #fff;
}

.generated-single-wrapper {
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.generated-image-grid {
  width: min(100% - 24px, 760px);
  max-height: calc(100% - 24px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  overflow: auto;
  padding: 4px;
}

.generated-image-carousel {
  width: min(100% - 24px, 820px);
  max-height: calc(100% - 24px);
  overflow: hidden;
}

.generated-image-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 76%);
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 12px;
}

.generated-image-track::-webkit-scrollbar,
.record-dialog-image-grid::-webkit-scrollbar,
.image-viewer-thumbs::-webkit-scrollbar {
  height: 8px;
}

.generated-image-track::-webkit-scrollbar-thumb,
.record-dialog-image-grid::-webkit-scrollbar-thumb,
.image-viewer-thumbs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.36);
}

.generated-image-slide,
.generated-image-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  cursor: zoom-in;
  scroll-snap-align: center;
}

.generated-image-slide img,
.generated-image-tile img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  box-shadow: none;
}

.generated-image-slide span,
.generated-image-tile span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.empty-state,
.preview-loading {
  width: min(240px, 90%);
  min-height: 116px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed #b8c7dc;
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.preview-loading span {
  font-size: 13px;
  font-weight: 600;
}

.generation-progress-card {
  width: min(520px, calc(100% - 28px));
  display: grid;
  gap: 16px;
  border: 1px solid #a3e8ed;
  border-radius: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(16, 24, 40, 0.08);
}

.generation-progress-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.generation-progress-head strong {
  display: block;
  color: #101828;
  font-size: 16px;
  font-weight: 850;
}

.generation-progress-head span {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.generation-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.generation-progress-grid>div {
  min-width: 0;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f4fcfd;
}

.generation-progress-grid span,
.generation-summary-row span,
.generation-summary-prompt span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 760;
}

.generation-progress-grid strong {
  display: block;
  margin-top: 5px;
  color: #101828;
  font-size: 20px;
  font-weight: 880;
  font-variant-numeric: tabular-nums;
}

.generation-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ec;
}

.generation-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00c5ef, #00efbf);
  transition: width 0.35s ease;
}

.generation-summary {
  display: grid;
  gap: 10px;
  border-top: 1px solid #e4e7ec;
  padding-top: 14px;
}

.generation-summary-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.generation-summary-row strong {
  min-width: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.generation-summary-prompt {
  display: grid;
  gap: 6px;
}

.generation-summary-prompt p {
  max-height: 112px;
  overflow: auto;
  margin: 0;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* ----- 多图并发进度卡片网格 ----- */
.multi-generation-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  padding: 4px;
}

.multi-task-card {
  display: grid;
  gap: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.multi-task-card.is-done {
  border-color: #a3e8ed;
  box-shadow: 0 2px 14px rgba(0, 197, 239, 0.08);
}

.multi-task-card.is-failed {
  border-color: #fbd38d;
  background: #fff7e6;
}

.multi-task-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.multi-task-card-head strong {
  font-size: 14px;
  font-weight: 700;
  color: #101828;
}

.multi-task-card-head .task-status {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e6faff;
  color: #00c5ef;
}

.multi-task-card.is-done .task-status {
  background: #e6faff;
  color: #00c5ef;
}

.multi-task-card.is-failed .task-status {
  background: #fff7e6;
  color: #e67e00;
}

.multi-task-image-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f4fbfc;
  border: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.multi-task-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.multi-task-image-box .image-placeholder {
  width: 40px;
  height: 40px;
  border: 3px solid #ddf1f4;
  border-top-color: #9cc5cc;
  border-radius: 50%;
  animation: spinner-rotate 1s linear infinite;
}

.multi-task-image-box .image-failed-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #b0b8c0;
  font-size: 14px;
  background: #fafafa;
}

.multi-task-image-box .image-failed-placeholder span {
  padding: 6px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  background: #fff;
  color: #a0a8b0;
}

.multi-task-card .task-error {
  color: #e67e00;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px;
  background: #fff7e6;
  border-radius: 6px;
}

.multi-task-progress-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 0 0;
}

.multi-task-progress-info > div {
  min-width: 0;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 6px 8px;
  background: #f4fcfd;
  text-align: center;
}

.multi-task-progress-info span {
  display: block;
  color: #888;
  font-size: 10px;
}

.multi-task-progress-info strong {
  display: block;
  margin-top: 2px;
  color: #101828;
  font-size: 14px;
  font-weight: 780;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-task-progress-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ec;
}

.multi-task-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00c5ef, #00efbf);
  transition: width 0.6s linear;
}

.multi-task-card-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  color: #667085;
  padding: 8px 0 0;
  border-top: 1px dashed #e4e7ec;
}

.multi-task-card-detail dl {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.multi-task-card-detail dt {
  font-weight: 500;
  color: #98a2b3;
}

.multi-task-card-detail dd {
  margin: 0;
  font-weight: 600;
  color: #344054;
}

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

.preview-error {
  width: min(360px, 92%);
  min-height: 128px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid #fbd38d;
  border-radius: var(--radius);
  padding: 18px;
  background: var(--danger-soft);
  color: var(--danger);
  text-align: center;
  font-weight: 700;
}

.preview-error span {
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.preview-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #cdf2f5;
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

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

.history-list .record-card {
  height: 254px;
  min-height: 254px;
  display: grid;
  grid-template-rows: 128px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.history-list .record-card:hover {
  border-color: #00efbf;
  background: #f4fcfd;
  box-shadow: var(--shadow-soft);
}

.history-list .record-card:focus-visible {
  outline: 3px solid rgba(0, 197, 239, 0.16);
  outline-offset: 2px;
}

.record-image {
  display: grid;
  place-content: center;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #e6faff, #f4fcfd);
  color: var(--muted);
  font-weight: 750;
}

.record-image .record-elapsed {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  color: #ff8c1a;
  pointer-events: none;
}

.record-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.record-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
}

.record-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.record-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta span:first-child {
  color: var(--primary);
}

.record-body p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  overflow: hidden;
  color: #003540;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.record-body time {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.record-delete {
  min-height: 28px;
  border: 1px solid #fbd38d;
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.record-delete:hover {
  background: var(--danger-soft);
}

.record-foot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.record-remix {
  min-height: 28px;
  border: none;
  border-radius: 6px;
  padding: 0 9px;
  background: linear-gradient(135deg, #00c5ef, #00efbf);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.record-remix:hover {
  background: linear-gradient(135deg, #00c5ef, #00efbf);
}

.history-empty-inline {
  grid-column: 1 / -1;
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c7dc;
  border-radius: var(--radius);
  color: var(--muted);
  background: #f4fcfd;
  font-weight: 750;
}

/* ===== 统一 Hero 横幅（全部页面） ===== */
.article-hero {
  text-align: center;
  padding-left: 0px;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0 auto 14px auto;
  background: none;
  border-radius: 0;
  overflow: visible;
}
.article-hero-inner {
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  max-width: 100%;
  text-align: center;
}
.article-hero-text h1 {
  margin: 0 0 4px; font-size: 28px; font-weight: 850;
  background: linear-gradient(135deg, #a78bfa, #6366f1, #06b6d4, #00c5ef, #06b6d4, #6366f1, #a78bfa, #8b5cf6);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.5px; line-height: 1.2;
  animation: titleFloat 6s ease-in-out infinite, titleShimmer 8s ease-in-out infinite;
}
.article-hero-text p {
  margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6;
  animation: subtitleFade 4s ease-in-out infinite;
}
.article-hero-deco {
  flex-shrink: 0; color: #00c5ef; margin-left: 40px; display: none;
}
@media (max-width: 960px) {
  .article-hero-text h1 { font-size: 26px; }
  .article-hero-deco { display: none; }
}
@media (max-width: 680px) {
  .article-hero { margin: 0 auto; padding: 0; }
  .article-hero-text h1 { font-size: 22px; margin-bottom: 4px; }
  .article-hero-text p { font-size: 14px; }
}

/* ===== 各页面 Hero 间距统一（仅手机端） ===== */
@media (max-width: 680px) {
  .page-cases .article-hero,
  .page-article .article-hero,
  .page-records .article-hero,
  .page-create .article-hero {
    margin-top: 0;
    margin-bottom: 0;
  }
  .page-create .create-hero,
  .page-edit .editor-header {
    padding-top: 0;
    padding-bottom: 0;
  }
  .page-mi .domain-hero {
    padding-top: 0;
    padding-bottom: 0;
    position: relative;
    z-index: 1;
  }
}

.records-page-card {
  margin-top: 0;
}

/* Final invitation and credit-ledger overrides. */
.site-invite-code {
  height: 30px;
  max-width: 150px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #00efbf;
  border-radius: 8px;
  padding: 0 10px;
  background: #e6faff;
  color: #047857;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.site-invite-code:hover,
.site-invite-code:focus-visible {
  border-color: #00c5ef;
  background: #cdf2f5;
}

body.page-admin [data-admin-users],
[data-admin-users] {
  min-width: 1460px;
}

body.page-admin [data-admin-users] th:nth-child(1),
body.page-admin [data-admin-users] td:nth-child(1),
[data-admin-users] th:nth-child(1),
[data-admin-users] td:nth-child(1) {
  width: 140px;
}

body.page-admin [data-admin-users] th:nth-child(2),
body.page-admin [data-admin-users] td:nth-child(2),
[data-admin-users] th:nth-child(2),
[data-admin-users] td:nth-child(2) {
  width: 132px;
}

body.page-admin [data-admin-users] th:nth-child(3),
body.page-admin [data-admin-users] td:nth-child(3),
[data-admin-users] th:nth-child(3),
[data-admin-users] td:nth-child(3) {
  width: 200px;
}

body.page-admin [data-admin-users] th:nth-child(4),
body.page-admin [data-admin-users] td:nth-child(4),
body.page-admin [data-admin-users] th:nth-child(6),
body.page-admin [data-admin-users] td:nth-child(6),
body.page-admin [data-admin-users] th:nth-child(7),
body.page-admin [data-admin-users] td:nth-child(7),
body.page-admin [data-admin-users] th:nth-child(8),
body.page-admin [data-admin-users] td:nth-child(8),
[data-admin-users] th:nth-child(4),
[data-admin-users] td:nth-child(4),
[data-admin-users] th:nth-child(6),
[data-admin-users] td:nth-child(6),
[data-admin-users] th:nth-child(7),
[data-admin-users] td:nth-child(7),
[data-admin-users] th:nth-child(8),
[data-admin-users] td:nth-child(8) {
  width: 92px;
}

body.page-admin [data-admin-users] th:nth-child(5),
body.page-admin [data-admin-users] td:nth-child(5),
[data-admin-users] th:nth-child(5),
[data-admin-users] td:nth-child(5) {
  width: 190px;
}

body.page-admin [data-admin-users] th:nth-child(9),
body.page-admin [data-admin-users] td:nth-child(9),
[data-admin-users] th:nth-child(9),
[data-admin-users] td:nth-child(9) {
  width: 170px;
}

body.page-admin [data-admin-users] th:nth-child(11),
body.page-admin [data-admin-users] td:nth-child(11),
[data-admin-users] th:nth-child(11),
[data-admin-users] td:nth-child(11) {
  width: 280px;
}

body.page-admin [data-admin-users] th:nth-child(10),
body.page-admin [data-admin-users] td:nth-child(10),
[data-admin-users] th:nth-child(10),
[data-admin-users] td:nth-child(10) {
  width: 170px;
}



.invite-table-cell {
  max-width: 170px;
  display: grid;
  gap: 4px;
  line-height: 1.3;
}

.invite-table-cell strong {
  overflow: hidden;
  color: #003a47;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-table-cell span {
  overflow: hidden;
  color: #5a7a82;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-admin-credit-transactions] {
  min-width: 1160px;
}

[data-admin-credit-transactions] th:nth-child(1),
[data-admin-credit-transactions] td:nth-child(1) {
  width: 140px;
}

[data-admin-credit-transactions] th:nth-child(2),
[data-admin-credit-transactions] td:nth-child(2) {
  width: 132px;
}

[data-admin-credit-transactions] th:nth-child(3),
[data-admin-credit-transactions] td:nth-child(3),
[data-admin-credit-transactions] th:nth-child(4),
[data-admin-credit-transactions] td:nth-child(4),
[data-admin-credit-transactions] th:nth-child(5),
[data-admin-credit-transactions] td:nth-child(5) {
  width: 92px;
}

[data-admin-credit-transactions] th:nth-child(6),
[data-admin-credit-transactions] td:nth-child(6) {
  width: 140px;
}

[data-admin-credit-transactions] th:nth-child(8),
[data-admin-credit-transactions] td:nth-child(8) {
  width: 170px;
}

.credit-positive strong {
  color: #047857;
}

.credit-negative strong {
  color: #e67e00;
}


.admin-credit-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-credit-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-credit-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-credit-filter .field-inline input,
.admin-credit-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-credit-filter .field-inline input {
  width: 140px;
}

.admin-credit-filter .field-inline select {
  width: 130px;
}

.admin-credit-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.admin-code-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-code-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-code-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-code-filter .field-inline input,
.admin-code-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-code-filter .field-inline input {
  width: 160px;
}

.admin-code-filter .field-inline select {
  width: 130px;
}

.admin-code-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.admin-usage-filter,
.admin-domain-records-filter,
.admin-whois-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-usage-filter .filter-row,
.admin-domain-records-filter .filter-row,
.admin-whois-filter .filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  grid-template-columns: none;
}

.admin-usage-filter .field-inline,
.admin-domain-records-filter .field-inline,
.admin-whois-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-usage-filter .field-inline span,
.admin-domain-records-filter .field-inline span,
.admin-whois-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-usage-filter .field-inline input,
.admin-usage-filter .field-inline select,
.admin-domain-records-filter .field-inline input,
.admin-domain-records-filter .field-inline select,
.admin-whois-filter .field-inline input,
.admin-whois-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-usage-filter .field-inline input,
.admin-domain-records-filter .field-inline input,
.admin-whois-filter .field-inline input {
  width: 140px;
}

.admin-usage-filter .field-inline select,
.admin-domain-records-filter .field-inline select,
.admin-whois-filter .field-inline select {
  width: 130px;
}

.admin-usage-filter .filter-actions,
.admin-domain-records-filter .filter-actions,
.admin-whois-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

@media (max-width: 720px) {
  .mobile-account-invite {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #00efbf;
    border-radius: 13px;
    padding: 0 14px;
    background: #e6faff;
    color: #047857;
    font-size: 14px;
    font-weight: 850;
    text-align: left;
  }

  .mobile-account-invite strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }
}


/* Final invitation and credit-ledger overrides. */
.site-invite-code {
  height: 30px;
  max-width: 150px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #00efbf;
  border-radius: 8px;
  padding: 0 10px;
  background: #e6faff;
  color: #047857;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.site-invite-code:hover,
.site-invite-code:focus-visible {
  border-color: #00c5ef;
  background: #cdf2f5;
}

body.page-admin [data-admin-users],
[data-admin-users] {
  min-width: 1460px;
}

body.page-admin [data-admin-users] th:nth-child(1),
body.page-admin [data-admin-users] td:nth-child(1),
[data-admin-users] th:nth-child(1),
[data-admin-users] td:nth-child(1) {
  width: 140px;
}

body.page-admin [data-admin-users] th:nth-child(2),
body.page-admin [data-admin-users] td:nth-child(2),
[data-admin-users] th:nth-child(2),
[data-admin-users] td:nth-child(2) {
  width: 132px;
}

body.page-admin [data-admin-users] th:nth-child(3),
body.page-admin [data-admin-users] td:nth-child(3),
[data-admin-users] th:nth-child(3),
[data-admin-users] td:nth-child(3) {
  width: 200px;
}

body.page-admin [data-admin-users] th:nth-child(4),
body.page-admin [data-admin-users] td:nth-child(4),
body.page-admin [data-admin-users] th:nth-child(6),
body.page-admin [data-admin-users] td:nth-child(6),
body.page-admin [data-admin-users] th:nth-child(7),
body.page-admin [data-admin-users] td:nth-child(7),
body.page-admin [data-admin-users] th:nth-child(8),
body.page-admin [data-admin-users] td:nth-child(8),
[data-admin-users] th:nth-child(4),
[data-admin-users] td:nth-child(4),
[data-admin-users] th:nth-child(6),
[data-admin-users] td:nth-child(6),
[data-admin-users] th:nth-child(7),
[data-admin-users] td:nth-child(7),
[data-admin-users] th:nth-child(8),
[data-admin-users] td:nth-child(8) {
  width: 92px;
}

body.page-admin [data-admin-users] th:nth-child(5),
body.page-admin [data-admin-users] td:nth-child(5),
[data-admin-users] th:nth-child(5),
[data-admin-users] td:nth-child(5) {
  width: 190px;
}

body.page-admin [data-admin-users] th:nth-child(9),
body.page-admin [data-admin-users] td:nth-child(9),
[data-admin-users] th:nth-child(9),
[data-admin-users] td:nth-child(9) {
  width: 170px;
}

body.page-admin [data-admin-users] th:nth-child(11),
body.page-admin [data-admin-users] td:nth-child(11),
[data-admin-users] th:nth-child(11),
[data-admin-users] td:nth-child(11) {
  width: 280px;
}

body.page-admin [data-admin-users] th:nth-child(10),
body.page-admin [data-admin-users] td:nth-child(10),
[data-admin-users] th:nth-child(10),
[data-admin-users] td:nth-child(10) {
  width: 170px;
}



.invite-table-cell {
  max-width: 170px;
  display: grid;
  gap: 4px;
  line-height: 1.3;
}

.invite-table-cell strong {
  overflow: hidden;
  color: #003a47;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-table-cell span {
  overflow: hidden;
  color: #5a7a82;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-admin-credit-transactions] {
  min-width: 1160px;
}

[data-admin-credit-transactions] th:nth-child(1),
[data-admin-credit-transactions] td:nth-child(1) {
  width: 140px;
}

[data-admin-credit-transactions] th:nth-child(2),
[data-admin-credit-transactions] td:nth-child(2) {
  width: 132px;
}

[data-admin-credit-transactions] th:nth-child(3),
[data-admin-credit-transactions] td:nth-child(3),
[data-admin-credit-transactions] th:nth-child(4),
[data-admin-credit-transactions] td:nth-child(4),
[data-admin-credit-transactions] th:nth-child(5),
[data-admin-credit-transactions] td:nth-child(5) {
  width: 92px;
}

[data-admin-credit-transactions] th:nth-child(6),
[data-admin-credit-transactions] td:nth-child(6) {
  width: 140px;
}

[data-admin-credit-transactions] th:nth-child(8),
[data-admin-credit-transactions] td:nth-child(8) {
  width: 170px;
}

.credit-positive strong {
  color: #047857;
}

.credit-negative strong {
  color: #e67e00;
}


.admin-credit-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-credit-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-credit-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-credit-filter .field-inline input,
.admin-credit-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-credit-filter .field-inline input {
  width: 140px;
}

.admin-credit-filter .field-inline select {
  width: 130px;
}

.admin-credit-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.admin-code-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-code-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-code-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-code-filter .field-inline input,
.admin-code-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-code-filter .field-inline input {
  width: 160px;
}

.admin-code-filter .field-inline select {
  width: 130px;
}

.admin-code-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.admin-usage-filter,
.admin-domain-records-filter,
.admin-whois-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-usage-filter .filter-row,
.admin-domain-records-filter .filter-row,
.admin-whois-filter .filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  grid-template-columns: none;
}

.admin-usage-filter .field-inline,
.admin-domain-records-filter .field-inline,
.admin-whois-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-usage-filter .field-inline span,
.admin-domain-records-filter .field-inline span,
.admin-whois-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-usage-filter .field-inline input,
.admin-usage-filter .field-inline select,
.admin-domain-records-filter .field-inline input,
.admin-domain-records-filter .field-inline select,
.admin-whois-filter .field-inline input,
.admin-whois-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-usage-filter .field-inline input,
.admin-domain-records-filter .field-inline input,
.admin-whois-filter .field-inline input {
  width: 140px;
}

.admin-usage-filter .field-inline select,
.admin-domain-records-filter .field-inline select,
.admin-whois-filter .field-inline select {
  width: 130px;
}

.admin-usage-filter .filter-actions,
.admin-domain-records-filter .filter-actions,
.admin-whois-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

@media (max-width: 720px) {
  .mobile-account-invite {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #00efbf;
    border-radius: 13px;
    padding: 0 14px;
    background: #e6faff;
    color: #047857;
    font-size: 14px;
    font-weight: 850;
    text-align: left;
  }

  .mobile-account-invite strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }
}

/* Invite and credit ledger refinements. */
.site-invite-code {
  height: 30px;
  max-width: 150px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #00efbf;
  border-radius: 8px;
  padding: 0 10px;
  background: #e6faff;
  color: #047857;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.site-invite-code:hover,
.site-invite-code:focus-visible {
  border-color: #00c5ef;
  background: #cdf2f5;
}

body.page-admin [data-admin-users],
[data-admin-users] {
  min-width: 1460px;
}

body.page-admin [data-admin-users] th:nth-child(1),
body.page-admin [data-admin-users] td:nth-child(1),
[data-admin-users] th:nth-child(1),
[data-admin-users] td:nth-child(1) {
  width: 140px;
}

body.page-admin [data-admin-users] th:nth-child(2),
body.page-admin [data-admin-users] td:nth-child(2),
[data-admin-users] th:nth-child(2),
[data-admin-users] td:nth-child(2) {
  width: 132px;
}

body.page-admin [data-admin-users] th:nth-child(3),
body.page-admin [data-admin-users] td:nth-child(3),
[data-admin-users] th:nth-child(3),
[data-admin-users] td:nth-child(3) {
  width: 200px;
}

body.page-admin [data-admin-users] th:nth-child(4),
body.page-admin [data-admin-users] td:nth-child(4),
body.page-admin [data-admin-users] th:nth-child(6),
body.page-admin [data-admin-users] td:nth-child(6),
body.page-admin [data-admin-users] th:nth-child(7),
body.page-admin [data-admin-users] td:nth-child(7),
body.page-admin [data-admin-users] th:nth-child(8),
body.page-admin [data-admin-users] td:nth-child(8),
[data-admin-users] th:nth-child(4),
[data-admin-users] td:nth-child(4),
[data-admin-users] th:nth-child(6),
[data-admin-users] td:nth-child(6),
[data-admin-users] th:nth-child(7),
[data-admin-users] td:nth-child(7),
[data-admin-users] th:nth-child(8),
[data-admin-users] td:nth-child(8) {
  width: 92px;
}

body.page-admin [data-admin-users] th:nth-child(5),
body.page-admin [data-admin-users] td:nth-child(5),
[data-admin-users] th:nth-child(5),
[data-admin-users] td:nth-child(5) {
  width: 190px;
}

body.page-admin [data-admin-users] th:nth-child(9),
body.page-admin [data-admin-users] td:nth-child(9),
[data-admin-users] th:nth-child(9),
[data-admin-users] td:nth-child(9) {
  width: 170px;
}

body.page-admin [data-admin-users] th:nth-child(11),
body.page-admin [data-admin-users] td:nth-child(11),
[data-admin-users] th:nth-child(11),
[data-admin-users] td:nth-child(11) {
  width: 280px;
}

body.page-admin [data-admin-users] th:nth-child(10),
body.page-admin [data-admin-users] td:nth-child(10),
[data-admin-users] th:nth-child(10),
[data-admin-users] td:nth-child(10) {
  width: 170px;
}



.invite-table-cell {
  max-width: 170px;
  display: grid;
  gap: 4px;
  line-height: 1.3;
}

.invite-table-cell strong {
  overflow: hidden;
  color: #003a47;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-table-cell span {
  overflow: hidden;
  color: #5a7a82;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-admin-credit-transactions] {
  min-width: 1160px;
}

[data-admin-credit-transactions] th:nth-child(1),
[data-admin-credit-transactions] td:nth-child(1) {
  width: 140px;
}

[data-admin-credit-transactions] th:nth-child(2),
[data-admin-credit-transactions] td:nth-child(2) {
  width: 132px;
}

[data-admin-credit-transactions] th:nth-child(3),
[data-admin-credit-transactions] td:nth-child(3),
[data-admin-credit-transactions] th:nth-child(4),
[data-admin-credit-transactions] td:nth-child(4),
[data-admin-credit-transactions] th:nth-child(5),
[data-admin-credit-transactions] td:nth-child(5) {
  width: 92px;
}

[data-admin-credit-transactions] th:nth-child(6),
[data-admin-credit-transactions] td:nth-child(6) {
  width: 140px;
}

[data-admin-credit-transactions] th:nth-child(8),
[data-admin-credit-transactions] td:nth-child(8) {
  width: 170px;
}

.credit-positive strong {
  color: #047857;
}

.credit-negative strong {
  color: #e67e00;
}


.admin-credit-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-credit-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-credit-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-credit-filter .field-inline input,
.admin-credit-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-credit-filter .field-inline input {
  width: 140px;
}

.admin-credit-filter .field-inline select {
  width: 130px;
}

.admin-credit-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.admin-code-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-code-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-code-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-code-filter .field-inline input,
.admin-code-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-code-filter .field-inline input {
  width: 160px;
}

.admin-code-filter .field-inline select {
  width: 130px;
}

.admin-code-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.admin-usage-filter,
.admin-domain-records-filter,
.admin-whois-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-usage-filter .filter-row,
.admin-domain-records-filter .filter-row,
.admin-whois-filter .filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  grid-template-columns: none;
}

.admin-usage-filter .field-inline,
.admin-domain-records-filter .field-inline,
.admin-whois-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-usage-filter .field-inline span,
.admin-domain-records-filter .field-inline span,
.admin-whois-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-usage-filter .field-inline input,
.admin-usage-filter .field-inline select,
.admin-domain-records-filter .field-inline input,
.admin-domain-records-filter .field-inline select,
.admin-whois-filter .field-inline input,
.admin-whois-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-usage-filter .field-inline input,
.admin-domain-records-filter .field-inline input,
.admin-whois-filter .field-inline input {
  width: 140px;
}

.admin-usage-filter .field-inline select,
.admin-domain-records-filter .field-inline select,
.admin-whois-filter .field-inline select {
  width: 130px;
}

.admin-usage-filter .filter-actions,
.admin-domain-records-filter .filter-actions,
.admin-whois-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

@media (max-width: 720px) {
  .mobile-account-invite {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #00efbf;
    border-radius: 13px;
    padding: 0 14px;
    background: #e6faff;
    color: #047857;
    font-size: 14px;
    font-weight: 850;
    text-align: left;
  }

  .mobile-account-invite strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }
}

/* Admin final UI pass: blue-cyan primary. */
body.page-admin {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0, rgba(243, 249, 250, 0) 240px),
    #f4fcfd;
}

body.page-admin .app-shell {
  width: min(1440px, calc(100% - 32px));
}

body.page-admin .site-header,
body.page-admin .admin-nav,
body.page-admin .card,
body.page-admin .stat-card,
body.page-admin .table-wrap {
  border-color: #ddf1f4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

body.page-admin .site-header {
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.06);
}

body.page-admin .section-card {
  overflow: hidden;
  padding: 0;
}

body.page-admin .section-card>.card-head {
  margin: 0;
  padding: 18px 20px;
}

body.page-admin .card-head {
  border-bottom: 1px solid #ecf5f6;
}

body.page-admin .card-head h2 {
  color: #003a47;
  font-size: 18px;
  font-weight: 760;
}

body.page-admin .admin-nav {
  padding: 6px;
  gap: 4px;
}

body.page-admin .admin-nav .button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 0 13px;
  font-size: 13px;
}

body.page-admin .admin-nav .button.secondary.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 197, 239, 0.2);
}

body.page-admin .filter-bar,
body.page-admin .admin-record-bulk-form,
body.page-admin .code-create-form {
  border-color: #ecf5f6;
  background: #f5fcfd;
}

body.page-admin .section-card>.filter-bar,
body.page-admin .section-card>.admin-record-bulk-form,
body.page-admin .section-card>.code-create-form {
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 14px 20px;
}

body.page-admin .button {
  min-height: 36px;
  border-radius: 7px;
  font-weight: 720;
  box-shadow: none;
}

body.page-admin .button.small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
}

body.page-admin .button.primary {
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
}

body.page-admin .button.primary:hover {
  background: linear-gradient(135deg, #00efbf 0%, #00c5ef 100%);
}

body.page-admin .button.secondary {
  border-color: #d3e9ed;
  background: #fff;
  color: #2d6b76;
}

body.page-admin .button.secondary:hover {
  border-color: #b6dce3;
  background: #f4fcfd;
  color: #003a47;
}

body.page-admin input,
body.page-admin select,
body.page-admin textarea {
  border-color: #d3e9ed;
  border-radius: 7px;
}

body.page-admin input:focus,
body.page-admin select:focus,
body.page-admin textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 197, 239, 0.16);
}

body.page-admin .table-wrap {
  border-width: 1px 0 0;
  border-radius: 0 0 10px 10px;
  box-shadow: none;
}

body.page-admin th {
  height: 44px;
  background: #f4fcfd;
  color: #5a7a82;
  font-size: 12px;
  font-weight: 720;
  text-transform: none;
}

body.page-admin td {
  height: 58px;
  border-bottom-color: #ecf5f6;
  color: #1a5b66;
}

body.page-admin tbody tr:hover td {
  background: #f3fafc;
}

body.page-admin [data-admin-users] {
  min-width: 1460px;
}

body.page-admin [data-admin-users] th:nth-child(1),
body.page-admin [data-admin-users] td:nth-child(1) {
  width: 150px;
}

body.page-admin [data-admin-users] th:nth-child(2),
body.page-admin [data-admin-users] td:nth-child(2) {
  width: 150px;
}

body.page-admin [data-admin-users] th:nth-child(3),
body.page-admin [data-admin-users] td:nth-child(3) {
  width: 220px;
}

body.page-admin [data-admin-users] th:nth-child(4),
body.page-admin [data-admin-users] td:nth-child(4),
body.page-admin [data-admin-users] th:nth-child(5),
body.page-admin [data-admin-users] td:nth-child(5),
body.page-admin [data-admin-users] th:nth-child(7),
body.page-admin [data-admin-users] td:nth-child(7),
body.page-admin [data-admin-users] th:nth-child(8),
body.page-admin [data-admin-users] td:nth-child(8),
body.page-admin [data-admin-users] th:nth-child(9),
body.page-admin [data-admin-users] td:nth-child(9) {
  width: 96px;
}

body.page-admin [data-admin-users] th:nth-child(6),
body.page-admin [data-admin-users] td:nth-child(6) {
  width: 190px;
}

body.page-admin [data-admin-users] th:nth-child(10),
body.page-admin [data-admin-users] td:nth-child(10) {
  width: 390px;
}

body.page-admin .admin-credit-cell {
  overflow: visible;
}

body.page-admin .admin-credit-cell .inline-admin-form {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 58px;
  gap: 8px;
  align-items: center;
}

body.page-admin .admin-credit-cell .compact-input {
  width: 100%;
  min-width: 0;
}

body.page-admin {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0, rgba(246, 248, 250, 0) 240px),
    #f4fcfd;
}

body.page-admin .app-shell {
  width: min(1440px, calc(100% - 32px));
}

body.page-admin .site-header,
body.page-admin .card,
body.page-admin .stat-card,
body.page-admin .admin-nav,
body.page-admin .table-wrap {
  border-color: #ddf1f4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

body.page-admin .site-header {
  top: 0;
  min-height: 68px;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.06);
}

body.page-admin .card {
  padding: 18px;
}

body.page-admin .section-card {
  padding: 0;
}

body.page-admin .section-card>.card-head {
  padding: 18px 20px;
}

body.page-admin .card-head {
  min-height: 58px;
  margin-bottom: 6px;
  border-bottom: 1px solid #ecf5f6;
}

body.page-admin .card-head h2 {
  color: #003a47;
  font-size: 18px;
  font-weight: 700;
}

body.page-admin .eyebrow {
  color: #68868e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

body.page-admin .badge,
body.page-admin .status {
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

body.page-admin .admin-nav {
  position: sticky;
  top: 88px;
  z-index: 20;
  padding: 6px;
  gap: 4px;
  backdrop-filter: blur(14px);
}

body.page-admin .admin-nav .button {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 13px;
  font-size: 13px;
}

body.page-admin .admin-nav .button.secondary.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 197, 239, 0.2);
}

body.page-admin .stats-grid {
  gap: 10px;
  grid-template-columns: repeat(5, 1fr);
}

body.page-admin .stat-card {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05), 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

body.page-admin .stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0;
}

/* 不同列的强调色 */
body.page-admin .stat-card:nth-child(1)::before { background: linear-gradient(180deg, #00c5ef, #00b4d8); }
body.page-admin .stat-card:nth-child(2)::before { background: linear-gradient(180deg, #6366f1, #818cf8); }
body.page-admin .stat-card:nth-child(3)::before { background: linear-gradient(180deg, #10b981, #00efbf); }
body.page-admin .stat-card:nth-child(4)::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
body.page-admin .stat-card:nth-child(5)::before { background: linear-gradient(180deg, #f97316, #ef4444); }
body.page-admin .stat-card:nth-child(6)::before { background: linear-gradient(180deg, #8b5cf6, #a78bfa); }
body.page-admin .stat-card:nth-child(7)::before { background: linear-gradient(180deg, #00c5ef, #00efbf); }
body.page-admin .stat-card:nth-child(8)::before { background: linear-gradient(180deg, #10b981, #34d399); }
body.page-admin .stat-card:nth-child(9)::before { background: linear-gradient(180deg, #ec4899, #f472b6); }

body.page-admin .stat-card:hover {
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
  transform: translateY(-2px);
}

body.page-admin .stat-card span {
  color: #8896a0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

body.page-admin .stat-card strong {
  margin-top: 4px;
  color: #101828;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 980px) {
  body.page-admin .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  body.page-admin .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

body.page-admin .filter-bar,
body.page-admin .admin-record-bulk-form,
body.page-admin .code-create-form {
  border-color: #ecf5f6;
  border-radius: 0;
  background: #f5fcfd;
  box-shadow: none;
}

body.page-admin .section-card>.filter-bar,
body.page-admin .section-card>.admin-record-bulk-form,
body.page-admin .section-card>.code-create-form {
  margin: 0;
  border-width: 0 0 1px;
  padding: 14px 20px;
}

body.page-admin .field span {
  color: #4d6b73;
  font-size: 13px;
  font-weight: 700;
}

body.page-admin input,
body.page-admin select,
body.page-admin textarea {
  border-color: #d3e9ed;
  border-radius: 7px;
  background: #fff;
  color: #003a47;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body.page-admin input:hover,
body.page-admin select:hover,
body.page-admin textarea:hover {
  border-color: #b6dce3;
}

body.page-admin input:focus,
body.page-admin select:focus,
body.page-admin textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 197, 239, 0.16);
}

body.page-admin .button {
  min-height: 36px;
  border-radius: 7px;
  font-weight: 700;
  box-shadow: none;
}

body.page-admin .button.small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
}

body.page-admin .button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

body.page-admin .button.primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

body.page-admin .button.secondary {
  border-color: #d3e9ed;
  background: #fff;
  color: #2d6b76;
}

body.page-admin .button.secondary:hover {
  border-color: #b6dce3;
  background: #f4fcfd;
  color: #003a47;
}

body.page-admin .button.danger {
}

body.page-admin .button.danger:hover {
}

body.page-admin .table-wrap {
  border-width: 1px 0 0;
  border-radius: 0 0 10px 10px;
  box-shadow: none;
}

body.page-admin table {
  border-collapse: separate;
  border-spacing: 0;
}

body.page-admin th {
  height: 44px;
  border-bottom-color: #ddf1f4;
  background: #f4fcfd;
  color: #5a7a82;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

body.page-admin td {
  height: 58px;
  border-bottom-color: #ecf5f6;
  color: #1a5b66;
}

body.page-admin tbody tr:hover td {
  background: #f3fafc;
}

body.page-admin .table-primary-text,
body.page-admin .admin-record-id,
body.page-admin .admin-number-cell strong {
  color: #003a47;
  font-weight: 750;
}

body.page-admin .table-muted-cell,
body.page-admin .admin-prompt-cell {
  color: #5a7a82;
}

body.page-admin .inline-admin-form,
body.page-admin .table-action-group {
  gap: 8px;
}

body.page-admin .compact-input {
  height: 32px;
  border-radius: 6px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  padding-bottom: 24px;
}

.pagination span {
  color: var(--muted);
  font-weight: 750;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 30px;
  line-height: 1.1;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom-color: #d4eaef;
  background: #f4fbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
  letter-spacing: 0;
  white-space: nowrap;
}

tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

tbody tr:hover td {
  background: #f4fcfd;
}

tr.is-deleted td {
  background: #fafafa;
  color: var(--muted);
}

tr.is-deleted:hover td {
  background: #f6f6f6;
}

[data-admin-records] th,
[data-admin-users] th,
[data-admin-codes] th {
  text-transform: none;
}

[data-admin-records] {
  min-width: 1190px;
}

[data-admin-records] th:nth-child(1),
[data-admin-records] td:nth-child(1) {
  width: 44px;
  text-align: center;
}

[data-admin-records] th:nth-child(2),
[data-admin-records] td:nth-child(2) {
  width: 66px;
}

[data-admin-records] th:nth-child(3),
[data-admin-records] td:nth-child(3) {
  width: 172px;
}

[data-admin-records] th:nth-child(4),
[data-admin-records] td:nth-child(4) {
  width: 80px;
}

[data-admin-records] th:nth-child(5),
[data-admin-records] td:nth-child(5) {
  width: 92px;
}

[data-admin-records] th:nth-child(6),
[data-admin-records] td:nth-child(6) {
  width: 80px;
}

[data-admin-records] th:nth-child(7),
[data-admin-records] td:nth-child(7) {
  width: 60px;
}

[data-admin-records] th:nth-child(9),
[data-admin-records] td:nth-child(9) {
  width: 165px;
}

[data-admin-records] th:nth-child(10),
[data-admin-records] td:nth-child(10) {
  width: 250px;
}

[data-admin-users] {
  min-width: 1460px;
}

[data-admin-users] th:nth-child(1),
[data-admin-users] td:nth-child(1) {
  width: 150px;
}

[data-admin-users] th:nth-child(2),
[data-admin-users] td:nth-child(2) {
  width: 150px;
}

[data-admin-users] th:nth-child(3),
[data-admin-users] td:nth-child(3) {
  width: 220px;
}

[data-admin-users] th:nth-child(4),
[data-admin-users] td:nth-child(4) {
  width: 96px;
}

[data-admin-users] th:nth-child(5),
[data-admin-users] td:nth-child(5) {
  width: 96px;
}

[data-admin-users] th:nth-child(7),
[data-admin-users] td:nth-child(7),
[data-admin-users] th:nth-child(8),
[data-admin-users] td:nth-child(8),
[data-admin-users] th:nth-child(9),
[data-admin-users] td:nth-child(9) {
  width: 96px;
}

[data-admin-users] th:nth-child(6),
[data-admin-users] td:nth-child(6) {
  width: 190px;
}

[data-admin-users] th:nth-child(10),
[data-admin-users] td:nth-child(10) {
  width: 390px;
}

[data-admin-codes] {
  min-width: 1160px;
}

[data-admin-codes] th:nth-child(1),
[data-admin-codes] td:nth-child(1) {
  width: 230px;
}

[data-admin-codes] th:nth-child(2),
[data-admin-codes] td:nth-child(2),
[data-admin-codes] th:nth-child(3),
[data-admin-codes] td:nth-child(3),
[data-admin-codes] th:nth-child(4),
[data-admin-codes] td:nth-child(4),
[data-admin-codes] th:nth-child(5),
[data-admin-codes] td:nth-child(5) {
  width: 96px;
}

[data-admin-codes] th:nth-child(6),
[data-admin-codes] td:nth-child(6),
[data-admin-codes] th:nth-child(8),
[data-admin-codes] td:nth-child(8) {
  width: 170px;
}

[data-admin-codes] th:nth-child(7),
[data-admin-codes] td:nth-child(7) {
  width: 120px;
}

[data-admin-codes] th:nth-child(9),
[data-admin-codes] td:nth-child(9) {
  width: 150px;
}

.admin-record-row .admin-prompt-cell {
  color: var(--text-soft);
  max-width: 320px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-record-row .admin-username-cell {
  white-space: nowrap;
  overflow: visible !important;
  max-width: none !important;
  text-overflow: clip !important;
}

.admin-record-row .admin-time-cell {
  white-space: nowrap;
  overflow: visible;
}

.admin-image-cell {
  text-align: center;
  overflow: visible;
  white-space: nowrap;
}

.admin-image-user {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-time-cell {
  white-space: nowrap;
}

.admin-record-row td {
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-primary-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-muted-cell {
  color: var(--muted);
}

.admin-record-id-cell {
  line-height: 1.35;
}

.admin-record-id {
  display: inline-block;
  color: var(--text);
  font-weight: 850;
}

.admin-record-id-cell .status {
  margin-top: 5px;
}

.table-check-cell input,
[data-check-all-records] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.admin-number-cell {
  color: #344054;
  font-variant-numeric: tabular-nums;
}

.admin-number-cell strong {
  color: var(--text);
  font-weight: 880;
}

.admin-credit-cell {
  overflow: visible;
}

.admin-credit-cell .inline-admin-form {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 58px;
  gap: 8px;
  align-items: center;
}

.admin-credit-cell .compact-input {
  width: 100%;
  min-width: 0;
}

.admin-record-row .admin-table-actions {
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
}

.deleted-time {
  margin-top: 6px;
}

/* 案例开关 */
.switch-toggle {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
  user-select: none;
}

.switch-toggle input {
  display: none;
}

.switch-slider {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  background: #cbd5e1;
  transition: background .2s;
  position: relative;
}

.switch-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform .2s;
}

.switch-toggle input:checked + .switch-slider {
  background: #10b981;
}

.switch-toggle input:checked + .switch-slider::after {
  transform: translateX(20px);
}

.featured-label {
  margin-left: 8px;
  font-size: 13px;
  color: #4d6b73;
  vertical-align: middle;
}

/* 导航设置页 pill 切换按钮 */
.nav-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 20px;
  background: #f9fafb;
  color: #667085;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all .18s;
}

.nav-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.nav-toggle:has(input:checked) {
  border-color: #00c5ef;
  background: #e6faff;
  color: #007c9e;
  box-shadow: inset 0 0 0 1px rgba(0,197,239,.15);
}

.nav-toggle:hover {
  border-color: #98a2b3;
}

.nav-toggle:has(input:checked):hover {
  border-color: #00c5ef;
  background: #d6f5ff;
}
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

td:has(.table-thumb) {
  overflow: visible;
  width: 170px;
}

.table-thumb {
  width: 150px;
  height: auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.table-thumb:hover {
  border-color: #00efbf;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.table-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.inline-delete-form {
  display: inline-flex;
  margin: 0 0 0 6px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  border: 1px solid #ebf6f8;
  border-radius: 10px;
  background: #f4fcfd;
  padding: 12px;
}

.filter-bar.admin-user-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
}

.filter-bar.admin-user-filter .field {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-bar.admin-user-filter .field span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-bar.admin-user-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.sort-link {
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}

.sort-link::after {
  content: '\2195';
  font-size: 12px;
  color: #a0aab4;
  font-weight: normal;
  display: inline-block;
}

.sort-link:hover {
  color: #00b894;
}

.sort-link:hover::after {
  color: #00b894;
}

.filter-bar.admin-record-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px 14px;
}

.filter-bar.admin-record-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.filter-bar.admin-record-filter .field-inline span {
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.filter-bar.admin-record-filter .field-inline input,
.filter-bar.admin-record-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.filter-bar.admin-record-filter .field-inline input {
  width: 140px;
}

.filter-bar.admin-record-filter .field-inline select {
  width: 110px;
}

.filter-bar.admin-record-filter .field-inline input::placeholder {
  color: #94a3b8;
}

.filter-row {
  display: grid;
  gap: 12px;
  align-items: end;
}

.filter-bar.admin-record-filter .filter-row:first-child {
  grid-template-columns: 1fr 1fr;
}

.filter-bar.admin-record-filter .filter-row:last-child {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-actions .button {
  white-space: nowrap;
  height: 34px;
}

.admin-bulk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 12px;
  padding-top: 12px;
  padding-left: 10px;
  border-top: 1px solid #e5e7eb;
}

.admin-bulk-row .button.small {
  min-width: 90px;
  text-align: center;
  justify-content: center;
  height: 30px;
  line-height: 1;
  font-size: 12px;
  padding: 0 12px;
}

.admin-record-bulk-form {
  margin-bottom: 12px;
  border: 1px solid #fee2e2;
  border-radius: 10px;
  background: #fffafa;
  padding: 10px 12px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.code-create-card .card-head {
  margin-bottom: 12px;
}

.code-create-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.code-create-form .button {
  min-width: 96px;
}

.code-create-form .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.code-create-form .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.code-create-form .field-inline input,
.code-create-form .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  width: 90px;
}

.code-export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.code-export-actions span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.logo-preview img {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.user-identity {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.user-identity strong,
.user-identity span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-identity strong {
  color: var(--text);
  font-weight: 850;
  line-height: 1.2;
}

.user-identity>span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.inline-admin-form,
.table-action-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 0;
  vertical-align: middle;
}

.table-action-group {
  width: 100%;
  flex-wrap: wrap;
}

.compact-input {
  width: 88px;
  height: 36px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 13px;
}

.compact-input.password-input {
  width: 146px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.code-token {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f4fcfd;
  padding: 0 9px;
  color: #00333f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-copy-button {
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.code-copy-button:hover,
.code-copy-button:focus-visible {
  border-color: #00efbf;
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.redeem-dialog,
.record-dialog,
.generation-overlay,
.legal-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
}

.generation-overlay {
  z-index: 10002;
  pointer-events: auto;
}

.redeem-panel,
.record-dialog-panel,
.legal-dialog-panel,
.generation-modal {
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.3);
}

.record-dialog-panel {
  width: min(920px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
}

.legal-dialog-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  overflow: auto;
}

.generation-modal {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 22px;
  text-align: center;
}

.generation-modal h2 {
  font-size: 22px;
}

.generation-modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.generation-loader {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: 42px;
}

.generation-loader span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  animation: pulse 0.9s ease-in-out infinite;
}

.generation-loader span:nth-child(2) {
  animation-delay: 0.12s;
}

.generation-loader span:nth-child(3) {
  animation-delay: 0.24s;
}

.generation-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--primary-soft);
}

.generation-progress i {
  width: 42%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #00efbf, var(--primary));
  animation: progress 1.3s ease-in-out infinite;
}

.redeem-head,
.record-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.96);
}

.record-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(12px);
}

.redeem-form {
  padding: 20px;
}

.dialog-close {
  min-width: 72px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 750;
}

.dialog-close:hover {
  border-color: #00efbf;
  background: var(--primary-soft);
  color: var(--primary);
}

/* ====== 登录提示弹窗 ====== */
.login-prompt-panel {
  position: relative;
  width: min(440px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.3);
  animation: loginPromptIn 0.28s var(--ease-out);
}

@keyframes loginPromptIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-prompt-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.login-prompt-close:hover {
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

/* 装饰头部 */
.login-prompt-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 20px 24px;
  background: linear-gradient(135deg, #e6faff 0%, #f4fcfd 50%, #ecfdf5 100%);
}

.login-prompt-icon-ring {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c5ef, #00efbf);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 197, 239, 0.35);
}

.login-prompt-icon {
  width: 36px;
  height: 36px;
}

.login-prompt-dots {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}

.login-prompt-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ce7f5;
}

.login-prompt-dots span:nth-child(1) { background: #7bdff2; }
.login-prompt-dots span:nth-child(2) { background: #5fdac4; width: 24px; border-radius: 999px; }
.login-prompt-dots span:nth-child(3) { background: #a3e8ed; }

/* 内容 */
.login-prompt-body {
  padding: 24px 28px 28px;
  text-align: center;
}

.login-prompt-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.login-prompt-desc {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.65;
  color: #64748b;
}

.login-prompt-desc strong {
  color: var(--primary-dark);
  font-weight: 650;
}

/* 功能列表 */
.login-prompt-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--primary-soft);
}

.login-prompt-feature {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-dark);
  white-space: nowrap;
}

/* 按钮 */
.login-prompt-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.login-prompt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}

.login-prompt-btn:hover {
  transform: translateY(-1px);
}

.login-prompt-btn-primary {
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 197, 239, 0.35);
}

.login-prompt-btn-primary:hover {
  box-shadow: 0 6px 22px rgba(0, 197, 239, 0.5);
  color: #fff;
}

.login-prompt-btn-secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--line-strong);
}

.login-prompt-btn-secondary:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #00efbf;
}

@media (max-width: 480px) {
  .login-prompt-body {
    padding: 20px 18px 22px;
  }
  .login-prompt-hero {
    padding: 28px 18px 18px;
  }
  .login-prompt-icon-ring {
    width: 60px;
    height: 60px;
  }
  .login-prompt-icon {
    width: 30px;
    height: 30px;
  }
  .login-prompt-title {
    font-size: 18px;
  }
  .login-prompt-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .login-prompt-btn {
    width: 100%;
  }
}

.record-dialog-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 20px;
}

.record-dialog-toast {
  text-align: center;
  padding: 6px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(0,197,239,0.15);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.record-dialog-image {
  padding: 0;
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e6faff, #f4fcfd);
  color: var(--muted);
  font-weight: 750;
}

.record-dialog-image-button {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
}

.record-dialog-image-grid {
  width: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 48%);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 12px;
}

.record-dialog-carousel {
  width: 100%;
  overflow: hidden;
}

.record-dialog-image-grid .record-dialog-image-button {
  min-height: 180px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  scroll-snap-align: center;
}

.record-dialog-image-button {
  position: relative;
  cursor: zoom-in;
}

.record-dialog-image-button span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 42px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.record-dialog-image-button img,
.record-dialog-image img {
  width: 100%;
  height: 100%;
  max-height: 640px;
  object-fit: contain;
  background: #fff;
}

.record-input-images {
  display: grid;
  gap: 10px;
}

.record-input-images>span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.record-input-images [data-dialog-input-list] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.record-input-image-button {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0;
  cursor: zoom-in;
}

.record-input-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.86);
}

.image-viewer-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.image-viewer-meta {
  min-width: 0;
  margin-right: auto;
  display: grid;
  gap: 2px;
  color: #fff;
}

.image-viewer-meta strong {
  max-width: min(42vw, 560px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 850;
}

.image-viewer-meta span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 750;
}

.image-viewer-toolbar button,
.image-viewer-toolbar>span,
.image-viewer-download {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.image-viewer-toolbar>span {
  min-width: 72px;
}

.image-viewer-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.48);
  cursor: grab;
}

.image-viewer-canvas {
  min-width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
}

.image-viewer-stage.is-dragging {
  cursor: grabbing;
}

.image-viewer-stage img {
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  user-select: none;
}

.image-viewer-nav {
  position: fixed;
  top: 50%;
  z-index: 10021;
  width: 48px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.image-viewer-nav.prev {
  left: 24px;
}

.image-viewer-nav.next {
  right: 24px;
}

.image-viewer-nav:disabled {
  display: none;
}

.image-viewer-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 76px;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.image-viewer-thumbs button {
  width: 76px;
  height: 58px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.image-viewer-thumbs button.is-active {
  border-color: #fff;
}

.image-viewer-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.record-detail-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4fcfd;
}

.record-detail-grid .detail-sep {
  color: var(--line);
  font-size: 14px;
  margin: 0 2px;
}

.record-detail-grid span:not(.detail-sep),
.record-full-prompt span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.record-detail-grid strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.record-detail-grid strong.status {
  color: inherit;
  font-size: 13px;
}

.record-full-prompt {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.record-full-prompt-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.record-full-prompt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── 弹窗操作按钮统一风格 ── */
.record-full-prompt-actions > button,
.record-full-prompt-actions > .record-remix--dialog {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
}
.record-full-prompt-actions > button svg,
.record-full-prompt-actions > .record-remix--dialog svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* 复制提示词 —— 蓝青 */
.record-copy-btn {
  background: linear-gradient(135deg, #4f8ff7, #1cc8e0);
}
.record-copy-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}
.record-copy-btn--done,
.record-copy-btn--done:hover {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  pointer-events: none;
}
.record-copy-btn--done svg { opacity: 1; }

/* 存为我的模板 —— 橙金 */
.record-save-tpl-btn {
  background: linear-gradient(135deg, #f5b014, #f9862e);
}
.record-save-tpl-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

/* 同款创作 —— 青绿（主题色） */
.record-remix--dialog {
  background: linear-gradient(135deg, #00b8e0, #00e0b4);
}
.record-remix--dialog:hover {
  background: linear-gradient(135deg, #00a8d0, #00d0a4);
}

/* 作为参考图 —— 紫蓝 */
.record-ref-btn {
  background: linear-gradient(135deg, #9d72f8, #7278f4);
}
.record-ref-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

/* 去改图 —— 粉橙 */
.record-edit-btn {
  background: linear-gradient(135deg, #f68ac4, #fca048);
}
.record-edit-btn:hover {
  background: linear-gradient(135deg, #f472b6, #fb923c);
}

.record-full-prompt p {
  max-height: 132px;
  overflow: auto;
  margin: 0;
  color: #334155;
  white-space: pre-wrap;
}
.record-full-prompt p span {
  font-weight: 600;
  color: #64748b;
  margin-right: 2px;
}
  overflow-wrap: anywhere;
}

.record-error {
  grid-column: 1 / -1;
  border: 1px solid #fbd38d;
  border-radius: var(--radius);
  padding: 12px;
  background: var(--danger-soft);
  color: var(--danger);
}

.record-dialog-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  background: #f7f8fa;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.record-dialog-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.record-dialog-meta-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  flex: 0 0 auto;
}

.record-dialog-meta-value {
  font-size: 12px;
  font-weight: 550;
  color: var(--text);
  word-break: break-all;
}

.record-dialog-meta-value.status {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}

.record-dialog-meta-value.status.succeeded {
  border-color: #00efbf;
  background: var(--success-soft);
  color: #0098b8;
}

.record-dialog-meta-value.status.failed {
  border-color: #fbd38d;
  background: var(--danger-soft);
  color: var(--danger);
}

.record-dialog-meta-value.status.running,
.record-dialog-meta-value.status.queued {
  border-color: #fed7aa;
  background: var(--warning-soft);
  color: var(--warning);
}

.record-dialog-meta-value.status.deleted {
  border-color: var(--line-strong);
  background: #f2f4f7;
  color: var(--muted);
}

.history-list::-webkit-scrollbar,
.record-full-prompt p::-webkit-scrollbar,
.record-dialog-panel::-webkit-scrollbar,
.admin-nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.history-list::-webkit-scrollbar-thumb,
.record-full-prompt p::-webkit-scrollbar-thumb,
.record-dialog-panel::-webkit-scrollbar-thumb,
.admin-nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c3dee5;
}

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

@keyframes pulse {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

@keyframes progress {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(260%);
  }
}

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

@media (max-width: 980px) {
  .app-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-right {
    justify-content: flex-start;
  }

  /* 平板竖屏：导航项使用自然宽度，不强制均分 */
  .topbar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  .topbar-nav a {
    flex: 0 0 auto;
    width: auto;
    min-width: auto;
    padding: 0 10px;
    white-space: nowrap;
  }

  .two-col,
  .narrow-left,
  .auth-dashboard {
    grid-template-columns: 1fr;
  }

  .auth-info,
  .auth-form-card {
    min-height: auto;
  }

  .auth-info {
    gap: 28px;
  }

  .preview-card {
    grid-template-rows: auto minmax(300px, auto);
  }

  .preview-stage {
    min-height: 300px;
  }

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

  .code-create-form {
    flex-direction: column;
  }

  .code-create-form .button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 16px, 1180px);
    padding-top: 70px;
    padding-bottom: 30px;
  }

  .app-topbar {
    min-height: auto;
    padding: 12px;
  }

  .topbar-brand {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 19px;
  }

  .topbar-right {
    display: grid;
    gap: 8px;
    width: 100%;
  }

  .topbar-nav,
  .topbar-account {
    width: 100%;
    min-height: 40px;
  }

  .topbar-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .topbar-account {
    display: grid;
    grid-template-columns: minmax(78px, 1fr) auto auto auto;
  }

  .topbar-nav a,
  .topbar-account .balance,
  .topbar-account .nav-redeem,
  .topbar-account .logout-link {
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .card {
    padding: 14px;
  }

  .card-head {
    align-items: center;
    min-height: auto;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: nowrap;
  }

  .card-head h2 {
    font-size: 16px;
    white-space: nowrap;
  }

  .card-head .badge {
    font-size: 11px;
    padding: 3px 8px;
    white-space: nowrap;
  }

  .field-grid,
  .prompt-api-grid,
  .stats-grid,
  .auth-metrics,
  .filter-row {
    grid-template-columns: 1fr !important;
  }

  .code-create-form {
    flex-direction: column;
  }

  .card-head-actions,
  .filter-actions {
    width: 100%;
    align-self: stretch;
    flex-wrap: nowrap;
  }

  .card-head-actions .badge {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .code-export-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .code-export-actions .button {
    width: 100%;
  }

  .card-head-actions .button,
  .filter-actions .button {
    flex: 1;
  }

  .auth-dashboard {
    gap: 12px;
  }

  .auth-info,
  .auth-form-card {
    padding: 16px;
  }

  .auth-info h2 {
    font-size: 28px;
  }

  input,
  select {
    height: 42px;
  }

  textarea {
    min-height: 138px;
  }

  .button {
    min-height: 42px;
  }

  .history-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .history-list .record-card {
    height: 128px;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 10px;
    padding: 8px;
    overflow: visible;
  }

  .history-list .record-image {
    width: 92px;
    height: 92px;
    border-radius: var(--radius);
  }

  .history-list .record-body {
    align-content: center;
    padding: 0;
  }

  .redeem-dialog,
  .record-dialog,
  .legal-dialog,
  .generation-overlay {
    align-items: end;
    padding: 10px;
  }

  .redeem-panel,
  .generation-modal {
    width: 100%;
  }

  .record-dialog-panel {
    max-height: calc(100vh - 20px);
  }

  .legal-dialog-panel {
    max-height: calc(100vh - 20px);
  }

  .redeem-head,
  .record-dialog-head,
  .redeem-form {
    padding: 14px;
  }

  .record-dialog-body {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .record-dialog-image {
    min-height: 280px;
  }

  .pagination {
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .image-viewer {
    padding: 10px;
  }

  .image-viewer-toolbar {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .image-viewer-toolbar button,
  .image-viewer-toolbar>span,
  .image-viewer-download {
    width: 100%;
    padding: 0 8px;
    font-size: 13px;
  }

  .image-viewer-meta {
    grid-column: 1 / -1;
    margin-right: 0;
  }

  .image-viewer-meta strong {
    max-width: 100%;
  }

  .image-viewer-nav {
    width: 42px;
    height: 50px;
    font-size: 30px;
  }

  .image-viewer-nav.prev {
    left: 12px;
  }

  .image-viewer-nav.next {
    right: 12px;
  }

  .record-detail-grid {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .app-shell {
    width: min(100% - 12px, 1180px);
  }

  .topbar-account {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-account .balance {
    grid-column: 1 / -1;
  }
}

/* Enterprise UI refresh */
:root {
  --bg: #f4fcfd;
  --surface: #ffffff;
  --surface-soft: #f9fefd;
  --text: #172033;
  --text-soft: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --primary: #00c5ef;
  --primary-dark: #0098b8;
  --primary-soft: #e6faff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #b7791f;
  --warning-soft: #fff7e6;
  --danger: #e67e00;
  --danger-soft: #fff7e6;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.05);
  --radius: 10px;
}

html {
  background: #f4fcfd;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 20% 5%, rgba(99, 102, 241, 0.15), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 12%, rgba(139, 92, 246, 0.1), transparent 55%),
    linear-gradient(135deg, #f6fafd, #faf7fc, #f7fbf8, #fcfbf8, #f6fafd);
  background-size: 100% 100%, 100% 100%, 100% 200%;
  animation: bgFlow 16s ease-in-out infinite;
  color: var(--text);
  font-size: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(99, 102, 241, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.025) 1px, transparent 1px),
    linear-gradient(135deg, rgba(139, 92, 246, 0.015) 1px, transparent 8px),
    linear-gradient(225deg, rgba(59, 130, 246, 0.015) 1px, transparent 8px);
  background-size: 80px 80px, 80px 80px, 160px 160px, 160px 160px;
  animation: techDrift 30s linear infinite;
}

.app-shell {
  width: calc(100% - 36px);
  max-width: 1440px;
  padding-top: 97px;
}

.app-topbar,
.topbar-brand,
.topbar-right,
.topbar-nav,
.topbar-account,
.grid,
.two-col,
.section-card,
.preview-card {
  min-width: 0;
  max-width: 100%;
}

.app-topbar {
  position: sticky;
  top: 12px;
  z-index: 1000;
  min-height: 62px;
  margin-bottom: 18px;
  border-color: rgba(228, 231, 236, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.07);
}

.brand-mark {
  border-radius: 8px;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  box-shadow: 0 10px 20px rgba(0, 197, 239, 0.22);
}

h1 {
  font-size: 21px;
  font-weight: 850;
}

h2 {
  font-size: 19px;
  font-weight: 800;
}

.eyebrow {
  color: #5a7a82;
  font-size: 11px;
  text-transform: uppercase;
}

.topbar-nav,
.topbar-account {
  border-color: #e7f2f4;
  border-radius: 8px;
  background: #f4fcfd;
}

.topbar-nav a,
.topbar-account .balance,
.topbar-account .nav-redeem,
.topbar-account .logout-link {
  border-radius: 6px;
  color: #475467;
  font-size: 13px;
  font-weight: 750;
}

.topbar-nav a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 197, 239, 0.2);
}

.topbar-nav a:not(.active):hover,
.topbar-account .logout-link:hover {
  background: #ebf6f8;
  color: var(--text);
}

.topbar-account .balance {
  border: 1px solid #a3e8ed;
  background: #e6faff;
  color: var(--primary-dark);
}

.topbar-account .nav-redeem {
  border: 1px solid #00c5ef;
  background: #00c5ef;
  color: #ffffff;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(8, 127, 91, 0.22);
}

.topbar-account .nav-redeem:hover {
  border-color: #00c5ef;
  background: #00c5ef;
  color: #ffffff;
}

.grid {
  gap: 18px;
}

.two-col {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
}

.settings-page {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.settings-tabs-page {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.settings-tab-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #f4fcfd;
  padding: 8px;
  box-shadow: var(--shadow-soft);
}

.settings-tab-nav button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  font-weight: 820;
  cursor: pointer;
  white-space: nowrap;
}

.settings-tab-nav button:hover,
.settings-tab-nav button.active {
  border-color: #00efbf;
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.settings-tab-panel {
  grid-column: 1 / -1;
}

.settings-page>.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.settings-tab-panel:not(.active) {
  display: none;
}

.settings-page>.card>.form {
  flex: 1;
}

.settings-page>.card>.form>.button:last-child {
  margin-top: auto;
}

.cloud-storage-card {
  grid-column: 1 / -1;
}

.cloud-storage-form {
  align-content: start;
}

.cloud-storage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

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

.switch-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f4fcfd;
  padding: 0 12px;
  color: #475467;
  font-size: 13px;
  font-weight: 760;
}

.switch-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.settings-page textarea {
  min-height: 104px;
}

.card,
.stat-card {
  min-width: 0;
  border-color: #e4e7ec;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.card {
  padding: 18px;
}

.section-card {
  margin-top: 18px;
}

.card-head {
  min-height: 46px;
  margin-bottom: 16px;
}

.card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form {
  gap: 13px;
}

.field span {
  color: #475467;
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea {
  border-color: #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
}

input,
select {
  height: 42px;
}

textarea {
  min-height: 144px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.13);
}

.button {
  min-height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 780;
  box-shadow: none;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  box-shadow: none;
}

.button.primary:hover {
  background: linear-gradient(135deg, #00efbf 0%, #00c5ef 100%);
}

.button.secondary {
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
}

.button.secondary:hover,
.button.secondary.active {
  border-color: #98a2b3;
  background: #f2f4f7;
  color: #101828;
}

.button.online-action {
  border-color: #00efbf;
  background: #e6faff;
  color: var(--primary-dark);
}

.button.online-action:hover,
.button.online-action:focus-visible {
  border-color: var(--primary);
  background: #cdf2f5;
  color: #00c5ef;
}

.button.danger {
}

.badge,
.status {
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  border-color: #d0d5dd;
  background: #fff;
}

.alert,
.inline-message {
  border-radius: 8px;
  box-shadow: none;
}

.mode-toggle {
  gap: 10px;
}

.mode-toggle label {
  min-height: 40px;
  border-radius: 8px;
  background: #f4fcfd;
}

.mode-toggle label:has(input:checked) {
  border-color: #00efbf;
  background: #e6faff;
  color: var(--primary-dark);
}

.preview-card {
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr);
}

.preview-stage {
  min-height: 520px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f4fcfd 25%, transparent 25%),
    linear-gradient(-45deg, #f4fcfd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f4fcfd 75%),
    linear-gradient(-45deg, transparent 75%, #f4fcfd 75%),
    #fff;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.preview-stage img {
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.14);
}

.history-list {
  gap: 14px;
  padding-bottom: 4px;
}

.history-list .record-card {
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.6);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.history-list .record-card:hover {
  border-color: #acd2da;
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.08);
}

.history-list .record-image {
  border-radius: 0;
  border: none;
  background: #f2f4f7;
}

.record-meta span:first-child {
  font-weight: 850;
}

.record-body p,
.admin-prompt-cell {
  color: #475467;
}

.admin-nav {
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.admin-nav .button {
  min-height: 36px;
  border: 0;
}

.admin-nav .button.secondary.active {
  background: var(--primary);
  color: #fff;
}

.admin-version-footer {
  margin-top: 22px;
  padding: 14px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

/* ---- 通栏 banner（版权所有上方） ---- */

.site-banner-bar {
  position: relative;
  z-index: 1;
  padding: 24px 20px;
  background-image: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
}

.site-banner-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-banner-bar-left h3 {
  font-size: 22px;
  font-weight: 750;
  margin: 0 0 6px;
  color: #fff;
}

.site-banner-bar-left p {
  font-size: 14px;
  margin: 0;
  opacity: 0.9;
}

.site-banner-bar-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-banner-bar-right .button.primary {
  background: rgba(255, 255, 255, 0.95);
  color: #00c5ef;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

.site-banner-bar-right .button.primary:hover {
  background: #fff;
  color: #00a8d8;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.site-banner-bar-right .button.secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.site-banner-bar-right .button.secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #fff;
}

@media (max-width: 640px) {
  .site-banner-bar-inner {
    flex-direction: column;
    text-align: center;
  }

  .site-banner-bar-left h3 {
    font-size: 18px;
  }

  .site-banner-bar-right {
    justify-content: center;
  }
}

.site-footer {
  margin-top: 0;
  padding: 16px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--primary-dark);
  font-weight: 750;
}

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

.stat-card {
  min-height: 96px;
  padding: 16px;
  background: linear-gradient(180deg, #fff 0%, #f5fcfd 100%);
}

.stat-card span {
  color: #667085;
  font-size: 12px;
  font-weight: 760;
}

.stat-card strong {
  margin-top: 8px;
  color: #101828;
  font-size: 26px;
  font-weight: 880;
}

.table-wrap {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid #e7f2f4;
  padding: 12px 14px;
}

th {
  background: #f4fcfd;
  color: #667085;
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover td {
  background: #f5fcfd;
}

tr:last-child td {
  border-bottom: 0;
}

.table-thumb {
  width: 150px;
  height: auto;
  border-radius: 8px;
}

.inline-admin-form,
.table-action-group {
  gap: 7px;
}

.compact-input {
  height: 34px;
  border-radius: 7px;
}

.filter-bar {
  padding: 14px;
  gap: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #f4fcfd;
}

.filter-bar.admin-record-filter .field-inline {
  flex: 0 0 auto;
}

.code-create-card {
  background: linear-gradient(180deg, #fff 0%, #f5fcfd 100%);
}

.code-create-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.auth-dashboard {
  min-height: calc(100vh - 140px);
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
}

.auth-info,
.auth-form-card {
  min-height: 540px;
  border-radius: 10px;
}

.auth-info {
  background:
    linear-gradient(135deg, rgba(0, 197, 239, 0.12), transparent 42%),
    linear-gradient(180deg, #fff 0%, #f5fbfc 100%);
}

.auth-info h2 {
  max-width: 620px;
  color: #101828;
}

.auth-info p {
  max-width: 560px;
  color: #475467;
}

.auth-tag {
  border-color: #00efbf;
  background: #e6faff;
  color: var(--primary-dark);
}

.auth-metrics div {
  border-color: #e4e7ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.record-dialog-panel,
.redeem-panel {
  border-radius: 10px;
}

.record-dialog-head,
.redeem-head {
  border-bottom: 1px solid #e7f2f4;
  background: #f4fcfd;
}

.record-dialog-image {
  border-radius: 10px;
  background: #f4fcfd;
}

.record-detail-grid,
.record-full-prompt,
.record-input-images {
  border-color: #e4e7ec;
  border-radius: 8px;
}

.image-viewer-toolbar button,
.image-viewer-toolbar>span,
.image-viewer-download {
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .app-shell {
    width: calc(100% - 24px);
    max-width: 1180px;
  }

  .site-header {
    padding: 14px max(12px, calc((100vw - 1180px) / 2));
  }



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

  .code-create-form {
    flex-direction: column;
  }
}

@media (max-width: 980px) {
  .app-topbar {
    position: static;
  }

  .two-col,
  .settings-page,
  .auth-dashboard {
    grid-template-columns: 1fr;
  }

  .cloud-storage-card {
    grid-column: auto;
  }

  .cloud-storage-grid,
  .storage-options-grid {
    grid-template-columns: 1fr;
  }

  .settings-tab-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .settings-tab-nav button {
    min-height: 38px;
    padding: 0 6px;
    font-size: 13px;
  }

  .preview-card {
    grid-template-rows: auto minmax(340px, auto);
  }

  .preview-stage {
    min-height: 340px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: calc(100% - 16px);
    max-width: 720px;
    padding-top: 70px;
    padding-bottom: 30px;
  }

  .app-topbar,
  .card,
  .stat-card,
  .admin-nav,
  .table-wrap {
    border-radius: 8px;
  }

  .topbar-account {
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  }

  .stats-grid,
  .filter-bar,
  .code-create-form,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .auth-info,
  .auth-form-card {
    min-height: auto;
  }

  .auth-info h2 {
    font-size: 26px;
  }

  .history-list .record-card {
    min-height: 112px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

/* ====== 在线生成工作台新布局 ====== */
.create-workspace {
  display: grid;
  grid-template-columns: minmax(380px, 440px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

/* 生成多张图片时，右侧撑高，左侧保持自然高度 */
.create-workspace:has(.has-multi) {
  align-items: start;
}

/* 左侧控制面板 */
.workspace-panel {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.8);
  color: #334155;
  padding: 0 24px 24px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.workspace-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -24px 0;
  padding: 14px 24px 12px;
  background: transparent;
  border-bottom: 1px solid #e8eaed;
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, #0090b0, #00c5a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0;
}
.workspace-panel-head-right {
  -webkit-text-fill-color: initial;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}
.workspace-head-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.workspace-head-links .workspace-cost-rules-link {
  font-size: 12px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 500;
}
.workspace-head-links .workspace-cost-rules-link:hover {
  background: linear-gradient(135deg, #6d28d9, #0891b2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.workspace-panel-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.balance-num {
  color: #ef4444;
  font-weight: 750;
  padding: 0 3px;
}

.workspace-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #e8eaed;
  background: #fafbfc;
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}

.workspace-badge.is-secondary {
  border-color: #e8eaed;
  background: #f8fafb;
  color: #94a3b8;
  font-weight: 750;
}
.workspace-badge-login-hint {
  border-color: #e8eaed;
  background: #f8fafb;
  color: #64748b;
}
.workspace-badge-login-hint a {
  color: #0e7490;
  text-decoration: none;
  font-weight: 600;
  margin: 0 2px;
}
.workspace-badge-login-hint a:hover {
  color: #0891b2;
  text-decoration: underline;
}

.workspace-prompt-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.workspace-cost-rule {
  font-size: 11px;
  color: #94a3b8;
}

.workspace-cost-hint {
  padding: 4px 0 0 0;
  text-align: left;
  color: #94a3b8;
}
.workspace-cost-hint .cost-num {
  color: #0e7490;
  font-weight: 700;
}
.workspace-cost-rules-link {
  color: #0e7490;
  cursor: pointer;
}
.workspace-cost-rules-link:hover {
  color: #0891b2;
}

.cost-num {
  color: #f97316;
  padding: 0 2px;
}

.workspace-form {
  display: grid;
  gap: 10px;
}

/* 生成模式选择 */
.workspace-mode {
  display: flex;
  gap: 0;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  overflow: hidden;
  background: #fafbfc;
}

.workspace-mode-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 9px 0;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.workspace-mode-item + .workspace-mode-item {
  border-left: 1px solid #e8eaed;
}

.workspace-mode-item:hover {
  background: #f1f5f9;
  color: #64748b;
}

.workspace-mode-item:has(input:checked) {
  background: linear-gradient(135deg, #00c5ef, #00d9c4);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}

.workspace-mode-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* 上传区 */
.workspace-upload {
  display: grid;
  gap: 8px;
}

.workspace-upload-label {
  font-size: 13px;
  font-weight: 650;
  color: #475569;
}

.workspace-upload-label-hint {
  font-weight: 400;
  color: #94a3b8;
}

.upload-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 2px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
  position: relative;
  user-select: none;
  vertical-align: middle;
}

.upload-hint-icon::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}

.upload-hint-icon::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(30, 41, 59, 0.88);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.upload-hint-icon:hover::before,
.upload-hint-icon:hover::after,
.upload-hint-icon.show::before,
.upload-hint-icon.show::after {
  opacity: 1;
}

/* 提示词模板按钮（textarea 内） */
.workspace-tpl-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 7px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(135deg, #9d72f8, #7278f4);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.workspace-tpl-btn svg { width: 11px; height: 11px; opacity: 0.85; }
.workspace-tpl-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

/* 温馨提示公告栏 */
.workspace-tips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  margin: 0 0 6px;
  padding: 5px 0;
  background: transparent;
  border-radius: 0;
  border: none;
  font-size: 12px;
  color: #0e7490;
}
.workspace-tips-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.workspace-tips-scroll {
  overflow: hidden;
  flex: 1;
}
.workspace-tips-scroll span {
  display: inline-block;
  animation: tipsMarquee 22s linear infinite;
}
@keyframes tipsMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.workspace-upload-ref-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 提示词 */
.workspace-prompt {
  display: grid;
  gap: 8px;
  padding: 0;
  border-radius: 12px;
}

.workspace-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-prompt-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-prompt-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.workspace-prompt-title {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #00c5ef, #00efbf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.workspace-optimize-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #cdf2f5;
  border-radius: 8px;
  background: linear-gradient(135deg, #e6faff, #f4fcfd);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}

.workspace-optimize-btn:hover {
  border-color: #00efbf;
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.1);
}

.workspace-optimize-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.workspace-prompt-textarea-wrap {
  position: relative;
}

.workspace-prompt-textarea-wrap textarea {
  min-height: 170px;
  padding-right: 70px;
  padding-bottom: 56px;
}

/* textarea 底部工具栏 */
.workspace-textarea-toolbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
  padding: 6px 0 6px;
  background: linear-gradient(to top, #fff 60%, transparent 100%);
}
.workspace-textarea-toolbar > * {
  pointer-events: auto;
}
.workspace-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.workspace-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.workspace-prompt-textarea-wrap .workspace-optimize-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 7px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(135deg, #00b8e0, #00e0b4);
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.workspace-prompt-textarea-wrap .workspace-optimize-btn svg { width: 11px; height: 11px; opacity: 0.85; }
.workspace-prompt-textarea-wrap .workspace-optimize-btn:hover {
  background: linear-gradient(135deg, #00a8d0, #00d0a4);
}

.workspace-upload-ref-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1.5px dashed #00c5ef;
  border-radius: 8px;
  background: linear-gradient(135deg, #e6faff, #f0fdfb);
  color: #0e7490;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.workspace-upload-ref-btn:hover {
  background: linear-gradient(135deg, #cdf2f5, #e0f7fa);
  border-color: #00b8e0;
  color: #0891b2;
  box-shadow: 0 2px 8px rgba(0,197,239,0.15);
}

.workspace-upload-ref-btn.has-images {
  opacity: 0.85;
  box-shadow: 0 2px 8px rgba(0,197,239,.35);
}

.workspace-prompt textarea {
  min-height: 72px;
  resize: vertical;
  border: 2px solid #00c5ef;
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(to bottom, #e6faf7, #ffffff);
  font-size: 14px;
  line-height: 1.6;
  color: #1e293b;
  box-shadow: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.workspace-prompt textarea:focus {
  border-color: #00b8e0;
  background: linear-gradient(to bottom, #fffbeb, #fffef5);
  box-shadow: 0 0 0 6px rgba(0,197,239,0.08);
  outline: none;
}

.workspace-prompt textarea::placeholder {
  color: #94a3b8;
}

/* 分区 */
.workspace-section {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.workspace-section-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.workspace-section-label {
  font-size: 12px;
  font-weight: 650;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}

.workspace-select-sm {
  height: 30px;
  padding: 0 28px 0 10px;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  background: #fafbfc;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.18s;
}

.workspace-select-sm:hover {
  border-color: #cbd5e1;
  color: #64748b;
}

.workspace-select-sm:focus {
  border-color: #00c5ef;
  box-shadow: 0 0 0 3px rgba(0,197,239,0.08);
  outline: none;
  color: #334155;
}

/* 比例快捷芯片 */
.workspace-ratio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ratio-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  background: #fafbfc;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s, box-shadow 0.16s;
}

.ratio-chip:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.ratio-chip.is-active {
  border-color: #00c5ef;
  background: #e6faff;
  color: #0e7490;
  box-shadow: 0 0 0 2px rgba(0,197,239,0.1);
}

.ratio-chip-icon {
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  opacity: 0.7;
}

.ratio-chip.is-active .ratio-chip-icon {
  opacity: 1;
}

/* 比例弹窗 */
.workspace-ratio-chips {
  position: relative;
}

.ratio-popover {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin-top: 6px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.14), 0 2px 8px rgba(16, 24, 40, 0.06);
  overflow: hidden;
  animation: ratioPopoverIn 0.16s ease;
}

@keyframes ratioPopoverIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ratio-popover.is-open {
  display: block;
}

.ratio-popover-inner {
  display: grid;
  gap: 2px;
  padding: 6px;
}

.ratio-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.ratio-popover-item:hover {
  background: #f4fcfd;
  color: var(--primary-dark);
}

.ratio-popover-item.is-selected {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
}

.ratio-popover-item.is-selected::after {
  content: "";
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300c5ef' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

.ratio-popover-dims {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.ratio-popover-item:hover .ratio-popover-dims,
.ratio-popover-item.is-selected .ratio-popover-dims {
  color: #68868e;
}

/* 当前比例显示 */
.workspace-current-ratio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 2px;
  border-radius: 10px;
  background: var(--primary-soft, #f4fcfd);
  border: 1px solid #d6f3f7;
  flex-wrap: wrap;
}

/* 自定义尺寸输入（选中自动时显示） */
.workspace-custom-size {
  margin-top: 8px;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 8px;
  padding-left: 34px;
  flex-wrap: nowrap;
  align-items: center;
}

.workspace-custom-size input {
  flex: 0 0 240px;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  background: linear-gradient(135deg, #fffdf5 0%, #fffef0 100%);
  font-size: 13px;
  line-height: 1;
  color: #1e293b;
  outline: none;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.12);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.workspace-custom-size input::placeholder {
  color: #f59e0b;
  font-weight: 400;
  font-style: normal;
}

.workspace-custom-size input:focus {
  border-color: #d97706;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.custom-size-clear {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  background: #fff5f5;
  font-size: 12px;
  font-weight: 500;
  color: #ef4444;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s;
}

.custom-size-clear:hover {
  border-color: #ef4444;
  color: #fff;
  background: #ef4444;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

/* 尺寸试算弹窗 */
.size-calc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-calc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.size-calc-dialog {
  position: relative;
  width: 420px;
  max-width: 92vw;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.size-calc-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}

.size-calc-dialog-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.size-calc-dialog-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.size-calc-dialog-close:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.size-calc-dialog-body {
  padding: 16px 22px 22px;
}

.size-calc-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.size-calc-input-row + .size-calc-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #ef4444;
  line-height: 1.4;
}

.size-calc-guide {
  margin: 12px 0 0;
  padding: 8px 12px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.7;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.size-calc-guide code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #334155;
}

.size-calc-input-row {
  display: flex;
  gap: 8px;
}

.size-calc-input-row input {
  flex: 1;
  padding: 6px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.size-calc-input-row input:focus {
  border-color: var(--primary, #00c5ef);
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.1);
}

.size-calc-submit {
  flex-shrink: 0;
  padding: 9px 18px;
  border: none;
  border-radius: 10px;
  background: var(--primary, #00c5ef);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}

.size-calc-submit:hover {
  background: #00b0d6;
}

/* 试算结果 */
.size-calc-result {
  margin-top: 16px;
}

.size-calc-origin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 2px;
}

.size-calc-origin-row strong {
  font-size: 15px;
  color: #1e293b;
  font-family: monospace;
}

.size-calc-origin-ratio {
  font-size: 12px;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 1px 8px;
  border-radius: 10px;
}

/* 对比卡片 */
.size-calc-compare {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.size-calc-compare-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
}

.size-calc-compare-card.is-user {
  border-color: #cbd5e1;
  background: #fff;
}

.size-calc-compare-card.is-matched {
  border-color: #00c5ef;
  background: #f4fcfd;
}

.size-calc-compare-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.size-calc-compare-card.is-matched .size-calc-compare-label {
  color: #00b0d6;
}

.size-calc-compare-value {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  font-family: monospace;
}

.size-calc-compare-tag {
  font-size: 11px;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
}

.size-calc-compare-card.is-matched .size-calc-compare-tag {
  background: #dcf7fb;
  color: #00a0c7;
}

.size-calc-compare-arrow {
  flex-shrink: 0;
  font-size: 20px;
  color: #94a3b8;
  line-height: 1;
}

/* 矩形比例可视化（内嵌于卡片） */
.size-calc-compare-viz-wrap {
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0;
}

.size-calc-viz-rect {
  max-width: 100%;
  transition: width 0.3s, height 0.3s;
}

.size-calc-compare-card.is-user .size-calc-viz-rect {
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
}

.size-calc-compare-card.is-matched .size-calc-viz-rect {
  background: #d2f2f9;
  border: 1.5px solid #00c5ef;
}

.size-calc-tier-hint {
  margin: 8px 0 10px;
  font-size: 12px;
  color: #94a3b8;
}

.size-calc-tier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.size-calc-tier-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.size-calc-tier-card:hover {
  border-color: #00c5ef;
  background: #f4fcfd;
  box-shadow: 0 2px 8px rgba(0, 197, 239, 0.08);
}

.size-calc-tier-card.is-selected {
  border-color: #00c5ef;
  background: #e0f7fa;
  box-shadow: 0 0 0 2px rgba(0, 197, 239, 0.15);
}

.size-calc-tier-badge {
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #e0f2fe;
  color: #0284c7;
}

.size-calc-tier-size {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  font-family: monospace;
}

.size-calc-tier-meta {
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
  line-height: 1.5;
}

.size-calc-tier-changed {
  font-size: 11px;
  color: #f59e0b;
}
.current-ratio-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.current-ratio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.current-ratio-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fafbfc;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s, box-shadow 0.16s;
  line-height: 1;
  white-space: nowrap;
}

.current-ratio-chip:hover {
  border-color: #cdf2f5;
  background: #f4fcfd;
  color: var(--primary-dark);
}

.current-ratio-chip.is-selected {
  border-color: #00efbf;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(0, 197, 239, 0.12);
}

.current-ratio-chip .ratio-popover-dims {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.current-ratio-chip:hover .ratio-popover-dims,
.current-ratio-chip.is-selected .ratio-popover-dims {
  color: var(--primary-dark);
}

/* ===== 通用确认弹窗 ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  padding: 16px;
  animation: confirmFadeIn 0.15s ease;
}
@keyframes confirmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-dialog {
  width: 400px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.28);
  padding: 32px 28px 24px;
  text-align: center;
  animation: confirmSlideIn 0.2s ease;
}
@keyframes confirmSlideIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.confirm-dialog h3 {
  font-size: 17px;
  font-weight: 700;
  color: #101828;
  margin: 0 0 6px;
}
.confirm-message {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 20px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-cancel-btn,
.confirm-ok-btn {
  height: 38px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.confirm-cancel-btn {
  background: #f1f5f9;
  color: #475569;
}
.confirm-cancel-btn:hover {
  background: #e2e8f0;
}
.confirm-ok-btn {
  color: #fff;
}
.confirm-ok-btn:hover {
  transform: translateY(-1px);
}

/* ===== 生成确认弹窗 ===== */
.gen-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s ease;
  padding: 16px;
}
.gen-confirm-overlay.gen-confirm-in {
  opacity: 1;
}

.gen-confirm-dialog {
  width: 420px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.28);
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 0.22s ease;
}
.gen-confirm-in .gen-confirm-dialog {
  transform: translateY(0);
}

.gen-confirm-head {
  padding: 24px 24px 0;
  text-align: center;
}
.gen-confirm-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #ecfeff, #f0f9ff);
  color: #0098b8;
  border: 1px solid #bae6fd;
}
.gen-confirm-mode-edit {
  background: linear-gradient(135deg, #faf5ff, #fdf2f8);
  color: #a21caf;
  border-color: #f0abfc;
}
.gen-confirm-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}
.gen-confirm-head p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.gen-confirm-params {
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gen-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}
.gen-confirm-key {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}
.gen-confirm-val {
  font-size: 14px;
  color: #1e293b;
  font-weight: 600;
}

.gen-confirm-cost {
  margin: 18px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff7ed, #fff1f2);
  border: 1px solid #fbd38d;
  border-radius: 10px;
}
.gen-confirm-cost-label {
  font-size: 13px;
  color: #92400e;
  font-weight: 500;
}
.gen-confirm-cost-value {
  font-size: 14px;
  color: #dc2626;
  font-weight: 600;
}
.gen-confirm-cost-value strong {
  color: #dc2626;
  font-size: 16px;
}

.gen-confirm-actions {
  display: flex;
  gap: 12px;
  padding: 20px 24px 24px;
}
.gen-confirm-cancel,
.gen-confirm-submit {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.gen-confirm-cancel {
  background: #f1f5f9;
  color: #475569;
}
.gen-confirm-cancel:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.gen-confirm-submit {
  background: linear-gradient(135deg, var(--primary), #00dfc7, #00efbf);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 197, 239, 0.25);
}
.gen-confirm-submit:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 4px 14px rgba(0, 197, 239, 0.4);
}

/* 多图生成警告 */
.gen-confirm-bulk-warn {
  margin: 16px 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fef2f2, #fff7ed, #fef3c7);
  border: 1px solid #fca5a5;
  border-radius: 10px;
  font-size: 16px;
  color: #dc2626;
  font-weight: 700;
  line-height: 1.5;
}
.gen-confirm-bulk-warn svg {
  flex-shrink: 0;
  margin-top: 1px;
}
.gen-confirm-bulk-warn strong {
  color: #dc2626;
}

/* 积分不足弹窗 */
.gen-confirm-balance-warn-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  color: #e53e3e;
}
.gen-confirm-val-need {
  color: #dc2626;
  font-weight: 700;
}
.gen-confirm-val-count {
  color: #dc2626;
  font-weight: 700;
}
.gen-confirm-row-short {
  border-top: 1px dashed #fecaca;
  padding-top: 10px;
  margin-top: 2px;
}
.gen-confirm-val-short {
  color: #e53e3e;
  font-weight: 700;
}

/* 多图——消耗区加强 */
.gen-confirm-cost-bulk {
  background: linear-gradient(135deg, #fef2f2, #fff7ed) !important;
  border-color: #fecaca !important;
}
.gen-confirm-cost-bulk .gen-confirm-cost-label {
  color: #991b1b !important;
}
.gen-confirm-cost-bulk .gen-confirm-cost-value {
  color: #dc2626 !important;
}
.gen-confirm-cost-bulk .gen-confirm-cost-value strong {
  color: #ef4444 !important;
}

/* 编辑模式——无参考图提示 */
.edit-no-image-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
}
.edit-no-image-hint svg {
  flex-shrink: 0;
  color: #f59e0b;
}

/* 设置行 */
.workspace-settings-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.workspace-setting-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.workspace-setting-item .setting-chip-list {
  flex: 1 1 auto;
  min-width: 0;
}

.workspace-setting-label {
  font-size: 12px;
  font-weight: 650;
  color: #333;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 设置芯片 */
.setting-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.setting-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 9px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fafbfc;
  color: #333;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s, box-shadow 0.16s;
  line-height: 1;
  white-space: nowrap;
}

.setting-chip:hover {
  border-color: #cdf2f5;
  background: #f4fcfd;
  color: var(--primary-dark);
}

.setting-chip.is-selected {
  border-color: #00efbf;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(0, 197, 239, 0.12);
}

/* 生成按钮 */
.workspace-generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  padding: 0 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #00c5ef, #00efbf);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,197,239,0.2);
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}

.workspace-generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0,197,239,0.35);
}

.workspace-generate-btn:active {
  transform: translateY(0) scale(0.985);
}

.workspace-generate-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* 右侧预览 */
.workspace-preview {
  position: sticky;
  top: 20px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  min-height: max(520px, calc(100vh - 220px));
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  background: rgba(255,255,255,0.8);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.workspace-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.workspace-preview-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #334155;
}

.workspace-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.workspace-download-btn:hover {
  border-color: #00efbf;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.workspace-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.workspace-edit-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* 预览舞台 */
.workspace-preview-stage {
  flex: 1;
  min-height: 400px;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%),
    #fff;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.workspace-preview-stage.has-multi {
  place-items: unset;
  overflow: auto;
}

.workspace-preview-stage img {
  max-width: 100%;
  max-height: calc(70vh - 80px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.12);
}

.workspace-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
}

.workspace-preview-empty p {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: #94a3b8;
}

.workspace-preview-empty span {
  font-size: 13px;
  color: #c0c8d4;
}

/* 生成记录区 */
.create-history {
  margin-top: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.4);
  padding: 20px 24px 8px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

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

.create-history-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 750;
  color: #0f172a;
}

.create-history-head p {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

/* ====== 响应式 ====== */
@media (max-width: 960px) {
  .create-workspace {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .workspace-preview {
    position: static;
    min-height: 380px;
  }

  .workspace-preview-stage {
    min-height: 300px;
  }
}

@media (max-width: 600px) {
  .workspace-panel {
    padding: 0 16px 16px;
    border-radius: 12px;
    gap: 12px;
  }

  .workspace-panel-head {
    margin: 0 -16px 0;
    padding: 14px 16px 10px;
    font-size: 15px;
  }

  .workspace-panel-head h2 {
    font-size: 17px;
  }

  .workspace-prompt textarea {
    min-height: 80px;
  }

  .workspace-preview {
    min-height: 320px;
  }

  .workspace-preview-stage {
    min-height: 250px;
  }

  .create-history {
    padding: 14px 16px 6px;
  }
}

/* ====== 旧版兼容：保留 .two-col 和 .preview-card 但对新工作台不生效 ====== */

@media (max-width: 720px) {

  html,
  body.page-app,
  body.page-records,
  body.page-admin {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  body.page-app,
  body.page-records,
  body.page-admin {
    position: relative;
    touch-action: pan-y;
  }

  body.page-app .app-shell,
  body.page-records .app-shell,
  body.page-admin .app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-right: 8px;
    padding-left: 8px;
  }

  body.page-app main,
  body.page-app section,
  body.page-app form,
  body.page-app label,
  body.page-app input,
  body.page-app select,
  body.page-app textarea,
  body.page-app button,
  body.page-records main,
  body.page-records section,
  body.page-records form,
  body.page-records label,
  body.page-records input,
  body.page-records select,
  body.page-records textarea,
  body.page-records button,
  body.page-admin main,
  body.page-admin section,
  body.page-admin form,
  body.page-admin label,
  body.page-admin input,
  body.page-admin select,
  body.page-admin textarea,
  body.page-admin button {
    max-width: 100%;
    min-width: 0;
  }

  body.page-app .app-topbar,
  body.page-app .card,
  body.page-app .preview-stage,
  body.page-app .history-list,
  body.page-app .history-list .record-card,
  body.page-records .card,
  body.page-records .history-list,
  body.page-records .history-list .record-card,
  body.page-admin .card,
  body.page-admin .stat-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.page-admin .admin-nav,
  body.page-admin .table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.page-app .topbar-right,
  body.page-app .topbar-nav,
  body.page-app .topbar-account {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.page-app .topbar-account {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.page-app .topbar-nav a,
  body.page-app .topbar-account .balance,
  body.page-app .topbar-account .nav-redeem,
  body.page-app .topbar-account .logout-link {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.page-app .card-head,
  body.page-records .card-head,
  body.page-admin .card-head {
    min-width: 0;
    max-width: 100%;
  }

  body.page-app .generation-notice,
  body.page-app textarea {
    overflow-wrap: anywhere;
  }
}

/* Polished motion and depth layer */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ring: 0 0 0 3px rgba(0, 197, 239, 0.2);
  --shadow-lift: 0 18px 44px rgba(16, 24, 40, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a,
button,
.button,
.topbar-nav a,
.topbar-account .balance,
.topbar-account .nav-redeem,
.topbar-account .logout-link,
.mode-toggle label,
.record-card,
.stat-card,
.table-thumb,
.record-input-image-button,
.record-dialog-image-button,
.dialog-close {
  transition:
    transform 0.22s var(--ease-out),
    border-color 0.22s var(--ease-out),
    background-color 0.22s var(--ease-out),
    color 0.22s var(--ease-out),
    box-shadow 0.22s var(--ease-out),
    opacity 0.22s var(--ease-out);
}

input,
select,
textarea {
  transition:
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.record-card:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.app-topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(18px) saturate(1.18);
}

.topbar-brand:hover .brand-mark {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 14px 26px rgba(0, 197, 239, 0.26);
}

.topbar-nav a.active,
.topbar-account .nav-redeem,
.button.primary {
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
}

.topbar-nav a:not(.active):hover,
.topbar-account .logout-link:hover,
.button.secondary:hover,
.dialog-close:hover {
  transform: translateY(-1px);
}

.button:not(:disabled):active,
.topbar-nav a:active,
.topbar-account .nav-redeem:active,
.dialog-close:active,
.mode-toggle label:active {
  transform: translateY(0) scale(0.985);
}

.button.primary:hover,
.topbar-account .nav-redeem:hover {
  box-shadow: 0 12px 24px rgba(8, 127, 91, 0.22);
}

.card,
.stat-card,
.auth-info,
.auth-form-card,
.history-list .record-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(228, 231, 236, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  backdrop-filter: blur(12px) saturate(1.08);
  box-shadow: none;
}

.card,
.stat-card {
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.03), var(--shadow-soft);
}

.history-list .record-card:hover {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: none;
}

.record-meta .status {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
}

.record-meta .status.succeeded {
  border-color: #00efbf;
  background: var(--success-soft);
  color: #0098b8;
}

.record-meta .status.failed {
  border-color: #fbd38d;
  background: var(--danger-soft);
  color: var(--danger);
}

.record-meta .status.running,
.record-meta .status.queued {
  border-color: #fed7aa;
  background: var(--warning-soft);
  color: var(--warning);
}

.record-meta .status.deleted {
  border-color: var(--line-strong);
  background: #f2f4f7;
  color: var(--muted);
}

.card-head {
  position: relative;
}

.card-head::after {
  content: none;
}

.badge {
  background: linear-gradient(180deg, #fff, #f4fcfd);
}

.mode-toggle label {
  position: relative;
  overflow: hidden;
}

.mode-toggle label:has(input:checked) {
  box-shadow: inset 0 0 0 1px rgba(0, 197, 239, 0.12), 0 8px 20px rgba(0, 197, 239, 0.1);
}

.mode-toggle label:has(input:checked)::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 197, 239, 0.12);
}

select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

textarea::placeholder,
input::placeholder {
  color: #98a2b3;
}

.edit-upload-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.92)),
    #f4fcfd;
}

.edit-upload-box:hover {
  transform: translateY(-1px);
}

.edit-preview-item,
.table-thumb,
.record-input-image-button {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.preview-stage {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.preview-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 34%),
    radial-gradient(circle at 50% 0%, rgba(0, 197, 239, 0.08), transparent 46%);
}

.preview-stage>* {
  position: relative;
  z-index: 1;
}

.preview-stage img {
  animation: fadeLift 0.42s var(--ease-soft);
}

.empty-state,
.preview-loading,
.preview-error,
.history-empty-inline {
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.preview-spinner {
  border-color: rgba(0, 197, 239, 0.14);
  border-top-color: var(--primary);
}

.history-list .record-card {
  transform: translateZ(0);
}

.history-list .record-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.history-list .record-card:hover .record-image img,
.table-thumb:hover img,
.record-input-image-button:hover img {
  transform: scale(1.035);
}

.record-image img,
.table-thumb img,
.record-input-image-button img,
.record-dialog-image img {
  transition: transform 0.42s var(--ease-soft);
}

.record-delete:hover,
.button.danger:hover {
  transform: translateY(-1px);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #d0d5dd;
  box-shadow: var(--shadow-lift);
}

tbody tr td {
  transition: background-color 0.18s var(--ease-out);
}

.redeem-dialog,
.record-dialog,
.generation-overlay,
.legal-dialog,
.image-viewer {
  animation: overlayIn 0.22s var(--ease-out);
}

.redeem-panel,
.record-dialog-panel,
.legal-dialog-panel,
.generation-modal {
  animation: panelIn 0.28s var(--ease-soft);
}

.image-viewer-stage img {
  animation: viewerIn 0.28s var(--ease-soft);
}

.jpt-layer-root {
  position: relative;
  z-index: 100001;
}

.jpt-toast-stack {
  position: fixed;
  top: 33.333vh;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10060;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
  justify-items: center;
}

.jpt-toast {
  min-height: 46px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(228, 231, 236, 0.94);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-soft);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.14);
  backdrop-filter: blur(18px) saturate(1.12);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
  overflow-wrap: anywhere;
  pointer-events: auto;
  animation: toastIn 0.28s var(--ease-soft);
}

.jpt-toast.is-leaving {
  animation: toastOut 0.18s var(--ease-out) forwards;
}

.jpt-toast-icon,
.jpt-layer-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
}

.jpt-toast-icon {
  width: 18px;
  height: 18px;
  box-shadow: 0 0 0 4px rgba(0, 197, 239, 0.11);
}

.jpt-toast-icon::after,
.jpt-layer-icon::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: inherit;
  background: #fff;
}

.jpt-toast.success {
  border-color: #00efbf;
  color: #0098b8;
}

.jpt-toast.error {
  border-color: #fecdca;
  color: var(--danger);
}

.jpt-toast.warning {
  border-color: #fed7aa;
  color: var(--warning);
}

.jpt-toast.info {
  border-color: #d0d5dd;
}

.jpt-toast.success .jpt-toast-icon {
  background: var(--success);
}

.jpt-toast.error .jpt-toast-icon {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.1);
}

.jpt-toast.warning .jpt-toast-icon {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(183, 121, 31, 0.12);
}

.jpt-toast.info .jpt-toast-icon {
  background: #475467;
  box-shadow: 0 0 0 4px rgba(71, 84, 103, 0.1);
}

.jpt-layer-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
  animation: overlayIn 0.22s var(--ease-out);
}

.jpt-layer-overlay.is-leaving {
  animation: overlayOut 0.18s var(--ease-out) forwards;
}

.jpt-layer-panel {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.3);
  animation: panelIn 0.28s var(--ease-soft);
}

.jpt-layer-overlay.is-leaving .jpt-layer-panel {
  animation: panelOut 0.18s var(--ease-out) forwards;
}

.jpt-layer-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 22px 22px 18px;
}

.jpt-layer-icon {
  width: 40px;
  height: 40px;
  margin-top: 2px;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(0, 197, 239, 0.1);
}

.jpt-layer-panel.warning .jpt-layer-icon {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(183, 121, 31, 0.12);
}

.jpt-layer-panel.error .jpt-layer-icon {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(217, 45, 32, 0.1);
}

.jpt-layer-panel.info .jpt-layer-icon {
  background: #475467;
  box-shadow: 0 0 0 6px rgba(71, 84, 103, 0.1);
}

.jpt-layer-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 850;
}

.jpt-layer-head p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.jpt-layer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e7f2f4;
  padding: 14px 18px;
  background: #f4fcfd;
}

.jpt-layer-actions .button {
  min-width: 88px;
}

@keyframes fadeLift {
  from {
    transform: translateY(8px) scale(0.985);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes panelIn {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes viewerIn {
  from {
    transform: scale(0.985);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes overlayOut {
  to {
    opacity: 0;
  }
}

@keyframes panelOut {
  to {
    transform: translateY(10px) scale(0.985);
    opacity: 0;
  }
}

@keyframes toastIn {
  from {
    transform: translateX(18px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateX(18px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 720px) {
  .card-head::after {
    content: none;
  }

  .jpt-toast-stack {
    top: 30vh;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    width: auto;
    justify-items: center;
  }

  .jpt-layer-overlay {
    align-items: end;
    padding: 10px;
  }

  .jpt-layer-panel {
    width: 100%;
    border-radius: 12px;
  }

  .jpt-layer-head {
    padding: 20px 18px 16px;
  }

  .jpt-layer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .jpt-layer-actions .button:only-child {
    grid-column: 1 / -1;
  }

  .mode-toggle label:has(input:checked)::after {
    right: 10px;
  }

  .history-list .record-card:hover,
  .stat-card:hover,
  .edit-upload-box:hover {
    transform: none;
  }
}

body.page-auth:has(.center-auth-page) {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0) 260px),
    #f3f8f9;
}

body.page-auth:has(.center-auth-page) .app-shell {
  width: min(100% - 36px, 430px);
  min-height: auto;
  display: grid;
  padding: 40px 0 32px;
}

body.page-auth:has(.center-auth-register) .app-shell {
  width: min(100% - 36px, 450px);
}

.center-auth-page {
  width: 100%;
  align-self: start;
  display: grid;
  place-items: center;
  padding: 20px 0 0;
}

.center-auth-panel {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* 修改密码 - 卡片面板样式 */
.center-auth-panel--card {
  width: min(100%, 430px);
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.04);
  overflow: hidden;
}

.center-auth-password-head {
  padding: 28px 28px 0;
  text-align: center;
}

.center-auth-password-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #e6faff 0%, #cdf2f5 100%);
  color: #00c5ef;
}

.center-auth-password-icon svg {
  width: 28px;
  height: 28px;
}

.center-auth-password-head h2 {
  margin: 0 0 6px;
  color: #101828;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.2;
}

.center-auth-password-head p {
  margin: 0;
  color: #667085;
  font-size: 14px;
  font-weight: 620;
}

.center-auth-panel--card .center-auth-top {
  margin-bottom: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid #f2f4f7;
}

.center-auth-panel--card .center-auth-body {
  padding: 24px 28px 28px;
}

.password-success-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 28px -4px;
  padding: 14px 16px;
  border: 1px solid #a5f2e6;
  border-radius: 10px;
  background: linear-gradient(135deg, #e6faff 0%, #e6faf6 100%);
  animation: passwordSuccessIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes passwordSuccessIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.password-success-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #00c5ef;
  color: #fff;
}

.password-success-icon svg {
  width: 20px;
  height: 20px;
}

.password-success-text {
  display: grid;
  gap: 2px;
}

.password-success-text strong {
  color: #007a94;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.password-success-text span {
  color: #047857;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.3;
}

.center-auth-panel--card .center-auth-form {
  gap: 16px;
}

.center-auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.center-auth-top {
  margin-bottom: 26px;
  padding: 0;
  background: transparent;
  text-align: center;
}

.center-auth-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 28px;
  color: #101828;
  text-align: center;
  text-decoration: none;
}

.center-auth-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  font-size: 19px;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(0, 197, 239, 0.22);
}

.center-auth-mark svg {
  width: 37px;
  height: 37px;
  display: block;
}

.center-auth-mark .icon-frame,
.center-auth-mark .icon-line,
.center-auth-mark .icon-dot {
  fill: none;
  stroke: #fff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.center-auth-mark .ai-spark {
  fill: #a3e8ed;
  stroke: #fff;
  stroke-width: 0.6;
}

.center-auth-mark .ai-spark.small {
  fill: #fff;
  stroke: none;
  opacity: 0.92;
}

.center-auth-brand strong {
  display: block;
  font-size: 28px;
  font-weight: 850;
  line-height: 1.08;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.center-auth-brand small {
  display: block;
  margin-top: 16px;
  color: #4d6b73;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}

.center-auth-brand > span {
  margin-top: 16px;
  font-size: 24px;
}

.center-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-height: 42px;
  border: 1px solid #d4eaef;
  border-radius: 8px;
  padding: 4px;
  background: #edf6f8;
}

.center-auth-tabs a {
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #667085;
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.center-auth-tabs a.active {
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 197, 239, 0.25);
}

.center-auth-tabs a:not(.active):hover {
  color: #344054;
}

.center-auth-body {
  padding: 0;
}

.center-auth-form {
  display: grid;
  gap: 13px;
}

.center-auth-register .center-auth-form {
  gap: 12px;
}

.center-auth-field {
  display: grid;
  gap: 8px;
}

.center-auth-register .center-auth-field {
  gap: 7px;
}

.center-auth-field span {
  color: #344054;
  font-size: 13px;
  font-weight: 740;
}

.field-error {
  font-size: 13px;
  color: #dc2626 !important;
  margin-left: 6px;
  font-weight: 400;
}

.field-error svg {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 2px;
}

.field-success {
  font-size: 13px;
  color: #16a34a !important;
  margin-left: 6px;
  font-weight: 400;
}

.field-success svg {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 2px;
}

.center-auth-field input {
  width: 100%;
  height: 48px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: #101828;
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.center-auth-register .center-auth-field input {
  height: 46px;
}

.center-auth-field input::placeholder {
  color: #98a2b3;
}

.center-auth-field input:hover {
  border-color: #98a2b3;
}

.center-auth-field input:focus {
  border-color: #00c5ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.12);
}

.center-auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 8px;
}

.center-auth-code-row button {
  height: 46px;
  border: 1px solid #00c5ef;
  border-radius: 8px;
  background: #e6faff;
  color: #00c5ef;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.center-auth-code-row button:disabled {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #98a2b3;
  cursor: not-allowed;
}

.center-auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(0, 197, 239, 0.2);
  transition: box-shadow 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}

.center-auth-submit:hover {
  filter: brightness(0.98);
  box-shadow: 0 14px 26px rgba(0, 197, 239, 0.24);
}

.center-auth-submit:active {
  transform: translateY(1px);
}

/* 协议同意复选框 */
.auth-agreement-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 6px;
  cursor: default;
  user-select: none;
  width: fit-content;
}

.auth-agreement-check .agree-box,
.auth-agreement-check .agree-label {
  cursor: pointer;
}

.auth-agreement-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.agree-box {
  width: 18px;
  height: 18px;
  border: 2px solid #d0d5dd;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  background: #fff;
  transition: border-color .2s, background .2s, box-shadow .2s;
  position: relative;
}

.auth-agreement-check:hover .agree-box {
  border-color: #00c5ef;
}

.auth-agreement-check input:focus-visible + .agree-box {
  box-shadow: 0 0 0 3px rgba(0,197,239,.25);
}

.auth-agreement-check input:checked + .agree-box {
  background: #00c5ef;
  border-color: #00c5ef;
}

.auth-agreement-check input:checked + .agree-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agree-label {
  color: #667085;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

.agree-label a {
  color: #00c5ef;
  text-decoration: none;
  transition: color .2s;
}

.agree-label a:hover {
  color: #00efbf;
  text-decoration: underline;
}

/* 修改密码页面 - 单 tab 样式 */
.center-auth-tabs--single {
  grid-template-columns: minmax(0, 1fr);
}

.center-auth-tabs--single span.active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  font-size: 14px;
  font-weight: 780;
  padding: 9px 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.center-auth-tabs--single .tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* 输入框带图标 */
.center-auth-input-wrap {
  position: relative;
  width: 100%;
}

.center-auth-input-wrap .center-auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #98a2b3;
  pointer-events: none;
  transition: color 0.15s ease;
}

.center-auth-input-wrap input {
  width: 100%;
  height: 48px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 14px 0 42px;
  background: #fff;
  color: #101828;
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.center-auth-input-wrap input::placeholder {
  color: #98a2b3;
}

.center-auth-input-wrap input:hover {
  border-color: #98a2b3;
}

.center-auth-input-wrap input:focus {
  border-color: #00c5ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.12);
}

.center-auth-input-wrap input:focus ~ .center-auth-input-icon {
  color: #00c5ef;
}

/* 返回链接 */
.center-auth-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  text-align: center;
  transition: color 0.15s ease;
}

.center-auth-back-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.center-auth-back-link:hover {
  color: #344054;
}

.legal-dialog-close {
  position: sticky;
  top: 14px;
  z-index: 2;
  float: right;
  margin: 14px 14px -48px 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.12);
}

.legal-dialog-section {
  clear: both;
}

.legal-page {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.legal-panel {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
}

.legal-head {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid #e4e7ec;
  padding: 30px 30px 24px;
}

.legal-head h1 {
  margin: 0;
  color: #101828;
  font-size: 28px;
  font-weight: 880;
  line-height: 1.2;
}

.legal-head p:last-child {
  margin: 0;
  color: #667085;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.7;
}

.legal-content {
  display: grid;
  gap: 12px;
  padding: 28px 30px 32px;
}

.legal-content h2 {
  margin: 10px 0 0;
  color: #101828;
  font-size: 17px;
  font-weight: 850;
}

.legal-content p {
  margin: 0;
  color: #475467;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.9;
}

.legal-dialog .legal-head {
  padding-right: 92px;
}

.legal-dialog-panel::-webkit-scrollbar {
  width: 10px;
}

.legal-dialog-panel::-webkit-scrollbar-thumb {
  border: 3px solid #fff;
  border-radius: 999px;
  background: #d0d5dd;
}

@media (max-width: 720px) {
  body.page-auth:has(.center-auth-page) .app-shell {
    width: min(100% - 32px, 390px);
    padding: 24px 0 20px;
  }

  body.page-auth:has(.center-auth-register) .app-shell {
    width: min(100% - 32px, 390px);
  }

  .center-auth-page {
    padding: 0;
    align-self: start;
    padding-top: clamp(18px, 8vh, 54px);
  }

  .center-auth-top {
    margin-bottom: 20px;
  }

  .center-auth-brand {
    gap: 9px;
    margin-bottom: 24px;
  }

  .center-auth-mark {
    width: 42px;
    height: 42px;
  }

  .center-auth-mark svg {
    width: 30px;
    height: 30px;
  }

  .center-auth-brand strong {
    font-size: 22px;
  }

  .center-auth-brand small {
    margin-top: 12px;
    font-size: 18px;
  }

  .center-auth-tabs {
    min-height: 40px;
    border-radius: 8px;
  }

  .center-auth-tabs a {
    font-size: 13px;
  }

  .center-auth-form {
    gap: 12px;
  }

  .center-auth-field {
    gap: 6px;
  }

  .center-auth-field span {
    font-size: 12px;
  }

  .center-auth-field input {
    height: 46px;
    border-radius: 8px;
    font-size: 14px;
  }

  .center-auth-code-row {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .center-auth-submit {
    min-height: 46px;
    margin-top: 6px;
    font-size: 14px;
  }

  .center-auth-tabs--single span.active {
    font-size: 13px;
  }

  .center-auth-input-wrap input {
    height: 46px;
    font-size: 14px;
  }

  .center-auth-back-link {
    font-size: 12px;
  }

  .legal-page {
    padding: 14px 0 28px;
  }

  .legal-head,
  .legal-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .legal-dialog .legal-head {
    padding-right: 76px;
  }

  .legal-dialog-close {
    top: 10px;
    margin: 10px 10px -44px 0;
  }

  .legal-head h1 {
    font-size: 24px;
  }
}

.mobile-menu-toggle {
  display: none;
}

@media (max-width: 720px) {
  .app-topbar {
    position: sticky;
    top: 8px;
    z-index: 1000;
    display: grid !important;
    grid-template-columns: 44px 42px !important;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    min-height: 58px;
    padding: 8px 10px;
    border-radius: 14px;
    overflow: visible !important;
  }

  .topbar-brand {
    width: 44px;
    grid-template-columns: 44px !important;
    gap: 0;
    padding: 0;
  }

  .brand-copy {
    display: none;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .brand-mark svg {
    width: 31px;
    height: 31px;
  }

  .mobile-menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
  }

  .mobile-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .topbar-right {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(280px, calc(100vw - 24px));
    display: none !important;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(228, 231, 236, 0.96);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16);
    backdrop-filter: blur(16px) saturate(1.12);
  }

  .app-topbar.is-menu-open .topbar-right {
    display: grid !important;
  }

  .topbar-nav {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f4fcfd;
  }

  .topbar-nav a {
    height: 38px;
    min-height: 38px;
    justify-content: flex-start;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 800;
  }

  .topbar-account {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f4fcfd;
  }

  .topbar-account .balance {
    grid-column: auto;
    justify-content: flex-start;
  }

  .topbar-account .balance,
  .topbar-account .nav-redeem,
  .topbar-account .logout-link {
    height: 36px;
    min-height: 36px;
    justify-content: flex-start;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
  }

  body.has-mobile-menu .app-shell {
    overflow: visible;
  }
}

@media (max-width: 420px) {
  .topbar-right {
    right: 0;
    width: min(260px, calc(100vw - 20px));
  }

  .topbar-nav a,
  .topbar-account .balance,
  .topbar-account .nav-redeem,
  .topbar-account .logout-link {
    padding: 0 6px;
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  .app-topbar .topbar-right {
    min-height: 0 !important;
  }

  .app-topbar .topbar-right .topbar-nav,
  .app-topbar .topbar-right .topbar-account {
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 6px !important;
  }

  .app-topbar .topbar-right .topbar-nav a,
  .app-topbar .topbar-right .topbar-account .balance,
  .app-topbar .topbar-right .topbar-account .nav-redeem,
  .app-topbar .topbar-right .topbar-account .logout-link {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    overflow: hidden !important;
    border-radius: 10px !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-topbar .topbar-right .topbar-account .balance {
    grid-column: auto !important;
  }
}

.mobile-topbar-menu {
  display: none;
}

@media (min-width: 721px) {

  .mobile-menu-toggle,
  .mobile-topbar-menu {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    position: sticky !important;
    top: 8px !important;
    z-index: 1000 !important;
    display: grid !important;
    grid-template-columns: 44px 44px !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 60px !important;
    padding: 8px 10px !important;
    overflow: visible !important;
    border-radius: 14px !important;
  }

  .app-topbar>.topbar-brand {
    width: 44px !important;
    min-width: 44px !important;
    display: block !important;
    padding: 0 !important;
  }

  .app-topbar>.topbar-brand .brand-copy {
    display: none !important;
  }

  .app-topbar>.topbar-brand .brand-mark {
    width: 44px !important;
    height: 44px !important;
    border-radius: 13px !important;
  }

  .app-topbar>.topbar-brand .brand-mark svg {
    width: 32px !important;
    height: 32px !important;
  }

  .app-topbar>.topbar-right {
    display: none !important;
  }

  .mobile-menu-toggle {
    width: 44px !important;
    height: 44px !important;
    display: grid !important;
    place-content: center !important;
    gap: 5px !important;
    padding: 0 !important;
    border: 1px solid var(--line) !important;
    border-radius: 13px !important;
    background: #fff !important;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08) !important;
  }

  .mobile-menu-toggle span {
    width: 18px !important;
    height: 2px !important;
    display: block !important;
    border-radius: 999px !important;
    background: var(--text) !important;
    transition: transform 0.18s ease, opacity 0.18s ease !important;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0 !important;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  .mobile-topbar-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    width: min(280px, calc(100vw - 24px)) !important;
    display: none !important;
    padding: 10px !important;
    border: 1px solid rgba(228, 231, 236, 0.96) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16) !important;
    backdrop-filter: blur(16px) saturate(1.12) !important;
  }

  .app-topbar.is-menu-open .mobile-topbar-menu {
    display: grid !important;
    gap: 8px !important;
  }

  .mobile-menu-balance {
    min-width: 0 !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    overflow: hidden !important;
    border: 1px solid #a3e8ed !important;
    border-radius: 11px !important;
    background: #e6faff !important;
    color: var(--primary-dark) !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .mobile-menu-nav,
  .mobile-menu-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .mobile-menu-nav a,
  .mobile-menu-actions a,
  .mobile-menu-actions button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    background: #f4fcfd !important;
    color: var(--text-soft) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-align: left !important;
    text-decoration: none !important;
  }

  .mobile-menu-nav a.active,
  .mobile-menu-actions button {
    border-color: #00c5ef !important;
    background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%) !important;
    color: #fff !important;
  }

  .mobile-menu-nav a:not(.active):hover,
  .mobile-menu-actions a:hover {
    border-color: #d0d5dd !important;
    background: #ebf6f8 !important;
    color: var(--text) !important;
  }
}

@media (max-width: 380px) {
  .mobile-topbar-menu {
    width: min(260px, calc(100vw - 18px)) !important;
  }
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 14px max(18px, calc((100vw - 1440px) / 2));
  border: 0;
  border-bottom: 1px solid rgba(228, 231, 236, 0.85);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.06);
  backdrop-filter: blur(12px);
}

.site-brand {
  min-width: 0;
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}

.site-brand-text-only {
  grid-template-columns: minmax(0, auto);
}

.site-brand-image-only {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-brand-mark {
  width: auto;
  height: 42px;
  display: block;
  border-radius: 0;
}

.site-brand-mark svg {
  width: 31px;
  height: 31px;
  display: block;
}

.site-brand-mark img {
  height: 42px;
  width: auto;
  display: block;
  border-radius: inherit;
  object-fit: contain;
}

.site-brand-mark .icon-frame,
.site-brand-mark .icon-line,
.site-brand-mark .icon-dot {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-brand-mark .ai-spark {
  fill: #a3e8ed;
  stroke: #ffffff;
  stroke-width: 0.6;
}

.site-brand-mark .ai-spark.small {
  fill: #ffffff;
  stroke: none;
  opacity: 0.92;
}

.site-brand-name {
  min-width: 0;
  overflow: hidden;
  font-size: 27px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  background: linear-gradient(135deg, #00a5c4 0%, #00d6a5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-nav {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  row-gap: 2px;
  min-width: 0;
}

.site-nav a {
  height: 34px;
  min-width: 52px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a.active {
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 197, 239, 0.25);
}

.site-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.site-balance,
.site-action {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.site-balance {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  border: 1px solid #a3e8ed;
  background: linear-gradient(135deg, rgba(0, 197, 239, 0.08), rgba(0, 239, 191, 0.08));
  color: var(--primary-dark);
  text-overflow: ellipsis;
}

.site-action {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(0, 197, 239, 0.04), rgba(0, 239, 191, 0.04));
  color: var(--text-soft);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-action:hover {
  border-color: #00c5ef;
  background: linear-gradient(135deg, rgba(0, 197, 239, 0.12), rgba(0, 239, 191, 0.1));
  color: #005566;
}

.site-action-primary {
  border-color: #00c5ef;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 197, 239, 0.25);
  font-weight: 600;
}

.site-action-primary:hover {
  box-shadow: 0 6px 18px rgba(0, 197, 239, 0.35);
}

/* ── 用户菜单（登录后） ── */
.site-user-menu {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 0;
  background: none;
  border: none;
  transition: all 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.site-user-menu:hover {
  box-shadow: none;
}

.site-user-avatar {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 197, 239, 0.25);
  margin-right: -4px;
}

.site-user-name {
  font-size: 11.5px;
  font-weight: 400;
  color: #005566;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64px;
  text-decoration: none;
  cursor: pointer;
}
.site-user-name:hover {
  color: #00c5ef;
}

.site-user-credits {
  font-size: 11.5px;
  font-weight: 400;
  color: #475467;
  white-space: nowrap;
}
.site-user-credits strong {
  font-weight: 700;
  font-size: 14px;
  color: #e53e3e;
  margin: 0 3px;
}
.site-user-credit-num {
  padding: 0;
  color: #e53e3e;
  font-size: 11.5px;
}

.site-user-link {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 400;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid #bae6f0;
  background: rgba(0, 197, 239, 0.06);
  cursor: pointer;
  font-family: inherit;
}

.site-user-link:hover {
  background: rgba(0, 197, 239, 0.12);
  border-color: #7dd3e6;
  color: #005566;
}

/* 兑换积分按钮 */
.site-user-redeem-btn {
  background: linear-gradient(135deg, #00c5ef, #00efbf) !important;
  color: #fff !important;
  padding: 3px 10px !important;
}

.site-user-redeem-btn:hover {
  background: linear-gradient(135deg, #00a8d8, #00d6a8) !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(0, 197, 239, 0.3);
}

/* 退出按钮 */
.site-user-logout {
  color: #94a3b8 !important;
}

.site-user-logout:hover {
  color: #ef4444 !important;
  background: #fef2f2 !important;
}

/* 兑换弹窗 */
.redeem-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.redeem-dialog.hidden {
  display: none;
}

.redeem-dialog-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.redeem-dialog-panel {
  position: relative;
  width: 380px;
  max-width: 90vw;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 28px 24px 24px;
  animation: redeemSlideIn 0.25s ease;
}

@keyframes redeemSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.redeem-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.redeem-dialog-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.redeem-dialog-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.redeem-dialog-close:hover {
  background: #e2e8f0;
  color: #334155;
}

.redeem-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.redeem-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.redeem-field span {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.redeem-field input {
  padding: 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s;
}

.redeem-field input:focus {
  border-color: #00c5ef;
}

.redeem-dialog-hint {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  margin: 0;
  min-height: 18px;
}

.redeem-dialog-hint.error {
  color: #ef4444;
}

.redeem-dialog-hint.success {
  color: #10b981;
}

.redeem-dialog-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #00c5ef, #00efbf);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.redeem-dialog-submit:hover {
  background: linear-gradient(135deg, #00a8d8, #00d6a8);
  box-shadow: 0 4px 16px rgba(0, 197, 239, 0.35);
}

.redeem-dialog-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.site-btn-outline {
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 197, 239, 0.25);
}

.site-btn-outline:hover {
  background: linear-gradient(135deg, #00a5c4 0%, #00d6a5 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 197, 239, 0.38);
  transform: translateY(-1px);
}

.site-btn-primary {
  background: linear-gradient(135deg, #ff6b35, #ff8c42);
  color: #fff;
  box-shadow: 0 3px 12px rgba(255, 107, 53, 0.35);
}

.site-btn-primary:hover {
  background: linear-gradient(135deg, #ff5722, #ff6b35);
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.45);
  transform: translateY(-1px);
}

.site-menu-button,
.site-mobile-menu {
  display: none;
}

@media (max-width: 1200px) {
  /* ===== 平板/小屏：logo左 + actions右（第1行），nav折到第2行居中 ===== */
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    padding: 8px 16px;
    min-height: 96px;
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.06);
  }

  .site-brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .site-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 8px;
    padding: 11px 16px 4px;
    margin: 0 -16px 0;
    border-top: none;
    position: relative;
  }
  .site-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: calc(-50vw + 50%);
    width: 100vw;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
  }
  .site-nav a {
    flex: 0 0 auto;
    width: auto;
    padding: 4px 10px;
    font-size: 13px;
    height: 30px;
    border-radius: 6px;
  }

  .site-user-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 6px;
  }
  .site-user-name {
    max-width: 40px;
    font-size: 11px;
  }
  .site-user-credits {
    font-size: 11px;
  }
  .site-user-link {
    padding: 2px 6px;
    font-size: 11px;
  }
  .site-user-redeem-btn {
    padding: 2px 6px !important;
    font-size: 11px !important;
  }
  .site-user-logout {
    font-size: 11px !important;
    padding: 2px 6px !important;
  }
  .site-btn {
    height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }

  .site-menu-button,
  .site-mobile-menu {
    display: none;
  }

  .app-shell {
    padding-top: 152px;
  }
}

@media (max-width: 720px) {
  body.page-auth .site-header {
    display: none;
  }

  /* ===== 手机端：logo左 + 三杠右（第1行），nav展开到第2行，actions在第3行居中 ===== */
  .site-header {
    top: 0;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    padding: 9px 12px 2px;
    min-height: 36px;
    border-radius: 0;
  }

  .app-shell {
    padding-top: 76px;
    padding-bottom: 24px;
  }

  .site-brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    grid-template-columns: auto minmax(0, auto);
    justify-content: start;
    gap: 6px;
  }
  .site-brand-text-only {
    grid-template-columns: minmax(0, auto);
  }
  .site-brand-name {
    display: block;
    align-self: center;
    font-size: 20px;
  }
  .site-brand-mark {
    height: 32px;
    border-radius: 0;
  }
  .site-brand-mark img {
    height: 32px;
  }

  /* 导航默认隐藏 */
  .site-nav {
    display: none;
  }

  /* 导航展开（第2行） */
  .site-nav.open {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 2px 6px;
    padding: 8px 12px 4px;
    margin: 4px -12px 0;
    border-top: none;
    position: relative;
  }
  .site-nav.open::before {
    content: '';
    position: absolute;
    top: 0;
    left: calc(-50vw + 50%);
    width: 100vw;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
  }
  .site-nav.open a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 4px 10px;
    font-size: 13px;
    height: 30px;
  }

  /* 未登录/已登录按钮：始终在 header 第1行右侧，三杠左边 */
  .site-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-right: 48px;
    z-index: 2;
  }
  .site-actions .site-btn {
    padding: 4px 10px;
    font-size: 11px;
    height: 26px;
    border-radius: 13px;
  }
  .site-actions .site-user-credits {
    font-size: 11px;
  }



  /* 三横线按钮 */
  .site-menu-button {
    position: absolute;
    top: 6px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: grid;
    place-content: center;
    gap: 5px;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
  }
  .site-menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    display: block;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }
  .site-nav.open ~ .site-menu-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .site-nav.open ~ .site-menu-button span:nth-child(2) {
    opacity: 0;
  }
  .site-nav.open ~ .site-menu-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-mobile-menu {
    display: none;
  }

  .center-auth-mark-wrapper .site-brand,
  .center-auth-brand .site-brand {
    justify-self: center;
  }

  body {
    padding-bottom: 82px;
  }
}

.mobile-bottom-nav,
.mobile-account-sheet {
  display: none;
}

@media (max-width: 720px) {
  .mobile-bottom-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 1100;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 6px;
    border: 1px solid rgba(228, 231, 236, 0.96);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 38px rgba(16, 24, 40, 0.16);
    backdrop-filter: blur(16px) saturate(1.12);
  }

  body .mobile-bottom-nav a span {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    min-width: 52px;
    min-height: 42px;
    padding: 2px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
  }

  .mobile-bottom-nav .mobile-nav-icon {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    line-height: 1;
  }

  .mobile-bottom-nav .mobile-nav-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-bottom-nav a.active,
  .mobile-bottom-nav button.active {
    background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 197, 239, 0.3);
  }

  .mobile-account-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    align-items: end;
    padding: 12px;
    background: rgba(15, 23, 42, 0.36);
  }

  .mobile-account-sheet.hidden {
    display: none;
  }

  .mobile-account-panel {
    width: 100%;
    display: grid;
    gap: 12px;
    border-radius: 18px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(16, 24, 40, 0.22);
  }

  .mobile-account-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-account-balance {
    min-height: 46px;
    display: flex;
    align-items: center;
    border: 1px solid #a3e8ed;
    border-radius: 13px;
    padding: 0 14px;
    background: #e6faff;
    color: var(--primary-dark);
    font-weight: 850;
  }

  .mobile-account-actions {
    display: grid;
    gap: 8px;
  }

  .mobile-account-actions a,
  .mobile-account-actions button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 0 14px;
    background: #f4fcfd;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
  }

  .mobile-account-actions button {
    border-color: #00c5ef;
    background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
    color: #fff;
  }
}

.records-page-card {
  margin-top: 0;
}

/* Final invitation and credit-ledger overrides. */
.site-invite-code {
  height: 30px;
  max-width: 150px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #00efbf;
  border-radius: 8px;
  padding: 0 10px;
  background: #e6faff;
  color: #047857;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.site-invite-code:hover,
.site-invite-code:focus-visible {
  border-color: #00c5ef;
  background: #cdf2f5;
}

body.page-admin [data-admin-users],
[data-admin-users] {
  min-width: 1460px;
}

body.page-admin [data-admin-users] th:nth-child(1),
body.page-admin [data-admin-users] td:nth-child(1),
[data-admin-users] th:nth-child(1),
[data-admin-users] td:nth-child(1) {
  width: 140px;
}

body.page-admin [data-admin-users] th:nth-child(2),
body.page-admin [data-admin-users] td:nth-child(2),
[data-admin-users] th:nth-child(2),
[data-admin-users] td:nth-child(2) {
  width: 132px;
}

body.page-admin [data-admin-users] th:nth-child(3),
body.page-admin [data-admin-users] td:nth-child(3),
[data-admin-users] th:nth-child(3),
[data-admin-users] td:nth-child(3) {
  width: 200px;
}

body.page-admin [data-admin-users] th:nth-child(4),
body.page-admin [data-admin-users] td:nth-child(4),
body.page-admin [data-admin-users] th:nth-child(6),
body.page-admin [data-admin-users] td:nth-child(6),
body.page-admin [data-admin-users] th:nth-child(7),
body.page-admin [data-admin-users] td:nth-child(7),
body.page-admin [data-admin-users] th:nth-child(8),
body.page-admin [data-admin-users] td:nth-child(8),
[data-admin-users] th:nth-child(4),
[data-admin-users] td:nth-child(4),
[data-admin-users] th:nth-child(6),
[data-admin-users] td:nth-child(6),
[data-admin-users] th:nth-child(7),
[data-admin-users] td:nth-child(7),
[data-admin-users] th:nth-child(8),
[data-admin-users] td:nth-child(8) {
  width: 92px;
}

body.page-admin [data-admin-users] th:nth-child(5),
body.page-admin [data-admin-users] td:nth-child(5),
[data-admin-users] th:nth-child(5),
[data-admin-users] td:nth-child(5) {
  width: 190px;
}

body.page-admin [data-admin-users] th:nth-child(9),
body.page-admin [data-admin-users] td:nth-child(9),
[data-admin-users] th:nth-child(9),
[data-admin-users] td:nth-child(9) {
  width: 170px;
}

body.page-admin [data-admin-users] th:nth-child(11),
body.page-admin [data-admin-users] td:nth-child(11),
[data-admin-users] th:nth-child(11),
[data-admin-users] td:nth-child(11) {
  width: 280px;
}

body.page-admin [data-admin-users] th:nth-child(10),
body.page-admin [data-admin-users] td:nth-child(10),
[data-admin-users] th:nth-child(10),
[data-admin-users] td:nth-child(10) {
  width: 170px;
}



.invite-table-cell {
  max-width: 170px;
  display: grid;
  gap: 4px;
  line-height: 1.3;
}

.invite-table-cell strong {
  overflow: hidden;
  color: #003a47;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-table-cell span {
  overflow: hidden;
  color: #5a7a82;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-admin-credit-transactions] {
  min-width: 1160px;
}

[data-user-credit-transactions] {
  min-width: 1040px;
}

[data-user-credit-transactions] th:nth-child(1),
[data-user-credit-transactions] td:nth-child(1) {
  width: 132px;
}

[data-user-credit-transactions] th:nth-child(2),
[data-user-credit-transactions] td:nth-child(2),
[data-user-credit-transactions] th:nth-child(3),
[data-user-credit-transactions] td:nth-child(3),
[data-user-credit-transactions] th:nth-child(4),
[data-user-credit-transactions] td:nth-child(4) {
  width: 92px;
}

[data-user-credit-transactions] th:nth-child(5),
[data-user-credit-transactions] td:nth-child(5) {
  min-width: 180px;
  word-break: break-all;
}

[data-user-credit-transactions] th:nth-child(7),
[data-user-credit-transactions] td:nth-child(7) {
  width: 170px;
}

.user-credit-filter {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.user-credit-filter .field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  width: auto;
}

.user-credit-filter .field span {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  flex-shrink: 0;
}

.user-credit-filter .field select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 100px;
}

.user-credit-filter .filter-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-credit-filter .filter-actions .button {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.invite-link-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #a3e8ed;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: #e6faff;
}

.invite-link-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.invite-link-panel span {
  color: #f97316;
  font-size: 12px;
  font-weight: 800;
}

.invite-link-panel strong {
  min-width: 0;
  overflow: hidden;
  color: #003a47;
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-rule {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.6;
}

.invite-rule em {
  font-style: normal;
  font-weight: 700;
  color: #d97706;
}

.invite-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(135deg, #f97316, #f59e0b);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: inherit;
}

.invite-copy-btn:hover {
  background: linear-gradient(135deg, #ea580c, #d97706);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
  transform: translateY(-1px);
}

[data-admin-credit-transactions] th:nth-child(1),
[data-admin-credit-transactions] td:nth-child(1) {
  width: 140px;
}

[data-admin-credit-transactions] th:nth-child(2),
[data-admin-credit-transactions] td:nth-child(2) {
  width: 132px;
}

[data-admin-credit-transactions] th:nth-child(3),
[data-admin-credit-transactions] td:nth-child(3),
[data-admin-credit-transactions] th:nth-child(4),
[data-admin-credit-transactions] td:nth-child(4),
[data-admin-credit-transactions] th:nth-child(5),
[data-admin-credit-transactions] td:nth-child(5) {
  width: 92px;
}

[data-admin-credit-transactions] th:nth-child(6),
[data-admin-credit-transactions] td:nth-child(6) {
  width: 140px;
}

[data-admin-credit-transactions] th:nth-child(8),
[data-admin-credit-transactions] td:nth-child(8) {
  width: 170px;
}

.credit-positive strong {
  color: #047857;
}

.credit-negative strong {
  color: #e67e00;
}


.admin-credit-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-credit-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-credit-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-credit-filter .field-inline input,
.admin-credit-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-credit-filter .field-inline input {
  width: 140px;
}

.admin-credit-filter .field-inline select {
  width: 130px;
}

.admin-credit-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.admin-code-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-code-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-code-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-code-filter .field-inline input,
.admin-code-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-code-filter .field-inline input {
  width: 160px;
}

.admin-code-filter .field-inline select {
  width: 130px;
}

.admin-code-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.admin-usage-filter,
.admin-domain-records-filter,
.admin-whois-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-start;
  grid-template-columns: none;
}

.admin-usage-filter .filter-row,
.admin-domain-records-filter .filter-row,
.admin-whois-filter .filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  grid-template-columns: none;
}

.admin-usage-filter .field-inline,
.admin-domain-records-filter .field-inline,
.admin-whois-filter .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-usage-filter .field-inline span,
.admin-domain-records-filter .field-inline span,
.admin-whois-filter .field-inline span {
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #4d6b73;
  font-size: 13px;
  font-weight: 600;
}

.admin-usage-filter .field-inline input,
.admin-usage-filter .field-inline select,
.admin-domain-records-filter .field-inline input,
.admin-domain-records-filter .field-inline select,
.admin-whois-filter .field-inline input,
.admin-whois-filter .field-inline select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d3e9ed;
  border-radius: 6px;
  background: #fff;
  color: #003a47;
  font-size: 13px;
  min-width: 0;
}

.admin-usage-filter .field-inline input,
.admin-domain-records-filter .field-inline input,
.admin-whois-filter .field-inline input {
  width: 140px;
}

.admin-usage-filter .field-inline select,
.admin-domain-records-filter .field-inline select,
.admin-whois-filter .field-inline select {
  width: 130px;
}

.admin-usage-filter .filter-actions,
.admin-domain-records-filter .filter-actions,
.admin-whois-filter .filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

@media (max-width: 720px) {
  .mobile-account-invite {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #00efbf;
    border-radius: 13px;
    padding: 0 14px;
    background: #e6faff;
    color: #047857;
    font-size: 14px;
    font-weight: 850;
    text-align: left;
  }

  .mobile-account-invite strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }

  .invite-link-panel {
    grid-template-columns: 1fr;
  }

  .invite-link-panel .button {
    width: 100%;
  }
}

/* ========== 登录/注册页美化 ========== */

/* 背景装饰 */
.auth-bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  animation: authOrbFloat 8s ease-in-out infinite alternate;
}

.auth-bg-orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 197, 239, 0.08) 0%, transparent 70%);
  top: -140px;
  right: -120px;
  animation-delay: 0s;
}

.auth-bg-orb-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  bottom: -100px;
  left: -80px;
  animation-delay: 4s;
  animation-duration: 10s;
}

@keyframes authOrbFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(30px, -20px) scale(1.08);
  }
}

.auth-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 197, 239, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 197, 239, 0.015) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
}

/* 面板容器加 z-index 提升 */
body.page-auth:has(.center-auth-page) .app-shell {
  position: relative;
  z-index: 1;
}

/* 品牌标识区优化 */
.center-auth-brand {
  gap: 28px;
  margin-bottom: 48px;
}

.center-auth-mark-wrapper {
  position: relative;
  display: grid;
  place-items: center;
}

.center-auth-mark {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  box-shadow: 0 8px 32px rgba(0, 197, 239, 0.28), 0 0 0 1px rgba(0, 197, 239, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.center-auth-brand:hover .center-auth-mark {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(0, 197, 239, 0.35), 0 0 0 1px rgba(0, 197, 239, 0.2);
}

.center-auth-mark svg {
  width: 38px;
  height: 38px;
}

.center-auth-mark-glow {
  position: absolute;
  z-index: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 197, 239, 0.25) 0%, transparent 70%);
  animation: authMarkPulse 3s ease-in-out infinite;
}

@keyframes authMarkPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.25;
  }
}

.center-auth-brand strong {
  font-size: 30px;
  letter-spacing: -0.02em;
}

.center-auth-brand small {
  font-size: 24px;
  color: #4d6b73;
  margin-top: 16px;
}

/* Tab 切换优化 */
.center-auth-tabs {
  min-height: 44px;
  border-radius: 10px;
  padding: 5px;
  background: #eef7f9;
  border: 1px solid #e4e8f0;
}

.center-auth-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
  color: #5a7a82;
  padding: 9px 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.25s ease;
}

.center-auth-tabs a.active .tab-icon {
  opacity: 1;
}

.center-auth-tabs a.active {
  background: #fff;
  color: #101828;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08), 0 0 0 1px rgba(16, 24, 40, 0.04);
}

.center-auth-tabs a:not(.active):hover {
  color: #344054;
  background: rgba(255, 255, 255, 0.5);
}

/* 输入框优化 */
.center-auth-form {
  gap: 16px;
}

.center-auth-field {
  gap: 7px;
}

.center-auth-field span {
  font-size: 13px;
  font-weight: 720;
  color: #344054;
  letter-spacing: 0.01em;
}

.center-auth-input-wrap {
  position: relative;
  display: grid;
}

.center-auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9cc5cc;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 1;
}

.center-auth-input-wrap input {
  padding-left: 44px !important;
}

.center-auth-input-wrap:focus-within .center-auth-input-icon {
  color: #00c5ef;
}

.center-auth-field input {
  height: 50px;
  border: 1.5px solid #d8eaef;
  border-radius: 10px;
  padding: 0 16px;
  background: #fff;
  color: #101828;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.center-auth-field input::placeholder {
  color: #7d99a0;
}

.center-auth-field input:hover {
  border-color: #badae2;
}

.center-auth-field input:focus {
  border-color: #00c5ef;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 197, 239, 0.1), 0 1px 3px rgba(16, 24, 40, 0.06);
}

/* 提交按钮优化 */
.center-auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 197, 239, 0.22), 0 0 0 1px rgba(0, 197, 239, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.center-auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  border-radius: 10px;
  pointer-events: none;
}

.center-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 197, 239, 0.3), 0 0 0 1px rgba(0, 197, 239, 0.15);
}

.center-auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(0, 197, 239, 0.2);
  transition: all 0.1s ease;
}

.center-auth-submit-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
}

.center-auth-submit:hover .center-auth-submit-arrow {
  transform: translateX(3px);
}

/* QQ 一键登录 */
.center-auth-oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 600;
}

.center-auth-oauth-divider::before,
.center-auth-oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e5ea;
}

.center-auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 1px solid #d0e0e8;
  border-radius: 10px;
  background: #f6fafc;
  color: #34495e;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.center-auth-oauth-btn:hover {
  background: #e8f4fb;
  border-color: #a0cced;
  box-shadow: 0 2px 12px rgba(18, 183, 245, 0.12);
}

.center-auth-oauth-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 图形验证码 */
.center-auth-captcha {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.center-auth-captcha .center-auth-field {
  flex: 1;
  margin-top: 0;
}

.center-auth-captcha .center-auth-input-wrap {
  margin-top: 4px;
}

.center-auth-captcha-img-wrap {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #d8eaef;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.center-auth-captcha-img-wrap:hover {
  border-color: #00c5ef;
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.1);
}

.center-auth-captcha-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f2f8f9;
}

.center-auth-captcha-refresh {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.center-auth-captcha-refresh svg {
  width: 14px;
  height: 14px;
}

.center-auth-captcha-img-wrap:hover .center-auth-captcha-refresh {
  opacity: 1;
}

/* 响应式适配 */
@media (max-width: 720px) {
  .center-auth-brand {
    gap: 14px;
    margin-bottom: 28px;
  }

  .center-auth-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .center-auth-mark svg {
    width: 30px;
    height: 30px;
  }

  .center-auth-mark-glow {
    width: 56px;
    height: 56px;
  }

  .center-auth-brand strong {
    font-size: 24px;
  }

  .center-auth-brand small {
    font-size: 18px;
    margin-top: 12px;
  }

  .center-auth-tabs {
    min-height: 42px;
    border-radius: 9px;
  }

  .center-auth-tabs a {
    font-size: 13px;
    gap: 5px;
    padding: 8px 12px;
  }

  .tab-icon {
    width: 16px;
    height: 16px;
  }

  .center-auth-field input {
    height: 48px;
    font-size: 14px;
  }

  .center-auth-input-icon {
    left: 12px;
    width: 18px;
    height: 18px;
  }

  .center-auth-input-wrap input {
    padding-left: 38px !important;
  }

  .center-auth-submit {
    min-height: 48px;
    font-size: 15px;
  }

  .center-auth-captcha-img-wrap {
    width: 120px;
    height: 44px;
  }

  .auth-bg-orb-1 {
    width: 260px;
    height: 260px;
    top: -80px;
    right: -80px;
  }

  .auth-bg-orb-2 {
    width: 220px;
    height: 220px;
    bottom: -60px;
    left: -60px;
  }
}

/* ========== 案例展示页 - 瀑布流 ========== */

.cases-grid-section {
  padding: 0;
  border-radius: 16px;
}

/* cases / records 页面外层无背景无间距无阴影 */
body.page-cases .grid > .card,
body.page-records .grid > .card {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.cases-empty {
  text-align: center;
  padding: 80px 20px;
}

.cases-empty .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: #9cc5cc;
  opacity: 0.6;
}

.cases-empty .empty-icon svg {
  width: 100%;
  height: 100%;
}

.cases-empty p {
  font-size: 17px;
  font-weight: 700;
  color: #5a7a82;
  margin: 0 0 6px;
}

.cases-empty small {
  font-size: 13px;
  color: #9cc5cc;
}

/* 瀑布流容器 - CSS Columns 实现 */
.cases-waterfall {
  column-count: 5;
  column-gap: 20px;
}

/* 瀑布流卡片 */
.waterfall-card {
  break-inside: avoid;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.6);
  border-radius: 16px;
  overflow: hidden;
  border: none;
  box-shadow: none;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
  opacity: 0;
  transform: translateY(24px);
  animation: caseFadeUp 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
}

.waterfall-card:hover {
  transform: translateY(-4px);
  z-index: 5;
}

/* 图片区域 */
.waterfall-image {
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
  line-height: 0;
}

.waterfall-image::before {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(0,197,239,0.03) 0%,
    rgba(0,239,191,0.03) 50%,
    rgba(0,197,239,0.03) 100%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.waterfall-card:hover .waterfall-image::before {
  opacity: 1;
}

.waterfall-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22,1,0.36,1),
              filter 0.7s ease;
  filter: brightness(0.96);
}

.waterfall-card:hover .waterfall-image img {
  transform: scale(1.06);
  filter: brightness(1);
}

/* 底部渐变遮罩 */
.waterfall-gradient {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0.15) 45%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.waterfall-card:hover .waterfall-gradient {
  opacity: 1;
}

/* 底部彩色渐变条 */
.waterfall-accent {
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #00dfc7, #00efbf);
  z-index: 3;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1);
}

.waterfall-card:hover .waterfall-accent {
  transform: scaleX(1);
}

.case-no-image {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9cc5cc;
  font-size: 13px;
  font-weight: 500;
  background: linear-gradient(135deg, rgba(156,197,204,.06) 0%, rgba(156,197,204,.12) 100%);
  border-radius: 6px;
  margin: 8px;
}
.case-no-image span {
  opacity: 0.7;
}

/* 悬停操作按钮 */
.waterfall-image-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 4;
}

.case-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #003a47;
  font-size: 12px;
  font-weight: 650;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: inherit;
  letter-spacing: 0.03em;
}

.case-action-btn:hover {
  background: #fff;
  transform: scale(1.04);
}

.case-action-btn:active {
  transform: scale(0.96);
}

.case-action-btn svg {
  flex-shrink: 0;
}

.case-action-btn-primary {
  background: linear-gradient(135deg, var(--primary), #00dfc7, #00efbf);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,197,239,0.2);
}

.waterfall-card:hover .case-action-btn-primary {
  background: linear-gradient(135deg, var(--primary), #00dfc7, #00efbf);
  box-shadow: 0 4px 20px rgba(0,197,239,0.4);
}

.case-action-btn-primary:hover {
  background: linear-gradient(135deg, var(--primary), #00dfc7, #00efbf);
  box-shadow: 0 4px 20px rgba(0,197,239,0.4);
  transform: translateY(-1px);
}

/* 文字信息区域 */
.waterfall-body {
  padding: 14px 16px;
}

.waterfall-prompt {
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.waterfall-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #9cc5cc;
}

.waterfall-user {
  font-weight: 650;
  color: #5a7a82;
}

.waterfall-time {
  font-variant-numeric: tabular-nums;
}

/* 加载指示器 */
.waterfall-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px 40px;
  color: #9cc5cc;
  font-size: 14px;
  font-weight: 600;
}

.waterfall-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #ddf1f4;
  border-top-color: #00c5ef;
  border-radius: 50%;
  animation: waterfall-spin 0.7s linear infinite;
}

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

/* 底部结束提示 */
.waterfall-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px 48px;
  color: #9cc5cc;
}

.waterfall-end-icon {
  width: 40px;
  height: 40px;
  color: #c4e3e9;
}

.waterfall-end-icon svg {
  width: 100%;
  height: 100%;
}

.waterfall-end p {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

/* 复制成功 Toast */
.copy-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #003a47;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  padding: 10px 24px;
  border-radius: 10px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.copy-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.copy-toast-error {
  background: #e67e00;
}

/* 后台批量操作区域间距 */
.admin-record-bulk-form + .admin-record-bulk-form {
  margin-top: 8px;
}

@media (max-width: 1024px) {
  .cases-waterfall {
    column-count: 4;
    column-gap: 16px;
  }

  .waterfall-card {
    margin-bottom: 16px;
  }
}

@media (max-width: 720px) {
  .article-hero { border-radius: 14px; }
  .article-hero-inner { padding: 20px 22px; }
  .article-hero-text h1 { font-size: 22px; }
  .article-hero-text p { font-size: 14px; }
  .article-hero-deco { display: none; }

  .cases-waterfall {
    column-count: 3;
    column-gap: 14px;
  }

  .waterfall-card {
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .waterfall-body {
    padding: 10px 12px;
  }

  .waterfall-prompt {
    font-size: 12px;
    -webkit-line-clamp: 1;
  }

  .waterfall-image-actions {
    padding: 6px;
  }

  .waterfall-gradient {
    opacity: 1;
  }

  .waterfall-accent {
    transform: scaleX(1);
  }

  .case-action-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .case-action-btn span {
    display: none;
  }

  .copy-toast {
    bottom: 24px;
    font-size: 13px;
    padding: 8px 20px;
  }
}

/* ========== 图片查看器弹窗 ========== */

.image-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.image-viewer-overlay.image-viewer-visible {
  opacity: 1;
}

.image-viewer-overlay.image-viewer-closing {
  opacity: 0;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.image-viewer-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-content img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.image-viewer-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* 缩略图悬停效果 */
img[data-thumb] {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

img[data-thumb]:hover {
  opacity: 0.85;
}


/* 案例页查看原图按钮 */

@media (max-width: 720px) {
  .image-viewer-content {
    max-width: 96vw;
    max-height: 90vh;
  }

  .image-viewer-content img {
    max-width: 96vw;
    max-height: 90vh;
    border-radius: 8px;
  }

  .image-viewer-close {
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

/* ========== 首页 ========== */

body.page-home {
  min-height: 100vh;
  min-height: 100dvh;
}

body.page-home .app-shell {
  padding-top: 0;
}

.home-page {
  padding-top: 0;
}

/* ---- 轮播 ---- */

.home-hero {
  position: relative;
  z-index: 2;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  margin-bottom: 0;
  margin-top: 0;
}

.home-carousel-track {
  position: relative;
  overflow: hidden;
  margin-bottom: -1px;
}
.carousel-img {
  display: block;
  width: 100%;
  height: auto;
}
.carousel-img-desk { display: block; }
.carousel-img-mb { display: none; }
.carousel-img-both { display: block; }

/* ===== 通用广告位 ===== */
.ad-spot-section {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 0 24px;
  padding: 0;
}
.ad-spot-row {
  margin-bottom: 16px;
}
.ad-spot-item {
  overflow: hidden;
  border-radius: 12px;
}
.ad-spot-link {
  display: block;
}
.ad-spot-img-desk {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.ad-spot-img-mb {
  display: none;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.ad-spot-img-both {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
/* 大屏/平板：图片自然撑高 */
@media (min-width: 769px) {
  .carousel-slide:not(.active) {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
  }
  .carousel-slide.active {
    position: relative;
    inset: auto;
    display: block !important;
    opacity: 1;
    z-index: 1;
  }
}
/* 手机 */
@media (max-width: 768px) {
  .carousel-img-desk { display: none !important; }
  .carousel-img-mb { display: block !important; }
  .ad-spot-img-desk { display: none !important; }
  .ad-spot-img-mb { display: block !important; }
  /* 4列→2列，6列→3列 */
  .ad-spot-row--col4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ad-spot-row--col6 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .carousel-slide:not(.active) {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
  }
  .carousel-slide.active {
    position: relative;
    inset: auto;
    display: block !important;
    opacity: 1;
    z-index: 1;
  }
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1.8s ease;
  pointer-events: none;
  background: #0f172a;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
  animation: carouselZoomIn 8s ease forwards;
}

.carousel-slide:not(.active) {
  transform: scale(1.04);
}

@keyframes carouselZoomIn {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

/* 背景图片 */

.carousel-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 6s ease;
}



/* 轮播控制 */

.carousel-controls {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 10;
}
@media (max-width: 768px) {
  .carousel-controls {
    bottom: 18px;
  }
  .home-generate-section {
    margin-top: -150px;
  }
}

/* 进度条 */

.carousel-progress-track {
  display: none;
  width: 140px;
  height: 2px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}

.carousel-progress-fill {
  width: 0%;
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transition: width 5s linear;
}

.carousel-progress-fill.running {
  width: 100%;
}

/* 圆点行 */

.carousel-dots-row {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.carousel-dot.active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.25);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease;
  opacity: 0;
}

.home-hero:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover {
  background: rgba(255,255,255,0.28);
}

.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

/* ---- 生成表单卡片 ---- */

.home-generate-section {
  position: relative;
  z-index: 3;
  margin-top: -100px;
  margin-bottom: 56px;
  padding: 0 20px;
}

.home-generate-card {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 48px 36px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
}

.home-generate-header {
  text-align: center;
  margin-bottom: 28px;
}

.home-generate-header h2 {
  font-size: 28px;
  font-weight: 850;
  margin: 0 0 8px;
  background-image: linear-gradient(135deg, #a78bfa, #6366f1, #06b6d4, #00c5ef, #06b6d4, #6366f1, #a78bfa, #8b5cf6);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  line-height: 1.3;
  animation: titleFloat 6s ease-in-out infinite, titleShimmer 8s ease-in-out infinite;
}

.home-generate-header h2::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  margin: 0 auto 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  animation: barPulse 3s ease-in-out infinite;
}

.home-generate-header p {
  font-size: 14px;
  color: #9ca3af;
  margin: 0;
  animation: subtitleFade 4s ease-in-out infinite;
}

.home-generate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 800px;
  margin: 0 auto;
}

/* 输入框 + 按钮同行 */
.home-generate-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

/* 提示词输入区 */
.home-field-prompt {
  position: relative;
  flex: 1;
  min-width: 0;
}

.home-field-prompt textarea {
  width: 100%;
  min-height: 80px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  padding: 14px 20px 36px;
  font-size: 16px;
  line-height: 1.6;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
  outline: none;
}

.home-field-prompt textarea::placeholder {
  color: #a0aec0;
}

.home-field-prompt textarea:focus {
  border-color: #00c5ef;
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.1);
}

.home-field-prompt input {
  width: 100%;
  height: 54px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  padding: 0 20px;
  font-size: 16px;
  line-height: 54px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.home-field-prompt input::placeholder {
  color: #a0aec0;
}

.home-field-prompt input:focus {
  border-color: #00c5ef;
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.1);
}

.home-prompt-foot {
  position: absolute;
  right: 12px;
  bottom: 8px;
}

.home-prompt-counter {
  font-size: 12px;
  color: #9ca3af;
}

/* 快捷标签 */
.home-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-quick-tags button {
  padding: 6px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.home-quick-tags button:hover {
  border-color: #00c5ef;
  color: #00a0c4;
  background: rgba(0, 197, 239, 0.05);
}

/* 比例/张数行 */
.home-field-row {
  display: flex;
  gap: 12px;
}

.home-field {
  flex: 1;
  min-width: 0;
}

.home-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

.home-field select {
  width: 100%;
  height: 44px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.home-field select:focus {
  border-color: #00c5ef;
  box-shadow: 0 0 0 3px rgba(0, 197, 239, 0.1);
}

.home-generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  height: 54px;
  padding: 0 32px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.home-generate-btn svg {
  transition: transform 0.3s ease;
}

.home-generate-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.home-generate-btn:hover svg {
  transform: rotate(-10deg) scale(1.1);
}

.home-generate-btn:active {
  transform: translateY(0);
}

/* ---- AI 在线生图展示 ---- */

.home-ai-showcase {
  position: relative;
  z-index: 3;
  margin-top: -15px !important;
  margin-bottom: 30px;
  padding: 24px 12px 24px;
  background: linear-gradient(135deg, #f0f9ff 0%, #faf5ff 30%, #f0fdff 60%, #f5f9ff 100%);
  border-radius: 16px;
  box-shadow: 0 4px 0 0 rgba(0,0,0,0.02), 0 12px 0 -4px rgba(0,0,0,0.03), 0 20px 0 -8px rgba(0,0,0,0.02);
  overflow: hidden;
}
.home-ai-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(0,197,239,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 30%, rgba(99,102,241,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 80%, rgba(0,239,191,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.home-ai-showcase::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,197,239,0.2), rgba(99,102,241,0.2), transparent);
  pointer-events: none;
}

.ai-showcase-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  display: block;
  padding: 0 40px;
}

.ai-showcase-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.ai-showcase-form {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 900px;
  background: #fff;
  padding: 8px;
  border-radius: 16px;
  border: 1.5px solid rgba(0,197,239,0.15);
  box-shadow: 0 4px 40px rgba(0,197,239,0.08), 0 0 0 4px rgba(0,197,239,0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.ai-showcase-form:focus-within {
  border-color: rgba(0,197,239,0.4);
  box-shadow: 0 4px 50px rgba(0,197,239,0.15), 0 0 0 4px rgba(0,197,239,0.06);
}
.ai-showcase-form-title {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #00c5ef, #6366f1, #00d4aa);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleShimmer 4s ease-in-out infinite;
  white-space: nowrap;
  padding: 0 12px;
  flex-shrink: 0;
}

.ai-showcase-form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 16px;
  font-size: 16px;
  color: #0f172a;
  outline: none;
}
.ai-showcase-form input::placeholder {
  color: #94a3b8;
}

.ai-showcase-form button {
  border: none;
  background: linear-gradient(135deg, #00c5ef 0%, #6366f1 50%, #00d4aa 100%);
  background-size: 200% 200%;
  animation: btnShimmer 3s ease-in-out infinite;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  line-height: 1.2;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 24px rgba(0,197,239,0.3);
}
.ai-showcase-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,197,239,0.45);
}

@keyframes btnShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ai-showcase-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.ai-showcase-tags a {
  font-size: 12px;
  color: #475569;
  text-decoration: none;
  padding: 5px 12px;
  background: rgba(0,197,239,0.04);
  border: 1px solid rgba(0,197,239,0.12);
  border-radius: 20px;
  transition: all 0.2s ease;
}
.ai-showcase-tags a:hover {
  color: #0891b2;
  border-color: rgba(0,197,239,0.35);
  background: rgba(0,197,239,0.08);
}

@media (max-width: 900px) {
  .home-ai-showcase {
    margin-top: -10px !important;
    padding: 32px 12px 28px;
  }

  .ai-showcase-container {
    padding: 0 12px;
  }

  .ai-showcase-form {
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
  }

  .ai-showcase-form-title {
    font-size: 16px;
    padding: 0 8px;
  }

  .ai-showcase-form input {
    padding: 12px 12px;
    font-size: 14px;
  }

  .ai-showcase-form button {
    padding: 12px 20px;
    font-size: 14px;
  }
}

@media (max-width: 520px) {
  .ai-showcase-form {
    flex-wrap: wrap;
    gap: 8px;
  }

  .ai-showcase-form-title {
    font-size: 15px;
    padding: 0 8px;
  }

  .ai-showcase-form input {
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    font-size: 14px;
  }

  .ai-showcase-form button {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border-radius: 10px;
  }

  .ai-showcase-tags {
    gap: 6px;
  }
  .ai-showcase-tags a {
    font-size: 11px;
    padding: 4px 10px;
  }
}

/* ---- 功能特性 ---- */

.home-features {
  padding: 24px 0 48px;
  background: transparent;
  border: none;
  border-radius: 0;
}

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

.home-features-header h2 {
  font-size: 26px;
  font-weight: 750;
  background-image: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin: 0;
}

.home-features-header h2::before {
  display: none;
}

.home-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.home-feature-item {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  gap: 16px;
  padding: 24px 20px;
  border-radius: 16px;
  background: rgba(255,255,255,0.6);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  overflow: hidden;
}

.home-feature-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  background: linear-gradient(135deg, rgba(0, 197, 239, 0.04), rgba(0, 239, 191, 0.04));
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.home-feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 197, 239, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.home-feature-item:hover::after {
  opacity: 1;
}

.feature-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00c5ef, #00efbf);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 197, 239, 0.25);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-feature-item h3 {
  font-size: 16px;
  font-weight: 750;
  color: #1e1b4b;
  margin: 0 0 4px;
}

.home-feature-item p {
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
  margin: 0;
}

/* 序号角标 */
.home-feature-item .feature-num {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: rgba(0, 197, 239, 0.05);
  pointer-events: none;
}

/* ---- 精选案例展示 (AI平台画廊风格) ---- */

.home-cases {
  position: relative;
  padding: 48px 20px 24px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 16px;
  overflow: hidden;
}

/* 装饰光晕 */
.home-cases-glow {
  display: none;
}

.home-cases-header {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

.home-cases-header h2 {
  font-size: 30px;
  font-weight: 800;
  background-image: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.home-cases-header h2::before {
  display: none;
}

.home-cases-header p {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 16px;
  line-height: 1.6;
}

.home-cases-footer {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 28px auto 0;
  text-align: center;
}

.home-cases-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 9px 20px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  white-space: nowrap;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.home-cases-more:hover {
  background: linear-gradient(135deg, var(--primary), #00dfc7, #00efbf);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,197,239,0.3);
}

/* ====== 瀑布流容器 ====== */
.home-cases-masonry {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  column-count: 5;
  column-gap: 24px;
}

/* ====== 卡片主体 ====== */
.home-case-card {
  break-inside: avoid;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.6);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.35s cubic-bezier(0.22,1,0.36,1);
  opacity: 0;
  transform: translateY(24px);
  animation: caseFadeUp 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
}

@keyframes caseFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-case-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.1), 0 4px 16px rgba(0,197,239,0.12);
  z-index: 5;
}

/* ====== 图片区域 ====== */
.home-case-img {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f1f5f9;
  text-decoration: none;
  line-height: 0;
  cursor: pointer;
}

.home-case-img::before {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(0,197,239,0.03) 0%,
    rgba(0,239,191,0.03) 50%,
    rgba(0,197,239,0.03) 100%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.home-case-card:hover .home-case-img::before {
  opacity: 1;
}

/* 图片加载态 */
.home-case-img img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22,1,0.36,1),
              filter 0.7s ease;
  filter: brightness(0.96);
}

.home-case-img.loaded img {
  filter: brightness(1);
}

/* 图片加载骨架屏 */
.home-case-img:not(.loaded) img {
  min-height: 160px;
  background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.home-case-card:hover .home-case-img img {
  transform: scale(1.06);
}

/* 渐变遮罩 */
.home-case-gradient {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0.15) 45%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.home-case-card:hover .home-case-gradient {
  opacity: 1;
}

/* 底部彩色渐变条 */
.home-case-accent {
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #00dfc7, #00efbf);
  z-index: 3;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1);
}

.home-case-card:hover .home-case-accent {
  transform: scaleX(1);
}

/* ====== 同款创作按钮 ====== */
.home-case-remix {
  position: absolute;
  bottom: 6px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 10px;
  background: linear-gradient(135deg, var(--primary), #00dfc7, #00efbf);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  width: auto;
  z-index: 4;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0,197,239,0.2);
  transition: all 0.25s ease;
  pointer-events: auto;
  white-space: nowrap;
}

.home-case-remix:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 4px 20px rgba(0,197,239,0.4);
  transform: translateX(-50%) translateY(-1px);
}

/* ====== 卡片底部信息 ====== */
.home-case-foot {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.home-case-prompt {
  font-size: 13px;
  line-height: 1.55;
  color: #4b5563;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 无图片占位 */
.home-case-no-img {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  background: #f8fafc;
}

.home-case-no-img svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

/* ---- 底部 CTA ---- */

.home-cta {
  padding: 0 20px 24px;
}

.home-cta-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 36px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(135deg, #00c5ef 0%, #007a94 100%);
  color: #fff;
  box-shadow: 0 10px 32px rgba(0, 197, 239, 0.25);
}

.home-cta-card h2 {
  font-size: 22px;
  font-weight: 750;
  margin: 0 0 8px;
}

.home-cta-card p {
  font-size: 14px;
  opacity: 0.9;
  margin: 0 0 24px;
}

.home-cta-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-cta-actions .button.primary {
  border: 0;
  background: #fff;
  color: #007a94;
  font-weight: 700;
  padding: 0 24px;
  height: 42px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.home-cta-actions .button.secondary {
  border: 1.5px solid rgba(255,255,255,0.5);
  background: transparent;
  color: #fff;
  font-weight: 600;
  padding: 0 24px;
  height: 42px;
}

/* ---- 首页响应式 ---- */

@media (max-width: 1200px) {
  .home-cases-masonry {
    column-count: 4;
  }
}

@media (max-width: 860px) {
  .home-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .home-feature-item {
    padding: 28px 20px;
    gap: 14px;
  }

  .feature-icon {
    width: 48px;
    height: 48px;
  }

  .feature-icon svg {
    width: 24px;
    height: 24px;
  }

  .home-feature-item h3 {
    font-size: 15px;
  }

  .home-feature-item p {
    font-size: 12px;
  }

  .home-feature-item .feature-num {
    font-size: 30px;
    top: 8px;
    right: 12px;
  }

  .home-generate-card {
    padding: 32px 28px 28px;
  }

  .home-generate-header h2 {
    font-size: 24px;
  }

  .home-generate-form {
    max-width: 100%;
  }

  .home-field-prompt textarea {
    font-size: 14px;
  }

  .home-generate-btn {
    padding: 0 24px;
    font-size: 15px;
  }

  .home-cases-masonry {
    column-count: 3;
    column-gap: 16px;
  }

  .home-case-card {
    margin-bottom: 12px;
  }

  .home-cases-header {
    text-align: center;
  }
}

@media (max-width: 720px) {
  .home-page {
    padding-top: 0;
  }

  .carousel-arrow {
    display: none;
  }

  .carousel-controls {
    bottom: 18px;
    gap: 6px;
  }

  .home-generate-section {
    margin-top: -150px;
    padding: 0 12px;
  }

  .home-generate-card {
    padding: 24px 18px 22px;
    border-radius: 14px;
  }

  .home-generate-header h2 {
    font-size: 20px;
  }

  .home-generate-header p {
    font-size: 13px;
  }

  .home-generate-form {
    gap: 10px;
  }

  .home-generate-row {
    gap: 8px;
  }

  .home-field-prompt textarea {
    min-height: 50px;
    padding: 10px 12px 32px;
    font-size: 14px;
  }

  .home-field-prompt input {
    height: 50px;
    padding: 0 14px;
    font-size: 14px;
  }

  .home-generate-btn {
    height: auto;
    min-height: 50px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 10px;
  }

  .home-generate-btn svg {
    width: 16px;
    height: 16px;
  }

  .home-quick-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .home-quick-tags::-webkit-scrollbar {
    display: none;
  }

  .home-quick-tags button {
    flex-shrink: 0;
    font-size: 12px;
    padding: 5px 12px;
  }

  .home-field-row {
    gap: 8px;
  }

  .home-field label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .home-field select {
    height: 42px;
    font-size: 13px;
  }

  .home-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .home-feature-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    gap: 10px;
  }

  .feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .feature-icon svg {
    width: 24px;
    height: 24px;
  }

  .feature-body {
    align-items: center;
    gap: 2px;
  }

  .home-feature-item h3 {
    margin-bottom: 2px;
  }

  .home-feature-item .feature-num {
    right: 8px;
  }

  .home-features-header h2 {
    font-size: 22px;
  }

  .home-cta-card {
    padding: 28px 20px;
  }

  .home-cases-masonry {
    column-count: 2;
    column-gap: 14px;
  }

  .home-case-card {
    margin-bottom: 14px;
  }

  .home-case-foot {
    padding: 10px 12px;
    gap: 8px;
  }

  .home-case-prompt {
    font-size: 12px;
    -webkit-line-clamp: 1;
  }

  .home-cases-header h2 {
    font-size: 22px;
  }

  .home-cases-header p {
    font-size: 13px;
  }

  .home-case-remix {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 8px;
    bottom: 4px;
    left: 50%;
  }
}

@media (max-width: 480px) {
  .home-cases-masonry {
    column-count: 2;
    column-gap: 10px;
  }

  .home-case-card {
    margin-bottom: 8px;
    border-radius: 12px;
  }

  .home-case-foot {
    padding: 8px 10px;
    gap: 6px;
  }

  .home-case-prompt {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }

  .home-case-remix {
    padding: 3px 6px;
    font-size: 9px;
    border-radius: 6px;
    bottom: 3px;
    left: 50%;
  }
}


/* ============ 首页资讯信息 ============ */
.home-articles {
  position: relative;
  padding: 48px 20px 8px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 16px;
  overflow: hidden;
}
.home-articles-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 24px;
}
.home-articles-header h2 {
  font-size: 30px;
  font-weight: 800;
  background-image: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.home-articles-header h2::before {
  display: none;
}
.home-articles-header p {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 16px;
  line-height: 1.6;
}
.home-articles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
}
.home-article-card {
  position: relative;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: rgba(255,255,255,0.6);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  overflow: hidden;
}
.home-article-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  background: linear-gradient(135deg, rgba(0, 197, 239, 0.04), rgba(0, 239, 191, 0.04));
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.home-article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(167,139,250,0.2), 0 4px 12px rgba(0,0,0,0.15);
}
.home-article-card:hover::after {
  opacity: 1;
}
.home-article-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #f2f4f7;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.home-article-cover img {
  display: block;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  transition: transform 0.4s ease;
}
.home-article-card:hover .home-article-cover img {
  transform: scale(1.08);
}
.home-article-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ef6c00);
  line-height: 1.6;
  z-index: 1;
}
.home-article-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-article-text {
  margin: 0;
  text-align: center;
  line-height: 1.6;
  color: #4b5563;
}
.home-article-cat {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #00a8d6;
  background: #e0f7fd;
}
.home-article-title {
  font-size: 15px;
  font-weight: 600;
  color: #101828;
  margin: 0;
  line-height: 1.5;
}
.home-articles-footer {
  max-width: 1440px;
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
}
.home-articles-footer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-articles-footer-cats a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}
.home-articles-footer-cats a:hover {
  color: #101828;
  background: #fff;
  border-color: #d0d5dd;
}
.home-articles-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 9px 20px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  white-space: nowrap;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all .25s ease;
}
.home-articles-more:hover {
  background: linear-gradient(135deg, var(--primary), #00dfc7, #00efbf);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,197,239,0.3);
}

@media (max-width: 1100px) {
  .home-articles-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (max-width: 860px) {
  .home-articles-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 680px) {
  .home-articles { padding: 36px 16px 8px; }
  .home-articles-header { margin-bottom: 20px; }
  .home-articles-header h2 { font-size: 22px; }
  .home-articles-header p { font-size: 13px; }
  .home-articles-text-list { grid-template-columns: repeat(2, 1fr) !important; }
  .home-articles-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .home-article-card { border-radius: 12px; }
  .home-article-body { padding: 14px 14px 18px; }
  .home-article-title { font-size: 13px; }
}

/* ============ 广告位配置（Banner 管理） ============ */
body.page-admin .banner-add-form {
  grid-template-columns: 1fr;
  max-width: 640px;
}

/* 来源切换标签 */
.banner-source-tabs {
  display: flex;
  gap: 0;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  overflow: hidden;
}

.banner-source-tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: #f9fafb;
  color: #667085;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.banner-source-tab:first-child {
  border-right: 1px solid #d0d5dd;
}

.banner-source-tab:hover {
  background: #f0f2f5;
}

.banner-source-tab.active {
  background: #00b4d8;
  color: #fff;
}

/* 拖拽上传区 */
.banner-drop-zone {
  position: relative;
  border: 2px dashed #d0d5dd;
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  background: #fafbfc;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-drop-zone:hover {
  border-color: #00b4d8;
  background: #f0faff;
}

.banner-drop-zone.drag-over {
  border-color: #00b4d8;
  background: #e6f7fb;
  border-style: solid;
}

.banner-drop-zone-sm {
  padding: 24px 16px;
  min-height: 80px;
}

.banner-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #667085;
  pointer-events: none;
}

.banner-drop-inner svg {
  color: #98a2b3;
  margin-bottom: 2px;
}

.banner-drop-inner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.banner-drop-inner p.muted {
  font-size: 12px;
  color: #98a2b3;
}

.banner-drop-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.banner-file-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #00b4d8;
  text-align: center;
}

/* URL 预览 */
.banner-url-preview {
  margin-top: 4px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  max-height: 160px;
}

.banner-url-preview img {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  display: block;
}

/* 表单底部 */
.banner-form-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.banner-form-footer .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Banner 列表 ---------- */
body.page-admin .banner-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.page-admin .banner-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body.page-admin .banner-item:hover {
  border-color: #c3dee5;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
}

body.page-admin .banner-item.banner-disabled {
  opacity: 0.55;
  background: #f9fafb;
}

body.page-admin .banner-item-preview {
  flex-shrink: 0;
  width: 300px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f2f5;
}

body.page-admin .banner-item-preview img {
  width: 300px;
  height: auto;
  object-fit: contain;
}

body.page-admin .banner-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.page-admin .banner-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #5a7a82;
}

body.page-admin .banner-item-id {
  font-weight: 700;
  color: #003a47;
}

body.page-admin .banner-item-link {
  font-size: 12px;
  color: #5a7a82;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-admin .banner-item-link a {
  color: #00b4d8;
}

body.page-admin .banner-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

body.page-admin .banner-item-time {
  color: #8896a0;
  margin-left: auto;
}

/* ---------- 编辑弹窗 ---------- */
body.page-admin .banner-edit-dialog {
  border: none;
  border-radius: 12px;
  padding: 24px;
  max-width: 640px;
  width: 92vw;
  box-shadow: 0 20px 60px rgba(16, 24, 40, 0.18);
}

body.page-admin .banner-edit-dialog::backdrop {
  background: rgba(16, 24, 40, 0.35);
}

body.page-admin .banner-edit-dialog .card {
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

body.page-admin .banner-edit-dialog .card-head {
  margin-bottom: 16px;
}

body.page-admin .banner-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #667085;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

body.page-admin .banner-dialog-close:hover {
  background: #f0f2f5;
  color: #101828;
}

/* 编辑预览 */
.banner-edit-preview {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  margin-bottom: 4px;
}

.banner-edit-preview img {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  display: block;
}

body.page-admin .banner-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ---------- 轮播链接 ---------- */
.carousel-link {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  body.page-admin .banner-item {
    flex-direction: column;
  }

  body.page-admin .banner-item-preview {
    width: 100%;
    height: 100px;
  }

  body.page-admin .banner-add-form {
    max-width: 100%;
  }

  body.page-admin .banner-edit-dialog {
    padding: 16px;
  }
}

/* 后台布局样式已独立到 /assets/css/admin.css */

/* ===== 前台悬浮客服 ===== */

.kf-float {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 9999;
}

.kf-float-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 197, 239, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.kf-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 197, 239, 0.45);
}

.kf-float-btn.kf-active {
  background: linear-gradient(135deg, #00efbf 0%, #00c5ef 100%);
}

.kf-float-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
  overflow: hidden;
}

.kf-float-panel.kf-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.kf-float-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #00c5ef 0%, #00efbf 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.kf-float-panel-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.kf-float-panel-close:hover {
  opacity: 1;
}

.kf-float-panel-body {
  padding: 20px;
  text-align: center;
}

.kf-qrcode img {
  max-width: 180px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.kf-qrcode p {
  margin: 10px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.kf-wechat-id {
  margin-top: 14px;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.kf-wechat-id-label {
  font-size: 13px;
  color: #9ca3af;
}

.kf-wechat-id-value {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  user-select: all;
  transition: color 0.2s;
}

.kf-wechat-id-value:hover {
  color: #00c5ef;
}

.kf-other-contact {
  margin-top: 14px;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kf-other-contact-label {
  font-size: 13px;
  color: #9ca3af;
}

.kf-other-contact-value {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

@media (max-width: 640px) {
  .kf-float {
    right: 12px;
    bottom: 70px;
  }

  .kf-float-btn {
    width: 46px;
    height: 46px;
  }

  .kf-float-btn svg {
    width: 22px;
    height: 22px;
  }

  .kf-float-panel {
    width: 260px;
    right: -4px;
  }
}

/* ===== 弹窗（modal）公共样式 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active {
  display: flex;
}
.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ========== 好图克隆弹窗 ========== */
.clone-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 7px;
  margin-left: 0;
  border: none;
  border-radius: 5px;
  background: linear-gradient(135deg, #f5b014, #f9862e);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1;
  box-shadow: none;
}
.clone-btn svg { width: 11px; height: 11px; opacity: 0.85; }
.clone-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  transform: none;
}
.clone-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 2px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
  position: relative;
  user-select: none;
  vertical-align: middle;
}
.clone-hint-icon::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
.clone-hint-icon::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(30, 41, 59, 0.88);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.clone-hint-icon:hover::before,
.clone-hint-icon:hover::after,
.clone-hint-icon.show::before,
.clone-hint-icon.show::after {
  opacity: 1;
}

.clone-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.clone-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.clone-dialog { position: relative; width: 560px; max-width: 92vw; max-height: 90vh; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.15); overflow: hidden; display: flex; flex-direction: column; }
.clone-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #f0f0f0; }
.clone-dialog-head h3 { margin: 0; font-size: 16px; font-weight: 650; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.clone-dialog-close { width: 32px; height: 32px; border: none; background: none; font-size: 22px; color: #94a3b8; cursor: pointer; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.clone-dialog-close:hover { background: #f1f5f9; color: #475569; }
.clone-dialog-body { padding: 22px; overflow-y: auto; }

.clone-hint { margin: 0 0 14px; font-size: 13px; color: #64748b; }

.clone-upload-area { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; border: 2px dashed #d0d5dd; border-radius: 12px; cursor: pointer; transition: all .2s; }
.clone-upload-area:hover { border-color: #00d6a5; background: rgba(0,214,165,.04); }
.clone-upload-area p { margin: 0; font-size: 14px; color: #475569; font-weight: 500; }
.clone-upload-area span { font-size: 12px; color: #94a3b8; }
.clone-upload-area.dragover { border-color: #00d6a5; background: rgba(0,214,165,.08); }

.clone-preview-area { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid #e4e7ec; }
.clone-preview-area img { display: block; width: 100%; max-height: 300px; object-fit: contain; background: #f8fafc; }
.clone-preview-remove { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: none; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.clone-error { margin: 10px 0 0; font-size: 13px; color: #ef4444; }

.clone-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 0; }
.clone-loading-spinner { width: 36px; height: 36px; border: 3px solid #e4e7ec; border-top-color: #00d6a5; border-radius: 50%; animation: clone-spin .7s linear infinite; }
@keyframes clone-spin { to { transform: rotate(360deg); } }
.clone-loading p { margin: 0; font-size: 14px; color: #64748b; }

.clone-result-box { border: 1px solid #e4e7ec; border-radius: 10px; background: #fafbfc; padding: 16px; }
.clone-result-label { font-size: 12px; color: #94a3b8; margin-bottom: 8px; font-weight: 500; }
.clone-result-text { font-size: 14px; color: #1e293b; line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow-y: auto; }
.clone-result-actions { display: flex; gap: 10px; margin-top: 14px; }
.clone-btn-use {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #00a5c4, #00d6a5); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.clone-btn-use:hover { box-shadow: 0 4px 16px rgba(0,197,239,.35); transform: translateY(-1px); }
.clone-btn-retry {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: 1px solid #d0d5dd; border-radius: 8px;
  background: #fff; color: #475569; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.clone-btn-retry:hover { border-color: #94a3b8; background: #f8fafc; }

@media (max-width: 600px) {
  .clone-dialog { width: 94vw; }
  .clone-dialog-body { padding: 16px; }
  .clone-upload-area { padding: 24px 16px; }
}
