/* 墨韵 AI — 样式 */
:root {
  --paper: #f6f1e6;
  --paper-2: #fbf7ee;
  --ink: #1d1c1a;
  --ink-2: #4a4741;
  --ink-3: #7d786e;
  --line: #ddd4c2;
  --seal: #a8322d;
  --gold: #b08d57;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 28, 26, .04), 0 12px 32px -12px rgba(29, 28, 26, .18);
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 15% -10%, rgba(255, 255, 255, .9), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(176, 141, 87, .08), transparent 60%);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.skip {
  position: absolute; left: -9999px; top: 0; padding: 10px 16px;
  background: var(--ink); color: var(--paper); z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(18px, 4vw, 44px);
  background: rgba(246, 241, 230, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(221, 212, 194, .7);
}

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); }

.brand-seal {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--seal); color: #fbeee6;
  font-family: var(--serif); font-size: 19px; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

.brand-text { font-size: 18px; letter-spacing: .06em; }
.brand-text em { font-style: normal; color: var(--seal); font-size: 12px; letter-spacing: .16em; }

.nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; color: var(--ink-2); }
.nav a { position: relative; padding: 4px 0; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--seal); transition: right .25s ease;
}
.nav a:hover::after { right: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: .02em;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s;
  background: none; color: inherit; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-primary {
  background: var(--ink); color: #f8f3e8;
  box-shadow: 0 8px 20px -10px rgba(29, 28, 26, .8);
  position: relative; overflow: hidden;
}
.btn-primary:hover { background: #000; box-shadow: 0 12px 26px -10px rgba(29, 28, 26, .9); }
.btn-primary[disabled] { opacity: .75; cursor: progress; }

.btn-ghost { border-color: var(--line); color: var(--ink-2); background: rgba(255, 255, 255, .5); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); background: #fff; }

/* 研磨动画 */
.btn-ink {
  width: 0; height: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .5), transparent 70%);
  transition: width .4s, height .4s;
}
.is-loading .btn-ink { width: 16px; height: 16px; animation: pulse 1.1s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }

/* ---------- 首屏 ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(48px, 7vw, 92px) clamp(18px, 4vw, 44px) clamp(26px, 4vw, 44px);
  text-align: center;
}

.eyebrow {
  font-size: 12px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 18px;
}
.eyebrow::before, .eyebrow::after { content: "·"; margin: 0 10px; opacity: .6; }

.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 5.2vw, 56px); line-height: 1.28;
  letter-spacing: .03em; margin: 0 0 18px;
}

.lede {
  max-width: 34em; margin: 0 auto; color: var(--ink-2);
  font-size: clamp(14px, 1.5vw, 16px);
}

/* ---------- 工作台 ---------- */
.studio {
  max-width: var(--max); margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 44px) clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 24px;
  align-items: start;
}

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  position: sticky; top: 84px;
}

.field { margin-bottom: 20px; }
.field-label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; letter-spacing: .18em; color: var(--ink-3);
  margin-bottom: 10px;
}
.field-label b { color: var(--seal); font-weight: 500; letter-spacing: .1em; }
.hint { font-size: 11px; letter-spacing: .05em; color: var(--ink-3); opacity: .7; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .6);
  font-family: var(--sans); font-size: 13px; color: var(--ink-2);
  cursor: pointer; transition: all .16s ease;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-on {
  background: var(--ink); border-color: var(--ink); color: #f8f3e8;
  box-shadow: 0 6px 14px -8px rgba(29, 28, 26, .9);
}
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12) inset; }
.chip.is-on i { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }

.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2px; border-radius: 2px; background: var(--line); outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--paper-2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: pointer;
}
.range::-moz-range-thumb {
  width: 16px; height: 16px; border: 3px solid var(--paper-2); border-radius: 50%;
  background: var(--ink); cursor: pointer;
}

.text-input {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-family: var(--sans); font-size: 14px; color: var(--ink);
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.text-input::placeholder { color: #b9b2a4; }
.text-input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(29, 28, 26, .06); }

.actions { display: flex; gap: 10px; margin: 26px 0 12px; }
.actions .btn-primary { flex: 1; }
.actions .btn-ghost { padding-inline: 14px; }

.quota { margin: 0; font-size: 12px; color: var(--ink-3); text-align: center; letter-spacing: .04em; }

/* ---------- 舞台 ---------- */
.stage {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 560px;
  display: flex; flex-direction: column;
}

.stage-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  font-size: 13px; letter-spacing: .1em; color: var(--ink-2);
}
.stage-badge {
  font-size: 11px; letter-spacing: .08em; padding: 3px 10px; border-radius: 999px;
  background: rgba(176, 141, 87, .14); color: #8a6c3d; border: 1px solid rgba(176, 141, 87, .3);
}

.canvas { flex: 1; padding: 20px; display: flex; }

.placeholder {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center; color: var(--ink-3); font-size: 14px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: repeating-linear-gradient(135deg, rgba(0,0,0,.012) 0 10px, transparent 10px 20px);
  padding: 32px;
}
.placeholder small { display: inline-block; margin-top: 8px; font-size: 12px; opacity: .8; }

.placeholder-art {
  width: 96px; height: 132px; border-radius: 8px;
  background:
    radial-gradient(circle at 68% 24%, #fff 0 12%, transparent 13%),
    linear-gradient(160deg, #efe8d8 0%, #e3dbc9 45%, #cfc6b1 46%, #b9b0a0 70%, #8e8a80 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 10px 24px -14px rgba(0, 0, 0, .5);
  position: relative; opacity: .9;
}
.placeholder-art::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(transparent, rgba(255, 255, 255, .55));
  filter: blur(6px);
}

.results {
  flex: 1; display: none; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  align-content: start;
}
.results.is-on { display: grid; }

.card {
  position: relative; border-radius: 10px; overflow: hidden;
  background: #e8e2d4; box-shadow: 0 10px 26px -18px rgba(0, 0, 0, .6);
  aspect-ratio: var(--ar, 9 / 16); animation: rise .5s cubic-bezier(.2, .7, .2, 1) backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.card img, .card svg { width: 100%; height: 100%; object-fit: cover; }

.card-actions {
  position: absolute; inset: auto 0 0 0;
  display: flex; gap: 8px; padding: 28px 10px 10px;
  background: linear-gradient(transparent, rgba(15, 14, 12, .55));
  opacity: 0; transform: translateY(6px); transition: all .22s ease;
}
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; transform: none; }
.card-actions .btn {
  flex: 1; padding: 7px 10px; font-size: 12px;
  background: rgba(255, 255, 255, .92); color: var(--ink); border: 0;
}
.card-actions .btn:hover { background: #fff; }
.card-actions .btn-pro { background: rgba(168, 50, 45, .92); color: #fff; }
.card-actions .btn-pro:hover { background: var(--seal); }

/* 生成中骨架 */
.skeleton {
  aspect-ratio: var(--ar, 9 / 16); border-radius: 10px;
  background: linear-gradient(100deg, #eae3d4 30%, #f5efe3 50%, #eae3d4 70%);
  background-size: 220% 100%; animation: sheen 1.4s infinite linear;
}
@keyframes sheen { to { background-position: -220% 0; } }

.prompt-preview {
  border-top: 1px solid var(--line);
  padding: 14px 20px 18px;
  background: rgba(255, 255, 255, .35);
}
.prompt-preview p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.65; }

/* ---------- 通用区块 ---------- */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(44px, 6vw, 76px) clamp(18px, 4vw, 44px);
  border-top: 1px solid rgba(221, 212, 194, .6);
}

.section-head { margin-bottom: 30px; }
.section-head h2 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 3vw, 30px);
  letter-spacing: .06em; margin: 0 0 8px;
}
.section-head p { margin: 0; color: var(--ink-3); font-size: 14px; }

/* 灵感墙 */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery figure {
  margin: 0; border-radius: 10px; overflow: hidden; background: #e8e2d4;
  aspect-ratio: 9 / 16; cursor: zoom-in; position: relative;
  box-shadow: 0 10px 26px -20px rgba(0, 0, 0, .6);
  transition: transform .3s ease;
}
.gallery figure:hover { transform: translateY(-4px); }
.gallery svg, .gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px;
  font-size: 11px; letter-spacing: .1em; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .5));
}

/* 价格 */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }

.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow);
}
.plan h3 { font-family: var(--serif); font-weight: 500; font-size: 17px; letter-spacing: .12em; margin: 0 0 6px; }
.plan .price { font-family: var(--serif); font-size: 34px; margin: 0 0 18px; letter-spacing: .02em; }
.plan .price span { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin-left: 4px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; font-size: 14px; color: var(--ink-2); }
.plan li { padding: 5px 0 5px 20px; position: relative; }
.plan li::before {
  content: "·"; position: absolute; left: 4px; top: 4px; color: var(--gold);
  font-size: 18px; line-height: 1;
}
.plan .btn { margin-top: auto; }

.plan-hot { background: var(--ink); color: #f6f1e6; border-color: var(--ink); }
.plan-hot h3, .plan-hot .price { color: #f6f1e6; }
.plan-hot ul { color: rgba(246, 241, 230, .78); }
.plan-hot li::before { color: #d9b878; }
.plan-hot .btn-primary { background: #d9b878; color: #221f19; }
.plan-hot .btn-primary:hover { background: #e6c88f; }
.plan-tag {
  position: absolute; top: -11px; left: 24px;
  background: var(--seal); color: #fff; font-size: 11px;
  padding: 3px 10px; border-radius: 999px; letter-spacing: .08em;
}

.pay-note { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 22px 0 0; }

/* FAQ */
.faq { max-width: 760px; }
.faq details {
  border-bottom: 1px solid var(--line); padding: 4px 0;
}
.faq summary {
  cursor: pointer; padding: 16px 30px 16px 0; position: relative;
  font-size: 15px; list-style: none; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 14px;
  font-size: 20px; color: var(--ink-3); transition: transform .25s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 18px; font-size: 14px; color: var(--ink-2); max-width: 62ch; }

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 20px;
  padding: 40px clamp(18px, 4vw, 44px) 26px;
  background: rgba(255, 255, 255, .35);
}
.footer-main {
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start;
}
.footer-main strong { font-family: var(--serif); letter-spacing: .1em; margin-left: 8px; }
.footer-main p { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--ink-2); }
.footer-links a:hover { color: var(--seal); }
.footer-meta {
  max-width: var(--max); margin: 30px auto 0;
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  font-size: 12px; color: var(--ink-3); padding-top: 18px; border-top: 1px solid rgba(221, 212, 194, .6);
}

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(18, 16, 13, .88); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 40px 20px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.lightbox.is-on { opacity: 1; pointer-events: auto; }
.lightbox img, .lightbox svg { max-height: 88vh; width: auto; border-radius: 6px; box-shadow: 0 30px 80px -30px #000; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: 0; color: #f6f1e6; font-size: 30px; line-height: 1; cursor: pointer;
}

/* 吐司 */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  background: var(--ink); color: #f6f1e6; padding: 10px 20px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .28s ease; z-index: 300;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .7);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .studio { grid-template-columns: 1fr; }
  .panel { position: static; }
  .nav { display: none; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .stage { min-height: 480px; }
}

@media (max-width: 620px) {
  .site-header { padding: 12px 16px; gap: 12px; }
  .hero { padding-top: 36px; }
  .results { gap: 10px; }
  .canvas { padding: 12px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .actions { flex-direction: column; }
  .footer-meta { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
