*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0;background:#ededed;color:#222;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing:antialiased;font-size:15px}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
button{font:inherit;cursor:pointer;border:none;background:none}

/* phone-sized center column; on desktop this stays centered like a phone preview */
.frame{max-width:480px;margin:0 auto;min-height:100vh;background:#fff;position:relative;overflow:hidden}
@media (min-width:768px){
  body{padding:24px 0}
  .frame{box-shadow:0 6px 28px rgba(0,0,0,.1);border-radius:18px;overflow:hidden;min-height:calc(100vh - 48px)}
}

/* ========== home ========== background:#e44c3d; */
.hero{position:relative;color:#fff;padding:48px 24px 60px;margin-bottom:36px;min-height:338px;display:flex;flex-direction:column}
.hero .owner{position:absolute;right:0;bottom:-28px;display:flex;align-items:flex-start;gap:12px;padding:0 14px 0 0;z-index:3}
.hero .owner .name{color:#fff;font-weight:500;font-size:20px;padding: 3px;text-shadow:0 1px 2px rgba(0,0,0,.35);padding-top:6px}
.hero .owner .avatar{width:72px;height:72px;border-radius:4px;background:#ccc;overflow:hidden;flex:0 0 auto;display:block;box-shadow:0 1px 4px rgba(0,0,0,.1)}
.hero .owner .avatar img{width:100%;height:100%;object-fit:cover}
.hero.with-bg{background-size:cover} /* background-position:center; */
.hero.with-bg::before{content:"";position:absolute;inset:0;/* background:rgba(228,76,61,.65) */}
.hero>*{position:relative;z-index:1}
.hero-title{font-size:22px;font-weight:700;letter-spacing:1px;margin:0 0 28px}
.app-row{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:auto;margin-bottom:-10px}
.app-cell{display:flex;flex-direction:column;align-items:center;gap:6px;color:#fff;font-size:12px;text-align:center}
.app-cell .ic{width:44px;height:44px;border-radius:10px;background:rgba(255,255,255,.18);
  display:flex;align-items:center;justify-content:center;overflow:hidden;font-size:11px;color:#fff;opacity:.9}
.app-cell .ic img{width:100%;height:100%;object-fit:cover}
.hero-slogan{font-size:26px;font-weight:700;line-height:1.35;margin:12px 0 0}

/* owner stripe (profile/personal) */
.owner{position:relative;margin-top:-44px;padding:0 16px 10px 0;display:flex;justify-content:flex-end;align-items:flex-end;gap:10px;z-index:2}
.owner .name{color:#e44c3d;font-weight:600;font-size:14px;padding-bottom:10px}
.owner .avatar{width:56px;height:56px;border-radius:6px;background:#ccc;overflow:hidden;flex:0 0 auto;display:block}
.owner .avatar img{width:100%;height:100%;object-fit:cover}

/* moments list */
.moments{padding:14px 14px 40px}
.moment{display:flex;gap:12px;padding:16px 0 12px;border-bottom:1px solid #f1f1f1}
.moment:last-child{border-bottom:none}
.moment .mav{width:48px;height:48px;border-radius:4px;flex:0 0 auto;background:#ddd;overflow:hidden;cursor:pointer}
.moment .mbody{flex:1;min-width:0}
.moment .mname{display:block;color:#576b95;font-weight:600;font-size:16px;margin-bottom:6px;cursor:pointer}
.moment .mtext{font-size:16px;line-height:1.5;white-space:pre-wrap;word-break:break-word;color:#222}
.moment .mimgs{margin-top:8px;display:grid;gap:4px}
.moment .mimgs.n1{grid-template-columns:minmax(0,60%)}
.moment .mimgs.n2,.moment .mimgs.n4{grid-template-columns:repeat(2,1fr)}
.moment .mimgs.n3,.moment .mimgs.n5,.moment .mimgs.n6,.moment .mimgs.n7,.moment .mimgs.n8,.moment .mimgs.n9{grid-template-columns:repeat(3,1fr)}
.moment .mimgs img{width:100%;aspect-ratio:1/1;object-fit:cover;background:#eee;cursor:zoom-in;
  -webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none}
.moment .mtime{margin-top:8px;color:#b5b5b5;font-size:12px}
.moment .mvideo{position:relative;margin-top:8px;max-width:62%;aspect-ratio:3/4;background:#000;border-radius:3px;overflow:hidden;cursor:pointer}
.moment .mvideo video{display:block;width:100%;height:100%;object-fit:cover;background:#000}
.moment .mvideo .play{position:absolute;inset:0;margin:auto;width:46px;height:46px;border-radius:50%;
  background:rgba(0,0,0,.55);pointer-events:none;transition:opacity .15s}
.moment .mvideo .play::before{content:"";position:absolute;top:50%;left:55%;transform:translate(-50%,-50%);
  width:0;height:0;border-left:14px solid #fff;border-top:9px solid transparent;border-bottom:9px solid transparent}
.moment .mvideo.playing .play{opacity:0}

.empty{color:#999;text-align:center;padding:40px 20px}

/* fullscreen image viewer */
.lightbox{position:fixed;inset:0;background:#000;z-index:1000;display:none;
  overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
.lightbox.active{display:flex;align-items:safe center;justify-content:center}
.lightbox .lb-img{display:block;width:100%;height:auto;flex-shrink:0;
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
.lightbox .lb-close{position:fixed;top:14px;right:16px;width:40px;height:40px;border-radius:50%;
  background:rgba(255,255,255,.18);color:#fff;font-size:26px;line-height:40px;text-align:center;
  cursor:pointer;user-select:none;z-index:2}
.lightbox .lb-counter{position:fixed;top:20px;left:50%;transform:translateX(-50%);
  color:#fff;font-size:13px;background:rgba(0,0,0,.45);padding:4px 12px;border-radius:12px;z-index:2}
.lightbox .lb-nav{position:fixed;top:50%;transform:translateY(-50%);width:44px;height:44px;
  border-radius:50%;background:rgba(255,255,255,.18);color:#fff;font-size:30px;line-height:44px;
  text-align:center;cursor:pointer;user-select:none;z-index:2}
.lightbox .lb-prev{left:10px}
.lightbox .lb-next{right:10px}

/* ========== profile ========== */
.pf-bar{display:flex;align-items:center;justify-content:space-between;padding:14px 16px}
.pf-bar a.back{font-size:24px;line-height:1}
.pf-head{display:flex;gap:14px;padding:4px 16px 18px}
.pf-head .pav{width:64px;height:64px;border-radius:6px;background:#ddd;overflow:hidden;flex:0 0 auto}
.pf-head .pn{display:flex;flex-direction:column;justify-content:center}
.pf-head .pn h1{margin:0;font-size:22px;font-weight:700}
.pf-head .pn .gender{width:30px;height:30px;margin-top:6px;display:block;object-fit:contain; margin-left: -7px}
.pf-section{border-top:10px solid #ededed;padding:16px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.pf-section .label{color:#222;font-size:15px}
.pf-section .muted{color:#888;font-size:14px;margin-top:6px}
.pf-section .chev{color:#c7c7c7}
.pf-section.stacked{flex-direction:column;align-items:stretch}
.pf-section.stacked .row{display:flex;justify-content:space-between;align-items:center}
.pf-row-strip{display:flex;align-items:center;padding:14px 16px;gap:14px;cursor:pointer;background:#fff;border-bottom:1px solid #f3f3f3}
.pf-row-strip .label{flex:0 0 auto;white-space:nowrap;font-size:16px;font-weight:600;color:#222}
.pf-row-strip .strip{display:flex;gap:4px;overflow:hidden;flex:1 1 auto;min-width:0}
.pf-row-strip .strip img{width:50px;height:50px;object-fit:cover;background:#eee;flex:0 0 auto;border-radius:2px}
.pf-row-strip .chev{flex:0 0 auto;color:#c7c7c7;font-size:18px}
.pf-recommend{padding:6px 10px 40px;background:#fff}
.pf-recommend h3{font-size:14px;color:#666;font-weight:500;padding:10px 6px;margin:0;display:flex;align-items:center;gap:6px}
.pf-recommend h3::before{content:"";display:inline-block;width:14px;height:14px;background:#666;
  mask:linear-gradient(#000,#000);mask-size:contain;border-radius:2px}
.pf-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px 10px;padding:8px 10px 18px}
.pf-grid .c{display:flex;flex-direction:column;align-items:center;gap:8px;color:#333;font-size:13px;text-align:center}
.pf-grid .c .ic{width:52px;height:52px;border-radius:12px;background:#f2f2f2;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:11px;color:#888}
.pf-grid .c .ic img{width:100%;height:100%;object-fit:cover}

/* ========== admin ========== */
.adm{max-width:860px;margin:0 auto;padding:24px 16px}
.adm h1{margin:0 0 18px;font-size:22px}
.adm h2{margin:28px 0 12px;font-size:17px;color:#444}
.adm .card{background:#fff;border-radius:10px;padding:18px;box-shadow:0 2px 10px rgba(0,0,0,.04);margin-bottom:16px}
.adm label{display:block;font-size:13px;color:#555;margin:10px 0 6px}
.adm input[type=text],.adm input[type=url],.adm input[type=password],.adm textarea,.adm select{
  width:100%;padding:9px 10px;border:1px solid #dcdcdc;border-radius:6px;font:inherit;background:#fff}
.adm textarea{min-height:100px;resize:vertical}
.adm .btn{display:inline-block;background:#07c160;color:#fff;padding:9px 18px;border-radius:6px;font-size:14px}
.adm .btn.secondary{background:#666}
.adm .btn.danger{background:#e64340}
.adm .inline{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.adm .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.adm .kvs{display:grid;grid-template-columns:140px 1fr;gap:8px 16px;margin:8px 0}
.adm .post-row{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid #eee;align-items:flex-start}
.adm .post-row:last-child{border-bottom:none}
.adm .post-row .tag{display:inline-block;font-size:11px;padding:2px 6px;border-radius:10px;background:#eef}
.adm .post-row .tag.p{background:#fee}
.adm .thumbs{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}
.adm .thumbs img{width:64px;height:64px;object-fit:cover;border-radius:4px;background:#eee}
.adm .msg{padding:10px 14px;background:#e6f7ee;border:1px solid #bde5c8;border-radius:6px;margin-bottom:14px;color:#207040}
.adm .err{padding:10px 14px;background:#fde8e8;border:1px solid #f5c2c2;border-radius:6px;margin-bottom:14px;color:#902}
.adm .topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.adm .stat{display:inline-block;background:#fff;border-radius:8px;padding:14px 22px;margin-right:12px;box-shadow:0 2px 8px rgba(0,0,0,.04)}
.adm .stat .n{font-size:26px;font-weight:700;color:#07c160}
.adm .stat .l{font-size:12px;color:#888;margin-top:4px}

/* login */
.login-wrap{max-width:360px;margin:80px auto;padding:32px 24px;background:#fff;border-radius:12px;box-shadow:0 4px 18px rgba(0,0,0,.06)}
.login-wrap h1{margin:0 0 20px;font-size:20px;text-align:center}
