:root {
  --paper: #fbf7f1;
  --paper-deep: #f3ece1;
  --card: #fffdf9;
  --ink: #2e2924;
  --ink-soft: #6b6157;
  --muted: #9a8f82;
  --line: #e9e0d2;
  --line-soft: #f0e9dd;
  --accent: #b9653c;
  --accent-ink: #8f4a29;
  --accent-soft: #f5e5d9;
  --sage: #7c8f76;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(70, 55, 40, 0.04), 0 8px 24px -12px rgba(70, 55, 40, 0.18);
  --glow: #fffdf8;
  --scrim: rgba(251, 247, 241, 0.86);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(1200px 600px at 50% -10%, var(--glow) 0%, transparent 60%);
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.view { animation: fade-in 0.4s ease both; }
.view[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 通用 ---------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.28em;
  color: var(--ink);
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.brand-sm { font-size: 14px; letter-spacing: 0.22em; color: var(--ink-soft); }
.brand-sm .brand-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  padding: 13px 22px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary {
  background: var(--accent);
  color: #fffaf5;
  box-shadow: 0 6px 18px -8px rgba(185, 101, 60, 0.75);
}
.btn-primary:hover { background: #a95732; }

.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: #efd9c9; }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }

.btn-text { background: transparent; color: var(--muted); padding-left: 8px; padding-right: 8px; }
.btn-text:hover { color: var(--ink-soft); }

.btn-sm { font-size: 13px; padding: 9px 14px; }
.btn-block { width: 100%; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-error {
  margin: 10px 0 0;
  color: #a8432c;
  font-size: 13px;
}

.fineprint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ---------------- 首页 ---------------- */

.hero { padding: 18px 2px 34px; }

.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 6.4vw, 38px);
  line-height: 1.42;
  letter-spacing: 0.01em;
  margin: 26px 0 18px;
}

.hero-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.85;
}

.create-card { padding: 26px 24px 24px; }

.card-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 18px;
}

.field { display: block; margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}
.field-label em { color: var(--muted); font-style: normal; }

.field input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input::placeholder { color: #bdb2a4; }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fffdf9;
}

.create-card .btn-block { margin-top: 6px; }

.steps {
  display: grid;
  gap: 12px;
  margin: 34px 0 0;
}

.step {
  padding: 20px 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.9), rgba(251, 247, 241, 0.6));
  border: 1px solid var(--line-soft);
}
.step-num {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--accent);
}
.step h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin: 6px 0 4px;
}
.step p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.demo-link { margin: 30px 0 0; text-align: center; }
.demo-link a {
  color: var(--accent-ink);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
}
.demo-link a:hover { border-bottom-color: var(--accent); }

.site-foot {
  margin-top: 46px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  font-family: var(--serif);
}

/* ---------------- 分享者控制台 ---------------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.console-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  margin: 10px 0 2px;
}
.console-sub { margin: 0; color: var(--muted); font-size: 13px; }

.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.topbar-actions a { text-decoration: none; display: inline-flex; align-items: center; }

.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding: 10px 14px;
  background: var(--paper-deep);
  border-radius: 12px;
  overflow: hidden;
}
.share-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.share-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer { position: relative; margin-top: 20px; padding: 20px 20px 16px; }

.composer textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  border: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  padding: 2px 2px 8px;
}
.composer textarea::placeholder { color: #bdb2a4; }
.composer textarea:focus { outline: none; }

.image-preview {
  position: relative;
  margin: 4px 0 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  line-height: 0;
}
.image-preview img { width: 100%; max-height: 340px; object-fit: cover; display: block; }
.image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(30, 24, 18, 0.55);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.mood-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 6px 0 14px; }

.mood-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}
.mood-chip:hover { border-color: #d9cdbc; }
.mood-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: #e6cdba;
  color: var(--accent-ink);
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.composer-tools { display: flex; align-items: center; gap: 14px; }

.tool-btn {
  appearance: none;
  flex-shrink: 0;
  white-space: nowrap;
  background: transparent;
  border: none;
  padding: 6px 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}
.tool-btn:hover { color: var(--accent); }

.counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.feed-head { margin: 40px 0 18px; }
.feed-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.feed-hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ---------------- 信息流 ---------------- */

.feed { display: flex; flex-direction: column; gap: 12px; }

.day-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  font-family: var(--serif);
}
.day-divider::before,
.day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}
.day-divider:first-child { margin-top: 4px; }

.post {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 18px 20px 14px;
  box-shadow: 0 1px 2px rgba(70, 55, 40, 0.03);
  animation: rise 0.42s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.post-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mood {
  font-size: 12.5px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
  line-height: 1.6;
  white-space: nowrap;
}

.post-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16.5px;
  line-height: 1.85;
}

.post-image {
  margin: 12px 0 2px;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  line-height: 0;
}
.post-image img { width: 100%; display: block; }

/* 链接卡片 */
.link-input-row {
  display: flex;
  gap: 8px;
  margin: 4px 0 12px;
}
.link-input-row input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 13px;
}
.link-input-row input:focus { outline: none; border-color: var(--accent); background: #fffdf9; }
.link-input-row .btn { flex-shrink: 0; }

.link-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  position: relative;
}
.link-preview .link-thumb { width: 54px; height: 54px; }
.link-preview .link-title { font-size: 13.5px; -webkit-line-clamp: 1; }
.link-preview .link-desc { -webkit-line-clamp: 1; font-size: 11.5px; }
.link-preview .link-body { padding-right: 18px; }

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 2px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.link-card:hover { border-color: #dbcbb7; background: #fffdf9; }
.link-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.link-thumb {
  position: relative;
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(140deg, var(--paper-deep), var(--line));
  line-height: 0;
}
.link-thumb img { width: 100%; height: 100%; object-fit: cover; }
.link-thumb.no-image::after {
  content: "🔗";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0.55;
  line-height: 1;
}
.link-thumb.no-image.is-video::after { content: "▶"; font-size: 18px; color: var(--accent-ink); opacity: 0.8; }

.link-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 22, 15, 0.28);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  padding-left: 2px;
}

.link-body { min-width: 0; flex: 1; }
.link-site {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-title {
  margin: 3px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-desc {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-arrow { color: #c9bdad; font-size: 13px; flex-shrink: 0; }

/* 表情与贴纸 */
.panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 62px;
  z-index: 20;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px -18px rgba(70, 55, 40, 0.35);
  padding: 12px;
  max-height: 268px;
  overflow-y: auto;
  animation: rise 0.2s ease both;
}
.panel[hidden] { display: none; }

.panel-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.panel-tab {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.panel-tab.is-on { background: var(--accent-soft); color: var(--accent-ink); }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
}
.emoji-grid button {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 21px;
  line-height: 1;
  padding: 6px 0;
  border-radius: 9px;
  cursor: pointer;
}
.emoji-grid button:hover { background: var(--paper-deep); }

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 420px;
}
.sticker-pick {
  appearance: none;
  border: 2px solid transparent;
  background: var(--paper);
  border-radius: 13px;
  padding: 6px;
  cursor: pointer;
  line-height: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.sticker-pick:hover { transform: translateY(-1px); }
.sticker-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sticker-pick svg, .sticker svg { width: 100%; height: auto; display: block; }

.sticker-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.sticker-preview .sticker {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  cursor: pointer;
}
.sticker-preview .sticker::after {
  content: "×";
  position: absolute;
  top: -6px;
  right: -6px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(40, 33, 26, 0.6);
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
}

.post-stickers { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.post-stickers .sticker { width: 52px; height: 52px; }
.post-stickers .sticker:nth-child(2n) { transform: rotate(4deg); }
.post-stickers .sticker:nth-child(3n) { transform: rotate(-5deg); }

.post-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  min-height: 34px;
}

.reactions-read {
  display: flex;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.reactions-read .has { color: var(--ink-soft); }

.react-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.react-btn:hover { border-color: #d9cdbc; background: #fdfaf5; }
.react-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: #e6cdba;
  color: var(--accent-ink);
}
.react-btn .count { font-variant-numeric: tabular-nums; font-size: 12px; opacity: 0.9; }
.react-btn .count.zero { opacity: 0.45; }
.react-btn .label { font-size: 12.5px; }

.post-delete {
  margin-left: auto;
  appearance: none;
  background: transparent;
  border: none;
  color: #c0b5a6;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 2px;
}
.post-delete:hover { color: #a8432c; }

/* ---------------- 阅读者 ---------------- */

.reader-head { padding: 8px 2px 26px; border-bottom: 1px solid var(--line-soft); }

.reader-title {
  font-family: var(--serif);
  font-size: clamp(26px, 6vw, 32px);
  font-weight: 600;
  line-height: 1.35;
  margin: 16px 0 6px;
}
.reader-sub { margin: 0; color: var(--muted); font-size: 13.5px; }

.note {
  margin: 22px 0 30px;
  padding: 18px 22px;
  border-left: 2px solid var(--accent-soft);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-radius: 0 14px 14px 0;
}
.note p {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.more-wrap { text-align: center; margin-top: 28px; }
.end-mark { color: #c0b5a6; font-size: 12px; letter-spacing: 0.24em; margin: 0; }

.empty { text-align: center; padding: 48px 20px; }
.empty-title { font-family: var(--serif); font-size: 17px; margin: 0 0 6px; color: var(--ink-soft); }
.empty-sub { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------------- 提示 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(40, 33, 26, 0.92);
  color: #fdf8f1;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 50;
  backdrop-filter: blur(6px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ---------------- 响应式 ---------------- */

@media (min-width: 700px) {
  .wrap { padding: 56px 24px 80px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .step { padding: 20px 18px; }
  .composer textarea { min-height: 110px; }
}

@media (max-width: 480px) {
  .composer textarea { min-height: 74px; }
  .composer-tools { gap: 12px; }
  .counter { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ================= 账号 / 登录 ================= */

.auth-card { padding: 10px 24px 24px; }

.tabs { display: flex; gap: 4px; padding: 6px 0 2px; }
.tab {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.tab.is-on { background: var(--accent-soft); color: var(--accent-ink); }

.auth-form { padding-top: 14px; }
.auth-form .btn-block { margin-top: 6px; }

.demo-hint { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.demo-hint code {
  background: var(--paper-deep);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ================= 控制台头部 ================= */

.console-head { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.console-titles { min-width: 0; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  padding: 0;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--serif);
  font-size: 17px;
  cursor: pointer;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; cursor: default; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.guest { background: var(--paper-deep); color: var(--muted); font-size: 14px; }

.days-line { margin: 10px 0 0; font-size: 12.5px; color: var(--accent-ink); }
.days-chip {
  display: inline-block;
  font-size: 11.5px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.reader-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ================= 对话框式信息流 ================= */

.feed { gap: 16px; }

.msg-row { display: flex; align-items: flex-start; gap: 9px; }
.msg-row.owner { flex-direction: row-reverse; }

.msg {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 86%;
}
.msg-row.owner .msg { align-items: flex-end; }

.msg-time { margin: 5px 8px 0; font-size: 11px; color: var(--muted); }

.msg-row.owner .post { border-bottom-right-radius: 6px; }
.msg-row.guest .post {
  border-bottom-left-radius: 6px;
  background: var(--paper-deep);
  border-color: transparent;
}

.post.note-post {
  padding: 12px 15px 13px;
  background: var(--accent-soft);
  border-color: transparent;
}
.note-post .post-text { font-size: 15px; }
.note-quote {
  margin: 0 0 6px;
  padding-left: 8px;
  border-left: 2px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0.72;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-with-sticker { display: flex; align-items: flex-end; gap: 8px; }
.note-with-sticker .sticker { width: 32px; height: 32px; flex-shrink: 0; }

/* ================= 合拍 ================= */

.coop-row { display: flex; gap: 8px; margin: 4px 0 12px; }

.coop-chip {
  flex: 1;
  text-align: left;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s ease;
}
.coop-chip small { display: block; font-size: 11px; color: var(--muted); }
.coop-chip[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.coop-chip[aria-pressed="true"] small { color: var(--accent-ink); opacity: 0.75; }

.coop-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0 2px;
}
.coop-half {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid var(--line-soft);
}
.coop-half img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coop-half.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
  padding: 6px;
}
.coop-add {
  appearance: none;
  border: none;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.coop-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(20, 15, 10, 0.45);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(3px);
}
.same-moment {
  display: inline-block;
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.canvas {
  position: relative;
  margin: 10px 0 2px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  line-height: 0;
  cursor: default;
}
.canvas img { width: 100%; display: block; }
.canvas.editing { cursor: crosshair; }
.canvas .mark {
  position: absolute;
  width: 13%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}
.canvas-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* 留句话入口 */
.note-entry { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.note-entry-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-toggle {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--accent-ink);
  cursor: pointer;
  padding: 4px 0;
}
.note-toggle:hover { text-decoration: underline; }
.note-count { font-size: 11.5px; color: var(--muted); }

.note-form { margin-top: 10px; }
.note-form textarea {
  width: 100%;
  min-height: 58px;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
}
.note-form textarea:focus { outline: none; border-color: var(--accent); }
.note-form-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.note-sticker-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.note-sticker {
  width: 30px;
  height: 30px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.note-sticker[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.note-sticker svg { width: 100%; height: 100%; }

/* ================= 设置面板 ================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(30, 24, 18, 0.34);
  backdrop-filter: blur(3px);
}
.modal-card {
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { font-family: var(--serif); font-size: 17px; margin: 0; font-weight: 600; }
.modal-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
}
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line-soft); }

.settings-block + .settings-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.settings-block h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.swatch {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 1 / 1;
  padding: 6px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
}
.swatch span {
  font-size: 10px;
  color: var(--swatch-ink, #fff);
  opacity: 0.85;
  line-height: 1.2;
}
.swatch[aria-pressed="true"] { border-color: var(--accent); }

.theme-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.theme-color { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); }
.theme-color input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

@media (max-width: 480px) {
  .msg { max-width: 88%; }
  .avatar { width: 38px; height: 38px; font-size: 15px; }
  .avatar-sm { width: 26px; height: 26px; font-size: 11px; }
  .theme-swatches { grid-template-columns: repeat(4, 1fr); }
  .modal { padding: 10px; }
  .modal-card { max-height: calc(100vh - 20px); }
}

/* 新消息轻微上浮，重渲染时不闪 */
.post { animation: none; }
.post.fresh { animation: rise 0.42s cubic-bezier(0.22, 0.8, 0.3, 1) both; }

/* 细节修正 */
.react-btn { white-space: nowrap; flex-shrink: 0; }
.post-foot { flex-wrap: wrap; row-gap: 8px; }
.post-image img { max-height: 460px; object-fit: cover; }
.canvas { max-width: 420px; }
.coop-pair { max-width: 440px; }

@media (max-width: 520px) {
  .post-foot { gap: 6px; }
  .react-btn { padding: 4px 9px; font-size: 12px; gap: 4px; }
  .react-btn .label { font-size: 12px; }
  .topbar-actions { gap: 6px; }
}

.msg-delete {
  margin-left: 8px;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.msg-delete:hover { color: #a8432c; }

/* ================= 邀请码 ================= */

.invite-code {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 4px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.invite-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  letter-spacing: 0.16em;
  color: var(--ink);
}
.invite-code .btn { margin-left: auto; }

.invite-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.invite-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--paper);
  font-size: 12px;
  color: var(--muted);
}
.invite-status.is-on { color: var(--accent-ink); }
.invite-status.is-off { opacity: 0.6; }
.invite-meta { margin-left: auto; }
.invite-revoke {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.invite-revoke:hover { color: #a8432c; }
.invite-empty { font-size: 12px; color: var(--muted); padding: 6px 2px; }

/* ================= 找回密码 / 成员 ================= */

.link-btn {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-hint { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

.recovery-code {
  margin: 14px 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  letter-spacing: 0.18em;
  color: var(--ink);
  user-select: all;
}

.member-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--paper);
}
.member-info { min-width: 0; display: flex; flex-direction: column; }
.member-info strong { font-size: 13px; font-weight: 500; }
.member-info span { font-size: 11px; color: var(--muted); }
.member-actions { margin-left: auto; display: flex; gap: 6px; }
.member-act {
  border: none;
  background: none;
  padding: 3px 4px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
}
.member-act:hover { color: var(--accent-ink); }
.member-act.danger:hover { color: #a8432c; }
.member-empty { font-size: 12px; color: var(--muted); padding: 4px 2px; }

/* ================= 状态栏 ================= */

.status-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 0;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 1.5;
}
.status-bar[hidden] { display: none; }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.75;
}
.status-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-meta { font-size: 11px; opacity: 0.65; white-space: nowrap; }
.status-action {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--accent-ink);
  opacity: 0.75;
  cursor: pointer;
  padding: 2px 0;
  white-space: nowrap;
}
.status-action:hover { opacity: 1; }

.status-edit { display: flex; align-items: center; gap: 8px; width: 100%; }
.status-edit input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
}
.status-edit input:focus { outline: none; border-color: var(--accent); }

/* 文案编辑里的多行输入 */
.field textarea {
  width: 100%;
  resize: vertical;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 14px;
}
.field textarea::placeholder { color: #bdb2a4; }
.field textarea:focus { outline: none; border-color: var(--accent); background: #fffdf9; }

.hero-title, .hero-sub, .note p { white-space: pre-line; }

/* ================= 留言：贴在原帖下方 ================= */

.thread-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0 38px;
}
.thread-notes .msg { max-width: 100%; }
.thread-notes .note-post { padding: 10px 14px 11px; }
.thread-notes .note-post .post-text { font-size: 14px; }

.note-flag {
  font-size: 11px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

.note-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 4px;
  padding: 9px 14px;
  border: none;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.note-alert:hover { filter: brightness(0.98); }
.note-alert-arrow { margin-left: auto; }

.post.flash { animation: flash 1.5s ease; }
@keyframes flash {
  0%, 100% { box-shadow: 0 1px 2px rgba(70, 55, 40, 0.03); }
  30% { box-shadow: 0 0 0 3px var(--accent-soft); }
}

.note-entry-bar { justify-content: flex-end; }

/* 卡片内的留言 */
.post-thread { margin-top: 8px; }
.thread-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 4px 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--accent-ink);
  cursor: pointer;
}
.thread-caret { margin-left: auto; font-size: 11px; opacity: 0.7; }
.thread-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.thread-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--paper);
}
.thread-sticker { width: 22px; height: 22px; flex-shrink: 0; }
.thread-sticker svg { width: 100%; height: 100%; display: block; }
.thread-body { min-width: 0; flex: 1; }
.thread-body p {
  margin: 0 0 2px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.thread-time { font-size: 10.5px; color: var(--muted); }
.thread-delete {
  border: none;
  background: none;
  padding: 0 2px;
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.thread-delete:hover { color: #a8432c; }

/* 留言配图 */
.thread-image {
  margin-top: 6px;
  max-width: 240px;
  border-radius: 9px;
  overflow: hidden;
  cursor: zoom-in;
  line-height: 0;
}
.thread-image img { width: 100%; max-height: 220px; object-fit: cover; display: block; }

.note-image-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.note-image-preview {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  line-height: 0;
}
.note-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.note-image-preview button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(40, 33, 26, 0.65);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 15, 10, 0.86);
  cursor: zoom-out;
  backdrop-filter: blur(4px);
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

.note-tool {
  border: none;
  background: none;
  padding: 2px 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--accent-ink);
  cursor: pointer;
  white-space: nowrap;
}

/* ================= 语音 ================= */

.audio-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.audio-preview audio { flex: 1; min-width: 0; height: 36px; }
.audio-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(40, 33, 26, 0.55);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.recorder {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d4574a;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.rec-timer { font-size: 13px; font-variant-numeric: tabular-nums; }
.rec-hint { font-size: 11.5px; opacity: 0.75; }
.recorder .btn { margin-left: auto; }

.post-audio { margin: 10px 0 2px; }
.post-audio audio { width: 100%; height: 38px; }

/* ================= 页面上直接改文案 ================= */

.inline-editable {
  cursor: text;
  border-radius: 6px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.inline-editable:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.inline-editor {
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 6px;
  width: 100%;
  min-width: 3em;
  outline: none;
}
textarea.inline-editor { resize: vertical; min-height: 3.2em; }

/* 邀请链接 */
.invite-link { display: flex; gap: 8px; margin: 8px 0 0; }
.invite-link input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
}
.invite-link input:focus { outline: none; border-color: var(--accent); }

.settings-block .btn-primary + .btn-ghost { margin-top: 10px; }

/* 设置最底部的退出按钮 */
.logout-block { border-top: 1px solid var(--line-soft); }
.logout-btn {
  color: #a8432c;
  border-color: #e8cfc6;
  background: transparent;
  font-size: 14.5px;
}
.logout-btn:hover {
  background: #fbeee9;
  border-color: #d9a894;
  color: #93381f;
}
