/* Anonymous tree hole. Uses the same light/dark tokens as the chat, with a paper column of notes. */
:root {
  color-scheme: light dark;
  --bg: #f3f1eb;
  --card: #fffcf7;
  --text: #1a1916;
  --muted: #5e5a53;
  --faint: #8d877c;
  --line: rgba(40, 32, 16, 0.1);
  --line-strong: rgba(40, 32, 16, 0.16);
  --shadow: 0 1px 1px rgba(40, 32, 16, 0.04), 0 12px 32px rgba(40, 32, 16, 0.06);
  --accent: #166534;
  --accent-bg: #ecfdf3;
  --bot: #f3faf5;
  --danger: #9f1239;
  --danger-bg: #fff1f2;
  --ring: rgba(34, 197, 94, 0.45);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #212121;
    --card: #2a2a2a;
    --text: #f3f1eb;
    --muted: #c8c2b8;
    --faint: #9a948a;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.28);
    --accent: #86efac;
    --accent-bg: #14261c;
    --bot: #1c2b22;
    --danger: #fda4af;
    --danger-bg: rgba(159, 18, 57, 0.28);
    --ring: rgba(134, 239, 172, 0.4);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 420px at 50% -80px, color-mix(in srgb, #86efac 22%, transparent), transparent 70%),
    var(--bg);
}
button, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.hole { width: min(680px, 100%); margin: 0 auto; padding: 0 16px calc(28px + var(--safe-bottom)); }

.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: calc(10px + var(--safe-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
}
.back {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: var(--muted); text-decoration: none;
}
.back:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: #eee url("/avatar/avatar-96.webp") center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--line);
}
.titles { flex: 1; min-width: 0; }
.titles h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; }
.titles p { margin: 1px 0 0; font-size: 12px; color: var(--faint); }
.titles p::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px;
  border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); vertical-align: 0;
}
.lang { display: flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, transparent); }
.lang button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; font-weight: 650; padding: 0 6px; height: 26px; border-radius: 999px; white-space: nowrap;
}
.lang button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
@media (max-width: 480px) {
  .bar { gap: 4px; padding: calc(8px + var(--safe-top)) 6px 8px; }
  .bar .back { width: 32px; height: 32px; flex: none; }
  .bar .avatar { width: 28px; height: 28px; }
  .bar .titles { min-width: 0; flex: 1 1 auto; }
  .bar .titles h1 { font-size: 16px; white-space: nowrap; }
  .bar .titles p { font-size: 11.5px; white-space: nowrap; line-height: 1.3; overflow: visible; }
  .bar .lang { padding: 1px; }
  .bar .lang button { padding: 0 4px; font-size: 11px; height: 28px; }
}

.intro {
  margin: 8px 0 14px; font-size: 15.5px; line-height: 1.65; color: var(--muted);
}
.intro strong { color: var(--text); font-weight: 650; }

.compose, .note {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow);
}
.compose { padding: 14px 14px 12px; }
.compose textarea {
  width: 100%; resize: none; border: 0; outline: 0; background: transparent;
  font-size: 16px; line-height: 1.55; min-height: 84px; padding: 4px 4px 0;
}
.compose textarea::placeholder { color: var(--faint); }
.stickers {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 4px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.stickers::-webkit-scrollbar { display: none; }
.stickers button {
  flex: none; width: 48px; height: 48px; border-radius: 16px; border: 1px solid transparent;
  background: color-mix(in srgb, var(--text) 4%, transparent); padding: 4px; cursor: pointer;
  scroll-snap-align: start; transition: transform .15s ease, border-color .15s ease, background .15s;
}
.stickers button svg { width: 100%; height: 100%; display: block; }
.stickers button[aria-selected="true"] {
  border-color: var(--accent); background: var(--accent-bg); transform: translateY(-2px);
  box-shadow: 0 0 0 3px var(--ring);
}
.stickers button:active { transform: scale(.94); }
.compose-bar { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.count { flex: 1; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; padding-left: 4px; }
#postBtn {
  border: 0; border-radius: 999px; height: 38px; padding: 0 16px; cursor: pointer;
  background: var(--text); color: var(--bg); font-weight: 650; font-size: 14.5px;
  transition: transform .15s ease, opacity .15s;
}
#postBtn:disabled { opacity: .38; cursor: default; }
#postBtn:not(:disabled):active { transform: scale(.97); }
.banner {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 14px;
  background: var(--danger-bg); color: var(--danger); font-size: 14px; line-height: 1.45;
}
.login-note { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.login-note a { color: var(--accent); font-weight: 650; }

.feed { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.note { padding: 16px 16px 12px; animation: rise .45s ease both; }
.note-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.note .big-sticker { width: 64px; height: 64px; flex: none; filter: drop-shadow(0 6px 10px rgba(40, 32, 16, .08)); }
.note .big-sticker svg { width: 100%; height: 100%; display: block; }
.when { font-size: 12px; color: var(--faint); padding-top: 4px; }
.note-text { margin: 10px 0 0; font-size: 16.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.note-text.translated { color: var(--text); }
.tr-tag {
  display: inline-block; margin: 8px 0 0; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--accent); background: var(--accent-bg);
}
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.text-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 6px 8px; border-radius: 999px;
}
.text-btn:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.text-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-bg); }
.text-btn:disabled { opacity: .55; cursor: progress; }

.thread { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.reply {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; border-radius: 16px;
}
.reply.bot { background: var(--bot); }
.reply .mini {
  width: 26px; height: 26px; border-radius: 50%; flex: none; margin-top: 1px;
  background: #eee url("/avatar/avatar-96.webp") center / cover no-repeat;
}
.reply .who { font-size: 12px; font-weight: 700; color: var(--faint); }
.reply.bot .who { color: var(--accent); }
.reply p { margin: 1px 0 0; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.reply .text-btn { padding: 4px 2px; }
.mini-sticker { width: 28px; height: 28px; vertical-align: -6px; margin-right: 4px; }
.mini-sticker svg { width: 100%; height: 100%; }

.reply-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 4px; }
.reply-form textarea {
  flex: 1; resize: none; border: 1px solid var(--line-strong); background: transparent;
  border-radius: 14px; padding: 8px 10px; font-size: 16px; line-height: 1.4; min-height: 42px; outline: 0;
}
.reply-form textarea:focus { border-color: var(--accent); }
.reply-form button {
  flex: none; height: 38px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700;
}
.reply-form button:disabled { opacity: .4; cursor: default; }

.empty { text-align: center; color: var(--faint); padding: 28px 10px; }
.foot { text-align: center; color: var(--faint); font-size: 12px; margin: 22px 0 0; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .note, .stickers button { animation: none; transition: none; }
}

@media (min-width: 720px) {
  .hole { padding-top: 8px; }
  .intro { font-size: 17px; }
  .note { padding: 18px 20px 14px; }
}
.foot.visits { margin-top: 6px; font-size: 11px; }
