/* ============================================================
   赵氏喜乐汇 · 家书纸笺
   宣纸底 · 宋体题 · 手写批注 · 无一枚玻璃、无一处霓虹
   ============================================================ */

:root {
  /* 纸 */
  --paper: #e7deca;
  --paper-lit: #f2ebdb;
  --note: #faf3de;
  --note-b: #f6edd6;
  --note-c: #fbf6e6;

  /* 墨 */
  --ink: #474135;
  --ink-2: #6a6255;
  --ink-3: #847b6c;

  /* 线与印 */
  --rule: rgba(122, 99, 68, 0.17);
  --rule-soft: rgba(122, 99, 68, 0.09);
  --accent: #93604a;
  --seal: #9c4b3b;
  --danger: #9a4638;

  --serif: "Source Han Serif SC", "Noto Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Source Han Sans SC", "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "SimSun", "Segoe UI Emoji", serif;

  /* 纸纹：极低透明度噪点，平铺 220px，看不出接缝 */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)' opacity='0.085'/%3E%3C/svg%3E");
  --noise-soft: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.06'/%3E%3C/svg%3E");

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  margin: 0;
  padding: 0;
  background: #e3dac8;
  overflow-x: hidden;
}
@supports (overflow-x: clip) {
  html { overflow-x: clip; }
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* 宣纸：底色 + 三团几乎看不见的陈年水渍 + 麻布噪点 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--paper);
  background-image:
    radial-gradient(58% 42% at 16% 6%, rgba(200, 178, 140, 0.16), rgba(200, 178, 140, 0) 70%),
    radial-gradient(50% 38% at 90% 88%, rgba(182, 160, 124, 0.14), rgba(182, 160, 124, 0) 72%),
    radial-gradient(36% 30% at 78% 16%, rgba(214, 200, 170, 0.2), rgba(214, 200, 170, 0) 68%),
    var(--noise);
  background-size: auto, auto, auto, 220px 220px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }

::selection { background: rgba(147, 96, 74, 0.18); color: var(--ink); }

:focus-visible {
  outline: 1px solid rgba(147, 96, 74, 0.45);
  outline-offset: 2px;
}

/* ---------- 印章 ---------- */

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  color: #f7f1e3;
  background-color: rgba(156, 75, 59, 0.74);
  border-radius: 2px 3px 2px 4px / 3px 2px 4px 2px;
  box-shadow:
    inset 0 0 0 1px rgba(247, 241, 227, 0.45),
    0 0 0 1px rgba(156, 75, 59, 0.14);
  transform: rotate(-3.5deg);
  opacity: 0.42;
  user-select: none;
  pointer-events: none;
}

/* ---------- 登录 ---------- */

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(28px + var(--safe-t)) 22px calc(28px + var(--safe-b));
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 366px;
  padding: 38px 27px 26px;
  background-color: var(--note);
  background-image: var(--noise-soft);
  border-radius: 5px 9px 6px 10px / 9px 5px 10px 6px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 20px 38px -30px rgba(74, 58, 38, 0.75),
    0 2px 6px -4px rgba(74, 58, 38, 0.22);
  transform: rotate(-0.3deg);
  animation: letter-in 0.9s cubic-bezier(0.22, 0.72, 0.28, 1) both;
}

/* 信笺抬头的一道细双线：跟着副标题走，窄屏换行也不会压字 */
.login-sub {
  font-family: var(--kai);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  margin: 0 0 27px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(122, 99, 68, 0.2);
}

.login-mark {
  position: absolute;
  top: 20px;
  right: 21px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
  color: #f8f2e5;
  background-color: rgba(156, 75, 59, 0.72);
  border-radius: 2px 4px 3px 4px / 4px 2px 4px 3px;
  box-shadow: inset 0 0 0 1px rgba(248, 242, 229, 0.45);
  transform: rotate(3.5deg);
  opacity: 0.52;
  user-select: none;
}

.login-card h1 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--ink);
}

.field { display: block; margin-bottom: 19px; }
.field span {
  display: block;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.field input {
  width: 100%;
  height: 40px;
  border: none;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  padding: 0 2px;
  font-size: 16px;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.5s ease, background-color 0.5s ease;
}
.field input:focus {
  border-bottom-color: rgba(147, 96, 74, 0.55);
  background: rgba(255, 255, 255, 0.26);
}
.field input::placeholder { color: var(--ink-3); opacity: 0.85; }

.primary-btn {
  width: 100%;
  height: 47px;
  margin-top: 9px;
  border: 1px solid rgba(147, 96, 74, 0.4);
  border-radius: 3px 6px 4px 6px / 5px 4px 6px 4px;
  background: rgba(147, 96, 74, 0.06);
  color: #87573f;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  transition: background-color 0.45s ease, border-color 0.45s ease, opacity 0.45s ease;
}
.primary-btn:hover { background: rgba(147, 96, 74, 0.12); border-color: rgba(147, 96, 74, 0.5); }
.primary-btn:active { background: rgba(147, 96, 74, 0.18); }
.primary-btn:disabled { opacity: 0.55; }

.form-error {
  color: var(--danger);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  min-height: 18px;
  margin: 10px 0 0;
}

.login-note {
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  line-height: 1.7;
  margin: 18px 0 0;
}

/* ---------- 框架 ---------- */

.app { max-width: 600px; margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: var(--safe-t);
  background: rgba(238, 231, 217, 0.96);
  border-bottom: 1px solid var(--rule-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
/* 抬头下的第二道细线 */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--rule-soft);
  pointer-events: none;
}

.topbar-inner {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.17em;
  margin: 0;
  color: var(--ink);
}

.topbar .seal {
  width: 21px;
  height: 21px;
  font-size: 12px;
  opacity: 0.34;
}

.avatar-btn {
  margin-left: auto;
  width: 31px;
  height: 31px;
  padding: 0;
  overflow: hidden;
}

/* 顶上那枚小信：有人 @ 你的时候，右上角落一点朱砂 */
.mention-bell {
  position: relative;
  width: 30px;
  height: 30px;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  transition: color 0.4s ease, translate 0.4s ease;
}
.mention-bell:hover { color: var(--accent); translate: 0 -1px; }
.mention-bell:active { translate: 0 0; }
.mention-bell svg { opacity: 0.72; }
.mention-bell.has-new svg { opacity: 0.95; }
.mention-dot {
  position: absolute;
  top: 4px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: 0 0 0 2px rgba(238, 231, 217, 0.92);
  animation: mention-dot 2.8s ease-in-out infinite;
}
@keyframes mention-dot {
  0%, 100% { opacity: 0.68; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.12); }
}
.topbar .avatar-btn { margin-left: 0; }

/* 新动态提示：一枚纸签，不弹不跳 */
.new-pill {
  position: fixed;
  top: calc(var(--safe-t) + 67px);
  left: 50%;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 13px;
  border: 1px solid rgba(147, 96, 74, 0.26);
  border-radius: 2px 5px 3px 5px / 4px 3px 5px 3px;
  background: #f7f0e0;
  background-image: var(--noise-soft);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 18px -18px rgba(74, 58, 38, 0.8);
  transform: translate(-50%, -6px) rotate(-0.8deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.new-pill.show {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-0.8deg);
  pointer-events: auto;
}
.new-pill:hover { background: #fbf5e7; }
.new-pill svg { margin-top: -1px; flex: none; opacity: 0.8; }

/* ---------- 手动刷新：压在“我的”上方的圆纸片 ---------- */

.refresh-fab {
  position: fixed;
  right: 14px;
  /* 底栏 58px + 一点缝，正好浮在“我的”上面 */
  bottom: calc(72px + var(--safe-b));
  z-index: 35;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(147, 96, 74, 0.22);
  border-radius: 50%;
  background: #f7f0e0;
  background-image: var(--noise-soft);
  color: var(--accent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 10px 18px -14px rgba(74, 58, 38, 0.85);
  transition: transform 0.18s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.refresh-fab:active {
  transform: scale(0.94);
  background: #fbf5e7;
}
.refresh-fab svg { display: block; transition: opacity 0.3s ease; }
.refresh-fab[aria-busy="true"] svg { opacity: 0.55; }

/* 转一圈：用动画，点第二次还能再转 */
.refresh-fab.spin svg { animation: fab-spin 0.7s cubic-bezier(0.45, 0.05, 0.3, 1); }
@keyframes fab-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 宽屏时跟着纸面右边缘，别飘到浏览器最右边 */
@media (min-width: 601px) {
  .refresh-fab { right: calc(50vw - 300px + 14px); }
}

main { padding: 2px 14px calc(132px + var(--safe-b)); }

/* ---------- 头像 ---------- */

.avatar-sm, .avatar-btn, .avatar-lg, .avatar-md {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 500;
  flex: none;
  user-select: none;
  overflow: hidden;
  border-radius: 50% 47% 52% 49% / 49% 52% 48% 51%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-btn { font-size: 13px; }
.avatar-md { width: 39px; height: 39px; font-size: 15px; }
.avatar-lg { width: 62px; height: 62px; font-size: 24px; }

/* 自己传的照片头像：和色块头像同一套不规则圆，外面压一圈极淡的纸框 */
.has-photo {
  padding: 0;
  background-color: #efe6d4;
  box-shadow:
    inset 0 0 0 1px rgba(120, 94, 58, 0.2),
    inset 0 1px 0 rgba(255, 255, 250, 0.5);
}
.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* 压一点饱和度，让照片和泛黄的纸面处在同一个光线下 */
  filter: saturate(0.9) contrast(1.02) sepia(0.06);
}

/* 头像上的「换」字小记：点它就知道这里能动 */
.avatar-edit {
  position: relative;
  flex: none;
  padding: 0;
  line-height: 0;
  transition: opacity 0.45s ease;
}
.avatar-edit.is-busy { opacity: 0.5; }
.avatar-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--kai);
  font-size: 10.5px;
  line-height: 1;
  color: #8d5a43;
  background: #fbf6e8;
  border: 1px solid rgba(147, 96, 74, 0.32);
  border-radius: 50%;
  box-shadow: 0 2px 5px -4px rgba(74, 58, 38, 0.9);
  opacity: 0.88;
  transition: opacity 0.45s ease, background-color 0.45s ease;
}
.avatar-edit:hover .avatar-badge { opacity: 1; background: #fdfaf2; }

/* ---------- 快捷发布 ---------- */

.quick-composer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 13px 0 19px;
  padding: 13px 15px;
  background-color: var(--note-b);
  background-image:
    linear-gradient(150deg, rgba(255, 254, 246, 0.58) 0%, rgba(255, 254, 246, 0) 56%, rgba(124, 98, 60, 0.055) 100%),
    var(--noise-soft);
  border-radius: 7px 11px 8px 12px / 11px 7px 12px 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.96),
    inset 1px 0 0 rgba(255, 254, 245, 0.34),
    inset 0 -1px 0 rgba(120, 94, 58, 0.1),
    0 1px 0 rgba(150, 124, 86, 0.26),
    0 2px 0 rgba(150, 124, 86, 0.1),
    2px 5px 8px -3px rgba(62, 44, 22, 0.21),
    5px 16px 26px -12px rgba(62, 44, 22, 0.29),
    8px 34px 44px -26px rgba(62, 44, 22, 0.34);
  cursor: text;
  transform: rotate(-0.26deg);
  transition: box-shadow 0.5s ease, background-color 0.5s ease, transform 0.5s ease;
}
/* 一小截和纸胶带 */
.quick-composer::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 24px;
  width: 52px;
  height: 14px;
  background: rgba(206, 190, 159, 0.5);
  border-radius: 1px;
  transform: rotate(-2.6deg);
  box-shadow: 0 1px 2px rgba(90, 70, 40, 0.05);
  pointer-events: none;
}
.quick-composer:hover {
  background-color: #f8f2e4;
  transform: rotate(-0.26deg) translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.96),
    inset 1px 0 0 rgba(255, 254, 245, 0.34),
    inset 0 -1px 0 rgba(120, 94, 58, 0.08),
    0 1px 0 rgba(150, 124, 86, 0.24),
    0 2px 0 rgba(150, 124, 86, 0.09),
    3px 8px 12px -3px rgba(62, 44, 22, 0.23),
    7px 22px 32px -14px rgba(62, 44, 22, 0.31),
    11px 40px 52px -28px rgba(62, 44, 22, 0.36);
}

.quick-placeholder {
  flex: 1;
  font-family: var(--kai);
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.composer-mark {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
  color: var(--ink-3);
  opacity: 0.75;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  padding: 0 3px 13px;
}
.filter-bar button {
  font-family: var(--kai);
  font-size: 12.5px;
  color: var(--accent);
  border-bottom: 1px solid rgba(147, 96, 74, 0.28);
  padding-bottom: 1px;
}

/* ---------- 动态：泛黄便签 ---------- */

.feed { display: flex; flex-direction: column; gap: 21px; }

/* 一张浮在宣纸上的便签：左上受光、纸边有厚度、底下落一层接触阴影 */
.post {
  position: relative;
  padding: 17px 17px 13px;
  background-color: var(--note);
  background-image:
    linear-gradient(
      172deg,
      rgba(255, 254, 246, 0.52) 0%,
      rgba(255, 254, 246, 0.18) 22%,
      rgba(255, 254, 246, 0) 48%,
      rgba(124, 98, 60, 0.045) 86%,
      rgba(124, 98, 60, 0.07) 100%
    ),
    var(--noise-soft);
  border-radius: 9px 13px 10px 12px / 13px 9px 12px 10px;
  box-shadow:
    /* 上沿一道受光，下沿一道背光 —— 纸不是平的 */
    inset 0 1px 0 rgba(255, 255, 250, 0.96),
    inset 1px 0 0 rgba(255, 254, 245, 0.36),
    inset 0 -1px 0 rgba(120, 94, 58, 0.1),
    /* 纸的切口：一条很细的暗边，不能粗 */
    0 1px 0 rgba(150, 124, 86, 0.26),
    0 2px 0 rgba(150, 124, 86, 0.1),
    /* 贴桌面的接触阴影 */
    2px 5px 8px -3px rgba(62, 44, 22, 0.22),
    /* 中景：柔、向右下铺开 */
    5px 16px 26px -12px rgba(62, 44, 22, 0.3),
    /* 远景，很淡，负责"离地" */
    8px 34px 44px -26px rgba(62, 44, 22, 0.35);
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 50% 100%;
  transition: transform 0.5s cubic-bezier(0.22, 0.7, 0.3, 1), box-shadow 0.5s ease;
  animation: card-in 0.62s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}
/* 每张纸放得不太一样：微小的角度与纸色差别 */
.post:nth-child(4n + 1) { --tilt: -0.34deg; }
.post:nth-child(4n + 2) { --tilt: 0.3deg; background-color: var(--note-b); border-radius: 12px 8px 13px 9px / 8px 12px 9px 13px; }
.post:nth-child(4n + 3) { --tilt: -0.18deg; background-color: var(--note-c); border-radius: 10px 12px 8px 13px / 12px 10px 13px 8px; }
.post:nth-child(4n + 4) { --tilt: 0.16deg; background-color: #f8efd9; }

/* 桌面端：只是轻轻抬一下，不跳、不弹 */
@media (hover: hover) and (pointer: fine) {
  .post:hover {
    transform: rotate(var(--tilt, 0deg)) translateY(-3px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 250, 0.96),
      inset 1px 0 0 rgba(255, 254, 245, 0.34),
      inset 0 -1px 0 rgba(120, 94, 58, 0.1),
      0 1px 0 rgba(150, 124, 86, 0.24),
      0 2px 0 rgba(150, 124, 86, 0.09),
      3px 8px 12px -3px rgba(62, 44, 22, 0.24),
      7px 24px 34px -14px rgba(62, 44, 22, 0.32),
      11px 44px 56px -28px rgba(62, 44, 22, 0.38);
  }
}

.post-head { display: flex; gap: 11px; align-items: flex-start; }
.post-meta { flex: 1; min-width: 0; }
.post-name {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.4;
  color: var(--ink);
}
.post-time {
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-top: 3px;
}
.post-delete {
  font-family: var(--kai);
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 8px 0 8px 14px;
  min-height: 30px;
  transition: color 0.4s ease;
}
.post-delete:hover { color: var(--danger); }

.post-content {
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.015em;
  margin-top: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 正文里被点到的名字：旧墨色，底下压一道虚线，点一下能翻名帖 */
.mention {
  display: inline;
  padding: 0 1px;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: #8a5539;
  border-bottom: 1px dotted rgba(147, 96, 74, 0.42);
  transition: color 0.35s ease, border-color 0.35s ease;
}
.mention:hover { color: var(--seal); border-bottom-color: rgba(156, 75, 59, 0.6); }

.image-grid { display: grid; gap: 5px; margin-top: 11px; }
.image-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.08);
  display: block;
}
.grid-1 { grid-template-columns: minmax(0, 1fr); max-width: 74%; }
.grid-1 img {
  aspect-ratio: 4 / 3;
  padding: 5px;
  background: #fdfaf1;
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.09),
    0 1px 0 rgba(255, 255, 252, 0.8),
    0 2px 4px -3px rgba(62, 44, 22, 0.32),
    0 9px 14px -11px rgba(62, 44, 22, 0.46);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 66%; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.post-actions {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 13px;
  padding-top: 9px;
  border-top: 1px solid var(--rule-soft);
}

.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  padding: 4px 0;
  transition: color 0.4s ease;
}
.act-btn:hover { color: var(--accent); }
.act-btn.seen { color: var(--accent); }
.act-btn svg { display: block; }

.act-count {
  font-family: var(--kai);
  font-size: 12px;
  color: var(--ink-3);
  margin-left: 3px;
}
.act-count:empty { display: none; }

/* 「我在」留下的痕迹：一排毛边小墨点，不计数 */
.marks-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
  min-height: 16px;
  padding-left: 8px;
}
.marks { display: flex; align-items: center; gap: 5px; }
.mark {
  width: 6px;
  height: 6px;
  flex: none;
  background: hsl(var(--h, 30) 9% 52%);
  border-radius: 52% 46% 55% 48% / 48% 55% 45% 52%;
  opacity: 0.55;
  transform: rotate(var(--r, 0deg));
}
.mark-tail {
  width: 3px;
  height: 3px;
  background: rgba(122, 99, 68, 0.24);
  border-radius: 50%;
}
.marks-slot.is-fresh .mark:last-child { animation: ink-drop 0.55s ease both; }
@keyframes ink-drop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 0.55; transform: scale(1); }
}

/* ---------- 评论：信纸背面的一小段批注 ---------- */

.comments {
  margin-top: 12px;
  padding: 11px 12px 10px;
  background: rgba(243, 235, 220, 0.72);
  border-radius: 3px 6px 4px 7px / 6px 3px 7px 4px;
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.055);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.thread { display: flex; flex-direction: column; gap: 7px; }
.comment {
  font-size: 13.5px;
  line-height: 1.78;
  letter-spacing: 0.01em;
  word-break: break-word;
}
.comment .cname {
  padding: 3px 0;
  margin: -3px 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  letter-spacing: inherit;
  color: #7c5c45;
  vertical-align: baseline;
  text-align: left;
  cursor: pointer;
  transition: color 0.35s ease, text-decoration-color 0.35s ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.comment .cname:hover,
.comment .cname:active {
  color: var(--accent);
  text-decoration-color: rgba(147, 96, 74, 0.32);
}
.comment .cname:focus-visible {
  outline: 1px dashed var(--accent);
  outline-offset: 2px;
}
.comment .csep { color: #7c5c45; }
.comment .cto { color: var(--ink-3); font-weight: 400; margin: 0 3px; font-family: var(--kai); font-size: 12px; }
.comment .cops {
  margin-left: 7px;
  display: inline-flex;
  gap: 2px;
  vertical-align: baseline;
  white-space: nowrap;
}
.comment .cbtn {
  padding: 5px 4px;
  margin: -4px 0;
  font-family: var(--kai);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
  transition: color 0.4s ease;
}
.comment .cbtn:hover { color: var(--accent); }
.comment .cbtn.cdel:hover { color: var(--danger); }

.replies {
  margin-top: 1px;
  padding-left: 11px;
  border-left: 1px solid rgba(122, 99, 68, 0.16);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.comment.reply { font-size: 13px; }
.reply-form { margin-top: 2px; }

.comment-form { display: flex; gap: 9px; margin-top: 11px; align-items: center; }
.comment-form input {
  flex: 1;
  height: 34px;
  border: none;
  border-bottom: 1px solid rgba(122, 99, 68, 0.24);
  border-radius: 0;
  padding: 0 2px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 16px;
  outline: none;
  transition: border-color 0.45s ease, background-color 0.45s ease;
}
.comment-form input:focus {
  border-bottom-color: rgba(147, 96, 74, 0.5);
  background: rgba(255, 255, 255, 0.3);
}
.comment-form button {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding: 6px 4px;
}

/* ---------- 唤名：@ 的时候递上来一排名字 ---------- */

.mention-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 6px 8px;
  background-color: rgba(250, 246, 233, 0.94);
  background-image: var(--noise-soft);
  border-radius: 4px 7px 5px 8px / 7px 4px 8px 5px;
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.12),
    inset 0 1px 0 rgba(255, 255, 250, 0.7);
  animation: mention-bar-in 0.26s ease both;
}
.mention-bar.quiet { animation: none; }
@keyframes mention-bar-in {
  from { opacity: 0; translate: 0 -3px; }
  to { opacity: 1; translate: 0 0; }
}
.mention-bar-tag {
  flex: none;
  font-family: var(--kai);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.mention-bar-list {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 1px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mention-bar-list::-webkit-scrollbar { display: none; }
.mention-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 4px;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
  background: rgba(255, 254, 246, 0.78);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.11);
  transition: background-color 0.35s ease, color 0.35s ease;
}
.mention-chip:hover { background: #fffdf6; color: var(--accent); }
.mention-bar-none {
  padding: 2px 4px;
  font-family: var(--kai);
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.mention-bar-x {
  flex: none;
  width: 20px;
  height: 20px;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1;
  color: var(--ink-3);
  border-radius: 50%;
  transition: color 0.35s ease, background-color 0.35s ease;
}
.mention-bar-x:hover { color: var(--accent); background: rgba(255, 254, 246, 0.7); }

.avatar-xs {
  width: 20px;
  height: 20px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  overflow: hidden;
  border-radius: 50% 47% 52% 49% / 49% 52% 48% 51%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.avatar-xs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sentinel { height: 24px; }

.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--ink-3);
  position: relative;
}
.empty::before {
  content: "赵";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0 auto 16px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
  color: #f7f1e3;
  background: rgba(156, 75, 59, 0.5);
  border-radius: 2px 4px 3px 4px;
  box-shadow: inset 0 0 0 1px rgba(247, 241, 227, 0.4);
  transform: rotate(-4deg);
  opacity: 0.4;
}
.empty p {
  font-family: var(--serif);
  font-size: 14.5px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  margin: 0 0 7px;
}
.empty span { font-family: var(--kai); font-size: 12.5px; }

/* ---------- 成员：一页名册 ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 15px 3px 13px;
}
.section-head h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.18em;
  margin: 0;
}
.section-head h3::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  margin-left: 11px;
  vertical-align: middle;
  background: var(--rule);
}
.section-head span {
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}

.member-list {
  background-color: var(--note);
  background-image:
    linear-gradient(172deg, rgba(255, 254, 246, 0.46) 0%, rgba(255, 254, 246, 0) 52%, rgba(124, 98, 60, 0.055) 100%),
    var(--noise-soft);
  border-radius: 8px 11px 9px 12px / 11px 8px 12px 9px;
  padding: 3px 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.9),
    inset 1px 0 0 rgba(255, 254, 245, 0.3),
    inset 0 -1px 0 rgba(120, 94, 58, 0.1),
    0 1px 0 rgba(150, 124, 86, 0.22),
    0 2px 0 rgba(150, 124, 86, 0.08),
    2px 5px 8px -3px rgba(62, 44, 22, 0.18),
    5px 16px 26px -14px rgba(62, 44, 22, 0.24),
    8px 32px 44px -30px rgba(62, 44, 22, 0.28);
  transform: rotate(-0.2deg);
}
.member {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
  width: 100%;
  text-align: left;
}
.member:last-child { border-bottom: none; }
.member-name {
  flex: 1;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.member-count {
  font-family: var(--kai);
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- 相册：一条往下的时间轴 ---------- */

/* 顶上那排纸签：横着滑，不显示滚动条 */
.tag-bar {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 3px 13px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tag-bar::-webkit-scrollbar { display: none; }

.tag-chip {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 9px 4px;
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--ink-2);
  background-color: rgba(250, 245, 232, 0.66);
  background-image: var(--noise-soft);
  border-radius: 2px 5px 3px 5px / 4px 3px 5px 3px;
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.14),
    0 1px 1px rgba(62, 44, 22, 0.04);
  transition: color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}
.tag-chip b {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-3);
  opacity: 0.8;
}
.tag-chip:hover { color: var(--accent); background-color: #fbf6e8; }
.tag-chip.active {
  color: var(--accent);
  background-color: #fbf5e6;
  box-shadow:
    inset 0 0 0 1px rgba(147, 96, 74, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 1px 2px rgba(62, 44, 22, 0.06);
}
.tag-blank {
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 4px 2px;
}

/* 一天一格：左边一条细线落一个墨点，右边是这天的照片 */
.timeline { position: relative; padding: 0 0 2px; }
.tl-day {
  position: relative;
  padding: 0 0 21px 27px;
  animation: tl-in 0.62s cubic-bezier(0.22, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
/* 翻下一页时不重播动画，免得整页忽明忽暗 */
.timeline.no-anim .tl-day { animation: none; }
.tl-day::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: -4px;
  width: 1px;
  background: linear-gradient(180deg, rgba(147, 96, 74, 0.26), rgba(122, 99, 68, 0.09));
}
.tl-day:last-child::before { display: none; }
.tl-day::after {
  content: "";
  position: absolute;
  left: 2.5px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper-lit);
  box-shadow:
    inset 0 0 0 1px rgba(147, 96, 74, 0.44),
    0 0 0 3px rgba(231, 222, 202, 0.86);
}
.tl-date {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 2px 9px;
}
.tl-date b {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.tl-date span {
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.tl-date em {
  margin-left: auto;
  font-style: normal;
  font-family: var(--kai);
  font-size: 11.5px;
  color: var(--ink-3);
}
.tl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.tl-grid[data-n="1"] { grid-template-columns: minmax(0, 1fr); max-width: 63%; }
.tl-grid[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 78%; }
.tl-photo { position: relative; line-height: 0; }
.tl-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.09);
  display: block;
  transition: filter 0.5s ease;
}
.tl-photo img:hover { filter: brightness(1.04); }
/* 照片角上贴的一枚小签 */
.tl-sticker {
  position: absolute;
  left: 4px;
  bottom: 4px;
  max-width: calc(100% - 8px);
  padding: 0 5px 1px;
  font-family: var(--kai);
  font-size: 10.5px;
  line-height: 1.65;
  letter-spacing: 0.04em;
  color: #6b5340;
  background: rgba(250, 244, 228, 0.94);
  border-radius: 1px 3px 2px 3px;
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.16),
    0 1px 2px rgba(60, 44, 22, 0.16);
  transform: rotate(-1.8deg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.35s ease, transform 0.35s ease;
}
.tl-sticker:hover { color: var(--seal); transform: rotate(-1.8deg) translateY(-1px); }

@keyframes tl-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 时光便签：冰箱门上的一叠便利贴 ---------- */

.notes-lead {
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin: -2px 3px 14px;
}

/* 空白便签：直接在上面写 */
.note-composer {
  position: relative;
  padding: 15px 16px 12px;
  background-color: var(--note);
  background-image:
    linear-gradient(168deg, rgba(255, 254, 246, 0.5) 0%, rgba(255, 254, 246, 0) 52%, rgba(124, 98, 60, 0.05) 100%),
    var(--noise-soft);
  border-radius: 6px 10px 7px 11px / 10px 6px 11px 7px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.92),
    inset 0 -1px 0 rgba(120, 94, 58, 0.09),
    0 1px 0 rgba(150, 124, 86, 0.22),
    2px 5px 8px -3px rgba(62, 44, 22, 0.18),
    5px 16px 26px -14px rgba(62, 44, 22, 0.26),
    8px 30px 42px -30px rgba(62, 44, 22, 0.3);
  transform: rotate(-0.34deg);
  margin-bottom: 15px;
}
/* 一小截和纸胶带，和快捷发布那张一个手法 */
.note-tape {
  position: absolute;
  top: -6px;
  left: 22px;
  width: 46px;
  height: 12px;
  background: rgba(206, 190, 159, 0.48);
  border-radius: 1px;
  transform: rotate(-2.2deg);
  box-shadow: 0 1px 2px rgba(90, 70, 40, 0.05);
  pointer-events: none;
}
.nc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.nc-title {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.nc-kinds {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 3px;
  background: rgba(122, 99, 68, 0.06);
}
.nc-kind {
  padding: 3px 8px 4px;
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  border-radius: 2px 4px 3px 4px;
  transition: color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}
.nc-kind.active {
  color: var(--accent);
  background: rgba(252, 247, 235, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(147, 96, 74, 0.22),
    0 1px 1px rgba(62, 44, 22, 0.05);
}
#note-text {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 2px 1px 8px;
  border: none;
  border-bottom: 1px dashed rgba(122, 99, 68, 0.22);
  background: transparent;
  font-family: var(--kai);
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  resize: none;
  outline: none;
  transition: border-color 0.4s ease;
}
#note-text:focus { border-bottom-color: rgba(147, 96, 74, 0.45); }
#note-text::placeholder { color: var(--ink-3); opacity: 0.8; }
.nc-foot { display: flex; align-items: center; gap: 9px; padding-top: 9px; }
.nc-hint {
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.nc-count {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--ink-3);
  opacity: 0.8;
}
.nc-post {
  height: 30px;
  padding: 0 14px;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: rgba(252, 247, 236, 0.8);
  border-radius: 2px 5px 3px 5px / 4px 3px 5px 3px;
  box-shadow: inset 0 0 0 1px rgba(147, 96, 74, 0.3);
  transition: color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}
.nc-post:hover:not(:disabled) { background: #fdfaf1; box-shadow: inset 0 0 0 1px rgba(147, 96, 74, 0.45); }
.nc-post:disabled {
  color: var(--ink-3);
  opacity: 0.55;
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.14);
}

/* 冰箱门：一块温色的搪瓷面，右边一条细把手 */
.fridge {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 172px;
  padding: 15px 20px 17px 15px;
  background-color: #f2ede2;
  background-image:
    linear-gradient(168deg, rgba(255, 253, 248, 0.86) 0%, rgba(255, 253, 248, 0) 46%, rgba(120, 100, 70, 0.05) 100%),
    var(--noise-soft);
  border-radius: 14px 15px 12px 13px / 13px 12px 15px 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(120, 94, 58, 0.1),
    0 1px 0 rgba(150, 124, 86, 0.2),
    0 2px 0 rgba(150, 124, 86, 0.08),
    0 8px 18px -10px rgba(62, 44, 22, 0.26),
    0 26px 46px -34px rgba(62, 44, 22, 0.46);
  transform: rotate(-0.16deg);
}
/* 门里一圈浅浅的压边 */
.fridge::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.09);
  pointer-events: none;
}
.fridge-handle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 4px;
  height: 62px;
  margin-top: -31px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ddd2bd, #cdc0a6);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    1px 1px 2px rgba(90, 70, 40, 0.16);
  pointer-events: none;
}
/* 便签分几列由脚本装好，这里只管排 */
.notes-board { flex: 1; display: flex; gap: 11px; align-items: flex-start; }
.note-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.note {
  position: relative;
  margin: 0;
  padding: 16px 13px 10px;
  background-color: var(--tint, var(--note));
  background-image:
    linear-gradient(168deg, rgba(255, 255, 250, 0.6) 0%, rgba(255, 255, 250, 0) 52%, rgba(124, 98, 60, 0.05) 100%),
    var(--noise-soft);
  border-radius: 3px 6px 4px 7px / 6px 4px 7px 3px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.9),
    0 1px 0 rgba(150, 124, 86, 0.2),
    0 2px 3px -1px rgba(62, 44, 22, 0.16),
    0 8px 14px -12px rgba(62, 44, 22, 0.4);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.45s cubic-bezier(0.22, 0.7, 0.3, 1), box-shadow 0.45s ease;
  animation: note-drop 0.52s cubic-bezier(0.22, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.note:nth-child(5n + 1) { --tilt: -1.1deg; --tint: #faf3de; }
.note:nth-child(5n + 2) { --tilt: 0.9deg; --tint: #f7efdb; }
.note:nth-child(5n + 3) { --tilt: -0.5deg; --tint: #f3ecdd; }
.note:nth-child(5n + 4) { --tilt: 1.2deg; --tint: #eef0e2; }
.note:nth-child(5n + 5) { --tilt: -0.8deg; --tint: #f5eee1; }
@media (hover: hover) and (pointer: fine) {
  .note:hover {
    transform: rotate(var(--tilt, 0deg)) translateY(-2px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 250, 0.92),
      0 1px 0 rgba(150, 124, 86, 0.2),
      0 3px 5px -1px rgba(62, 44, 22, 0.18),
      0 12px 20px -14px rgba(62, 44, 22, 0.44);
  }
}
@keyframes note-drop {
  from { opacity: 0; transform: rotate(var(--tilt, 0deg)) translateY(-7px); }
  to { opacity: 1; transform: rotate(var(--tilt, 0deg)) translateY(0); }
}

/* 顶上那枚哑光小磁钉 */
.note-magnet {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f2ded4, #b97a6a 58%, #8e5b4d);
  box-shadow:
    0 1px 2px rgba(60, 40, 22, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
/* 珍藏便签多一枚小小的「藏」字印 */
.note-seal {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1;
  color: #f8f2e4;
  background: rgba(156, 75, 59, 0.58);
  border-radius: 1px 2px 1px 2px;
  transform: rotate(4deg);
  opacity: 0.75;
  user-select: none;
}
.note-text {
  margin: 0;
  font-family: var(--kai);
  font-size: 14.5px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.note-foot {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid rgba(122, 99, 68, 0.12);
}
.note-who {
  font-family: var(--serif);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.note-when {
  margin-left: auto;
  font-family: var(--kai);
  font-size: 10.5px;
  color: var(--ink-3);
}
.note-when.is-soon { color: var(--seal); opacity: 0.78; }
.note-tear {
  flex: none;
  font-family: var(--kai);
  font-size: 10.5px;
  color: var(--ink-3);
  padding: 0 1px;
  opacity: 0.5;
  transition: color 0.35s ease, opacity 0.35s ease;
}
.note-tear:hover { color: var(--danger); opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .note-tear { opacity: 0; }
  .note:hover .note-tear { opacity: 0.8; }
}
.notes-empty {
  flex: 1;
  margin: auto;
  padding: 26px 10px;
  text-align: center;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* ---------- 我的：一张名帖 ---------- */

.me-card {
  position: relative;
  background-color: var(--note);
  background-image:
    linear-gradient(170deg, rgba(255, 254, 246, 0.5) 0%, rgba(255, 254, 246, 0) 54%, rgba(124, 98, 60, 0.06) 100%),
    var(--noise-soft);
  border-radius: 7px 11px 8px 12px / 11px 7px 12px 8px;
  padding: 18px 18px 15px;
  display: block;
  margin-top: 11px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.96),
    inset 1px 0 0 rgba(255, 254, 245, 0.34),
    inset 0 -1px 0 rgba(120, 94, 58, 0.1),
    0 1px 0 rgba(150, 124, 86, 0.24),
    0 2px 0 rgba(150, 124, 86, 0.09),
    2px 5px 8px -3px rgba(62, 44, 22, 0.2),
    4px 14px 22px -12px rgba(62, 44, 22, 0.26),
    7px 28px 38px -26px rgba(62, 44, 22, 0.3);
  transform: rotate(-0.22deg);
}
.me-card .seal {
  position: absolute;
  top: 14px;
  right: 15px;
  width: 22px;
  height: 22px;
  font-size: 13px;
  opacity: 0.26;
}
.me-head {
  display: flex;
  gap: 17px;
  align-items: center;
}
.me-info { flex: 1; min-width: 0; }
.nickname-input {
  width: 100%;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.08em;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 2px 0 7px;
  background: transparent;
  outline: none;
  transition: border-color 0.45s ease;
}
.nickname-input:focus { border-bottom-color: rgba(147, 96, 74, 0.4); }
.me-stats {
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--ink-3);
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--rule-soft);
}

.me-actions { display: flex; justify-content: center; margin-top: 14px; }
.me-actions .ghost-btn {
  flex: none;
  min-width: 126px;
  height: 38px;
  padding: 0 24px;
}
.ghost-btn {
  flex: 1;
  height: 44px;
  border-radius: 3px 5px 4px 6px / 5px 3px 6px 4px;
  border: 1px solid var(--rule);
  background: rgba(250, 245, 232, 0.5);
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  transition: background-color 0.45s ease, color 0.45s ease;
}
.ghost-btn:hover { background: rgba(252, 248, 238, 0.85); color: var(--ink); }
.ghost-btn.danger { color: var(--danger); border-color: rgba(154, 70, 56, 0.22); }

/* 名帖下的一行：最近一句 */
.me-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 0;
  padding: 0 1px 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.me-line-label {
  flex: none;
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.me-line input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--kai);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  padding: 2px 0;
}
.me-line input::placeholder { color: var(--ink-3); opacity: 0.72; }

/* 小账：三格数字 */
.me-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  padding: 15px 2px;
  background-color: var(--note-c);
  background-image:
    linear-gradient(170deg, rgba(255, 254, 246, 0.48) 0%, rgba(255, 254, 246, 0) 56%, rgba(124, 98, 60, 0.055) 100%),
    var(--noise-soft);
  border-radius: 7px 10px 8px 11px / 10px 7px 11px 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.9),
    inset 0 -1px 0 rgba(120, 94, 58, 0.09),
    0 1px 0 rgba(150, 124, 86, 0.22),
    2px 4px 7px -3px rgba(62, 44, 22, 0.18),
    5px 13px 20px -14px rgba(62, 44, 22, 0.24);
  transform: rotate(0.14deg);
}
.ledger-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-left: 1px solid var(--rule-soft);
}
.ledger-cell:first-child { border-left: none; }
.ledger-num {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.ledger-num.is-zero { color: var(--ink-3); opacity: 0.55; }
.ledger-label {
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  white-space: nowrap;
}

/* 我的近照 */
.me-block { margin-top: 2px; }
.me-block .section-head { padding: 21px 3px 11px; }

.me-photos {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 1px 7px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.me-photos::-webkit-scrollbar { display: none; }
.me-photos.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 0;
  border: 1px dashed rgba(122, 99, 68, 0.18);
  border-radius: 6px;
  background: rgba(250, 245, 232, 0.28);
  scroll-snap-type: none;
}
.me-photos.is-empty .me-empty { padding: 0 14px; text-align: center; }
.me-photo {
  flex: none;
  width: 94px;
  height: 94px;
  padding: 4px;
  background: #fdfaf1;
  border-radius: 1px;
  scroll-snap-align: start;
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.08),
    0 1px 0 rgba(255, 255, 252, 0.7),
    0 2px 3px -2px rgba(62, 44, 22, 0.26),
    0 6px 10px -9px rgba(62, 44, 22, 0.42);
  transition: transform 0.45s cubic-bezier(0.22, 0.7, 0.3, 1), box-shadow 0.45s ease;
}
.me-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 1px;
}
.me-photo:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.07),
    0 1px 0 rgba(255, 255, 252, 0.7),
    0 3px 5px -2px rgba(62, 44, 22, 0.28),
    0 10px 15px -10px rgba(62, 44, 22, 0.46);
}

/* 小院回音 */
.echo-list {
  background-color: var(--note);
  background-image:
    linear-gradient(172deg, rgba(255, 254, 246, 0.44) 0%, rgba(255, 254, 246, 0) 54%, rgba(124, 98, 60, 0.05) 100%),
    var(--noise-soft);
  border-radius: 8px 11px 9px 12px / 11px 8px 12px 9px;
  padding: 3px 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.9),
    inset 0 -1px 0 rgba(120, 94, 58, 0.09),
    0 1px 0 rgba(150, 124, 86, 0.22),
    2px 4px 7px -3px rgba(62, 44, 22, 0.18),
    5px 14px 22px -15px rgba(62, 44, 22, 0.26);
  transform: rotate(-0.16deg);
}
.echo {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 12px 0;
  text-align: left;
  border-bottom: 1px solid var(--rule-soft);
}
.echo:last-child { border-bottom: none; }
.echo-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.echo-who {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.echo-time {
  font-family: var(--kai);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  flex: none;
}
.echo-text {
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--ink-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.4s ease;
}
.echo:hover .echo-text { color: var(--ink); }

.me-empty {
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  line-height: 1.8;
  padding: 15px 3px 17px;
  margin: 0;
}

/* 文末：提示、退出与落款 */
.me-tail { margin-top: 4px; }
.me-tail-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.me-logout {
  display: inline-block;
  margin: 2px 0 0;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--danger);
  padding: 6px 2px;
  border-bottom: 1px solid rgba(154, 70, 56, 0.2);
}
.me-quiet {
  display: inline-block;
  margin-top: 2px;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  padding: 6px 2px;
  border-bottom: 1px solid var(--rule-soft);
  transition: color 0.45s ease;
}
.me-quiet:hover { color: var(--ink-2); }
.me-sign {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 34px;
  padding: 15px 4px 2px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.me-sign .seal {
  width: 19px;
  height: 19px;
  font-size: 11px;
  opacity: 0.3;
}

/* 备案号：不抢眼，但得让来的人一眼能找到 */
.beian {
  margin: 0;
  padding: 12px 4px 0;
  text-align: right;
  font-family: var(--kai);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.7;
  color: var(--ink-3);
  opacity: 0.72;
}
.beian a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 1px;
  transition: color 0.45s ease, opacity 0.45s ease;
}
.beian a:hover { color: var(--ink-2); opacity: 1; }
.beian-center {
  text-align: center;
  padding: 14px 0 0;
  opacity: 0.68;
}

/* 从回音跳回某条动态时，轻轻提亮一下，外面浮一圈淡朱砂，两秒后退干净 */
.post-hit {
  outline: 1.5px solid transparent;
  outline-offset: 3px;
  animation: post-hit 1.8s ease;
}
@keyframes post-hit {
  0%, 100% { filter: none; outline-color: rgba(147, 96, 74, 0); }
  18% { filter: brightness(1.05) saturate(1.04); outline-color: rgba(147, 96, 74, 0.34); }
  62% { filter: brightness(1.02); outline-color: rgba(147, 96, 74, 0.2); }
}

.me-hint {
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  line-height: 1.8;
  padding: 15px 3px;
  margin: 0;
}

/* ---------- 底部：一条纸边 ---------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(238, 231, 217, 0.975);
  border-top: 1px solid var(--rule-soft);
  box-shadow: 0 -10px 22px -24px rgba(74, 58, 38, 0.7);
  padding-bottom: var(--safe-b);
  z-index: 40;
}
.tab {
  position: relative;
  flex: 1;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  transition: color 0.45s ease;
}
.tab svg { opacity: 0.62; transition: opacity 0.45s ease; }
.tab.active { color: var(--accent); }
.tab.active svg { opacity: 0.95; }
/* 选中时只落一点墨 */
.tab::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.tab.active::after { opacity: 0.55; }

/* ---------- 发布：一张摊开的信纸 ---------- */

.sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vvh, 100vh);
  z-index: 60;
  background: rgba(48, 41, 32, 0.34);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 600px;
  background-color: var(--paper-lit);
  background-image: var(--noise-soft);
  border: 1px solid rgba(122, 99, 68, 0.12);
  border-bottom: none;
  border-radius: 12px 15px 0 0 / 17px 19px 0 0;
  padding: 0 18px calc(16px + var(--safe-b));
  max-height: 88%;
  overflow-y: auto;
  box-shadow: 0 -16px 34px -26px rgba(50, 38, 24, 0.75);
  animation: sheet-rise 0.42s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}
/* 抽取时的一道折痕 */
.sheet-panel::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 34px;
  height: 2px;
  margin-left: -17px;
  border-radius: 2px;
  background: rgba(122, 99, 68, 0.16);
  pointer-events: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  position: sticky;
  top: 0;
  background: transparent;
}
.sheet-btn {
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  padding: 6px 2px;
}
.sheet-btn.send { color: var(--accent); }
.sheet-btn.send:disabled { color: var(--ink-3); opacity: 0.6; }
.sheet-title {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink-2);
}

#sheet-text {
  width: 100%;
  min-height: 112px;
  max-height: 36vh;
  border: none;
  outline: none;
  padding: 0 2px;
  font-size: 16px;
  line-height: 28px;
  letter-spacing: 0.02em;
  resize: none;
  background-color: transparent;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    rgba(122, 99, 68, 0.075) 27px,
    rgba(122, 99, 68, 0.075) 28px
  );
}
#sheet-text::placeholder { color: var(--ink-3); }

.preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.preview-item { position: relative; }
.preview-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  padding: 4px;
  background: #fdfaf1;
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.1);
  display: block;
}
.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(58, 48, 37, 0.72);
  color: #f7f1e3;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
}
.tool-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  white-space: nowrap;
  font-family: var(--kai);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  min-height: 34px;
}
.tool-plus { font-family: var(--serif); font-size: 15px; line-height: 1; opacity: 0.7; }
.location-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 2px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-soft);
}
.location-field input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.location-field input::placeholder { color: var(--ink-3); }

.sheet-error {
  color: var(--danger);
  font-size: 12.5px;
  min-height: 16px;
  margin: 9px 0 0;
}

/* ---------- 名帖：点头像翻开的一张小纸 ---------- */

.profile {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 20px calc(26px + var(--safe-b));
}
.profile-veil {
  position: absolute;
  inset: 0;
  background: rgba(52, 44, 33, 0.42);
  touch-action: none;
  animation: veil-in 0.42s ease both;
}
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }

.profile-paper {
  position: relative;
  width: min(374px, 100%);
  max-height: min(86vh, 660px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 19px 16px;
  background-color: var(--note);
  background-image:
    linear-gradient(171deg, rgba(255, 254, 246, 0.5) 0%, rgba(255, 254, 246, 0) 55%, rgba(124, 98, 60, 0.06) 100%),
    var(--noise-soft);
  border-radius: 9px 13px 10px 12px / 13px 9px 12px 10px;
  rotate: -0.36deg;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.96),
    inset 1px 0 0 rgba(255, 254, 245, 0.34),
    inset 0 -1px 0 rgba(120, 94, 58, 0.1),
    0 1px 0 rgba(150, 124, 86, 0.24),
    0 2px 0 rgba(150, 124, 86, 0.09),
    2px 6px 9px -4px rgba(62, 44, 22, 0.24),
    6px 20px 30px -16px rgba(62, 44, 22, 0.34),
    10px 44px 64px -34px rgba(42, 30, 16, 0.5);
  animation: profile-in 0.46s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}
@keyframes profile-in {
  from { opacity: 0; translate: 0 18px; scale: 0.975; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
/* 右下角一点翘起的纸边 */
.profile-paper::after {
  content: "";
  position: absolute;
  right: 11px;
  bottom: 9px;
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(122, 99, 68, 0.15));
  rotate: -18deg;
  pointer-events: none;
}

/* 右上角一枚淡印，像名帖上盖过的章 */
.profile-mark {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 21px;
  height: 21px;
  font-size: 12px;
  opacity: 0.22;
  pointer-events: none;
}

.profile-close {
  flex: none;
  padding: 7px 1px 6px;
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-soft);
  transition: color 0.4s ease;
}
.profile-close:hover { color: var(--ink-2); }

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 26px;
}
/* 头像像贴上去的一张小像：白纸托底、微微歪着 */
.profile-avatar-wrap {
  flex: none;
  padding: 3px;
  background: #fdfaf1;
  border-radius: 4px 6px 5px 7px / 6px 4px 7px 5px;
  rotate: -1.4deg;
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.1),
    0 2px 4px -3px rgba(62, 44, 22, 0.5),
    0 6px 12px -9px rgba(62, 44, 22, 0.6);
}
.profile-id { flex: 1; min-width: 0; }
.profile-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.09em;
  line-height: 1.4;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-sub {
  margin-top: 2px;
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: var(--ink-3);
}

.profile-bio {
  margin-top: 15px;
  padding: 10px 13px 11px;
  background-color: rgba(250, 246, 233, 0.7);
  border-radius: 6px 9px 7px 10px / 9px 6px 10px 7px;
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.11),
    inset 0 1px 0 rgba(255, 255, 250, 0.6);
}
.profile-bio-tag {
  display: block;
  margin-bottom: 3px;
  font-family: var(--kai);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}
.profile-bio-text {
  font-family: var(--kai);
  font-size: 14.5px;
  line-height: 1.72;
  letter-spacing: 0.03em;
  color: var(--ink);
  word-break: break-word;
}
.profile-bio-text.is-blank { color: var(--ink-3); opacity: 0.8; }

.profile-ledger {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 13px;
  padding: 11px 0;
  transform: none;
}
.profile-ledger .ledger-num { font-size: 20px; }
.profile-ledger .ledger-label { font-size: 11px; }

.profile-sec { margin-top: 15px; }
.profile-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  padding: 0 1px 7px;
  border-bottom: 1px solid var(--rule-soft);
}
.profile-sec-head span:first-child {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--ink-2);
}
.profile-sec-head span:last-child {
  font-family: var(--kai);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.profile-photos {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 1px 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* 右边淡下去一点：照片多的时候知道还能往左滑 */
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
}
.profile-photos::-webkit-scrollbar { display: none; }
.profile-photo {
  flex: none;
  width: 74px;
  height: 74px;
  padding: 3px;
  background: #fdfaf1;
  border-radius: 1px;
  scroll-snap-align: start;
  box-shadow:
    inset 0 0 0 1px rgba(122, 99, 68, 0.08),
    0 2px 3px -2px rgba(62, 44, 22, 0.26),
    0 6px 10px -9px rgba(62, 44, 22, 0.4);
  transition: transform 0.4s cubic-bezier(0.22, 0.7, 0.3, 1);
}
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 1px;
}
.profile-photo:hover { transform: translateY(-2px); }

.profile-latest {
  display: block;
  width: 100%;
  padding: 8px 11px 9px;
  text-align: left;
  border-left: 2px solid rgba(147, 96, 74, 0.26);
  border-radius: 0 3px 3px 0;
  background: rgba(255, 254, 246, 0.42);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}
.profile-latest:hover {
  background: rgba(255, 254, 246, 0.72);
  border-left-color: rgba(147, 96, 74, 0.44);
}
.profile-latest-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.profile-none {
  margin: 0;
  padding: 7px 2px 9px;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  line-height: 1.8;
  color: var(--ink-3);
}

.profile-foot {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--rule-soft);
}
.profile-go {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  line-height: 38px;
  text-align: center;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 254, 246, 0.6);
  border: 1px solid rgba(147, 96, 74, 0.3);
  border-radius: 3px 5px 4px 6px / 5px 3px 6px 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 252, 0.6),
    0 2px 3px -3px rgba(62, 44, 22, 0.5);
  transition: background-color 0.42s ease, translate 0.42s ease;
}
.profile-go:hover { background: rgba(255, 254, 246, 0.95); translate: 0 -1px; }
.profile-go:active { translate: 0 0; }

.profile-loading {
  margin: 24px 0 8px;
  text-align: center;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}


/* 小窗开着的时候，背后的纸不要再跟着手指走 */
html.is-locked { overflow: hidden; }

/* 头像能点了：抬一点，按下去轻轻收一下 */
.post-head [data-avatar-user],
.member [data-avatar-user] { cursor: pointer; }
.post-head [data-avatar-user] {
  transition: translate 0.4s cubic-bezier(0.22, 0.7, 0.3, 1), box-shadow 0.4s ease;
}
.post-head [data-avatar-user]:hover { translate: 0 -1px; }
.post-head [data-avatar-user]:active,
.member [data-avatar-user]:active { scale: 0.94; }

/* ---------- 有人唤你：夹在信里的一张便条 ---------- */

.mentions {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 20px calc(26px + var(--safe-b));
}
.mentions-veil {
  position: absolute;
  inset: 0;
  background: rgba(52, 44, 33, 0.42);
  touch-action: none;
  animation: veil-in 0.42s ease both;
}
.mentions-paper {
  position: relative;
  width: min(378px, 100%);
  max-height: min(84vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 19px 15px;
  background-color: var(--note);
  background-image:
    linear-gradient(171deg, rgba(255, 254, 246, 0.5) 0%, rgba(255, 254, 246, 0) 55%, rgba(124, 98, 60, 0.06) 100%),
    var(--noise-soft);
  border-radius: 9px 13px 10px 12px / 13px 9px 12px 10px;
  rotate: 0.34deg;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.96),
    inset 1px 0 0 rgba(255, 254, 245, 0.34),
    inset 0 -1px 0 rgba(120, 94, 58, 0.1),
    0 1px 0 rgba(150, 124, 86, 0.24),
    0 2px 0 rgba(150, 124, 86, 0.09),
    2px 6px 9px -4px rgba(62, 44, 22, 0.24),
    6px 20px 30px -16px rgba(62, 44, 22, 0.34),
    10px 44px 64px -34px rgba(42, 30, 16, 0.5);
  animation: profile-in 0.46s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}
.mentions-mark {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 21px;
  height: 21px;
  font-size: 12px;
  opacity: 0.22;
  pointer-events: none;
}
.mentions-head { padding-right: 30px; }
.mentions-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.mentions-head p {
  margin: 3px 0 0;
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.mentions-list { margin-top: 13px; }

.mention-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 11px 2px;
  text-align: left;
  border-top: 1px solid var(--rule-soft);
  transition: background-color 0.4s ease;
}
.mention-item:first-child { border-top: none; }
.mention-item:hover { background: rgba(255, 254, 246, 0.55); }
.mention-item.is-new {
  padding-left: 9px;
  border-left: 2px solid rgba(156, 75, 59, 0.46);
}
.mention-item-body { flex: 1; min-width: 0; }
.mention-item-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.mention-item-who {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.mention-item-kind {
  font-family: var(--kai);
  font-size: 11px;
  color: var(--ink-3);
}
.mention-item-time {
  margin-left: auto;
  font-family: var(--kai);
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.mention-item-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  word-break: break-word;
}
.mentions-none {
  margin: 0;
  padding: 28px 4px 24px;
  text-align: center;
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.mentions-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--rule-soft);
}
.mentions-close {
  padding: 7px 2px 6px;
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-soft);
  transition: color 0.4s ease;
}
.mentions-close:hover { color: var(--ink-2); }

/* 从纸条翻回某条日常时，被点到的那层楼亮一下 */
.comment-hit {
  border-radius: 4px;
  animation: comment-hit 1.8s ease;
}
@keyframes comment-hit {
  0% { background: rgba(147, 96, 74, 0.16); }
  100% { background: transparent; }
}

/* ---------- 裁头像：一张小纸，圆窗里挪画面 ---------- */

.cropper {
  position: fixed;
  inset: 0;
  z-index: 74;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + var(--safe-b));
}
.cropper-veil {
  position: absolute;
  inset: 0;
  background: rgba(52, 44, 33, 0.46);
  touch-action: none;
  animation: veil-in 0.42s ease both;
}

.cropper-paper {
  position: relative;
  width: min(330px, 100%);
  padding: 18px 18px 15px;
  background-color: var(--note);
  background-image:
    linear-gradient(171deg, rgba(255, 254, 246, 0.5) 0%, rgba(255, 254, 246, 0) 55%, rgba(124, 98, 60, 0.06) 100%),
    var(--noise-soft);
  border-radius: 9px 13px 10px 12px / 13px 9px 12px 10px;
  rotate: -0.3deg;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 250, 0.96),
    inset 1px 0 0 rgba(255, 254, 245, 0.34),
    inset 0 -1px 0 rgba(120, 94, 58, 0.1),
    0 1px 0 rgba(150, 124, 86, 0.24),
    0 2px 0 rgba(150, 124, 86, 0.09),
    2px 6px 9px -4px rgba(62, 44, 22, 0.24),
    6px 20px 30px -16px rgba(62, 44, 22, 0.34),
    10px 44px 64px -34px rgba(42, 30, 16, 0.5);
  animation: profile-in 0.46s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}

.cropper-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  font-size: 11px;
  opacity: 0.22;
  pointer-events: none;
}

.cropper-head { padding-right: 22px; }
.cropper-head h3 {
  margin: 1px 0 4px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.cropper-head p {
  margin: 0;
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}

/* 取景窗：方形溢出裁剪，中间挖一个正圆，四角压暗 */
.cropper-stage {
  position: relative;
  width: min(100%, 258px);
  aspect-ratio: 1;
  margin: 14px auto 10px;
  overflow: hidden;
  border-radius: 3px;
  background: #d8ceb8;
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.14);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-touch-callout: none;
}
.cropper-stage.is-dragging { cursor: grabbing; }
.cropper-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.crop-hole {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 0 9999px rgba(44, 35, 25, 0.52),
    inset 0 0 0 1px rgba(250, 243, 222, 0.55);
}

.cropper-zoom {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 5px;
  margin-bottom: 12px;
}
.crop-z {
  flex: none;
  font-family: var(--kai);
  font-size: 11px;
  color: var(--ink-3);
}
.crop-z-max { font-size: 12.5px; }

#crop-zoom {
  flex: 1;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
#crop-zoom::-webkit-slider-runnable-track {
  height: 1px;
  background: rgba(122, 99, 68, 0.26);
}
#crop-zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(250, 243, 222, 0.8), 0 1px 3px rgba(62, 44, 22, 0.25);
}
#crop-zoom::-moz-range-track { height: 1px; background: rgba(122, 99, 68, 0.26); }
#crop-zoom::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
}

.cropper-foot { display: flex; gap: 10px; }
.cropper-foot .ghost-btn,
.cropper-foot .primary-btn {
  width: auto;
  flex: 1;
  height: 42px;
  margin-top: 0;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}

/* ---------- 看图 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(38, 32, 25, 0.985);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px calc(18px + var(--safe-b));
}
.lightbox img {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  border-radius: 1px;
}

.lightbox-bar {
  flex: 0 0 auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 20px;
  border-radius: 2px 5px 3px 5px / 4px 3px 5px 3px;
  border: 1px solid rgba(243, 236, 221, 0.26);
  background: rgba(243, 236, 221, 0.08);
  color: #f3ecdd;
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.14em;
  transition: background-color 0.45s ease;
}
.lightbox-btn:hover { background: rgba(243, 236, 221, 0.16); }
.lightbox-btn:active { background: rgba(243, 236, 221, 0.24); }

/* ---------- 贴标签：从底下推上来的一张小纸 ---------- */

.tag-sheet {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tag-veil {
  position: absolute;
  inset: 0;
  background: rgba(34, 28, 22, 0.55);
  animation: veil-in 0.4s ease both;
}
.tag-panel {
  position: relative;
  width: 100%;
  max-width: 600px;
  padding: 13px 20px calc(20px + var(--safe-b));
  background-color: var(--paper-lit);
  background-image: var(--noise-soft);
  border-radius: 13px 16px 0 0 / 18px 20px 0 0;
  box-shadow: 0 -18px 40px -26px rgba(30, 22, 14, 0.8);
  animation: sheet-rise 0.42s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}
.tag-grip {
  display: block;
  width: 34px;
  height: 3px;
  margin: 0 auto 12px;
  border-radius: 2px;
  background: rgba(122, 99, 68, 0.18);
}
.tag-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tag-title {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.tag-close {
  font-family: var(--kai);
  font-size: 12px;
  color: var(--ink-3);
  transition: color 0.4s ease;
}
.tag-close:hover { color: var(--accent); }
.tag-current {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 25px;
  margin-bottom: 11px;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 3px 2px 8px;
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: rgba(250, 245, 232, 0.82);
  border-radius: 2px 5px 3px 5px / 4px 3px 5px 3px;
  box-shadow: inset 0 0 0 1px rgba(122, 99, 68, 0.16);
}
.tag-pill button {
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1;
  color: var(--ink-3);
  border-radius: 50%;
  transition: color 0.3s ease, background-color 0.3s ease;
}
.tag-pill button:hover { color: var(--danger); background: rgba(154, 70, 56, 0.08); }
.tag-none {
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  line-height: 25px;
}
.tag-form { display: flex; gap: 10px; align-items: center; }
.tag-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 2px;
  border: none;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  font-family: var(--kai);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.4s ease, background-color 0.4s ease;
}
.tag-form input:focus {
  border-bottom-color: rgba(147, 96, 74, 0.5);
  background: rgba(255, 255, 255, 0.26);
}
.tag-form input::placeholder { color: var(--ink-3); opacity: 0.85; }
.tag-form button {
  flex: none;
  height: 32px;
  padding: 0 14px;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--accent);
  border-radius: 2px 5px 3px 5px / 4px 3px 5px 3px;
  box-shadow: inset 0 0 0 1px rgba(147, 96, 74, 0.28);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}
.tag-form button:hover { background: rgba(252, 247, 236, 0.85); box-shadow: inset 0 0 0 1px rgba(147, 96, 74, 0.42); }
.tag-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}
.tag-suggest:empty { display: none; }
.tag-note {
  margin: 12px 0 0;
  font-family: var(--kai);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  transform: translate(-50%, 8px);
  background: rgba(63, 55, 44, 0.93);
  color: #f5efe2;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  padding: 9px 17px;
  border-radius: 2px 4px 3px 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
  z-index: 90;
  /* left:50% 会让收缩宽度只按右半边算，长句还没到 max-width 就折行了；先按内容撑开再钳住 */
  width: max-content;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 动效：淡淡的，像翻过一页纸 ---------- */

@keyframes letter-in {
  from { opacity: 0; transform: rotate(-0.3deg) translateY(10px); }
  to { opacity: 1; transform: rotate(-0.3deg) translateY(0); }
}

@keyframes card-in {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes sheet-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.view:not(.hidden) {
  animation: page-in 0.5s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 640px) {
  /* 桌面端：整列收成一张摊在桌上的纸，顶栏与底栏不再是一条突兀的色带 */
  .app {
    min-height: 100vh;
    background: rgba(248, 242, 230, 0.34);
    box-shadow:
      inset 1px 0 0 var(--rule-soft),
      inset -1px 0 0 var(--rule-soft),
      0 40px 70px -60px rgba(74, 58, 38, 0.9);
  }
  .tabbar {
    max-width: 600px;
    margin: 0 auto;
    border-left: 1px solid var(--rule-soft);
    border-right: 1px solid var(--rule-soft);
  }
  .grid-1 { max-width: 56%; }
  .grid-2 { max-width: 62%; }
  .me-photo { width: 108px; height: 108px; }
}

/* ---------- 按下去要有回应 ----------
   网页做的按钮最容易露怯的地方，就是按下去一点反应都没有。
   这里只压暗一点点、松手立刻回弹；不做缩放——便签本来就是斜的，
   transform 会把它扶正，scale 属性又太新的机器才认。 */
.tab:active,
.quick-composer:active,
.avatar-btn:active,
.avatar-edit:active,
.act-btn:active,
.tag-chip:active,
.tl-photo:active,
.member:active,
.ghost-btn:active,
.new-pill:active,
.note:active,
#avatar-reset:active {
  opacity: 0.75;
}
