/* LM FrameCraft H5 —— 由小程序 WXSS 移植（1rem = 100rpx，桌面端限宽 520px） */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: calc(min(100vw, 520px) / 7.5); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #f5f4f0;
  color: #171717;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", Arial, sans-serif;
}
button { font-family: inherit; }
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; }

.card { background: #fff; border-radius: 0.28rem; padding: 0.28rem; }
.muted { color: #8b8b86; }
.section-title { font-size: 0.3rem; font-weight: 650; margin: 0.36rem 0 0.2rem; }
.primary {
  display: block; width: 100%; border: 0;
  height: 0.92rem; line-height: 0.92rem; border-radius: 0.46rem;
  background: #171717; color: #fff; font-size: 0.3rem; font-weight: 600;
  cursor: pointer;
}
.secondary {
  display: block; width: 100%; border: 1px solid #ddd;
  height: 0.82rem; line-height: 0.82rem; border-radius: 0.41rem;
  background: #fff; color: #171717; font-size: 0.28rem; cursor: pointer;
}

/* ---------- 首页 ---------- */
.home { padding: 0.56rem 0.36rem 1.2rem; }
.hero { padding: 0.35rem 0 0.5rem; }
.eyebrow { font-size: 0.2rem; letter-spacing: 0.03rem; color: #898780; display: block; margin-bottom: 0.3rem; }
.title { font-size: 0.56rem; line-height: 1.18; font-weight: 750; display: block; }
.desc { display: block; color: #85837d; font-size: 0.26rem; line-height: 1.7; margin-top: 0.24rem; max-width: 6.5rem; }
.main-btn { margin: 0 0 0.45rem; }
.tips { display: flex; gap: 0.16rem; }
.tip { flex: 1; min-height: 1.7rem; display: flex; flex-direction: column; justify-content: space-between; font-size: 0.24rem; }
.tip-num { font-size: 0.22rem; color: #aaa; }

/* ---------- 编辑器 ---------- */
.editor { padding: 0 0.28rem 0.7rem; }
.topbar { height: 1rem; display: flex; align-items: center; justify-content: space-between; font-size: 0.28rem; }
.back { font-size: 0.55rem; line-height: 1; cursor: pointer; padding: 0 0.1rem; }
.top-action { color: #2563eb; font-weight: 650; cursor: pointer; padding: 0 0.1rem; }
.preview-wrap {
  background: #dcdad4; border-radius: 0.28rem; padding: 0.2rem;
  display: flex; justify-content: center; overflow: hidden;
}
.canvas { display: block; max-width: 100%; }
/* 编辑器吸顶：顶栏 + 预览固定，面板滚动调参时图片始终可见 */
#view-editor .topbar { position: sticky; top: 0; z-index: 20; background: #f5f4f0; margin: 0 -0.28rem; padding: 0 0.28rem; }
#view-editor .preview-wrap {
  position: sticky; top: 1rem; z-index: 10;
  border-radius: 0; padding: 0.2rem 0; margin: 0 -0.28rem;
  box-shadow: 0 0.1rem 0.18rem rgba(0, 0, 0, 0.06);
}
.info { margin-top: 0.2rem; padding: 0.24rem; }
.info-title { font-size: 0.21rem; color: #999; margin-bottom: 0.12rem; letter-spacing: 0.01rem; }
.camera { display: block; font-size: 0.28rem; font-weight: 650; }
.lens { display: block; color: #777; font-size: 0.23rem; margin-top: 0.07rem; }
.params { display: block; margin-top: 0.12rem; font-size: 0.22rem; letter-spacing: 0.01rem; }
.thumbs { margin: 0.2rem 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.thumb-row { display: flex; gap: 0.12rem; }
.thumb {
  width: 1rem; height: 1rem; border-radius: 0.14rem; overflow: hidden;
  border: 0.04rem solid transparent; flex: 0 0 auto; cursor: pointer;
}
.thumb.active { border-color: #111; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-add { display: flex; align-items: center; justify-content: center; font-size: 0.6rem; color: #777; background: #e9e7e1; }

.tabs { display: flex; background: #e9e7e1; border-radius: 0.42rem; padding: 0.05rem; margin: 0.16rem 0; }
.tab { flex: 1; text-align: center; padding: 0.18rem 0; border-radius: 0.36rem; font-size: 0.25rem; color: #777; cursor: pointer; }
.tab.selected { background: #fff; color: #111; font-weight: 650; }

.panel { background: #fff; border-radius: 0.25rem; padding: 0.2rem; margin-bottom: 0.2rem; }
.template-row { display: flex; gap: 0.18rem; }
.tpl-x { overflow-x: auto; padding-bottom: 0.05rem; }
.template-item { width: 1.25rem; text-align: center; color: #777; font-size: 0.2rem; cursor: pointer; flex: 0 0 auto; }
.template-item.chosen { color: #111; font-weight: 650; }
.mini { height: 1.25rem; border-radius: 0.15rem; padding: 0.1rem; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; overflow: hidden; }
.mini .mini-area { flex: 1; display: block; margin-bottom: 0.07rem; overflow: hidden; }
.mini .mini-img { width: 100%; height: 100%; background: #7772; }

.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 0.19rem 0; border-bottom: 1px solid #eee; font-size: 0.25rem; }
.setting-row:last-child { border: 0; }
.sw { width: 1.05rem; height: 1.05rem; accent-color: #171717; cursor: pointer; }
#qualitySel { font-size: 0.25rem; color: #2563eb; font-weight: 600; border: 0; background: none; cursor: pointer; }

.text-input {
  background: #f5f4f0; border: 0; outline: none; border-radius: 0.15rem;
  padding: 0.2rem; width: 100%; font-size: 0.25rem;
}
.text-input:disabled { opacity: 0.5; }
.text-field { margin-bottom: 0.18rem; }
.text-field:last-child { margin-bottom: 0; }
.text-label { display: block; font-size: 0.23rem; color: #999; margin-bottom: 0.1rem; }

.apply { margin-top: 0.1rem; }
.hidden-canvas { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

.tpl-panel { padding: 0.1rem 0 0; }
.tpl-scroll { max-height: 13rem; overflow-y: auto; }
.tpl-group { margin-bottom: 0.2rem; }
.tpl-cat { display: flex; align-items: center; margin: 0 0.04rem 0.16rem; font-size: 0.26rem; font-weight: 600; color: #222; }
.tpl-cat-bar { width: 0.06rem; height: 0.26rem; background: #b5d334; border-radius: 0.03rem; margin-right: 0.12rem; }
.tpl-name { display: block; margin-top: 0.08rem; font-size: 0.2rem; }


/* ---------- 调节面板 ---------- */
#panel-adjust input[type=range] { flex: 1; margin: 0 0.15rem; accent-color: #171717; }
.adj-val { width: 0.9rem; text-align: right; color: #999; font-size: 0.22rem; }
#panel-adjust input[type=color] { width: 1.4rem; height: 0.62rem; border: 1px solid #ddd; border-radius: 0.12rem; padding: 0.05rem; background: #fff; cursor: pointer; }

/* ---------- 签名面板 ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.16rem; }
.chip { display: inline-block; padding: 0.12rem 0.3rem; border-radius: 0.32rem; background: #f0efeb; font-size: 0.24rem; color: #777; cursor: pointer; user-select: none; }
.chip-on { background: #171717; color: #fff; font-weight: 600; }
#panel-sig input[type=range] { flex: 1; margin: 0 0.15rem; accent-color: #171717; }

/* ---------- 结果页 ---------- */
.result { padding: 0 0.36rem 1rem; }
.result-tip { font-size: 0.22rem; color: #85837d; padding: 0.2rem 0.1rem; line-height: 1.6; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem; padding-bottom: 0.2rem; }
.result-item { background: #fff; border-radius: 0.16rem; overflow: hidden; }
.result-item img { width: 100%; display: block; }
.result-btns { display: flex; border-top: 1px solid #eee; }
.result-btns button { flex: 1; border: 0; background: none; padding: 0.15rem 0; font-size: 0.22rem; cursor: pointer; }

/* ---------- 浮层 ---------- */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.78); color: #fff;
  padding: 0.2rem 0.34rem; border-radius: 0.16rem; font-size: 0.24rem;
  z-index: 99; max-width: 80vw; text-align: center;
}
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 98; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: #fff; border-radius: 0.24rem; padding: 0.4rem; width: 100%; }
.modal-title { font-size: 0.3rem; font-weight: 650; margin-bottom: 0.16rem; }
.modal-content { font-size: 0.25rem; color: #555; line-height: 1.6; }
.modal-btns { display: flex; gap: 0.16rem; margin-top: 0.3rem; }
.modal-btns button { flex: 1; border: 0; background: #f5f4f0; padding: 0.2rem 0; border-radius: 0.16rem; font-size: 0.26rem; cursor: pointer; }
.modal-btns button.primary { background: #171717; color: #fff; }
