/* ============================================================
   超级封面王 · 样式
   设计语言:「创作工作室」编辑感 — 暖米白底 / 墨黑大字 /
   电光蓝主色 / 警示橙点缀 / 细点阵纹理 / 无磨砂玻璃
   ============================================================ */
:root {
  --bg: #f7f5f0;
  --bg-dot: rgba(17, 18, 20, 0.05);
  --surface: #fffdf9;
  --surface-2: #faf8f3;
  --line: #e6e2d9;
  --line-strong: #d8d3c8;
  --ink: #111214;
  --ink-2: #5a5c63;
  --ink-3: #9a9ca4;
  --blue: #1855a5;
  --blue-deep: #0c3d7c;
  --blue-soft: #e7eff9;
  --orange: #ff5a1f;
  --orange-soft: #ffe9df;
  --green: #0f6e56;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 18, 20, 0.04), 0 12px 32px -16px rgba(17, 18, 20, 0.14);
  --shadow-lg: 0 2px 4px rgba(17, 18, 20, 0.05), 0 24px 48px -20px rgba(17, 18, 20, 0.22);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* 品牌字体:站酷庆科黄油体(本地自托管) */
@font-face {
  font-family: "ZCOOL QingKe HuangYou";
  src: url("/assets/fonts/zcool-qingke-huangyou.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background:
    radial-gradient(var(--bg-dot) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 桌面端:隐藏系统光标,使用自定义圆点 */
@media (hover: hover) and (pointer: fine) {
  body, a, button, .chip, .switch, .cover-card { cursor: none; }
  textarea, input { cursor: text; }
}
::selection { background: var(--blue); color: #fff; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* ---------- 自定义光标 ---------- */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--blue);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.18s ease, height 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  opacity: 0;
  mix-blend-mode: multiply;
}
.cursor-dot.on { opacity: 1; }
.cursor-dot.hover {
  width: 34px; height: 34px;
  background: transparent;
  border: 2px solid var(--blue);
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot { display: none; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 240, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}
.brand:hover .brand-dot {
  transform: scale(1.6);
  background: var(--blue);
  box-shadow: 0 0 0 5px var(--blue-soft);
}
.brand-name {
  font-family: "ZCOOL QingKe HuangYou", "PingFang SC", sans-serif;
  font-size: 23px;
  line-height: 1;
  letter-spacing: 0.03em;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s;
}
.brand:hover .brand-name { transform: translateY(-1px); color: var(--blue); }
.brand-en {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-badge {
  font-size: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 600;
}
.topbar-link {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1.5px solid var(--orange);
  padding-bottom: 2px;
  transition: color 0.2s;
}
.topbar-link:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 56px; }
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 26px;
}
.hero-title {
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.14;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.hero-line { display: block; }
.hero-line-accent {
  position: relative;
  color: var(--blue);
}
.hero-underline {
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.14em;
  background: var(--orange);
  transform-origin: left;
  border-radius: 99px;
  animation: underlineDraw 0.9s 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes underlineDraw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero-sub {
  margin-top: 26px;
  font-size: 16px;
  color: var(--ink-2);
  max-width: 560px;
}

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.section-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--orange);
  background: var(--orange-soft);
  padding: 2px 8px;
  border-radius: 6px;
}
.section-hint { font-size: 12.5px; color: var(--ink-3); }

/* ---------- 灵感画廊 ---------- */
.gallery { padding: 8px 0 64px; }
.gallery-viewport {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 0 2px;
}
.gallery-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 8px 28px 16px;
  cursor: grab;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.dragging { cursor: grabbing; scroll-snap-type: none; }

.cover-card {
  flex: 0 0 auto;
  width: 196px;
  scroll-snap-align: start;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
  user-select: none;
}
.cover-card:hover {
  transform: translateY(-6px) rotate(-0.6deg);
  box-shadow: var(--shadow-lg);
}
.cover-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.gallery-fade {
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  pointer-events: none;
  z-index: 2;
}
.gallery-fade.left { left: 0; background: linear-gradient(to right, var(--bg) 0%, transparent 100%); }
.gallery-fade.right { right: 0; background: linear-gradient(to left, var(--bg) 0%, transparent 100%); }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-58%);
  z-index: 3;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.gallery-arrow:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-58%) scale(1.06); }
.gallery-arrow.left { left: 4px; }
.gallery-arrow.right { right: 4px; }

.gallery-progress {
  margin-top: 6px;
  height: 3px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.gallery-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 99px;
  transition: width 0.15s linear;
}

/* ---------- 生成器布局 ---------- */
.builder { padding: 0 0 80px; }
.builder-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 24px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 20px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.input-wrap { position: relative; }
#contentInput {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 54px 14px 16px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface-2);
  resize: vertical;
  min-height: 92px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#contentInput::placeholder { color: var(--ink-3); }
#contentInput:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24, 85, 165, 0.1);
  background: var(--surface);
}
.clear-btn {
  position: absolute;
  top: 12px; right: 12px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
}
.clear-btn:hover { color: var(--ink-2); background: rgba(17, 18, 20, 0.05); }

/* ---------- 选项 ---------- */
.random-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
}
.random-btn:hover {
  color: var(--orange);
  border-color: var(--orange);
  background: var(--orange-soft);
  transform: translateY(-1px);
}

.opt-grid { display: grid; gap: 18px; }
.opt-group { display: flex; flex-direction: column; gap: 9px; }
.opt-title { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.02em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 13px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1.3;
}
.chip .chip-ratio { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.chip:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}
.chip.active .chip-ratio { color: rgba(255, 255, 255, 0.66); }
.chip.active:hover { border-color: var(--blue); background: var(--blue); }

/* 照片开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch-track {
  width: 42px; height: 24px;
  border-radius: 99px;
  background: var(--line-strong);
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch-label { font-size: 13px; color: var(--ink-2); }

/* ---------- 生成按钮 ---------- */
.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  padding: 15px 24px;
  border-radius: 14px;
  margin-top: 24px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.generate-btn:hover { background: var(--blue); box-shadow: 0 10px 24px -8px rgba(24, 85, 165, 0.5); transform: translateY(-1px); }
.generate-btn:active { transform: translateY(0) scale(0.995); }
.generate-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.generate-btn .btn-arrow { display: inline-flex; transition: transform 0.2s; }
.generate-btn:hover .btn-arrow { transform: translateX(4px); }
.generate-btn.loading .btn-arrow svg { animation: arrowSlide 0.9s ease-in-out infinite; }
@keyframes arrowSlide {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* ---------- 输出面板 ---------- */
.output-panel { min-height: 520px; position: relative; }
.result-actions { display: flex; gap: 8px; }
.ghost-btn, .copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 99px;
  cursor: pointer;
  padding: 8px 16px;
  transition: all 0.18s;
}
.ghost-btn {
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
}
.ghost-btn:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.copy-btn {
  border: none;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.copy-btn:hover { background: var(--blue-deep); transform: translateY(-1px); }
.copy-btn.copied { background: var(--green); }

.output-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 380px;
  color: var(--ink-3);
  padding: 20px;
}
.output-empty-title { font-size: 14px; color: var(--ink-3); line-height: 1.9; }
.output-empty-title b { color: var(--ink-2); font-weight: 600; }

.result-meta {
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.result-meta .badge {
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 99px;
}

.blocks { display: grid; gap: 10px; }
.block {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  opacity: 0;
  transform: translateY(10px);
  animation: blockIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes blockIn { to { opacity: 1; transform: translateY(0); } }
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.block-head:hover { background: var(--surface-2); }
.block-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.block-idx {
  width: 21px; height: 21px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: var(--mono);
}
.block-body {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
}
.block-copy {
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
}
.block-copy:hover { color: var(--blue); background: var(--blue-soft); }

.guide {
  margin-top: 18px;
  padding: 15px 17px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 13px;
  line-height: 1.8;
  border: 1px solid rgba(24, 85, 165, 0.14);
}
.guide b { font-weight: 700; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand { font-size: 16px; font-weight: 800; }
.footer-en { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-3); margin-left: 8px; }
.footer-note { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.footer-tip { font-size: 13px; color: var(--ink-2); font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 滚动显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-underline { animation: none; }
}

/* ---------- 移动端 ---------- */
.mobile-only { display: none; }
@media (max-width: 900px) {
  .builder-grid { grid-template-columns: 1fr; }
  .output-panel { min-height: 320px; }
  .gallery-track { padding-left: 18px; padding-right: 18px; }
  .cover-card { width: 168px; }
  .gallery-arrow { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 56px 0 40px; }
  .brand-en, .topbar-badge { display: none; }
  .panel { padding: 20px 16px; }
  .section-head { flex-wrap: wrap; gap: 8px; }
  .chips { gap: 7px; }
  .chip { padding: 6px 11px; font-size: 12.5px; }
  .output-empty { min-height: 300px; }
  .mobile-only { display: inline; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
