/* 幻映图片工具箱 · 手机优先的浅色工具站 */
:root {
  --bg: #f2f6ff;
  --card: #ffffff;
  --ink: #171b26;
  --sub: #7c8698;
  --line: rgba(23, 27, 38, .08);
  --blue: #2f7bff;
  --blue-soft: #eaf1ff;
  --aqua: #35c5e8;
  --orange: #ff9a2e;
  --danger: #ef5350;
  --r: 16px;
  --shadow: 0 4px 16px rgba(31, 58, 122, .07);
  --header-grad: linear-gradient(170deg, #8dd8f2 0%, #c9ecfa 45%, #eaf6fe 100%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ---------------- 顶部 ---------------- */
.hd {
  position: relative;
  padding: 18px 18px 0;
  background: var(--header-grad);
  overflow: hidden;
}
.hd::after {
  content: '';
  position: absolute;
  right: -30px; top: -20px;
  width: 190px; height: 120px;
  background-image: radial-gradient(rgba(255, 255, 255, .75) 1.6px, transparent 1.7px);
  background-size: 13px 13px;
  opacity: .9;
  pointer-events: none;
}
.hd-row { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: #10365c; white-space: nowrap; }
.logo i { font-style: normal; font-size: 13px; font-weight: 700; color: #2f7bff; margin-left: 4px; }
.hd-row { flex-wrap: nowrap; }
.hd-row .pill { flex-shrink: 0; }
.hd-row .lang { flex-shrink: 0; }
.crown { width: 22px; height: 22px; color: var(--orange); }
.pill {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; color: var(--blue);
  border: 1px solid rgba(47, 123, 255, .35);
  border-radius: 999px; padding: 7px 13px;
  font-size: 13px; font-weight: 600;
}
.hero-txt { position: relative; z-index: 1; margin: 14px 0 50px; }
.hero-txt h1 {
  margin: 0; font-size: 25px; line-height: 1.32; font-weight: 800;
  color: #14294a; letter-spacing: -.4px;
}
.hero-txt h1 em { font-style: normal; color: #1273d8; }
.hero-txt p { margin: 8px 0 0; font-size: 13px; color: #45698f; }

/* ---------------- 通用区块 ---------------- */
.wrap { padding: 0 14px; }
.sec { margin-top: 14px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; margin: 20px 4px 10px; }
.sec-h b { font-size: 16px; font-weight: 700; }
.sec-h span { font-size: 12px; color: var(--sub); }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }

/* 顶部三张主推卡 */
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: -30px; position: relative; z-index: 2; }
.feat .card { padding: 23px 11px 12px; position: relative; overflow: hidden; }
.feat b { display: block; font-size: 14.5px; font-weight: 700; }
.feat span { display: block; font-size: 11.5px; color: var(--sub); margin-top: 3px; }
.feat .ico { width: 34px; height: 34px; margin-top: 10px; color: var(--blue); }
.badge {
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 0 16px 0 10px;
}

/* 工具格子 */
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tool {
  background: var(--card); border-radius: 14px; border: 0;
  padding: 12px 4px 10px; display: flex; flex-direction: column;
  align-items: center; gap: 7px; box-shadow: var(--shadow);
  position: relative; color: inherit; text-align: center;
}
.tool:active { transform: scale(.96); }
.tool svg { width: 28px; height: 28px; }
.tool span { font-size: 11.5px; line-height: 1.25; color: #2b3550; }
.tool .tag {
  position: absolute; top: -5px; right: -3px;
  background: var(--orange); color: #fff; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 999px;
}

/* 促销条 */
.promo {
  margin-top: 16px; border-radius: var(--r); padding: 14px 16px;
  background: linear-gradient(100deg, #6fc9f2 0%, #8fd9ef 55%, #b7ecf7 100%);
  color: #0d3350; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 6px 18px rgba(53, 150, 200, .22);
}
.promo b { font-size: 16px; font-weight: 800; }
.promo p { margin: 3px 0 0; font-size: 12px; opacity: .8; }
.promo .go {
  margin-left: auto; background: #fff; color: #0d6bb0;
  border: 0; border-radius: 999px; padding: 8px 16px;
  font-size: 13px; font-weight: 700;
}

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff; display: flex; z-index: 60;
  box-shadow: 0 -2px 16px rgba(31, 58, 122, .07);
}
.tab {
  flex: 1; border: 0; background: transparent; color: #9aa4b6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11.5px; font-weight: 600;
}
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--blue); }

/* ---------------- 我的 ---------------- */
.me-hd { background: var(--header-grad); padding: 22px 18px 26px; }
.me-row1 { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(140deg, #6f8bff, #b58cff);
  display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 700;
  flex-shrink: 0;
}
.me-name { display: flex; align-items: center; gap: 7px; font-size: 20px; font-weight: 800; color: #14294a; }
.vip {
  background: linear-gradient(140deg, #3d3f52, #23242f); color: #ffd27a;
  font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px;
  letter-spacing: .5px;
}
.me-sub { font-size: 12px; color: #4a6b8f; margin-top: 5px; }
.coin {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, .85); border-radius: 999px;
  padding: 6px 13px; font-size: 15px; font-weight: 700; color: #c07a12;
}
.coin svg { width: 18px; height: 18px; }

.me-list { margin-top: 14px; overflow: hidden; }
.me-item {
  display: flex; align-items: center; gap: 13px;
  padding: 16px; border-bottom: 1px solid var(--line);
  font-size: 15px; color: var(--ink); background: #fff;
  width: 100%; border-left: 0; border-right: 0; border-top: 0; text-align: left;
}
.me-item:last-child { border-bottom: 0; }
.me-item .mi {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.me-item .mi svg { width: 17px; height: 17px; }
.me-item .lbl { flex: 1; }
.me-item .chev { color: #c6ccd8; }
.me-item .val { color: var(--sub); font-size: 13.5px; }

/* ---------------- 工具页 ---------------- */
.toolpage { position: fixed; inset: 0; background: var(--bg); z-index: 80; display: flex; flex-direction: column; }
.tp-hd {
  height: 54px; flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; background: #fff; border-bottom: 1px solid var(--line);
}
.tp-hd button { border: 0; background: transparent; padding: 4px 6px; color: var(--ink); }
.tp-hd b { font-size: 16px; font-weight: 700; }
.tp-body { flex: 1; overflow-y: auto; padding: 14px 14px 96px; }
.tp-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--line);
  display: flex; gap: 10px;
}
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 16px; font-size: 14.5px; font-weight: 600; color: var(--ink);
}
.btn.primary { background: linear-gradient(120deg, #4b9dff, #35c5e8); color: #fff; border: 0; flex: 1; }
.btn.primary:disabled { opacity: .45; }
.btn.wide { flex: 1; }

.drop {
  border: 1.5px dashed rgba(47, 123, 255, .45); border-radius: var(--r);
  background: #fff; padding: 40px 20px; text-align: center; color: var(--sub);
}
.drop b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.drop svg { width: 44px; height: 44px; color: var(--blue); margin-bottom: 10px; }
.stage { background: #fff; border-radius: var(--r); padding: 10px; box-shadow: var(--shadow); }
.stage canvas { width: 100%; height: auto; display: block; border-radius: 10px; touch-action: none; }
.opts { margin-top: 12px; background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.opt { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.opt:last-child { margin-bottom: 0; }
.opt label { width: 76px; font-size: 13.5px; color: var(--sub); flex-shrink: 0; }
.opt input[type=range] { flex: 1; accent-color: var(--blue); }
.opt input[type=text], .opt select {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 14px; background: #fff; color: var(--ink);
}
.opt .v { width: 42px; text-align: right; font-size: 12.5px; color: var(--sub); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: 13.5px; color: var(--sub);
}
.chips button.on { background: var(--blue-soft); border-color: rgba(47,123,255,.4); color: var(--blue); font-weight: 600; }
.hint { font-size: 12.5px; color: var(--sub); line-height: 1.7; margin: 10px 2px 0; }

/* 视频去水印 */
.drama-band {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding: 14px 16px;
  border-radius: var(--r); text-decoration: none;
  background: linear-gradient(100deg, #eef2ff 0%, #e8f4ff 60%, #e6fbf7 100%);
  border: 1px solid rgba(90, 120, 255, .18);
  box-shadow: 0 6px 18px rgba(80, 110, 220, .1);
}
.drama-band .db-ico {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(140deg, #7c5cff, #4b9dff);
  color: #fff; display: grid; place-items: center;
}
.drama-band .db-ico svg { width: 22px; height: 22px; }
.drama-band .db-txt { flex: 1; min-width: 0; }
.drama-band b { display: block; font-size: 15px; font-weight: 800; color: #1b2440; }
.drama-band p { margin: 3px 0 0; font-size: 12px; color: #6b7690; line-height: 1.5; }
.drama-band .db-go {
  flex-shrink: 0; background: #fff; color: #3d6bff; font-size: 12.5px; font-weight: 700;
  border-radius: 999px; padding: 7px 13px; box-shadow: 0 2px 8px rgba(80, 110, 220, .15);
}
a.tab { text-decoration: none; }

/* 语言按钮 + 返回主页按钮 */
.lang {
  border: 1px solid rgba(47, 123, 255, .35); background: #fff; color: var(--blue);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700;
}
.home-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 14px 0 0; padding: 13px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); font-size: 15px; font-weight: 600; box-shadow: var(--shadow);
}
.home-btn svg { width: 20px; height: 20px; color: var(--blue); }
.tp-hd .tp-home {
  margin-left: auto; display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--line2); border-radius: 999px; padding: 6px 11px;
  font-size: 12.5px; color: var(--sub); background: #fff;
}
.tp-hd .tp-home svg { width: 16px; height: 16px; }

.vstage { position: relative; background: #0d1220; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.vstage video { width: 100%; display: block; }
.vstage .rects { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.vstage .mrect {
  position: absolute; border: 2px solid #ff4d4d; background: rgba(255, 77, 77, .22);
  border-radius: 4px; color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.vstage .sel {
  position: absolute; border: 1.5px dashed rgba(255, 255, 255, .95);
  background: rgba(47, 123, 255, .2); border-radius: 4px; pointer-events: none;
}
.vprog { height: 8px; border-radius: 999px; background: #e6ebf5; overflow: hidden; margin-top: 12px; }
.vprog i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #4b9dff, #35c5e8); transition: width .25s linear; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(10px);
  background: rgba(20, 26, 40, .93); color: #fff; padding: 10px 18px;
  border-radius: 12px; font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 200; max-width: 80vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 会员 / 付费墙 ---------------- */
.tool.locked { position: relative; }
.tool.locked::after {
  content: 'VIP';
  position: absolute; top: -5px; right: -4px;
  background: linear-gradient(140deg, #ffb020, #ff8a00);
  color: #fff; font-size: 9px; font-weight: 800;
  padding: 1px 6px; border-radius: 999px;
  letter-spacing: .3px;
}
.feat .card.locked::after {
  content: 'VIP';
  position: absolute; top: 0; left: 0;
  background: linear-gradient(140deg, #ffb020, #ff8a00);
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 16px 0 10px 0;
}

.member-banner {
  margin-top: 16px; border-radius: var(--r); padding: 16px;
  background: linear-gradient(120deg, #2b3550 0%, #1d2436 100%);
  color: #ffe0a6; box-shadow: 0 8px 22px rgba(20, 28, 48, .28);
}
.member-banner b { display: block; font-size: 17px; font-weight: 800; color: #ffcf80; }
.member-banner p { margin: 6px 0 12px; font-size: 12.5px; line-height: 1.7; color: #b9c2d6; }
.member-banner .go {
  width: 100%; border: 0; border-radius: 12px; padding: 12px;
  background: linear-gradient(120deg, #ffc043, #ff9a1f);
  color: #3a2600; font-size: 15px; font-weight: 800;
}
.member-on { background: linear-gradient(120deg, #2f6b4f, #24543e) !important; }
.member-on b { color: #b6f0c9 !important; }

.mask {
  position: fixed; inset: 0; background: rgba(12, 18, 30, .5);
  z-index: 120; display: none; align-items: flex-end; justify-content: center;
}
.mask.show { display: flex; }
.sheet {
  width: 100%; max-width: 480px; background: #fff;
  border-radius: 22px 22px 0 0; padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: 88vh; overflow-y: auto;
}
.sheet h3 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.sheet .sub { font-size: 12.5px; color: var(--sub); margin: 0 0 16px; line-height: 1.7; }
.plan {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px; background: #fff;
  width: 100%; text-align: left; position: relative;
}
.plan.on { border-color: var(--blue); background: #f3f8ff; }
.plan .pi { flex: 1; }
.plan .pi b { display: block; font-size: 15px; font-weight: 700; }
.plan .pi span { font-size: 12px; color: var(--sub); }
.plan .pp { font-size: 20px; font-weight: 800; color: #d97800; }
.plan .pp small { font-size: 11.5px; color: var(--sub); font-weight: 500; }
.plan .tag {
  position: absolute; top: -10px; left: 12px;
  background: #ff5a3c; color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(255, 90, 60, .35);
}
.sheet .field { margin: 14px 0 10px; }
.sheet .field label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.sheet .field input {
  width: 100%; border: 1px solid var(--line2); border-radius: 12px;
  padding: 13px; font-size: 15px; color: var(--ink); background: #fff;
}
.sheet .pay {
  width: 100%; border: 0; border-radius: 14px; padding: 15px;
  background: linear-gradient(120deg, #ffc043, #ff9a1f);
  color: #3a2600; font-size: 16px; font-weight: 800; margin-top: 6px;
}
.sheet .pay:disabled { opacity: .5; }
.sheet .close-x {
  position: absolute; right: 16px; top: 16px; border: 0; background: transparent;
  font-size: 20px; color: var(--sub); line-height: 1;
}
.sheet .note { font-size: 11.5px; color: var(--dim); line-height: 1.7; margin-top: 12px; }

/* 支付通道切换 + 微信二维码 */
.paytabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  background: #f1f5fb; border-radius: 12px; padding: 4px;
}
.paytabs .pt {
  flex: 1; border: 0; background: transparent; border-radius: 9px;
  padding: 10px 6px; font-size: 13.5px; font-weight: 600; color: var(--sub);
}
.paytabs .pt.on { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(31, 58, 122, .1); }
.qrhidden { display: none; }
.qrhidden.show { display: block; }
.qrcard {
  margin-top: 14px; background: #f8fafd; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; text-align: center;
}
.qrcard .qrt { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.qrcard .qrimg { display: inline-block; background: #fff; padding: 10px; border-radius: 10px; }
.qrcard .qrimg svg { width: 200px; height: 200px; display: block; }
.qrcard .qramt { margin-top: 10px; font-size: 15px; font-weight: 700; color: #d97800; }
.qrcard .qrstate { margin-top: 6px; font-size: 12.5px; color: var(--sub); }

/* AdSense 未填充时收起，避免留白 */
.ad-slot:has(> ins.adsbygoogle[data-ad-status="unfilled"]){display:none!important}
