@font-face { font-family: "LR Serif"; src: url("/fonts/noto-serif-sc-chinese-simplified-400-normal.woff2") format("woff2"); font-display: swap; }

:root {
  color-scheme: light;
  --ink: #202822;
  --muted: #7a857d;
  --sage: #315d43;
  --sage-soft: #dce9de;
  --sage-pale: #edf3ed;
  --ivory: #f5f2eb;
  --paper: #fffefb;
  --line: rgba(55,75,61,.12);
  --serif: "LR Serif", "Songti SC", SimSun, serif;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--ivory); }
body { min-width: 0; margin: 0; overflow-x: hidden; background: var(--ivory); color: var(--ink); }
button, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.moments-shell { width: min(720px, 100%); min-height: 100dvh; margin: 0 auto; background: var(--ivory); box-shadow: 0 0 55px rgba(29,49,36,.08); }
.moments-cover { position: relative; z-index: 2; height: 252px; overflow: visible; padding: max(16px, env(safe-area-inset-top)) 18px 0; color: #fff; background-color: #294c38; background-image: radial-gradient(circle at 78% 24%, rgba(213,197,139,.35), transparent 32%), linear-gradient(135deg, #18271f, #416b50 72%, #7c8f70); background-position: center; background-size: cover; background-repeat: no-repeat; }
.moments-cover::before { content: "MOMENTS"; position: absolute; z-index: 1; top: max(22px, calc(env(safe-area-inset-top) + 5px)); left: 22px; color: rgba(255,255,255,.68); font-size: 9px; font-weight: 750; letter-spacing: .22em; pointer-events: none; }
.moments-cover.custom-cover::after { content: ""; position: absolute; z-index: 0; inset: 0; background: linear-gradient(180deg, rgba(6,12,8,.24), rgba(6,12,8,.03) 58%, rgba(6,12,8,.34)); pointer-events: none; }
.moments-cover > * { position: relative; z-index: 1; }
.back-button, .cover-publish-button { position: absolute; top: max(15px, env(safe-area-inset-top)); display: grid; place-items: center; width: 44px; height: 44px; border: 0; color: #fff; background: rgba(13,24,17,.32); backdrop-filter: blur(10px); }
.back-button { left: 14px; border-radius: 50%; text-decoration: none; font: 38px/1 Georgia, serif; padding-bottom: 5px; }
.cover-publish-button { right: 14px; border-radius: 50%; background: rgba(19,31,23,.28); box-shadow: 0 7px 20px rgba(8,18,11,.18); }
.cover-publish-button span { position: relative; width: 23px; height: 17px; border: 2px solid currentColor; border-radius: 4px; }
.cover-publish-button span::before { content: ""; position: absolute; top: -6px; left: 4px; width: 10px; height: 5px; border-radius: 3px 3px 0 0; background: currentColor; }
.cover-publish-button span::after { content: ""; position: absolute; inset: 3px 6px; border: 2px solid currentColor; border-radius: 50%; }
.change-cover-button { position: absolute !important; left: 18px; bottom: 18px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.38); border-radius: 999px; background: rgba(15,27,19,.26); color: white; font-size: 11px; letter-spacing: .03em; backdrop-filter: blur(12px); }
.change-cover-button:disabled { cursor: wait; opacity: .7; }
.profile { position: absolute !important; right: 24px; bottom: -41px; display: flex; align-items: center; gap: 13px; }
.profile strong { margin-top: -23px; color: #fff; font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: .03em; text-shadow: 0 2px 9px rgba(0,0,0,.38); }
.avatar { display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 auto; border-radius: 14px; background-position: center; background-size: cover; color: #fff; font-size: 16px; font-weight: 800; box-shadow: 0 5px 16px rgba(20,35,26,.16); }
.profile .avatar { width: 82px; height: 82px; border: 4px solid var(--paper); border-radius: 20px; box-shadow: 0 9px 24px rgba(20,35,26,.18); }
.avatar-okra, [data-avatar-id="okra"] { background-color: #d9895e; }
[data-avatar-id="gen"] { background-color: #f5f5f2; color: #1d2922; border: 1px solid #d7dbd8; }
[data-avatar-id="kimi"] { background-color: #4f8b62; }
[data-avatar-id="glm"] { background-color: #5963b6; }
[data-avatar-id="k"] { background-color: #171a18; }
.avatar.has-photo { color: transparent; border-color: rgba(255,255,255,.86); }

main { position: relative; z-index: 1; min-height: calc(100dvh - 252px); padding: 62px 10px 18px; background: var(--ivory); }
.connection-note { margin: 0 18px 10px; padding: 10px 13px; border-radius: 10px; background: #fff2db; color: #79572b; font-size: 12px; }
.feed { display: grid; gap: 10px; border-top: 0; background: transparent; }
.moment { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 20px 18px; border: 1px solid rgba(55,75,61,.09); border-radius: 17px; background: #fff; box-shadow: 0 7px 24px rgba(42,58,47,.055); }
.moment-main { min-width: 0; }
.author { display: inline-block; margin: 0 0 8px; color: var(--sage); font-size: 15px; font-weight: 750; letter-spacing: .015em; }
.moment-content { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: #252b27; font-family: var(--serif); font-size: 17px; line-height: 1.75; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; width: min(460px, 100%); margin: 4px 0 12px; overflow: hidden; border-radius: 11px; }
.media-grid.one { grid-template-columns: minmax(0, 310px); }
.media-grid.two { grid-template-columns: repeat(2, minmax(0, 210px)); }
.media-grid button { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; background: #e7eee9; }
.media-grid.one button { aspect-ratio: auto; max-height: 390px; }
.media-grid img { display: block; width: 100%; height: 100%; min-height: 115px; object-fit: cover; }
.media-grid.one img { height: auto; max-height: 390px; object-fit: contain; object-position: left center; }
.moment-footer { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.moment-footer-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.moment-time { color: #a0a6a1; font-size: 11px; letter-spacing: .02em; }
.moment-publish-state { margin-left: 8px; color: #8b958e; font-size: 11px; }
.moment-publish-state.failed { padding: 4px 7px; border: 0; border-radius: 7px; background: #fff0ed; color: #a34b40; }
.moment-menu { width: 40px; height: 29px; border: 1px solid rgba(49,93,67,.08); border-radius: 9px; background: var(--sage-pale); color: var(--sage); font-size: 17px; font-weight: 800; letter-spacing: 2px; line-height: 1; }
.moment-menu:disabled { cursor: default; opacity: .45; }
.moment-actions { display: flex; align-items: center; gap: 0; margin: 0; width: fit-content; height: 32px; padding: 2px 4px; border-radius: 9px; background: #26352c; box-shadow: 0 6px 18px rgba(21,34,25,.17); }
.moment-actions button { position: relative; min-width: 66px; min-height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: #fff; font-size: 12px; }
.moment-actions button + button::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 0; width: 1px; background: rgba(255,255,255,.18); }
.moment-actions button:hover { background: rgba(255,255,255,.1); }
.social { overflow: hidden; border-radius: 10px; background: #eef3ed; }
.likes { padding: 9px 11px; color: var(--sage); font-family: var(--serif); font-size: 14px; line-height: 1.55; }
.likes + .comments { border-top: 1px solid #e0e8e1; }
.comments { padding: 7px 11px; }
.comment { margin: 0; padding: 2px 0; overflow-wrap: anywhere; color: #252b27; font-family: var(--serif); font-size: 14px; line-height: 1.55; }
.comment button { display: inline; padding: 0; border: 0; background: transparent; color: var(--sage); font-family: inherit; font-weight: 700; }
.comment .reply-name { color: var(--sage); font-weight: 700; }
.load-more { display: block; margin: 18px auto 36px; padding: 10px 22px; border: 1px solid #cad8cd; border-radius: 999px; background: var(--paper); color: var(--sage); box-shadow: 0 5px 18px rgba(42,58,47,.05); }
.empty-state { display: grid; justify-items: center; gap: 14px; min-height: 55vh; padding: 80px 20px; border-radius: 17px; background: var(--paper); color: var(--muted); font-family: var(--serif); }
.empty-state button { padding: 9px 17px; border: 0; border-radius: 999px; background: var(--sage); color: white; }

.dialog-layer { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(18,26,21,.62); backdrop-filter: blur(8px); }
.compose-card, .comment-card { width: min(560px, 100%); overflow: hidden; border: 1px solid rgba(255,255,255,.65); border-radius: 22px; background: var(--paper); box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.compose-card header, .comment-card header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.compose-card header button, .comment-card header button { justify-self: start; border: 0; background: transparent; color: var(--muted); }
.compose-card header .publish-button, .comment-card header .publish-button { justify-self: end; padding: 7px 13px; border-radius: 9px; background: var(--sage); color: #fff; font-weight: 700; }
.compose-card textarea, .comment-card textarea { display: block; width: 100%; resize: none; padding: 20px; border: 0; outline: 0; color: var(--ink); background: var(--paper); font-family: var(--serif); font-size: 17px; line-height: 1.65; }
.comment-layer { place-items: end stretch; padding: 0; background: transparent; backdrop-filter: none; }
.comment-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: end; gap: 8px; width: min(720px, 100%); margin: 0 auto; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid rgba(50,72,57,.12); border-radius: 0; background: rgba(250,249,245,.98); box-shadow: 0 -10px 34px rgba(32,45,36,.12); opacity: 0; transform: translateY(18px); transition: opacity 150ms ease, transform 180ms cubic-bezier(.22,.78,.25,1); backdrop-filter: blur(20px); }
.comment-layer.open .comment-card { opacity: 1; transform: translateY(0); }
.comment-close { display: grid; place-items: center; width: 36px; height: 40px; padding: 0 0 3px; border: 0; background: transparent; color: #7d877f; font: 28px/1 Georgia, serif; }
.comment-input-wrap { display: block; min-width: 0; }
.comment-card #comment-content { display: block; width: 100%; max-height: 112px; min-height: 40px; resize: none; overflow-y: auto; padding: 8px 12px; border: 1px solid rgba(50,72,57,.11); border-radius: 8px; outline: 0; background: #fff; color: var(--ink); font-family: var(--serif); font-size: 16px; line-height: 1.45; transition: border-color 120ms ease, box-shadow 120ms ease; }
.comment-card #comment-content:focus { border-color: rgba(49,93,67,.35); box-shadow: 0 0 0 3px rgba(49,93,67,.08); }
.comment-send { min-width: 52px; height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--sage); color: #fff; font-size: 13px; font-weight: 700; }
.comment-send:disabled { opacity: .48; }
.comment-card .post-status { grid-column: 2 / -1; min-height: 0; margin: -2px 2px 0; color: #a04b3f; font-size: 11px; }
.comment-card .post-status:empty { display: none; }
.commenting .moments-bottom-nav { opacity: 0; transform: translateY(100%); pointer-events: none; }
.post-previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 20px; }
.post-previews:empty { display: none; }
.post-preview { position: relative; aspect-ratio: 1; overflow: hidden; background: #edf1ed; }
.post-preview img { width: 100%; height: 100%; object-fit: cover; }
.post-preview button { position: absolute; top: 4px; right: 4px; width: 25px; height: 25px; border: 0; border-radius: 50%; background: rgba(0,0,0,.7); color: white; }
.add-images { margin: 16px 20px 2px; padding: 10px 13px; border: 1px solid #d8e0d9; border-radius: 11px; background: var(--sage-pale); color: var(--sage); }
.add-images span { font-size: 19px; vertical-align: -1px; }
.post-status { min-height: 20px; margin: 8px 20px 14px; color: #a04b3f; font-size: 12px; }
.lightbox { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 52px 12px 22px; background: rgba(5,8,6,.94); }
.lightbox img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 15px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: white; font-size: 31px; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: rgba(20,31,24,.9); color: #fff; font-size: 12px; }

@media (max-width: 600px) {
  .moments-shell { width: 100%; box-shadow: none; }
  .moments-cover { height: 228px; }
  .profile { right: 16px; bottom: -34px; }
  .profile .avatar { width: 72px; height: 72px; }
  .profile strong { font-size: 18px; }
  main { min-height: calc(100dvh - 228px); padding: 52px 8px 12px; }
  .feed { gap: 8px; }
  .moment { grid-template-columns: 46px minmax(0, 1fr); gap: 11px; padding: 18px 13px; border-radius: 15px; }
  .moment > .avatar { width: 46px; height: 46px; border-radius: 11px; }
  .moment-content { font-size: 16px; line-height: 1.67; }
  .media-grid img { min-height: 94px; }
  .dialog-layer { place-items: end stretch; padding: 0; }
  .compose-card { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .comment-card { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .comment-card, .moments-bottom-nav { transition: none; }
}
