/* FigGen 全站样式 */

:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #ff2442;
  --primary-hover: #fa6c7f;
  --success: #22c55e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --bs-primary: #ff2442;
  --bs-primary-rgb: 255, 36, 66;
  --bs-link-color: #ff2442;
  --bs-link-hover-color: #fa6c7f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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


a:hover {
  text-decoration: none;
}

/* Keep btn-check radio style on brand primary color */
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.text-muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6b8a, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.btn-ghost:hover {
  background: var(--bg);
  text-decoration: none;
}

/* Cards grid */
.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .cards-row {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  position: relative;
}

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
}

.card-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff0f3;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.credit-num {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.card-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.api-mask {
  font-family: ui-monospace, monospace;
  font-size: 15px;
  word-break: break-all;
}

.btn-copy {
  margin-top: 12px;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
}

.btn-copy:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Section */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.section-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 22px;
  margin-bottom: 20px;
}

label.field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

textarea.input-text {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
}

textarea.input-text:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.12);
}

.ratio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.ratio-opt {
  cursor: pointer;
}

.ratio-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ratio-pill {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  background: var(--card);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ratio-opt input:checked + .ratio-pill {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff0f3;
  font-weight: 500;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hint-balance {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* History */
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.history-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
  font-size: 18px;
}

.icon-btn:hover {
  color: var(--text);
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form input[type="search"] {
  width: 200px;
  max-width: 50vw;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.list {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
}

.list-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.list-item:last-child {
  border-bottom: none;
}

.list-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.status-dot .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.status-failed .dot {
  background: #ef4444;
}

.status-pending .dot {
  background: #eab308;
}

.link-view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  white-space: nowrap;
}

/* Messages */
.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.messages li {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.messages .success {
  background: #ecfdf5;
  color: #047857;
}

.messages .error {
  background: #fef2f2;
  color: #b91c1c;
}

.messages .warning {
  background: #fffbeb;
  color: #b45309;
}

/* Auth pages */
.auth-wrap {
  max-width: 400px;
  margin: 48px auto;
  padding: 0 16px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 28px;
}

.auth-card h1 {
  margin: 0 0 20px;
  font-size: 1.25rem;
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--muted);
}

.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.btn-auth-primary {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.warn-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* 快速生成 — API 结果预览（位于文案输入框上方） */
.gen-api-error {
  display: none;
  background: #fef2f2;
  color: #b91c1c;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}

.gen-api-error.is-visible {
  display: block;
}

.gen-preview-block {
  display: none;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.gen-preview-block.is-visible {
  display: block;
}

.gen-success-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #047857;
}

.gen-success-banner .check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.gen-success-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 4px;
}

.gen-preview-img {
  width: 100%;
  height: auto;
  object-fit: fill;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  display: block;
}

.gen-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gen-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-download:hover {
  background: var(--primary-hover);
}

.btn-outline-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline-new:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.gen-task-id {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 0;
}

.btn-primary.is-loading {
  position: relative;
  color: transparent;
}

.btn-primary.is-loading::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gen-spin 0.7s linear infinite;
}

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

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.panel-head-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.quick-gen-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.4rem;
  color: var(--primary);
  background: rgba(255, 36, 66, 0.08);
  border: 1px solid rgba(255, 36, 66, 0.28);
  border-radius: 0.75rem;
  line-height: 1;
  flex: 0 0 auto;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.history-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-search-input {
  min-width: 240px;
  border-radius: 10px;
  border-color: #e2e8f0;
  background: #f8fafc;
}

.history-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(255, 36, 66, 0.12);
  background: #fff;
}

.history-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 80px;
  white-space: nowrap;
  border-radius: 10px;
  padding-inline: 12px;
}

@media (max-width: 576px) {
  .history-search-form {
    width: 100%;
  }

  .history-search-input {
    min-width: 0;
    flex: 1 1 auto;
  }
}

.dashboard-lead {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 20px;
}

/* 首页顶部参考样式（从 home.html 内联迁移） */
.hero-reference-wrap {
  background: linear-gradient(180deg, #fff 0%, #fff7fb 100%);
}

.hero-main-title {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-main-title .accent {
  color: var(--primary);
}

.hero-dot-tip {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.95rem;
}

.hero-code-card {
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #e2e8f0;
  border: none;
}

.hero-preview-card {
  border-radius: 20px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
  background: #fff;
}

.hero-preview-accent-1,
.hero-preview-accent-2 {
  position: absolute;
  border-radius: 14px;
  transform: rotate(-8deg);
  z-index: 0;
}

.hero-preview-accent-1 {
  width: 92px;
  height: 92px;
  background: #fda4af;
  top: -16px;
  right: 48px;
}

.hero-preview-accent-2 {
  width: 86px;
  height: 86px;
  background: #fecdd3;
  bottom: -18px;
  right: -10px;
}

.hero-preview-inner {
  position: relative;
  z-index: 1;
}

.hero-mock-cover {
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 14px;
}

.hero-cover-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.hero-cover-item {
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: linear-gradient(160deg, #cbd5e1, #94a3b8);
}

.hero-nav-center .nav-link {
  font-weight: 500;
  color: #334155;
}

.hero-nav-center .nav-link:hover {
  color: #0f172a;
}

/* Landing Page v2 */
.landing-home {
  background: #fff;
}

.landing-nav .nav-link {
  color: #475569;
  font-weight: 500;
}

.landing-nav .nav-link:hover {
  color: var(--primary);
}

.landing-hero {
  background: linear-gradient(180deg, #fff 0%, #fae3e7 100%);
}

.landing-tip {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.landing-title {
  font-size: clamp(2rem, 4.1vw, 3.2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.landing-subtitle {
  color: #64748b;
  font-size: 1.05rem;
}

.landing-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  color: #fff;
  background: var(--primary);
  border-radius: 0.5rem;
}

.landing-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.landing-code {
  background: #111827;
  color: #e2e8f0;
  border-radius: 14px;
}

.landing-preview {
  border-radius: 16px;
}

.landing-preview-image {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: block;
}

.landing-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.landing-preview-item {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: linear-gradient(155deg, #fecdd3, #fda4af);
}

.landing-snippet {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #0f172a;
  color: #cbd5e1;
  padding: 14px 16px;
}

.landing-snippet code {
  color: inherit;
}


.pricing-card {
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.pricing-card:hover {
  transform: translateY(-6px);
  border-color: #ff2442;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.pricing-card-featured:hover {
  box-shadow: 0 16px 36px rgba(255, 36, 66, 0.2);
}

.pricing-discount-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}
