/* ==========================================================
   Birthday3D · 编辑器
   ========================================================== */
body.create {
  min-height: 100vh;
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(255, 214, 150, 0.07), transparent 70%),
    linear-gradient(180deg, #14101c 0%, #0a0810 60%, #070509 100%);
  padding-bottom: calc(120px + var(--safe-b));
}

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-t)) 20px 12px;
  background: linear-gradient(180deg, rgba(12, 9, 17, 0.92), rgba(12, 9, 17, 0.55) 70%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar h1 { font-size: 17px; margin: 0; letter-spacing: 0.1em; }
.topbar .step { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.2em; }

.wrap { max-width: 640px; margin: 0 auto; padding: 6px 18px 0; }

/* ---------- 分区 ---------- */
.sec { margin-top: 30px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.sec-head .no {
  font-family: var(--serif); font-size: 13px; color: var(--gold);
  border: 1px solid rgba(242, 211, 155, 0.35); border-radius: 50%;
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  flex: none; transform: translateY(2px);
}
.sec-head h2 { font-size: 16.5px; margin: 0; letter-spacing: 0.08em; }
.sec-head .tip { font-size: 11px; color: var(--ink-faint); margin-left: auto; letter-spacing: 0.04em; }

.card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius); padding: 16px;
}

/* ---------- 主题卡 ---------- */
.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.theme-card {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  aspect-ratio: 16 / 10.5; text-align: left; padding: 0;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.theme-card:active { transform: scale(0.97); }
.theme-card .swatch {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; padding: 12px 13px;
}
.theme-card .swatch::before {
  content: ''; position: absolute; inset: 0; opacity: 0.9;
}
.theme-card .swatch b {
  position: relative; font-size: 13px; letter-spacing: 0.1em; color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); font-weight: 500;
}
.theme-card .dot {
  position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff;
  opacity: 0; transition: opacity 0.2s;
}
.theme-card.on { border-color: rgba(255, 224, 170, 0.85); box-shadow: 0 0 0 1.5px rgba(255, 224, 170, 0.5), 0 10px 30px -12px rgba(255, 200, 120, 0.5); }
.theme-card.on .dot { opacity: 1; }

.theme-gold .swatch::before { background: radial-gradient(120% 130% at 30% 20%, #4a3210, #120a04 70%); }
.theme-gold .swatch::after { content: ''; position: absolute; inset: 0; background: radial-gradient(45% 45% at 50% 62%, rgba(255, 208, 130, 0.75), transparent 70%); }
.theme-pink .swatch::before { background: radial-gradient(120% 130% at 30% 20%, #4d1c30, #12060b 70%); }
.theme-pink .swatch::after { content: ''; position: absolute; inset: 0; background: radial-gradient(45% 45% at 50% 62%, rgba(255, 150, 190, 0.75), transparent 70%); }
.theme-goldStrawberry .swatch::before { background: radial-gradient(120% 130% at 30% 20%, #47230f, #120904 70%); }
.theme-goldStrawberry .swatch::after { content: ''; position: absolute; inset: 0; background: radial-gradient(45% 45% at 50% 62%, rgba(255, 175, 130, 0.75), transparent 70%); }
.theme-crystal .swatch::before { background: radial-gradient(120% 130% at 30% 20%, #10304d, #050a12 70%); }
.theme-crystal .swatch::after { content: ''; position: absolute; inset: 0; background: radial-gradient(45% 45% at 50% 62%, rgba(140, 210, 255, 0.75), transparent 70%); }

/* ---------- 生日 / 密码 ---------- */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.5) 50%), linear-gradient(135deg, rgba(255,255,255,0.5) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
select.input option { background: #171220; color: var(--ink); }

/* ---------- 照片 ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-item {
  position: relative; border-radius: 14px; overflow: hidden;
  aspect-ratio: 3 / 4; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s;
}
.photo-item:active { transform: scale(0.96); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 7px;
  font-size: 10px; color: #fff; line-height: 1.4;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-item .no {
  position: absolute; top: 6px; left: 6px; font-size: 9px; letter-spacing: 0.1em;
  background: rgba(0, 0, 0, 0.55); border-radius: 6px; padding: 2px 6px; color: rgba(255, 255, 255, 0.85);
}
.photo-item .del {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); color: #ffb3bd; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.photo-add {
  aspect-ratio: 3 / 4; border-radius: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-faint); font-size: 11px; letter-spacing: 0.08em; background: rgba(255, 255, 255, 0.02);
  transition: transform 0.2s;
}
.photo-add:active { transform: scale(0.96); }
.photo-add svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.uploading {
  grid-column: span 1; aspect-ratio: 3 / 4; border-radius: 14px;
  border: 1.5px dashed rgba(255, 224, 170, 0.4); display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 11px; letter-spacing: 0.1em;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }

/* ---------- BGM ---------- */
.bgm-list { display: flex; flex-direction: column; gap: 10px; }
.bgm-item {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s;
}
.bgm-item.on { border-color: rgba(255, 224, 170, 0.7); background: rgba(255, 224, 170, 0.07); }
.bgm-item .ic { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.07); font-size: 14px; }
.bgm-item .t { flex: 1; }
.bgm-item .t b { display: block; font-size: 14px; font-weight: 500; letter-spacing: 0.04em; }
.bgm-item .t span { font-size: 11px; color: var(--ink-faint); }
.bgm-item .chk { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); display: flex; align-items: center; justify-content: center; font-size: 10px; color: #1c1206; }
.bgm-item.on .chk { background: var(--gold); border-color: var(--gold); }

/* ---------- 底栏 ---------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 12px 18px calc(14px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(7, 5, 9, 0.9) 30%);
  display: flex; gap: 10px; justify-content: center;
}
.bottombar .btn { flex: 1; max-width: 240px; }
.btn-danger-ghost { color: #ffb3bd; }

/* ---------- 发布结果 ---------- */
.link-box {
  display: flex; align-items: center; gap: 10px; margin: 16px 0;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 224, 170, 0.08); border: 1px solid rgba(255, 224, 170, 0.35);
  word-break: break-all; font-size: 14px; color: var(--gold); line-height: 1.5;
}
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.result-actions .btn { height: 44px; }

.warn { font-size: 12px; line-height: 1.8; color: #ffc9c9; background: rgba(255, 90, 90, 0.08); border: 1px solid rgba(255, 120, 120, 0.3); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.ok-note { font-size: 12px; line-height: 1.8; color: #b9f0cd; }

/* 照片编辑 sheet */
.sheet-photo-edit img { width: 100%; max-height: 40vh; object-fit: cover; border-radius: 14px; margin-bottom: 14px; }
.sheet textarea { min-height: 76px; }

@media (min-width: 560px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .themes { grid-template-columns: repeat(4, 1fr); }
}
