:root{
  --p:#6f62d4; --p2:#8f7ee8; --ink:#242533; --muted:#858694;
  --line:#ececf2; --card:#fff; --bg:#f6f6fa;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{background:var(--bg)}
body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;-webkit-font-smoothing:antialiased}
button,input,textarea,select{font:inherit;color:inherit}
a{text-decoration:none;color:inherit}
.page{width:100%;max-width:760px;margin:0 auto;min-height:100vh;padding-bottom:calc(28px + env(safe-area-inset-bottom,0px))}

.top{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 6px}
.back{display:inline-flex;align-items:center;gap:4px;height:32px;padding:0 12px 0 8px;border-radius:10px;background:#fff;border:1px solid var(--line);font-size:13px;color:#5c5c6b}
.back:active{background:#f2f2f8}
.brand{font-size:10px;font-weight:700;letter-spacing:.18em;color:#b3b2c2}

.hero{margin:6px 12px 0;padding:22px 20px 24px;border-radius:24px;color:#fff;background:linear-gradient(135deg,#5d52bd 0%,#7566d7 52%,#9b8ae9 100%);box-shadow:0 12px 30px rgba(93,82,189,.20);position:relative;overflow:hidden}
.hero::before{content:"";position:absolute;width:200px;height:200px;right:-80px;top:-90px;border-radius:50%;background:rgba(255,255,255,.10)}
.hero::after{content:"";position:absolute;width:120px;height:120px;left:-50px;bottom:-80px;border-radius:50%;background:rgba(255,255,255,.07)}
.hero h1{margin:0;font-size:27px;line-height:1.25;position:relative}
.hero p{margin:9px 0 0;font-size:12.5px;line-height:1.7;color:rgba(255,255,255,.80);position:relative}
.hero-meta{margin-top:14px;display:flex;gap:8px;flex-wrap:wrap;position:relative}
.pill{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border-radius:999px;background:rgba(255,255,255,.16);font-size:11px;color:#fff}

.grp{margin:22px 12px 0}
.grp-h{display:flex;align-items:baseline;gap:8px;margin:0 4px 10px}
.grp-h i{font-style:normal;font-size:11px;font-weight:700;color:#b3aee0;letter-spacing:.06em}
.grp-h strong{font-size:15px;font-weight:700}
.grp-h em{font-style:normal;font-size:11px;color:#a4a4b4;margin-left:auto;text-align:right}
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.tile{display:flex;align-items:center;gap:9px;padding:12px 11px;border:1px solid var(--line);border-radius:16px;background:var(--card);box-shadow:0 2px 10px rgba(38,38,55,.03)}
.tile:active{transform:scale(.98);border-color:#d8d3f2}
.tile-e{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:11px;font-size:17px;background:#f3f1ff}
.tile-b{min-width:0;display:flex;flex-direction:column;gap:3px}
.tile-b strong{font-size:13.5px;font-weight:650;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tile-b em{font-style:normal;font-size:11px;color:#9a9aa8;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.foot{margin:26px 16px 0;text-align:center;font-size:11px;color:#b0b0be;line-height:1.7}

/* ===== 工具页 ===== */
.tool{margin:12px 12px 0}
.tool-head{padding:6px 4px 14px}
.tool-head h1{margin:0;font-size:21px;line-height:1.3}
.tool-head p{margin:7px 0 0;font-size:12.5px;color:#8b8b99;line-height:1.7}
.form{border:1px solid var(--line);border-radius:20px;background:var(--card);padding:4px 14px 16px;box-shadow:0 4px 16px rgba(38,38,55,.035)}
.field{padding:14px 0;border-bottom:1px solid #f4f4f8}
.field:last-child{border-bottom:0}
.field>label{display:block;margin-bottom:9px;font-size:12.5px;font-weight:600;color:#5f5f6e}
.field>label span{font-weight:400;color:#a8a8b6;margin-left:4px}
.inp{width:100%;height:42px;padding:0 12px;border:1px solid #e6e5ee;border-radius:11px;background:#fafafd;font-size:14px;outline:0}
.inp:focus{border-color:#b8aef0;background:#fff}
textarea.inp{height:auto;min-height:78px;padding:10px 12px;line-height:1.65;resize:vertical}
input[type=date].inp{line-height:42px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{height:33px;padding:0 13px;border:1px solid #e6e5ee;border-radius:999px;background:#fafafd;font-size:12.5px;color:#6b6b7a}
.chip.on{border-color:var(--p);background:#f0edff;color:var(--p);font-weight:600}
.chip:active{transform:scale(.96)}
.colors{display:flex;gap:10px}
.colors input{width:54px;height:38px;padding:2px;border:1px solid #e6e5ee;border-radius:10px;background:#fafafd}
.quiz-q{padding:12px 0 4px}
.quiz-q h4{margin:0 0 8px;font-size:13px;font-weight:600;line-height:1.5;color:#4c4c5c}
.opts{display:flex;flex-wrap:wrap;gap:8px}
.go{display:block;width:100%;height:50px;margin-top:14px;border:0;border-radius:15px;background:linear-gradient(135deg,#6f62d4,#9182ea);color:#fff;font-size:15.5px;font-weight:700;letter-spacing:.02em;box-shadow:0 8px 20px rgba(111,98,212,.28)}
.go:active{transform:scale(.985)}
.hint{margin:12px 6px 0;font-size:11px;color:#adadb9;line-height:1.7;text-align:center}

/* ===== 结果弹层 ===== */
.sheet{position:fixed;left:0;top:0;right:0;bottom:0;z-index:60;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));background:rgba(18,18,30,.72);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.sheet[hidden]{display:none}
.sheet img{max-width:100%;max-height:calc(100vh - 168px);border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.4);background:#fff}
.sheet-tip{margin:12px 0 0;font-size:12px;color:rgba(255,255,255,.72);text-align:center}
.sheet-bar{display:flex;gap:10px;margin-top:12px;width:100%;max-width:400px}
.sheet-btn{flex:1;height:44px;border:0;border-radius:13px;background:rgba(255,255,255,.14);color:#fff;font-size:13.5px;font-weight:600;border:1px solid rgba(255,255,255,.18)}
.sheet-btn.pri{background:linear-gradient(135deg,#6f62d4,#9182ea);border-color:transparent}
.sheet-btn:active{transform:scale(.98)}

/* ===== 转盘 ===== */
.wheel-wrap{display:flex;flex-direction:column;align-items:center;gap:14px;padding:8px 0 4px}
#wheelCanvas{width:min(320px,78vw);height:auto;filter:drop-shadow(0 10px 24px rgba(93,82,189,.22))}
.wheel-result{font-size:15px;font-weight:700;color:var(--p);min-height:22px}
.wheel-opts{width:100%;display:flex;flex-direction:column;gap:8px}
.wopt{display:flex;align-items:center;gap:8px}
.wopt input{flex:1;height:38px;padding:0 11px;border:1px solid #e6e5ee;border-radius:10px;background:#fafafd;font-size:13px;outline:0}
.wopt button{flex:none;width:34px;height:34px;border:1px solid #eee;border-radius:9px;background:#fff;color:#a0a0ae}

/* ===== 拼图 ===== */
.pz{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;width:min(300px,74vw);margin:0 auto;background:#e9e7f6;padding:4px;border-radius:14px}
.pz b{position:relative;display:block;padding-top:100%;border-radius:7px;background-repeat:no-repeat;background-size:300% 300%;cursor:pointer;transition:transform .12s}
.pz b.empty{background:#f3f2fb;box-shadow:inset 0 0 0 2px #dcd8f5;cursor:default}
.pz b:not(.empty):active{transform:scale(.96)}

/* ===== 上传 ===== */
.up-row{display:flex;gap:10px}
.up{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:96px;border:1.5px dashed #d9d5f0;border-radius:14px;background:#faf9ff;color:#9a94c4;font-size:11.5px;overflow:hidden;position:relative}
.up img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.up span{position:relative;z-index:1}
.up.has{border-style:solid;border-color:#c9c2f0}
.up input{display:none}
