:root {
  color-scheme: light;
  --green: #07c160;
  --green-press: #06ad56;
  --bg: #eaeaea;
  --nav: #f8f8f8;
  --text: #191919;
  --sub: #737373;
  --ph: #c8c8c8;
  --link: #576b95;
  --line: #e5e5e5;
  --like: #f3f3f5;
  --danger: #fa5151;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #d8d8d8;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }

#app {
  width: min(430px, 100%);
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 560px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #app {
    height: min(844px, calc(100dvh - 32px));
    margin: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
  }
}

#screen {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
#screen.view-list,
#screen.view-preview { background: #fff; }

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--nav);
  padding-top: env(safe-area-inset-top);
  border-bottom: 0.5px solid rgba(0, 0, 0, .08);
}
.nav-inner {
  height: 44px;
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  align-items: center;
  padding: 0 6px;
}
.nav h1 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}
.nav-side { display: flex; align-items: center; min-width: 0; }
.nav-side.right { justify-content: flex-end; }
.nav-btn {
  border: 0;
  background: transparent;
  height: 44px;
  padding: 0 6px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: #191919;
}
.nav-btn.green { color: var(--green); }
.nav-btn.icon { padding-right: 8px; }
.nav-btn:active { opacity: .45; }
.back-ico { margin-right: 1px; display: block; }

.item {
  width: 100%;
  border: 0;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 16px;
  min-height: 68px;
  text-align: left;
  position: relative;
}
.item + .item::before {
  content: "";
  position: absolute;
  left: 76px;
  right: 0;
  top: 0;
  height: 1px;
  background: #ededed;
  transform: scaleY(.5);
}
.item:active { background: #f5f5f5; }
.ava, .ava-ph {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex: none;
  background: #e6e6e6;
}
.item-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.item-name {
  font-size: 16px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-time {
  margin-top: 4px;
  font-size: 12px;
  color: #b0b0b0;
}
.chev { flex: none; display: block; }

.empty {
  padding: 28vh 24px 0;
  text-align: center;
  color: #999;
}
.empty p { margin: 0 0 16px; font-size: 15px; }
.primary {
  border: 0;
  background: var(--green);
  color: #fff;
  height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 16px;
}
.primary:active { background: var(--green-press); }

.composer {
  background: #fff;
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 14px;
}
.composer textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
  min-height: 72px;
  padding: 0;
}
.composer textarea::placeholder { color: #d0d0d0; }
.hair {
  height: 1px;
  background: #eee;
  border: 0;
  margin: 4px 0 0;
  transform: scaleY(.5);
}
.remind {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 0;
  font-size: 16px;
  color: var(--ph);
  line-height: 1.45;
}
.remind.on { color: var(--text); }
.grow { flex: 1; min-height: 20px; }
.img-row { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb, .add-img {
  width: 76px;
  height: 76px;
  border-radius: 2px;
  position: relative;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}
.thumb.sel { box-shadow: 0 0 0 2px var(--green); }
.thumb .x {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  padding: 0;
}
.add-img {
  border: 0;
  background: #d8d8d8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.img-tools { display: flex; gap: 8px; margin-top: 10px; }
.img-tools button {
  border: 0;
  background: #f2f2f2;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
}

.group { margin-top: 8px; background: #fff; }
.cell {
  width: 100%;
  min-height: 52px;
  border: 0;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 8px 14px 8px 16px;
  font-size: 16px;
  text-align: left;
  position: relative;
}
.cell + .cell::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--line);
  transform: scaleY(.5);
}
.cell:active { background: #f3f3f3; }
.cell-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--sub);
  font-size: 15px;
}
.cell-right .val {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-right .ph { color: var(--ph); }
.mini-ava {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  background: #e6e6e6;
  display: block;
}

.field-card {
  margin-top: 12px;
  background: #fff;
  padding: 0 16px;
}
.field-card input,
.field-card textarea {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 14px 0;
}
.hint {
  color: #999;
  font-size: 13px;
  padding: 12px 16px 0;
  margin: 0;
}
.quick-row { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.quick, .chip {
  border: 0;
  background: #fff;
  border-radius: 16px;
  padding: 7px 12px;
  font-size: 14px;
  color: #333;
}
.quick:active, .chip:active { background: #e8f8ef; }
.chips { padding: 4px 16px 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 8px 0;
}
.chip i {
  font-style: normal;
  color: #999;
  font-size: 14px;
}
.add-line {
  display: flex;
  gap: 8px;
  background: #fff;
  margin-top: 12px;
  padding: 8px 12px;
  align-items: center;
}
.add-line input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 16px;
  min-width: 0;
  padding: 8px 0;
  background: transparent;
}
.add-line button {
  border: 0;
  background: var(--green);
  color: #fff;
  border-radius: 4px;
  height: 32px;
  padding: 0 12px;
  font-size: 14px;
  flex: none;
}
.linkish {
  display: block;
  margin: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--link);
  font-size: 15px;
  padding: 8px 0;
  text-align: left;
}
.time-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px;
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
}
.time-label input { border: 0; font-size: 16px; background: transparent; }

.like-panel { background: #fff; padding-bottom: 12px; }
.like-ops {
  display: flex;
  gap: 16px;
  padding: 10px 14px 0;
}
.like-ops button, .text-btn {
  border: 0;
  background: none;
  color: var(--link);
  font-size: 13px;
  padding: 0;
}
.tip {
  margin: 0;
  padding: 10px 14px 0;
  color: #aaa;
  font-size: 12px;
}
.like-grid, .lib-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px 8px;
  padding: 12px;
}
.lib-grid { grid-template-columns: repeat(4, 1fr); gap: 14px 10px; }
.like-item, .lib-item {
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  text-align: center;
}
.like-item img, .lib-item img, .add-tile {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  background: #eee;
}
.nm {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.add-tile {
  border: 1px dashed #ddd;
  background: #fafafa;
  color: #cfcfcf;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lib-label {
  margin: 0;
  padding: 14px 14px 0;
  font-size: 13px;
  color: #999;
}
.lib-item { position: relative; }
.lib-item.on img { box-shadow: 0 0 0 2px var(--green); }
.mark {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  display: none;
  align-items: center;
  justify-content: center;
}
.lib-item.on .mark { display: flex; }
.lib-empty { color: #999; text-align: center; padding: 40px 16px; }

.post {
  display: flex;
  gap: 10px;
  padding: 14px 14px 24px;
  background: #fff;
}
.post-ava {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  flex: none;
  background: #eee;
}
.col { flex: 1; min-width: 0; }
.name {
  color: var(--link);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.post-text {
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.imgs { margin-top: 8px; }
.imgs.one img {
  max-width: 72%;
  max-height: 280px;
  width: auto;
  height: auto;
  border-radius: 4px;
  display: block;
}
.imgs.multi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 264px;
}
.imgs.multi.four {
  grid-template-columns: repeat(2, 1fr);
  max-width: 176px;
}
.imgs.multi img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}
.meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.meta-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.time { color: #737373; font-size: 13px; }
.src { color: #9a9a9a; font-size: 12px; }
.loc { color: var(--link); font-size: 13px; }
.del {
  border: 0;
  background: none;
  color: var(--link);
  font-size: 13px;
  padding: 0;
}
.dots {
  width: 32px;
  height: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: none;
  padding: 0;
}
.dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--link);
  display: block;
}
.interact {
  margin-top: 8px;
  background: var(--like);
  border-radius: 4px;
  padding: 7px 8px 6px;
}
.likes { display: flex; align-items: flex-start; gap: 6px; }
.heart {
  width: 18px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.like-avatars { display: flex; flex-wrap: wrap; gap: 4px; }
.like-avatars img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 2px;
  background: #e5e5e5;
}
.comments { margin-top: 4px; }
.likes + .comments {
  border-top: 1px solid #e4e4e6;
  margin-top: 6px;
  padding-top: 4px;
}
.cmt {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 2px 0;
  font-size: 14px;
  line-height: 1.45;
  color: #111;
  white-space: pre-wrap;
  word-break: break-word;
}
.who { color: var(--link); }

#dock {
  flex: none;
  background: #f7f7f7;
  border-top: 0.5px solid #dcdcdc;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
#dock[hidden] { display: none; }
.fake-input {
  flex: 1;
  height: 36px;
  border-radius: 6px;
  border: 0.5px solid #e3e3e3;
  background: #fff;
  color: #c5c5c5;
  text-align: left;
  padding: 0 10px;
  font-size: 15px;
}
.emoji-btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#overlay { position: absolute; inset: 0; z-index: 20; display: none; }
#overlay.open { display: block; }
.mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade .15s ease;
}
.mask.sheet-mask { align-items: flex-end; }
.mask.light-mask { background: rgba(0, 0, 0, .92); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  width: 80%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}
.dialog button {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 0;
  background: #fff;
  font-size: 17px;
}
.dialog button + button { box-shadow: inset 0 0.5px 0 #ededed; }
.dialog button.danger { color: var(--danger); }
.dialog button:active { background: #f2f2f2; }

.sheet {
  width: 100%;
  background: #fff;
  border-radius: 12px 12px 0 0;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom));
  max-height: 80%;
  overflow: auto;
}
.sheet h2 {
  margin: 6px 0 12px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}
.replying {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #888;
  font-size: 13px;
  margin-bottom: 8px;
}
.replying button { border: 0; background: none; color: var(--link); font-size: 13px; }
.picker {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.picker button {
  width: 58px;
  flex: none;
  border: 0;
  background: transparent;
  padding: 0;
}
.picker img {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  object-fit: cover;
  margin: 0 auto;
  display: block;
  background: #eee;
}
.picker .on img { box-shadow: 0 0 0 2px var(--green); }
.picker span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet textarea, .sheet input[type="text"] {
  width: 100%;
  border: 0;
  outline: none;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px;
  font-size: 16px;
}
.sheet textarea { min-height: 74px; resize: none; }
.sheet input[type="text"] { margin-bottom: 8px; }
.emo-row { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; }
.emo-row button {
  width: 34px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 0;
}
.send {
  margin-top: 10px;
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
}
.send:disabled { background: #b7e8cb; }
.light-img {
  max-width: 100%;
  max-height: 82%;
  object-fit: contain;
}
.light-nav {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}
.light-nav button, .light-side {
  border: 0;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border-radius: 16px;
  height: 32px;
  padding: 0 12px;
  font-size: 14px;
}
.light-side {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.light-side.prev { left: 8px; }
.light-side.next { right: 8px; }

#toast {
  position: absolute;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(6px);
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  padding: 8px 14px;
  border-radius: 8px;
  max-width: 78%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 40;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
