/* wishcard — 编辑器 + 播放器共用样式 */
:root {
  --bg: #0b1420;
  --panel: #101d2e;
  --panel-2: #16273d;
  --line: rgba(255, 255, 255, .09);
  --text: #eaf2ff;
  --muted: #8fa6c4;
  --accent: #5b8cff;
  --accent-2: #ff7eb6;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(91, 140, 255, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255, 126, 182, .12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px clamp(16px, 4vw, 40px);
}
.brand { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.brand-mark {
  display: inline-flex; width: 32px; height: 32px; margin-right: 6px;
  align-items: center; justify-content: center; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 16px;
}
.tagline { color: var(--muted); font-size: 13px; }

.layout { padding: 8px clamp(16px, 4vw, 40px) 60px; max-width: 1180px; margin: 0 auto; }
.panel-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; margin: 18px 0 16px;
}
.step-no {
  display: inline-flex; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 13px; align-items: center; justify-content: center; font-weight: 700;
}

/* ---------- 模板画廊 ---------- */
.tpl-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.tpl-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; transition: transform .18s ease, border-color .18s ease;
  aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: flex-end;
}
.tpl-card:hover { transform: translateY(-4px); border-color: rgba(91, 140, 255, .6); }
.tpl-card .cover { position: absolute; inset: 0; opacity: .92; }
.tpl-card .cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .55));
}
.tpl-card .meta { position: relative; padding: 12px 14px; }
.tpl-card .t-name { font-size: 15px; font-weight: 600; }
.tpl-card .t-family { font-size: 11px; color: rgba(255, 255, 255, .72); margin-top: 3px; }
.tpl-card .t-cover-art {
  position: absolute; top: 14px; left: 14px; font-size: 30px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4));
}
.loading { color: var(--muted); padding: 30px 0; }

/* ---------- 编辑器 ---------- */
.editor-cols {
  display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 26px;
}
@media (max-width: 860px) { .editor-cols { grid-template-columns: 1fr; } }
.form-col {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 13px; color: var(--muted); }
.mt8 { margin-top: 8px; }
input[type="text"], input[type="url"], textarea, select {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.primary-btn {
  background: linear-gradient(135deg, var(--accent), #7a5bff);
  color: #fff; font-size: 15px; font-weight: 600;
  border: 0; border-radius: 11px; padding: 12px 18px; cursor: pointer;
  transition: filter .15s, transform .1s;
}
.primary-btn:hover { filter: brightness(1.12); }
.primary-btn:active { transform: scale(.98); }
.primary-btn[disabled] { opacity: .55; cursor: not-allowed; }
.ghost-btn {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 12px; font-size: 13px; cursor: pointer; text-decoration: none;
}
.ghost-btn:hover { color: var(--text); border-color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.7; }
.hint.center { text-align: center; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; position: relative;
}
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* ---------- 预览 ---------- */
.preview-col { display: flex; flex-direction: column; gap: 10px; }
.preview-head { font-size: 13px; color: var(--muted); }
.phone-frame {
  width: min(360px, 100%); aspect-ratio: 9 / 16; margin: 0 auto;
  border-radius: 26px; border: 1px solid var(--line);
  overflow: hidden; background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.stage { position: absolute; inset: 0; }
.phone-frame { position: relative; }

/* ---------- 成功弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 8, 16, .72);
  display: flex; align-items: center; justify-content: center; z-index: 60;
  backdrop-filter: blur(6px); padding: 20px;
}
.modal-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 26px; width: min(420px, 100%);
  text-align: center; display: flex; flex-direction: column; gap: 14px;
}
.done-icon { font-size: 42px; }
.share-url {
  background: var(--panel-2); border: 1px dashed rgba(255, 255, 255, .25);
  border-radius: 10px; padding: 12px; font-size: 14px;
  word-break: break-all; color: #bfe0ff; font-family: ui-monospace, monospace;
}
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ---------- toast ---------- */
#wc-toast {
  position: fixed; left: 50%; bottom: 9vh; transform: translateX(-50%) translateY(20px);
  background: rgba(20, 32, 50, .95); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: all .25s ease; z-index: 99; border: 1px solid var(--line);
}
#wc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 播放器（分享页） ---------- */
body.player { overflow: hidden; background: #000; }
#stage { position: fixed; inset: 0; overflow: hidden; }
.player-ui {
  position: fixed; top: 14px; right: 14px; z-index: 40; display: flex; gap: 8px;
}
.player-ui button {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(0, 0, 0, .35); color: #fff; font-size: 16px; cursor: pointer;
  backdrop-filter: blur(4px);
}
.share-tip-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70;
  display: flex; align-items: flex-start; justify-content: flex-end; padding: 70px 26px;
}
.share-tip-mask .arrow { font-size: 40px; color: #fff; transform: rotate(-18deg); margin-right: 60px; }
#share-tip[hidden] { display: none; }
.tip-card { text-align: center; color: #fff; font-size: 15px; line-height: 1.8; }
.tip-card button {
  margin-top: 10px; background: var(--accent); border: 0; color: #fff;
  padding: 8px 20px; border-radius: 999px; font-size: 14px; cursor: pointer;
}
