:root {
  --green: #07c160;
  --link: #576b95;
  --text: #111;
  --sub: #888;
  --line: #e7e7e7;
  --page: #fff;
  --nav: rgba(237, 237, 237, 0.92);
  --like: #f7f7f7;
  --phone: 390px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background: #111;
  color: var(--text);
  user-select: none;
}

button, input, textarea, select { font: inherit; }
button { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.phone {
  width: min(100%, var(--phone));
  min-height: 100%;
  height: 100%;
  margin: 0 auto;
  background: var(--page);
  position: relative;
  overflow: hidden;
}

.shell { height: 100%; }
.pc-side { display: none; }

@media (min-width: 600px) and (max-width: 899px) {
  body { background: #e8e8e8; }
  .phone {
    width: min(100%, 540px);
    box-shadow: 0 0 0 1px #e0e0e0, 0 12px 40px rgba(0,0,0,.06);
  }
}

.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: calc(46px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 6px;
  padding-right: 8px;
  background: transparent;
  color: #fff;
  transition: background .2s, color .2s, box-shadow .2s;
}
.nav.solid {
  background: #ededed;
  color: #111;
  box-shadow: 0 0.5px 0 rgba(0,0,0,.08);
}
.nav h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: .2s;
}
.nav.solid h1 { opacity: 1; transform: none; }
.nav-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: inherit;
}
.nav-btn svg { width: 22px; height: 22px; }

.refresh-hint {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.feed {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  padding-bottom: 48px;
}
.feed::-webkit-scrollbar { width: 0; }

.cover-wrap { position: relative; margin-bottom: 48px; }
.cover {
  height: 320px;
  background: #2b2b2b center/cover no-repeat;
  overflow: hidden;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-user {
  position: absolute;
  right: 12px;
  bottom: -36px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cover-name {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
  margin-bottom: 22px;
}
.cover-avatar, .avatar {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.75);
  background: #6bb7a3;
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  overflow: hidden;
  flex-shrink: 0;
}

.notice {
  margin: 18px 16px 4px 76px;
  background: #4c4c4c;
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 92px);
}
.notice .dot {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
}
.notice b { font-weight: 500; }

.moment {
  display: flex;
  gap: 10px;
  padding: 14px 12px 12px;
  position: relative;
}
.moment + .moment::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--line);
}
.moment .avatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  margin-top: 1px;
}
.moment-body { flex: 1; min-width: 0; }
.nick {
  color: var(--link);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}
.text {
  margin: 5px 0 8px;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}
.imgs {
  display: grid;
  gap: 4px;
  margin: 2px 0 8px;
}
.imgs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f2f2f2;
}
.imgs.n1 { width: min(62%, 220px); }
.imgs.n1 img { height: auto; max-height: 240px; object-fit: cover; }
.imgs.n2, .imgs.n4 { width: calc((100% - 8px) * 2 / 3 + 4px); grid-template-columns: 1fr 1fr; }
.imgs.n2 img, .imgs.n4 img { aspect-ratio: 1; }
.imgs.n3, .imgs.n5, .imgs.n6, .imgs.n7, .imgs.n8, .imgs.n9 {
  width: 100%;
  grid-template-columns: 1fr 1fr 1fr;
}
.imgs.n3 img, .imgs.n5 img, .imgs.n6 img, .imgs.n7 img, .imgs.n8 img, .imgs.n9 img { aspect-ratio: 1; }

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  font-size: 13px;
  min-height: 28px;
}
.loc { color: var(--link); }
.del { color: var(--link); margin-left: 8px; }
.meta-spacer { flex: 1; }
.more {
  width: 32px;
  height: 20px;
  border-radius: 3px;
  background: #f7f7f7;
  color: var(--link);
  font-size: 18px;
  letter-spacing: 2px;
  line-height: 16px;
  position: relative;
}
.action-pop {
  position: absolute;
  right: 38px;
  top: 50%;
  transform: translateY(-50%) scaleX(.6);
  transform-origin: right center;
  background: #4c4c4c;
  color: #fff;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: .12s ease;
  z-index: 6;
}
.action-pop.show {
  opacity: 1;
  transform: translateY(-50%) scaleX(1);
  pointer-events: auto;
}
.action-pop button {
  width: 78px;
  height: 36px;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.action-pop button + button { border-left: 1px solid #5d5d5d; }
.action-pop svg { width: 16px; height: 16px; }

.social {
  margin-top: 6px;
  background: var(--like);
  border-radius: 3px;
  position: relative;
  font-size: 14px;
}
.social::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 10px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--like);
}
.likes, .comments { padding: 8px 10px; line-height: 1.5; }
.likes {
  color: var(--link);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.likes svg { width: 13px; height: 13px; margin-top: 4px; flex-shrink: 0; }
.likes + .comments, .comments + .comments { border-top: 0.5px solid #ececec; }
.cmt { color: #111; }
.cmt b { color: var(--link); font-weight: 600; }
.cmt .reply { color: #111; font-weight: 400; }

.end-tip {
  text-align: center;
  color: #bbb;
  font-size: 12px;
  padding: 18px 0 8px;
}

.sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #ededed;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.sheet-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.sheet[hidden], .lightbox[hidden], .comment-bar[hidden], .toast[hidden], .notice[hidden] { display: none !important; }
.sheet-nav {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #ededed;
  position: relative;
}
.sheet-nav b {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  pointer-events: none;
}
.text-btn { font-size: 16px; padding: 8px; }
.publish-btn {
  background: var(--green);
  color: #fff;
  border-radius: 4px;
  padding: 5px 14px;
  font-size: 15px;
}
.publish-btn:disabled { opacity: .45; }
#postText {
  width: 100%;
  min-height: 120px;
  border: 0;
  resize: none;
  padding: 8px 16px;
  outline: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
}
.picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 16px 20px;
}
.pick, .add-pick {
  aspect-ratio: 1;
  background: #d9d9d9;
  position: relative;
  overflow: hidden;
}
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick .x {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 16px;
}
.add-pick {
  display: grid;
  place-items: center;
  color: #888;
  font-size: 42px;
  background: #dcdcdc;
}
.row-item {
  margin: 0 0 10px;
  background: #fff;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  font-size: 16px;
}
.row-item.muted em { margin-left: auto; color: #bbb; font-style: normal; font-size: 14px; }
.row-ico { width: 22px; height: 22px; color: #07c160; display: grid; }
.row-ico svg { width: 22px; height: 22px; }
.row-item select {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  appearance: none;
}
.chev { color: #c7c7c7; font-size: 22px; }

.profile-sheet { background: #f7f7f7; }
.profile-tip { color: #888; font-size: 13px; padding: 16px 16px 0; }
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px;
  font-size: 13px;
  color: #888;
}
.field input {
  height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 16px;
  color: #111;
}
.field-label { margin: 0 16px 8px; color: #888; font-size: 13px; }
.swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.swatch {
  aspect-ratio: 1;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  border: 2px solid transparent;
}
.swatch.on { border-color: #111; }

.comment-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f6f6f6;
  border-top: 0.5px solid #ddd;
  display: flex;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
}
.comment-bar input {
  flex: 1;
  height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  outline: none;
}
.comment-bar button {
  color: var(--green);
  font-weight: 600;
  min-width: 48px;
}
.comment-bar button:disabled { color: #bbb; }

.lightbox {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #000;
  display: grid;
  place-items: center;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
#lightboxIndex {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 14px;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 60;
  white-space: nowrap;
}

.empty {
  text-align: center;
  color: #bbb;
  padding: 40px 0;
}

.imgs img { cursor: zoom-in; }

@media (min-width: 900px) and (min-height: 600px) {
  body {
    background:
      radial-gradient(1200px 600px at 20% -10%, #3a3a3a 0%, transparent 50%),
      #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: auto;
  }
  .shell {
    width: min(1180px, calc(100vw - 40px));
    height: min(860px, calc(100vh - 40px));
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0,0,0,.55);
  }
  .pc-side {
    display: flex;
    width: 64px;
    flex-shrink: 0;
    background: #2e2e2e;
    flex-direction: column;
    align-items: center;
    padding: 18px 0 16px;
  }
  .pc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: #6bb7a3;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 22px;
  }
  .pc-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    align-items: center;
  }
  .pc-ico {
    width: 44px;
    height: 44px;
    color: #a6a6a6;
    display: grid;
    place-items: center;
    border-radius: 6px;
  }
  .pc-ico svg { width: 22px; height: 22px; }
  .pc-ico svg path { fill: currentColor; }
  .pc-ico svg circle { fill: none; stroke: currentColor; }
  .pc-ico:hover { color: #ddd; background: rgba(255,255,255,.06); }
  .pc-ico.on { color: #07c160; }
  .phone {
    flex: 1;
    width: auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    box-shadow: none;
  }
  .nav {
    height: 54px;
    padding-left: 10px;
    padding-right: 14px;
  }
  .nav h1 { font-size: 18px; }
  .nav-btn { width: 46px; height: 46px; }
  .nav-btn:hover { opacity: .75; }
  #backBtn { visibility: hidden; pointer-events: none; }
  .cover { height: 380px; }
  .cover-user { right: 28px; bottom: -42px; gap: 12px; }
  .cover-name { font-size: 22px; margin-bottom: 26px; }
  .cover-avatar, .avatar {
    width: 80px;
    height: 80px;
    font-size: 30px;
    border-radius: 8px;
  }
  .cover-wrap { margin-bottom: 58px; }
  .feed {
    padding-bottom: 64px;
  }
  .feed::-webkit-scrollbar { width: 8px; }
  .feed::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.18);
    border-radius: 8px;
  }
  .notice {
    margin: 22px auto 8px;
    max-width: 740px;
    width: max-content;
    margin-left: max(96px, calc((100% - 740px) / 2 + 72px));
  }
  .moment {
    max-width: 740px;
    margin: 0 auto;
    gap: 14px;
    padding: 18px 8px 16px;
  }
  .moment .avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
    border-radius: 6px;
  }
  .nick { font-size: 17px; }
  .text { font-size: 16px; max-width: 640px; }
  .imgs { gap: 6px; }
  .imgs.n1 { width: min(70%, 360px); }
  .imgs.n1 img { max-height: 320px; }
  .imgs img:hover { filter: brightness(0.96); }
  .more {
    width: 36px;
    height: 24px;
  }
  .more:hover { background: #ececec; }
  .cmt { cursor: pointer; }
  .cmt:hover { background: rgba(0,0,0,.03); }
  .end-tip { padding: 28px 0 16px; }
  #postText {
    min-height: 160px;
    padding: 16px 28px;
    max-width: 680px;
  }
  .picker-grid {
    max-width: 420px;
    padding: 8px 28px 24px;
  }
  .row-item { max-width: 680px; }
  .profile-tip, .field, .field-label, .swatches {
    max-width: 560px;
  }
  .swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .comment-bar {
    padding: 10px 20px 12px;
  }
  .comment-bar input { height: 40px; font-size: 15px; }
  .sheet {
    background: rgba(0, 0, 0, .4);
    padding: 52px 24px 24px;
    align-items: flex-start;
    justify-content: center;
  }
  .sheet-card {
    width: min(560px, 100%);
    height: auto;
    max-height: calc(100% - 24px);
    background: #ededed;
    border-radius: 8px;
    overflow: auto;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  }
  .profile-sheet .sheet-card { background: #f7f7f7; }
  .sheet-nav { height: 52px; padding: 0 18px; }
  #postText, .picker-grid, .row-item {
    max-width: none;
  }
  @media (hover: hover) and (pointer: fine) {
    .meta:hover .action-pop {
      opacity: 1;
      transform: translateY(-50%) scaleX(1);
      pointer-events: auto;
    }
  }
}
