/* ================================
   占位图片生成器 - 自定义样式
   配色与 Leowh 主页统一
   ================================ */

:root {
  --bg: #FAFAF9;
  --bg-alt: #F5F5F4;
  --surface: #FFFFFF;
  --border: #E7E5E4;
  --border-strong: #D6D3D1;
  --text: #1E293B;
  --text-secondary: #52525B;
  --text-muted: #71717A;
  --primary: #6B7280;
  --primary-hover: #4B5563;
  --primary-light: rgba(107, 114, 128, 0.08);
  --secondary: #64748B;
  --accent: #EC4899;
  --success: #059669;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Toast ── */
.toast {
  position: fixed; top: 24px; right: 24px;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 100px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  z-index: 1000;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.toast.show { transform: translateX(0); }
.toast-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; }

/* ── Page ── */
.page { max-width: 960px; margin: 0 auto; padding: 0 32px; }

/* ── Header scroll effect ── */
#header.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

/* ── Generator ── */
.generator-section { padding: 24px 0 32px; }

.generator-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.panel-title { font-size: 16px; font-weight: 700; color: var(--text); }
.panel-body { padding: 20px; }

.form-group {
  margin-bottom: 16px;
}
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.color-row {
  display: flex; gap: 8px; align-items: center;
}
.color-input {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
}

.input-field {
  flex: 1; min-width: 0;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit; font-size: 15px; color: var(--text);
  transition: all 0.2s ease;
  outline: none;
}
.input-field:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(107,114,128,0.1);
}
.input-field::placeholder { color: #9CA3AF; }
.input-field--mono { font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace; font-size: 13px; }
.input-field--sm { padding: 9px 12px; font-size: 14px; }
.input-field--xs { padding: 9px 12px; font-size: 14px; max-width: 120px; }

.select-field {
  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='%2371717A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Preview Panel ── */
.preview-panel { display: flex; flex-direction: column; gap: 16px; }

.preview-body { text-align: center; }
.preview-frame {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 16px;
  overflow: auto;
}
.preview-info { margin-top: 10px; }
.preview-size { font-size: 13px; color: var(--text-muted); font-family: 'SF Mono', 'Cascadia Code', monospace; }

.action-row {
  display: flex; gap: 12px;
}

.btn-download {
  padding: 10px 24px;
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: 100px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: white; cursor: pointer;
  transition: all 0.15s ease;
}
.btn-download:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(0,0,0,0.10); transform: translateY(-1px); }

.btn-copy-url {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.15s ease;
}
.btn-copy-url:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.url-output {
  display: flex; gap: 8px; margin-top: 0;
}
.btn-copy-sm {
  padding: 8px 16px;
  background: var(--primary);
  border: none;
  border-radius: 100px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  color: white; cursor: pointer;
}
.btn-copy-sm:hover { background: var(--primary-hover); }

/* ── Footer ── */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--text-muted);
}
.footer-sep { margin: 0 8px; color: var(--border-strong); }

/* ══════════════════════════════════════════
   Custom scrollbar
   ══════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #A5B4FC; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4F46E5; }

::selection { background: rgba(107, 114, 128, 0.2); color: #1E293B; }

/* ══════════════════════════════════════════
   Guide Section (accordion)
   ══════════════════════════════════════════ */
.guide-section {
  margin-top: 16px;
  margin-bottom: 64px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.guide-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.guide-toggle:hover { background: var(--bg-alt); }
.guide-toggle-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1E293B;
}
.guide-toggle.open .toggle-arrow { transform: rotate(180deg); }
.toggle-arrow {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.guide-list { padding: 0 20px 20px; }
.guide-list.hidden { display: none; }
.guide-item { padding: 16px 0; border-top: 1px solid var(--border); }
.guide-item:first-child { border-top: 1px solid var(--border); }
.guide-item-title { font-size: 14px; font-weight: 600; color: #1E293B; margin-bottom: 6px; }
.guide-item-body { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.guide-item-body kbd {
  padding: 1px 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .page { padding: 0 16px; }
  .generator-grid { grid-template-columns: 1fr; }
  .preview-frame { min-height: 140px; }
}
