:root{
  --red:#ff2442; --ink:#1a1a1a; --gray:#8a8a8a; --line:#ececec; --bg:#f6f6f7;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background:#fff;color:var(--ink);-webkit-font-smoothing:antialiased;
}
img{display:block;max-width:100%}
button{font-family:inherit;border:none;background:none;cursor:pointer;color:inherit}
.wrap{max-width:480px;margin:0 auto;min-height:100%;background:#fff;position:relative}

/* 顶部 */
.topbar{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.94);
  backdrop-filter:saturate(180%) blur(12px);border-bottom:1px solid var(--line);
  height:48px;display:flex;align-items:center;padding:0 14px;gap:10px}
.brand{font-weight:700;font-size:15px;letter-spacing:.5px}
.brand i{color:var(--red);font-style:normal}
.topbar .spacer{flex:1}
.topbar a{font-size:12px;color:var(--gray)}

/* 生成页 */
.gen{padding:26px 20px 40px}
.gen h1{font-size:23px;line-height:1.35;letter-spacing:-.3px}
.gen h1 span{color:var(--red)}
.gen p.sub{color:var(--gray);font-size:13px;line-height:1.7;margin:10px 0 24px}
.field{background:var(--bg);border-radius:14px;padding:14px 16px;display:flex;align-items:center;gap:8px}
.field input{flex:1;border:none;background:none;font-size:16px;outline:none}
.field input::placeholder{color:#b6b6b6}
.primary{width:100%;margin-top:14px;height:50px;border-radius:25px;background:var(--red);
  color:#fff;font-size:16px;font-weight:600;letter-spacing:.5px}
.primary:disabled{opacity:.5}
.result{margin-top:22px;border:1px solid var(--line);border-radius:16px;padding:16px;display:none}
.result.show{display:block}
.result .label{font-size:12px;color:var(--gray);margin-bottom:8px}
.linkbox{display:flex;gap:8px;align-items:center;background:var(--bg);border-radius:12px;padding:11px 12px}
.linkbox code{flex:1;font-size:12px;color:#333;word-break:break-all;font-family:ui-monospace,Menlo,monospace}
.copy-btn{font-size:12px;color:var(--red);font-weight:600;flex:none}
.open-btn{display:block;text-align:center;margin-top:12px;height:44px;line-height:44px;
  border-radius:22px;background:#111;color:#fff;font-size:14px;font-weight:600;text-decoration:none}
.result-actions{display:flex;gap:10px}
.result-actions .open-btn{flex:1}
.ghost-btn{flex:1;margin-top:12px;height:44px;border-radius:22px;border:1px solid var(--line);
  background:#fff;color:#333;font-size:14px;font-weight:500}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.chip{height:34px;padding:0 14px;border-radius:17px;border:1px solid var(--line);background:#fff;
  font-size:13px;color:#555}
.chip.on{background:#111;border-color:#111;color:#fff}
.result .meta{font-size:12px;color:var(--red);margin-bottom:10px;line-height:1.6}
.tip{margin-top:18px;font-size:12px;color:#b0b0b0;line-height:1.7}

/* 预览切换 */
.switch{display:flex;gap:8px;padding:12px 14px;background:#fff;position:sticky;top:48px;z-index:19;
  border-bottom:1px solid var(--line)}
.switch button{flex:1;height:34px;border-radius:17px;font-size:13px;color:#666;background:var(--bg)}
.switch button.on{background:#111;color:#fff;font-weight:600}
.pane{display:none;padding-bottom:110px}
.pane.on{display:block}

/* 信息流 */
.feed{padding:14px 0 24px;background:var(--bg);min-height:calc(100vh - 140px)}
.feed-card{background:#fff;border-radius:14px;overflow:hidden;margin:0 12px 14px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.feed-cover{position:relative;aspect-ratio:3/4;background:#eee}
.feed-cover img{width:100%;height:100%;object-fit:cover}
.feed-body{padding:10px 12px 12px}
.feed-title{font-size:15px;line-height:1.45;font-weight:500;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.feed-meta{display:flex;align-items:center;gap:6px;margin-top:9px;font-size:11px;color:var(--gray)}
.avatar{width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,#ffb36b,#ff2442);
  display:flex;align-items:center;justify-content:center;color:#fff;font-size:9px;font-weight:700}
.feed-like{margin-left:auto;display:flex;align-items:center;gap:3px}

/* 详情 */
.detail-head{padding:0;position:relative}
.carousel{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:0;background:#000;-webkit-overflow-scrolling:touch}
.carousel::-webkit-scrollbar{display:none}
.slide{flex:0 0 100%;scroll-snap-align:center;position:relative}
.slide canvas{width:100%;height:auto;display:block}
.dots{position:absolute;right:14px;top:calc(min(100vw, 480px) * 4 / 3 - 44px);background:rgba(0,0,0,.45);color:#fff;
  font-size:11px;padding:3px 9px;border-radius:11px;z-index:5}
.detail{padding:16px 16px 8px}
.detail h2{font-size:18px;line-height:1.45;font-weight:600}
.detail .text{margin-top:12px;font-size:14.5px;line-height:1.82;color:#333;white-space:pre-wrap}
.tags{margin-top:14px;display:flex;flex-wrap:wrap;gap:7px}
.tags span{font-size:12.5px;color:#13386c}
.author{display:flex;align-items:center;gap:9px;padding:14px 16px;border-top:1px solid var(--bg);margin-top:16px}
.author .name{font-size:13px;font-weight:600}
.author .desc{font-size:11px;color:var(--gray);margin-top:2px}
.author .follow{margin-left:auto;font-size:12px;color:var(--red);border:1px solid var(--red);
  border-radius:14px;padding:5px 12px}

/* 底部操作栏 */
.actions{position:fixed;left:0;right:0;margin:0 auto;bottom:0;width:auto;max-width:480px;
  display:flex;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-top:1px solid var(--line);z-index:30}
.actions button{flex:1;min-width:0;white-space:nowrap;height:44px;border-radius:22px;font-size:13.5px;font-weight:600}
.btn-ghost{background:var(--bg);color:#222}
.btn-main{background:var(--red);color:#fff}

/* 弹层 */
.mask{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;z-index:50;align-items:flex-end;justify-content:center}
.mask.show{display:flex}
.sheet{width:100%;max-width:480px;background:#fff;border-radius:20px 20px 0 0;padding:22px 20px calc(24px + env(safe-area-inset-bottom))}
.sheet h3{font-size:17px;margin-bottom:6px}
.sheet p{font-size:12px;color:var(--gray);line-height:1.6;margin-bottom:14px}
.sheet label{display:block;font-size:12px;color:#666;margin:12px 0 6px}
.sheet input[type=url],.sheet input[type=text]{width:100%;height:44px;border:1px solid var(--line);
  border-radius:12px;padding:0 12px;font-size:14px;outline:none}
.upload{width:100%;height:96px;border:1px dashed #d8d8d8;border-radius:12px;display:flex;
  align-items:center;justify-content:center;color:#b0b0b0;font-size:13px;background:#fafafa;overflow:hidden}
.upload img{width:100%;height:100%;object-fit:cover}
.sheet .row{display:flex;gap:10px;margin-top:16px}
.sheet .row button{flex:1;height:46px;border-radius:23px;font-size:14px;font-weight:600}

/* toast */
.toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%) translateY(10px);
  background:rgba(0,0,0,.82);color:#fff;font-size:13px;padding:10px 16px;border-radius:20px;
  opacity:0;pointer-events:none;transition:.22s;z-index:99;white-space:nowrap}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* 记录页 */
.rec-list{padding:14px}
.rec{display:flex;gap:12px;padding:12px;border:1px solid var(--line);border-radius:14px;margin-bottom:12px}
.rec img{width:64px;height:84px;object-fit:cover;border-radius:8px;background:#eee}
.rec .meta{flex:1;min-width:0}
.rec .meta b{font-size:14px}
.rec .meta div{font-size:11px;color:var(--gray);margin-top:5px;word-break:break-all}
.empty{text-align:center;color:#b0b0b0;font-size:13px;padding:60px 0}

/* 双手机预览 */
.stage{display:none}
.phone-block{display:flex;flex-direction:column;align-items:center;gap:12px}
.phone-label{font-size:13px;color:#888;letter-spacing:.3px}
.phone-frame{width:340px;height:737px;background:#1a1a1a;border-radius:44px;padding:4px;
  box-shadow:0 0 0 1px #333,0 16px 48px rgba(0,0,0,.28)}
.phone-screen{width:100%;height:100%;border-radius:40px;overflow:hidden;background:#fff;
  display:flex;flex-direction:column;position:relative}
.status-bar{height:44px;flex:none;display:flex;align-items:center;justify-content:space-between;
  padding:0 22px;font-size:13px;font-weight:600;background:#fff}
.status-bar .sig{font-size:10px;letter-spacing:1px}
.phone-content{flex:1;overflow:hidden}
.phone-content iframe{width:100%;height:100%;border:none;display:block}
.home-bar{position:absolute;bottom:7px;left:50%;transform:translateX(-50%);width:108px;height:4px;
  border-radius:3px;background:rgba(0,0,0,.2);z-index:5}

@media (min-width:701px){
  body:not(.embed) .topbar,
  body:not(.embed) .switch,
  body:not(.embed) .actions{display:none}
  body:not(.embed) .wrap{max-width:none;background:#f0f0f0}
  body:not(.embed) .stage{display:flex;gap:34px;justify-content:center;align-items:flex-start;
    padding:36px 20px 48px}
  body:not(.embed) .pane{display:none!important}
}

/* iframe 内嵌模式 */
body.embed .topbar,
body.embed .switch,
body.embed .stage{display:none}
body.embed .wrap{max-width:none}
body.embed-feed .actions,
body.embed-feed #pane-detail{display:none!important}
body.embed-detail #pane-feed{display:none!important}
body.embed .pane{padding-bottom:96px}
