/* ============================================================
   云想衣 · AI 模特试衣间
   深黛蓝 × 鎏金 × 宣纸 —— 东方雅致 / 商业大片气质
   ============================================================ */

:root {
  --ink-950: #101322;
  --ink-900: #12141f;
  --ink-800: #171a2b;
  --ink-700: #1f2438;
  --gold-600: #a97f36;
  --gold-500: #c9a15a;
  --gold-300: #e5c98f;
  --paper: #f6f3ec;
  --card: #ffffff;
  --line: #e7e1d3;
  --line-soft: #efeade;
  --text: #2a2d3a;
  --muted: #8a8d9c;
  --danger: #b94a4a;
  --radius: 14px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "思源宋体", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --shadow-card: 0 1px 2px rgba(23, 26, 43, .05), 0 14px 36px -20px rgba(23, 26, 43, .22);
  --shadow-pop: 0 6px 22px -6px rgba(23, 26, 43, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold-300); color: var(--ink-900); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfc8b6; border-radius: 8px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }

/* ============================================================
   导航
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(16, 19, 34, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201, 161, 90, .28);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gold-300);
}

.brand-logo { width: 30px; height: 30px; color: var(--gold-500); }

.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .18em;
}

.brand-sub {
  font-size: 11.5px;
  letter-spacing: .3em;
  color: rgba(229, 201, 143, .62);
  border-left: 1px solid rgba(201, 161, 90, .4);
  padding-left: 10px;
}

.nav-right { display: flex; align-items: center; gap: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--gold-500);
  border-radius: 999px;
  padding: 7px 20px;
  font-size: 13.5px;
  font-family: var(--sans);
  letter-spacing: .12em;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s ease;
  background: transparent;
  color: var(--gold-300);
  white-space: nowrap;
}

.btn-ghost:hover { background: var(--gold-500); color: var(--ink-900); }

.btn-text {
  border: none;
  color: var(--muted);
  padding: 4px 8px;
  letter-spacing: .04em;
  font-size: 12.5px;
}
.btn-text:hover { color: var(--gold-600); background: rgba(201, 161, 90, .1); }

.btn-mini {
  border: 1px solid var(--line);
  color: var(--text);
  background: #faf8f2;
  padding: 5px 14px;
  font-size: 12.5px;
}
.btn-mini:hover { border-color: var(--gold-500); color: var(--gold-600); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 161, 90, .55); }
  50% { box-shadow: 0 0 0 10px rgba(201, 161, 90, 0); }
}
.btn.pulse { animation: pulse 1.1s ease 2; }

/* ---------- 用户信息 ---------- */
.user-chip { display: flex; align-items: center; gap: 10px; }

.u-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-500);
  object-fit: cover;
  background: var(--ink-700);
}

.u-name { color: #f0ead9; font-size: 13.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.u-logout { color: rgba(229, 201, 143, .55); font-size: 12.5px; text-decoration: none; }
.u-logout:hover { color: var(--gold-300); }

/* ============================================================
   主视觉
   ============================================================ */
.hero {
  position: relative;
  min-height: 64vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(90, 80, 140, .35), transparent 60%),
    radial-gradient(800px 400px at 85% 110%, rgba(169, 127, 54, .16), transparent 65%),
    linear-gradient(168deg, var(--ink-950) 0%, #1b2140 58%, #29224b 100%);
  overflow: hidden;
}

.hero::before, .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='130'%3E%3Cpath d='M30 88c-9 0-16-7-16-16s7-16 16-16c2.2 0 4.3.5 6.2 1.4C40 43 51 33 65 33c11 0 21 6 26 15 3.2-2.2 7.2-3.5 11.5-3.5 13 0 23 10 23 22 0 1.4-.1 2.7-.4 4 2-.7 4.2-1.1 6.4-1.1 10 0 18 8 18 18s-8 19-18 19H30z' fill='none' stroke='%23c9a15a' stroke-opacity='.14' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
}

.hero::before { transform: translateY(-26px) scale(1.15); opacity: .7; }
.hero::after { transform: translateY(30px) scale(1.05) rotate(2deg); opacity: .4; }

.hero-inner { position: relative; z-index: 1; max-width: 760px; }

.hero-kicker {
  font-size: 11px;
  letter-spacing: .55em;
  color: rgba(229, 201, 143, .5);
  margin-bottom: 26px;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(58px, 10vw, 104px);
  letter-spacing: .22em;
  margin-right: -.22em; /* 抵消末字间距 */
  color: #f2e9d8;
  text-shadow: 0 8px 40px rgba(0, 0, 0, .45);
}

.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 26px auto 22px;
}

.hero-divider span { width: 120px; height: 1px; background: linear-gradient(90deg, transparent, rgba(201, 161, 90, .7)); }
.hero-divider span:last-child { transform: scaleX(-1); }
.hero-divider i { color: var(--gold-500); font-style: normal; font-size: 15px; }

.hero-poem {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .3em;
  color: rgba(242, 233, 216, .66);
}

.hero-desc {
  margin-top: 14px;
  font-size: 14.5px;
  letter-spacing: .14em;
  color: rgba(242, 233, 216, .45);
}

.hero-cta {
  display: inline-block;
  margin-top: 38px;
  padding: 12px 44px;
  border: 1px solid rgba(201, 161, 90, .65);
  border-radius: 999px;
  color: var(--gold-300);
  font-size: 14px;
  letter-spacing: .3em;
  text-decoration: none;
  transition: all .25s ease;
}

.hero-cta:hover {
  background: var(--gold-500);
  color: var(--ink-900);
  box-shadow: 0 10px 30px -8px rgba(201, 161, 90, .6);
  transform: translateY(-2px);
}

/* ============================================================
   工作台
   ============================================================ */
.main { max-width: 1280px; margin: 0 auto; padding: 46px 24px 30px; }

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 408px;
  gap: 24px;
  align-items: start;
}

.form-col { display: grid; gap: 22px; min-width: 0; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 22px 13px;
  border-bottom: 1px dashed var(--line);
  background: linear-gradient(180deg, #fdfcf9, #faf7f0);
}

.card-no {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-500);
}

.card-title { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: .1em; color: var(--ink-800); }

.card-hint { margin-left: auto; font-size: 12px; color: var(--muted); letter-spacing: .04em; }

.card-body { padding: 18px 22px 22px; display: grid; gap: 18px; }

/* ---------- 分组与 chips ---------- */
.group { display: grid; gap: 9px; }

.group-label {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .16em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.group-label i {
  width: 5px; height: 5px;
  background: var(--gold-500);
  transform: rotate(45deg);
  flex: none;
}

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

.chip {
  padding: 6.5px 14px;
  border: 1px solid #ddd6c6;
  border-radius: 999px;
  background: #faf8f2;
  font-size: 13px;
  font-family: var(--sans);
  color: #4c4f5e;
  cursor: pointer;
  user-select: none;
  transition: all .16s ease;
  line-height: 1.45;
}

.chip:hover { border-color: var(--gold-500); color: var(--ink-800); transform: translateY(-1px); }

.chip.on {
  background: var(--ink-800);
  border-color: var(--ink-800);
  color: var(--gold-300);
  box-shadow: 0 5px 14px -5px rgba(23, 26, 43, .55);
}

/* ---------- 输入框 ---------- */
.field {
  width: 100%;
  border: 1px solid #ddd6c6;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13.5px;
  font-family: var(--sans);
  background: #faf8f2;
  color: var(--text);
  resize: vertical;
  transition: border-color .18s, box-shadow .18s;
}

.field:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 161, 90, .18);
  background: #fff;
}

.field::placeholder { color: #b6b3a6; }

/* ---------- 行内操作 ---------- */
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-actions.center { justify-content: center; gap: 10px; margin-top: 4px; }

.save-hint { margin-left: auto; font-size: 11.5px; color: #b3ae9d; letter-spacing: .08em; }

/* ============================================================
   右列：预览与生成
   ============================================================ */
.side-col { position: sticky; top: 84px; display: grid; gap: 22px; }

.prompt-preview {
  background: var(--ink-900);
  border: 1px solid rgba(201, 161, 90, .3);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.9;
  color: #cfc9b8;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.lock-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.lock-line input { accent-color: var(--gold-600); width: 15px; height: 15px; cursor: pointer; }

.btn-gen {
  width: 100%;
  margin-top: 4px;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecd49c 0%, var(--gold-500) 48%, var(--gold-600) 100%);
  color: var(--ink-900);
  font-family: var(--serif);
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: .42em;
  text-indent: .42em;
  cursor: pointer;
  box-shadow: 0 10px 26px -10px rgba(169, 127, 54, .65);
  transition: all .2s ease;
}

.btn-gen:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(169, 127, 54, .75); }

.btn-gen:disabled { filter: grayscale(.55) brightness(.9); cursor: not-allowed; transform: none; }

.gen-tip { font-size: 11.5px; color: #b3ae9d; text-align: center; letter-spacing: .05em; }

/* ---------- 生成中状态 ---------- */
.gen-status { display: grid; gap: 9px; margin-top: 16px; }

.shimmer {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  background: linear-gradient(110deg, #181c2e 8%, #232a47 20%, #181c2e 34%);
  background-size: 220% 100%;
  animation: shimmer 1.7s linear infinite;
}

@keyframes shimmer { to { background-position-x: -220%; } }

.status-text { font-family: var(--serif); color: var(--gold-500); font-size: 14px; letter-spacing: .14em; }
.status-time { color: var(--muted); font-size: 12px; }

/* ---------- 结果卡片 ---------- */
.result-img { width: 100%; border-radius: 12px; display: block; background: #eee; }

/* ============================================================
   历史作品
   ============================================================ */
.works { margin-top: 56px; }

.works-head { text-align: center; margin-bottom: 26px; }

.works-title {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--ink-800);
}

.works-sub { font-size: 12.5px; color: var(--muted); letter-spacing: .12em; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 18px;
}

.work { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-card); transition: transform .18s, box-shadow .18s; }
.work:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }

.work-img-wrap { position: relative; aspect-ratio: 3 / 4; background: #eceada; cursor: zoom-in; overflow: hidden; }
.work-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.work:hover .work-img { transform: scale(1.04); }

.work-tag {
  position: absolute;
  left: 10px; top: 10px;
  background: rgba(16, 19, 34, .78);
  color: var(--gold-300);
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: .06em;
  backdrop-filter: blur(4px);
}

.work-meta { padding: 10px 12px 6px; display: grid; gap: 2px; }
.work-date { font-size: 11.5px; color: var(--muted); }
.work-prompt { font-size: 12px; color: #6c6f7e; line-height: 1.5; max-height: 3em; overflow: hidden; }

.work-actions { display: flex; gap: 2px; padding: 4px 8px 8px; flex-wrap: wrap; }
.work-actions .btn-text { padding: 4px 8px; font-size: 12px; }

.works-empty {
  text-align: center;
  padding: 64px 20px;
  color: #b3ae9d;
  font-size: 13.5px;
  letter-spacing: .2em;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
}

/* ============================================================
   页脚 / 灯箱 / Toast
   ============================================================ */
.footer {
  margin-top: 70px;
  padding: 44px 20px 50px;
  text-align: center;
  background: var(--ink-950);
  color: rgba(229, 201, 143, .55);
  font-family: var(--serif);
  letter-spacing: .28em;
  font-size: 14px;
}

.footer-sub { margin-top: 8px; font-family: var(--sans); font-size: 11.5px; letter-spacing: .18em; color: rgba(229, 201, 143, .3); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 12, 20, .93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  cursor: zoom-out;
}

.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 8px; box-shadow: 0 24px 80px rgba(0, 0, 0, .6); }

.lb-caption {
  max-width: min(860px, 90vw);
  max-height: 3em;
  overflow: hidden;
  color: rgba(207, 201, 184, .75);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.lb-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(201, 161, 90, .5);
  background: transparent;
  color: var(--gold-300);
  font-size: 16px;
  cursor: pointer;
  transition: all .18s;
}
.lb-close:hover { background: var(--gold-500); color: var(--ink-900); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-800);
  color: var(--gold-300);
  border: 1px solid rgba(201, 161, 90, .45);
  padding: 11px 26px;
  border-radius: 999px;
  font-size: 13.5px;
  letter-spacing: .06em;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: all .3s ease;
  z-index: 120;
  max-width: 88vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { color: #ffb3b3; border-color: rgba(185, 74, 74, .6); }

/* ---------- 入场动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeUp .55s ease both; }

.hidden { display: none !important; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1020px) {
  .studio { grid-template-columns: 1fr; }
  .side-col { position: static; }
}

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .card-hint { display: none; }
  .card-body, .card-head { padding-left: 16px; padding-right: 16px; }
  .hero { min-height: 56vh; padding-top: 100px; }
  .hero-divider span { width: 70px; }
  .main { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
