:root {
  --bg: #f3eee7;
  --card: #fffdfb;
  --ink: #2b221c;
  --muted: #8d7d70;
  --nav: #2a211c;
  --accent: #e07a5f;
  --line: rgba(43, 34, 28, 0.08);
  --shadow: 0 16px 40px rgba(70, 42, 24, 0.08);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 420px at 0% -10%, #f8e6d6 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, #e5f3ee 0%, transparent 50%),
    var(--bg);
}
button, input, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.nav-wrap, #nav { width: min(1040px, calc(100% - 28px)); margin: 14px auto 0; }
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 8px 8px 18px;
  background: var(--nav);
  color: #f6f0e8;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(42, 33, 28, 0.18);
}
.logo { font-weight: 700; letter-spacing: 0.02em; font-size: 15px; margin-right: 6px; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; }
.nav-link, .login-link {
  border-radius: 999px;
  padding: 8px 14px;
  color: #f6f0e8;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), color 0.3s;
}
.nav-link.on, .dock-item.on {
  background: var(--accent);
  color: white;
}
.nav-link:hover, .login-link:hover { transform: scale(1.06); }
.nav-search { flex: 1; }
.nav-search input, .search-page input, .field input, .field textarea, .composer textarea {
  width: 100%;
  border: 0;
  outline: none;
  background: rgba(255, 252, 248, 0.12);
  color: #f6f0e8;
  border-radius: 999px;
  padding: 10px 16px;
}
.search-page input, .field input, .field textarea, .composer textarea {
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.field textarea, .composer textarea { border-radius: 22px; min-height: 140px; resize: vertical; padding: 16px 18px; }
.icon-btn, .avatar-btn, .pen {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.icon-btn { display: none; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.08); }
.avatar-btn { padding: 0; border-radius: 50%; }
.pen {
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  transition: transform 0.3s var(--ease);
}
.pen:hover, .pen.solid:hover { transform: scale(1.06); }
.pen.solid { display: inline-flex; margin: 8px 0 18px; background: var(--board, var(--accent)); }

.wrap { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 48px; }
.view-in { animation: rise 0.45s var(--ease); }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.hero h1, .board-head h1, .auth h1, .page-title { margin: 0 0 8px; font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.hero p, .board-head p, .lead { margin: 0; color: var(--muted); line-height: 1.6; }

.board-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 22px; }
.board-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--card);
  border-radius: 30px;
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.swatch {
  --board: #3cbbb2;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 28px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,0.55), transparent 46%),
    var(--board);
  transition: transform 0.4s var(--ease);
}
.swatch.lg { width: 92px; height: 92px; }
.board-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.board-copy strong { font-size: 22px; }
.board-copy em, .board-copy small { font-style: normal; color: var(--muted); }
.board-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }

.thread-list { display: flex; flex-direction: column; gap: 12px; }
.thread, .post, .report, .admin-row, .auth, .composer, .search-hit {
  background: var(--card);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.thread {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  transition: transform 0.3s var(--ease);
}
.thread-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.thread-copy strong { font-size: 17px; }
.thread-copy small, .meta, .empty, .loading { color: var(--muted); }
.thread-marks { display: flex; align-items: center; gap: 6px; }
.mark { font-style: normal; font-size: 12px; color: var(--muted); border-radius: 999px; padding: 4px 8px; background: #f3ece4; }
.dot-new { width: 10px; height: 10px; border-radius: 50%; background: #e07a5f; display: block; }

.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #2b221c; font-weight: 700; overflow: hidden; flex: none;
  transition: transform 0.3s var(--ease);
}
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who { display: flex; gap: 10px; align-items: center; }
.who button { border: 0; background: transparent; padding: 0; cursor: pointer; }

.post { padding: 20px 20px 14px; margin-bottom: 12px; transition: transform 0.3s var(--ease); }
.post h2 { margin: 12px 0; font-size: 28px; letter-spacing: -0.03em; }
.prose p { margin: 0 0 10px; line-height: 1.7; white-space: pre-wrap; }
.quote { margin: 0 0 12px; padding: 12px 14px; border-radius: 18px; background: #f6f1ea; color: #5e5148; }
.quote p { margin: 0; }
.shot { border-radius: 20px; margin: 8px 0 12px; cursor: zoom-in; transition: transform 0.3s var(--ease); }
.at { color: #8a5a48; cursor: pointer; }
.at.me { background: #f8d7cc; color: #6d3226; border-radius: 999px; padding: 0 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actions button, .more, .menu-item, .chip, .tab, .color-dot {
  border: 0; cursor: pointer; background: #f6f1ea; color: var(--ink);
  border-radius: 999px; padding: 8px 14px;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s;
}
.actions button.on { color: white; }
.actions button.like.on { background: #e07a6a; }
.actions button.save.on { background: #e0a84a; }
.actions button.pop, .chip.pop { animation: pop 0.35s var(--ease); }
@keyframes pop { from { transform: scale(0.9); } to { transform: scale(1); } }
.more { display: block; margin: 16px auto 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; }
.chip i, .color-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; padding: 0; }
.chip.on { color: white; transform: scale(1.06); }
.color-dot { width: 36px; height: 36px; border-radius: 14px; }
.color-dot.on { transform: scale(1.12); box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(43,34,28,0.35); }

.composer, .auth, .search-page { padding: 18px; }
.auth { max-width: 460px; margin: 24px auto; }
.title-input {
  width: 100%; border: 0; background: transparent; font-size: 32px; font-weight: 700;
  outline: none; margin: 8px 0 12px; letter-spacing: -0.03em;
}
.row { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 12px; }
.mention-pop, .preview { display: flex; flex-wrap: wrap; gap: 8px; }
.mention-pop { max-height: 0; overflow: hidden; transform: translateY(10px); opacity: 0; transition: max-height 0.35s var(--ease), opacity 0.35s, transform 0.35s var(--ease); }
.mention-pop.show { max-height: 180px; opacity: 1; transform: none; margin-bottom: 8px; }
.mention-pop button, .preview img { border-radius: 16px; }
.preview img { height: 72px; width: 72px; object-fit: cover; }
.tools { display: flex; gap: 8px; margin-top: 10px; }

.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tab.on { background: var(--accent); color: white; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.profile-head h1 { margin: 0; font-size: 28px; }
.admin-row, .report, .search-hit { padding: 14px 16px; margin-bottom: 10px; display: flex; gap: 12px; align-items: center; }
.admin-row { cursor: pointer; transition: transform 0.3s var(--ease); }
.grow { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span, .sheet h3 { color: var(--muted); font-size: 14px; }
.sheet h3 { margin: 0 0 12px; color: var(--ink); font-size: 22px; }
.danger { background: #fde8e4 !important; color: #a33b32 !important; }

#mask {
  position: fixed; inset: 0; background: rgba(36, 28, 24, 0.28);
  opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 30;
}
#mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 40; background: var(--card); padding: 22px;
  box-shadow: var(--shadow); overflow: auto;
  transition: transform 0.45s var(--ease);
}
.sheet.right { top: 12px; right: 12px; bottom: 12px; width: min(420px, calc(100% - 24px)); border-radius: 28px; transform: translateX(110%); }
.sheet.left { top: 12px; left: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); border-radius: 28px; transform: translateX(-110%); }
.sheet.bottom { left: 12px; right: 12px; bottom: 12px; max-height: min(70vh, 560px); border-radius: 28px; transform: translateY(110%); }
.sheet.show { transform: none; }
.menu-item { display: block; width: 100%; text-align: left; margin-bottom: 8px; background: transparent; }
.menu-item:hover, .menu-item.on { background: #f6efe7; transform: scale(1.02); }

#dock {
  display: none;
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20;
  height: 64px; border-radius: 999px; background: rgba(255, 253, 251, 0.92);
  box-shadow: var(--shadow); align-items: center; justify-content: space-around;
  backdrop-filter: blur(10px);
}
.dock-item { border-radius: 999px; padding: 8px 14px; transition: transform 0.3s var(--ease), background 0.3s; }
#toast {
  position: fixed; top: 18px; left: 50%; transform: translate(-50%, -140%);
  background: var(--nav); color: white; border-radius: 999px; padding: 12px 18px;
  z-index: 50; transition: transform 0.4s var(--ease);
}
#toast.show { transform: translate(-50%, 0); }
#light {
  position: fixed; inset: 0; display: none; place-items: center; background: rgba(36,28,24,0.55); z-index: 60;
}
#light.show { display: grid; }
#light img { max-width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 48px); border-radius: 24px; animation: pop 0.35s var(--ease); }

@media (hover: hover) {
  .board-card:hover { transform: scale(1.035); }
  .board-card:hover .swatch { transform: scale(1.08) rotate(-4deg); }
  .thread:hover, .post:hover, .admin-row:hover, .search-hit:hover { transform: translateY(-3px) scale(1.012); }
  .shot:hover { transform: scale(1.02); }
  .avatar:hover { transform: scale(1.08); }
  .actions button:hover, .more:hover, .chip:hover, .tab:hover { transform: scale(1.05); }
}
.board-card:active, .thread:active, .pen:active { transform: scale(0.98); }

@media (min-width: 800px) {
  .board-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links, .nav-search, .pen { display: none; }
  .icon-btn, #dock { display: flex; }
  body { padding-bottom: 96px; }
  .hero h1, .board-head h1 { font-size: 28px; }
  .wrap { width: calc(100% - 28px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
