/* =========================================================
 *  录屏转 Live Photo · 页面样式
 *
 *  公共色板 / 弹窗 / 按钮在 hub.css，这里只放本页专属：
 *  双栏布局、选项 chips、开关、预览舞台、进度与结果下载。
 * ========================================================= */

.tool-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 20px 24px;
}

.tp-head { text-align: center; margin-bottom: 22px; }
.tp-ic {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(10, 132, 255, .16), rgba(10, 132, 255, .06));
  color: var(--brand);
  font-size: 30px;
}
.tp-head h1 {
  margin: 0 0 8px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.tp-sub { margin: 0; color: var(--tx2); font-size: 14px; }

/* 额度条 */
.lp-quota {
  margin: 14px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--card-solid);
  border: 1px solid var(--line2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  color: var(--tx2);
  font-size: 13px;
}
.lp-quota b { color: var(--brand); font-weight: 700; }
.lp-quota.pro {
  background: rgba(255, 159, 10, .1);
  border-color: rgba(255, 159, 10, .24);
  color: #b26a00;
}
.lp-quota .link { font-size: 13px; }

.card {
  padding: 20px 22px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: var(--card-solid);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.lp-label {
  margin: 0 0 12px;
  color: var(--tx2);
  font-size: 13px;
  font-weight: 600;
}
.lp-label:first-child { margin-top: 0; }

/* 左侧选项 + 右侧舞台 */
.lp-wrap {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 16px;
  align-items: start;
}
.lp-wrap .card { margin-bottom: 0; }
.lp-wrap > .card:last-child { min-width: 0; }

/* 上传区 */
.drop {
  display: grid;
  place-items: center;
  padding: 30px 20px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: rgba(120, 128, 128, .04);
  text-align: center;
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop.on { border-style: solid; border-color: var(--brand); }
.drop-ic {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(10, 132, 255, .12);
  color: var(--brand);
  font-size: 24px;
}
.drop-tx { font-size: 14.5px; font-weight: 500; }
.drop-sub { margin-top: 6px; color: var(--brand); font-size: 12.5px; word-break: break-all; }

/* 分段控件 */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(120, 120, 128, .12);
}
.seg button {
  flex: 1;
  padding: 9px 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--tx2);
  font-size: 13.5px;
  font-family: inherit;
  transition: background .25s var(--ease), color .2s;
}
.seg button.on {
  background: #fff;
  color: var(--tx);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* 选项 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
  color: var(--tx2);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .18s, color .18s, background .18s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.lp-bgfile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  cursor: pointer;
}
.lp-bgname { color: var(--brand); font-size: 12.5px; word-break: break-all; }

/* 背景缩略图网格 */
.lp-bgs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.lp-bg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.lp-bg img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #f2f2f0;
}
.lp-bg span {
  font-size: 12px;
  color: var(--tx2);
  padding: 0 4px 7px;
  line-height: 1.2;
}
.lp-bg:hover { border-color: var(--brand); transform: translateY(-1px); }
.lp-bg.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.lp-bg.on span { color: var(--brand); font-weight: 600; }
.lp-bg-custom { justify-content: center; }
.lp-bg-custom .lp-bg-plus {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 300;
  color: var(--tx3, #9aa0a8);
  background: #f7f7f5;
  padding: 0;
}
.lp-bg-custom span:last-child { padding: 0 4px 7px; }
@media (max-width: 560px) {
  .lp-bgs { grid-template-columns: repeat(3, 1fr); }
}

/* iOS 开关 */
.lp-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  color: var(--tx2);
  font-size: 13px;
  line-height: 1.5;
}
.lp-switch input { display: none; }
.lp-switch .slider {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 99px;
  background: rgba(120, 120, 128, .22);
  transition: background .2s;
}
.lp-switch .slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .2s var(--ease);
}
.lp-switch input:checked + .slider { background: var(--ok); }
.lp-switch input:checked + .slider::before { transform: translateX(18px); }

/* 预览舞台：棋盘格表示这是要导出的画框 */
.lp-stage {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 16px;
  background:
    repeating-conic-gradient(rgba(120, 120, 128, .08) 0% 25%, transparent 0% 50%) 0 0 / 22px 22px;
  border: 1px solid var(--line2);
  min-height: 320px;
}
#preview {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 12px;
  display: block;
  background: #000;
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, .3);
}
.lp-hint { margin: 10px 2px 0; color: var(--tx3); font-size: 12.5px; text-align: center; }

.big { margin-top: 18px; }

/* 进度 */
.lp-progress {
  height: 6px;
  margin-top: 16px;
  border-radius: 99px;
  background: rgba(120, 120, 128, .14);
  overflow: hidden;
}
.lp-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 99px;
  transition: width .2s;
}
.lp-status { margin: 12px 0 0; text-align: center; color: var(--tx2); font-size: 13px; min-height: 18px; }

/* 结果下载 */
.lp-result { margin-top: 16px; }
.lp-dl { display: flex; gap: 10px; }
.lp-dl a { flex: 1; text-align: center; }
.lp-dl b { display: block; margin-bottom: 3px; color: var(--brand); font-size: 13px; }
.btn-ghost.lp-full { width: 100%; margin-top: 10px; }

/* 教程弹窗里的步骤 */
.lp-sheet { max-width: 440px; text-align: left; }
.lp-sheet h3, .lp-sheet .modal-sub { text-align: center; }
.lp-ol { margin: 14px 0; padding-left: 20px; color: var(--tx); font-size: 14px; line-height: 1.75; }
.lp-ol li + li { margin-top: 8px; }
.lp-ol b { font-weight: 600; }

/* ---------------- 深色模式 ---------------- */
@media (prefers-color-scheme: dark) {
  .seg button.on { background: #48484a; color: #fff; }
  .chip { background: #2c2c2e; }
  .lp-bg { background: #2c2c2e; }
  .lp-bg-custom .lp-bg-plus { background: #1c1c1e; }
  .lp-switch .slider { background: rgba(120, 128, 128, .36); }
  .drop { background: rgba(120, 128, 128, .1); }
}

/* ---------------- 移动端 / 窄屏 ---------------- */
@media (max-width: 860px) {
  .lp-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .tool-page { padding: 22px 14px 16px; }
  .tp-head h1 { font-size: 22px; }
  .tp-sub { font-size: 13px; }
  .card { padding: 17px 15px; border-radius: 16px; }
  .seg button { padding: 9px 6px; font-size: 13px; }
  .lp-stage { min-height: 220px; }
  #preview { max-height: 56vh; }
  .lp-dl { flex-direction: column; }
}
