/* ────────────────────────────────────────────
   Image to Prompt — Frontend Styles
   配色: #f5f4f0 (canvas) · #1a1917 (ink) · #e85d3a (coral)
   字体: DM Sans · DM Mono
   ──────────────────────────────────────────── */

/* ── Base reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: "DM Sans", system-ui, sans-serif;
  background-color: #f5f4f0;
  color: #1a1917;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background: #f5f4f0;
}

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f5f4f0; }
::-webkit-scrollbar-thumb { background: #d0c9be; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b8b2aa; }

/* ── Focus rings ─────────────────────────────── */
*:focus-visible {
  outline: 2px solid #e85d3a;
  outline-offset: 2px;
}

/* ── Alpine cloak ────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── Fonts ───────────────────────────────────── */
code, pre, kbd, samp,
.font-mono, [class*="font-mono"] {
  font-family: "DM Mono", ui-monospace, monospace;
}

/* ── Typography ──────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: "DM Sans", sans-serif;
  color: #1a1917;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── WordPress login override ────────────────── */
body.login { background-color: #f5f4f0 !important; }
body.login #login h1 a {
  background-image: none;
  color: #e85d3a;
  font-size: 1.25rem;
  text-indent: 0;
  width: auto;
  height: auto;
  font-family: "DM Sans", sans-serif;
}
body.login #loginform,
body.login #lostpasswordform,
body.login #registerform {
  background: #ffffff;
  border: 1px solid #e8e3da;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(26,25,23,.06);
}
body.login input[type="text"],
body.login input[type="password"],
body.login input[type="email"] {
  background: #faf8f5;
  border: 1px solid #e8e3da;
  color: #1a1917;
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
}
body.login input[type="submit"] {
  background: #e85d3a;
  border-color: #e85d3a;
  border-radius: 8px;
  box-shadow: none;
  text-shadow: none;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
}
body.login input[type="submit"]:hover { background: #d14e2c; border-color: #d14e2c; }
body.login #nav a, body.login #backtoblog a { color: #857f79; }

/* ── Line clamp ──────────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Prompt block ────────────────────────────── */
.prompt-block {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
  color: #3d3a36;
}

/* ── Upload drop zone ────────────────────────── */
#drop-zone {
  transition: border-color .2s, background-color .2s;
}
#drop-zone.dragging {
  border-color: #e85d3a !important;
  background-color: #fdf0ec !important;
}

/* ── Animations ──────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.animate-spin { animation: spin 0.75s linear infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .22s ease both; }

/* ── Toast notifications ─────────────────────── */
#itp-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.itp-toast-item {
  background: #1a1917;
  border: 1px solid #3d3a36;
  color: #f5f4f0;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-family: "DM Sans", sans-serif;
  pointer-events: auto;
  animation: fadeUp 0.2s ease;
  box-shadow: 0 8px 24px rgba(26,25,23,.18);
}
.itp-toast-item.success { border-color: #6ab187; color: #6ab187; }
.itp-toast-item.error   { border-color: #e85d3a; color: #e85d3a; }

/* ── Card hover lift ─────────────────────────── */
.card-lift {
  transition: transform .2s ease, box-shadow .2s ease;
}
.card-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(26,25,23,.08);
}

/* ── Gradient text ───────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #e85d3a, #f5a623);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Stat value mono ─────────────────────────── */
.stat-value {
  font-family: "DM Mono", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ── Remove WordPress block editor styles ────── */
.wp-block-library, .wp-block-library-theme { display: none !important; }
