:root {
  color-scheme: light;
  --paper: #fafaf7;
  --paper-2: #f2efe8;
  --card: #fff;
  --ink: #1d1c19;
  --muted: #74716a;
  --soft: #9c988f;
  --line: #e2ded5;
  --clay: #a8512f;
  --clay-2: #cc785c;
  --green: #5d8d7b;
  --shadow: 0 14px 34px rgba(47, 42, 34, .08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191a18;
  --paper-2: #22231f;
  --card: #242520;
  --ink: #f1efe8;
  --muted: #b3afa5;
  --soft: #89867d;
  --line: #393a34;
  --clay: #d47c5d;
  --clay-2: #ec9a7a;
  --green: #80ad9b;
  --shadow: 0 15px 38px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #e7e4dc; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(65, 61, 53, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(65, 61, 53, .045) 1px, transparent 1px),
    #e7e4dc;
  background-size: 24px 24px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body.entry-pending { overflow: hidden; }

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.entry-screen {
  --entry-paper: #fbfaf6;
  --entry-ink: #191916;
  --entry-muted: #66645d;
  --entry-line: #ddd9d0;
  --entry-clay: #a8512f;
  --entry-green: #658f70;
  position: fixed;
  inset: 0;
  z-index: 300;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--entry-ink);
  background: var(--entry-paper);
  transition:
    opacity .52s cubic-bezier(.4, 0, .2, 1),
    visibility 0s linear;
}

.entry-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .6;
  background-image:
    linear-gradient(rgba(73, 69, 61, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 69, 61, .06) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 72%, transparent 100%);
}

.entry-stamp {
  position: absolute;
  top: 15%;
  right: -38px;
  width: 142px;
  height: 142px;
  display: grid;
  place-items: center;
  color: var(--entry-clay);
  border: 4px solid currentColor;
  border-radius: 50%;
  font: 900 39px/1 ui-monospace, monospace;
  opacity: .12;
  transform: rotate(10deg);
  animation: entry-stamp-float 6s ease-in-out infinite;
}

.entry-header {
  position: relative;
  z-index: 2;
  width: min(1160px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(77, 73, 65, .14);
}

.entry-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 19px/1 "Songti SC", "SimSun", serif;
}

.entry-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 8px 20px rgba(83, 51, 35, .16);
}

.entry-domain { color: #8d8980; font: 11px/1 ui-monospace, monospace; }

.entry-layout {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 40px));
  min-height: calc(100dvh - 76px);
  margin: 0 auto;
  padding: 62px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(350px, .75fr);
  align-items: center;
  gap: clamp(48px, 8vw, 118px);
}

.entry-copy { max-width: 630px; }

.entry-logo-stage {
  position: relative;
  width: 78px;
  height: 78px;
  margin-bottom: 31px;
}

.entry-logo-stage img {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 78px;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(92, 48, 29, .24);
  animation: entry-logo-float 4.8s ease-in-out 1.2s infinite;
}

.entry-orbit {
  position: absolute;
  inset: -11px;
  border: 1px solid rgba(168, 81, 47, .3);
  border-radius: 25px;
  transform: rotate(11deg);
  animation: entry-orbit 9s linear infinite;
}

.entry-orbit-b {
  inset: -22px 4px 4px -22px;
  border-color: rgba(93, 141, 123, .25);
  transform: rotate(-8deg);
  animation-direction: reverse;
  animation-duration: 12s;
}

.entry-badge {
  width: fit-content;
  margin: 0 0 25px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--entry-muted);
  background: rgba(255, 255, 255, .62);
  border: 1px solid var(--entry-line);
  border-radius: 999px;
  font-size: 13px;
}

.entry-badge > span {
  width: 8px;
  height: 8px;
  background: var(--entry-green);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(101, 143, 112, .12);
}

.entry-copy h1 {
  margin: 0;
  font: 900 86px/.96 "Songti SC", "STSong", "SimSun", serif;
  letter-spacing: 0;
}

.entry-slogan {
  margin: 29px 0 0;
  color: #57564f;
  font: 800 27px/1.45 "Songti SC", "STSong", "SimSun", serif;
}

.entry-slogan::first-letter { color: var(--entry-clay); }

.entry-description {
  max-width: 570px;
  margin: 19px 0 0;
  color: var(--entry-muted);
  font-size: 15px;
  line-height: 1.95;
}

.entry-button {
  min-width: 178px;
  min-height: 54px;
  margin-top: 34px;
  padding: 0 18px 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: #fff;
  background: var(--entry-ink);
  border: 1px solid var(--entry-ink);
  border-radius: 6px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 13px 28px rgba(25, 25, 22, .15);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.entry-button:hover {
  background: var(--entry-clay);
  border-color: var(--entry-clay);
  transform: translateY(-2px);
}

.entry-button:focus-visible { outline: 3px solid rgba(168, 81, 47, .28); outline-offset: 4px; }
.entry-button svg { width: 20px; height: 20px; stroke-width: 2; transition: transform .2s ease; }
.entry-button:hover svg { transform: translateX(3px); }

.entry-preview {
  position: relative;
  padding: 21px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--entry-line);
  border-radius: 8px;
  box-shadow: 0 28px 75px rgba(45, 41, 34, .13);
  transform: rotate(1.5deg);
}

.entry-preview::before {
  content: "";
  position: absolute;
  inset: 9px -10px -10px 9px;
  z-index: -1;
  border: 1px solid rgba(168, 81, 47, .2);
  border-radius: 8px;
}

.entry-preview-head {
  padding: 2px 2px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: 800 14px/1.2 "Songti SC", "SimSun", serif;
}

.entry-live { color: var(--entry-green); font: 600 10px/1.2 system-ui, sans-serif; white-space: nowrap; }
.entry-live i { width: 6px; height: 6px; margin-right: 6px; display: inline-block; background: currentColor; border-radius: 50%; animation: entry-live 1.6s ease-in-out infinite; }

.entry-preview-post {
  padding: 19px;
  background: #fff;
  border: 1px solid #e6e2da;
  border-radius: 6px;
}

.entry-preview-meta { display: flex; align-items: center; gap: 9px; color: var(--entry-muted); font-size: 11px; }
.entry-preview-meta small { margin-left: auto; color: #969289; }
.entry-avatar { width: 29px; height: 29px; display: grid; place-items: center; color: #fff; background: var(--entry-clay); border-radius: 50%; font: 800 13px/1 "Songti SC", serif; }
.entry-preview-post h2 { margin: 18px 0 8px; font: 800 18px/1.5 "Songti SC", "SimSun", serif; }
.entry-preview-post p { margin: 0; color: var(--entry-muted); font-size: 12px; line-height: 1.75; }

.entry-topics {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.entry-topics span {
  min-width: 0;
  padding: 11px 8px;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--entry-muted);
  background: #f1eee7;
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
}

.entry-topics b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #557ca8;
  border-radius: 5px;
  font: 800 12px/1 "Songti SC", serif;
}

.entry-topics span:nth-child(2) b { background: var(--entry-clay); }
.entry-topics span:nth-child(3) b { background: var(--entry-green); }

.entry-piece {
  opacity: 0;
  animation: entry-piece-in .72s cubic-bezier(.16, 1, .3, 1) var(--entry-delay, 0ms) both;
}

.entry-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .52s cubic-bezier(.4, 0, .2, 1),
    visibility .52s step-end;
}

.entry-screen.is-leaving .entry-layout {
  transform: translateY(-18px);
  transition: transform .52s cubic-bezier(.4, 0, .2, 1);
}

.app-shell.community-reveal {
  animation: community-reveal .65s cubic-bezier(.16, 1, .3, 1) both;
}

.app-shell {
  position: relative;
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 70px rgba(48, 43, 35, .17);
  transition: background .2s ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 66px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  backdrop-filter: blur(18px) saturate(1.25);
}

.topbar-leading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.back-button {
  flex: 0 0 auto;
}

.brand-button {
  min-width: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.brand-button img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 7px 17px rgba(89, 45, 27, .18); }
.brand-button span { min-width: 0; display: grid; gap: 1px; }
.brand-button strong { font-family: "Songti SC", "SimSun", serif; font-size: 18px; line-height: 1.2; }
.brand-button small { max-width: 220px; overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }

.topbar-actions { display: flex; align-items: center; gap: 5px; }

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.icon-button:hover { background: var(--paper-2); }
.icon-button svg { width: 20px; height: 20px; }

#mainView {
  min-height: calc(100vh - 66px);
  padding-bottom: calc(100px + var(--safe-bottom));
}

.page-loading {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.loading-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--clay);
  border-radius: 15px;
  font: 800 15px/1 ui-monospace, monospace;
  animation: breathe 1.3s ease-in-out infinite alternate;
}

@keyframes breathe { to { transform: translateY(-4px); box-shadow: 0 12px 25px rgba(168, 81, 47, .28); } }

.home-page { padding-bottom: 10px; }

.hero-wrap { padding: 14px 14px 0; }

.hero {
  position: relative;
  min-height: 174px;
  padding: 24px 23px 21px;
  overflow: hidden;
  color: #fff;
  background: #9f4b2c;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero[data-tone="green"] { background: #477866; }
.hero[data-tone="blue"] { background: #476c94; }

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .25;
  background-image:
    linear-gradient(115deg, transparent 0 46%, rgba(255,255,255,.2) 46% 47%, transparent 47%),
    linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
}

.hero::after {
  content: "DQ";
  position: absolute;
  right: -8px;
  bottom: -28px;
  color: rgba(255,255,255,.12);
  font: 900 104px/1 ui-monospace, monospace;
}

.hero-copy { position: relative; z-index: 1; max-width: 355px; }
.hero-eyebrow { margin: 0 0 9px; font: 700 9px/1 ui-monospace, monospace; letter-spacing: .1em; opacity: .8; }
.hero h1 { margin: 0; font: 800 25px/1.38 "Songti SC", "SimSun", serif; letter-spacing: 0; }
.hero p { margin: 8px 0 0; color: rgba(255,255,255,.82); font-size: 12px; line-height: 1.7; }

.hero-action {
  position: relative;
  z-index: 1;
  min-height: 32px;
  margin-top: 17px;
  padding: 0 12px;
  color: #fff;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.hero-dots { display: flex; justify-content: center; gap: 5px; margin: 10px 0 0; }
.hero-dots span { width: 5px; height: 5px; background: var(--line); border-radius: 50%; }
.hero-dots span.active { width: 17px; background: var(--clay); border-radius: 3px; }

.notice-strip {
  width: calc(100% - 28px);
  min-width: 0;
  min-height: 43px;
  margin: 12px 14px 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.notice-label { flex: 0 0 auto; color: var(--clay); font: 800 11px/1 "Songti SC", serif; }
.notice-strip p { min-width: 0; margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.notice-strip svg { flex: 0 0 auto; width: 14px; margin-left: auto; color: var(--soft); }

.section { padding: 21px 14px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 13px; }
.section-head h2 { margin: 0; font: 800 18px/1.2 "Songti SC", "SimSun", serif; }
.section-head button, .text-button { padding: 0; color: var(--muted); background: none; border: 0; font-size: 11px; cursor: pointer; }

.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px 7px; }

.category-item {
  min-width: 0;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  background: none;
  border: 0;
  cursor: pointer;
}

.category-icon {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 11%, var(--card));
  border: 1px solid color-mix(in srgb, var(--category-color) 22%, var(--line));
  border-radius: 8px;
}

.category-icon svg { width: 22px; height: 22px; stroke-width: 1.7; }
.category-item span:last-child { max-width: 100%; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }

.feed-section { padding-top: 25px; }

.feed-head {
  position: sticky;
  top: 66px;
  z-index: 15;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--paper) 91%, transparent);
  border-top: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.feed-head h2 { margin: 0; font: 800 18px/1.2 "Songti SC", "SimSun", serif; }

.segment {
  padding: 3px;
  display: flex;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.segment button {
  min-width: 46px;
  height: 27px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
}

.segment button.active { color: var(--ink); background: var(--card); box-shadow: 0 2px 7px rgba(50,45,38,.08); font-weight: 700; }

.feed-list { padding: 0 14px; }

.post-card {
  position: relative;
  padding: 18px 2px 15px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.post-card:hover .post-title { color: var(--clay); }

.post-meta { display: flex; align-items: center; min-width: 0; color: var(--muted); font-size: 10px; }
.avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  font: 700 12px/1 "Songti SC", serif;
}
.post-author { max-width: 150px; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.verified { color: #4f83ae; }
.post-time { margin-left: auto; }

.category-chip {
  margin-left: 7px;
  padding: 3px 6px;
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--category-color) 18%, transparent);
  border-radius: 4px;
  font-size: 9px;
}

.post-title {
  margin: 13px 0 6px;
  font: 800 16px/1.48 "Songti SC", "SimSun", serif;
  transition: color .15s ease;
}

.post-content {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.72;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.post-price { margin: 10px 0 0; color: var(--clay); font: 800 18px/1 ui-monospace, monospace; }

.post-images { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.post-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; background: var(--paper-2); }
.post-images.one { grid-template-columns: minmax(0, 68%); }
.post-images.one img { aspect-ratio: 4 / 3; }
.post-images.two { grid-template-columns: repeat(2, 1fr); }

.post-actions {
  margin-top: 13px;
  display: flex;
  align-items: center;
  gap: 19px;
  color: var(--muted);
  font-size: 10px;
}

.post-actions span { display: inline-flex; align-items: center; gap: 5px; }
.post-actions svg { width: 15px; height: 15px; }
.post-actions .active { color: var(--clay); }
.post-actions .views { margin-left: auto; }

.load-more {
  width: 100%;
  height: 42px;
  margin: 13px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 11px;
  cursor: pointer;
}

.empty-state {
  min-height: 260px;
  padding: 40px 24px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg { width: 42px; height: 42px; color: var(--soft); }
.empty-state strong { color: var(--ink); font: 800 16px/1.3 "Songti SC", serif; }
.empty-state p { margin: 0; font-size: 11px; line-height: 1.7; }

.page-header { padding: 25px 17px 15px; border-bottom: 1px solid var(--line); }
.page-header .eyebrow { margin: 0 0 7px; color: var(--clay); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .1em; }
.page-header h1 { margin: 0; font: 800 26px/1.2 "Songti SC", serif; }
.page-header p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

.category-page .category-grid { padding: 20px 14px; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.category-page .category-item { min-height: 88px; padding: 14px; grid-template-columns: 50px minmax(0, 1fr); align-items: center; justify-items: start; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.category-page .category-item span:last-child { font: 700 14px/1.2 "Songti SC", serif; }

.notice-list { padding: 10px 14px; }
.notice-card { padding: 18px 2px; border-bottom: 1px solid var(--line); }
.notice-card time { color: var(--soft); font-size: 9px; }
.notice-card h2 { margin: 7px 0 8px; font: 800 16px/1.4 "Songti SC", serif; }
.notice-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; white-space: pre-wrap; }

.profile-head { padding: 28px 17px 22px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.profile-head .avatar { width: 54px; height: 54px; margin: 0; font-size: 20px; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy h1 { margin: 0; font: 800 20px/1.3 "Songti SC", serif; }
.profile-copy p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.profile-edit { min-height: 31px; padding: 0 10px; background: var(--card); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; cursor: pointer; }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 14px; border-bottom: 1px solid var(--line); }
.profile-stats button { padding: 5px; display: grid; gap: 4px; background: none; border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.profile-stats button:last-child { border-right: 0; }
.profile-stats strong { font: 800 19px/1 ui-monospace, monospace; }
.profile-stats span { color: var(--muted); font-size: 10px; }

.menu-list { padding: 9px 14px 0; }
.menu-item { width: 100%; min-height: 51px; padding: 0 2px; display: flex; align-items: center; gap: 12px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.menu-item > svg { width: 19px; color: var(--muted); }
.menu-item span { min-width: 0; flex: 1; font-size: 12px; }
.menu-item small { color: var(--muted); font-size: 9px; }
.menu-item .chevron { width: 14px; color: var(--soft); }
.menu-item.danger { color: #b64d4d; }

.login-callout { min-height: 65vh; padding: 55px 24px; display: grid; place-content: center; justify-items: center; text-align: center; }
.login-callout img { width: 66px; height: 66px; border-radius: 16px; box-shadow: var(--shadow); }
.login-callout h1 { margin: 20px 0 8px; font: 800 25px/1.3 "Songti SC", serif; }
.login-callout p { max-width: 290px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.primary-button, .secondary-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.primary-button { color: #fff; background: var(--ink); border: 1px solid var(--ink); }
.primary-button:hover { background: var(--clay); border-color: var(--clay); }
.secondary-button { color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.login-callout .primary-button { margin-top: 23px; }

.publish-fab {
  position: fixed;
  left: 50%;
  bottom: calc(21px + var(--safe-bottom));
  z-index: 45;
  width: 54px;
  height: 54px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--clay);
  border: 5px solid color-mix(in srgb, var(--paper) 88%, transparent);
  border-radius: 50%;
  box-shadow: 0 12px 25px rgba(126, 57, 31, .34);
  transform: translateX(-50%);
  cursor: pointer;
}
.publish-fab:hover { background: var(--clay-2); }
.publish-fab svg { width: 22px; height: 22px; stroke-width: 2.2; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(100%, 540px);
  min-height: calc(67px + var(--safe-bottom));
  padding: 7px 10px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  backdrop-filter: blur(19px) saturate(1.25);
  transform: translateX(-50%);
}

.bottom-nav button {
  min-width: 0;
  height: 50px;
  padding: 2px 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 3px;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.bottom-nav svg { width: 20px; height: 20px; }
.bottom-nav span { font-size: 9px; }
.bottom-nav button.active { color: var(--clay); }

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(21, 20, 18, .44);
  backdrop-filter: blur(3px);
  animation: fade-in .18s ease;
}

.modal {
  width: min(100%, 540px);
  max-height: min(92vh, 860px);
  overflow: auto;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -25px 60px rgba(0,0,0,.18);
  animation: sheet-up .23s cubic-bezier(.16, 1, .3, 1);
}

.modal.compact { width: min(calc(100% - 24px), 450px); margin-bottom: 16px; border-radius: 8px; }
.modal-head { position: sticky; top: 0; z-index: 2; min-height: 58px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--paper) 91%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.modal-head h2 { margin: 0; font: 800 17px/1.2 "Songti SC", serif; }
.modal-head .icon-button { width: 36px; height: 36px; }

.modal-body { padding: 18px 16px calc(24px + var(--safe-bottom)); }

.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field label { font-size: 11px; font-weight: 700; }
.field small { color: var(--muted); font-size: 9px; line-height: 1.6; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 43px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
}
.field textarea { min-height: 122px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--clay); box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 11%, transparent); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.form-actions .primary-button { min-width: 110px; }

.switch-line { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-line span { font-size: 11px; }
.switch { position: relative; width: 40px; height: 23px; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 15px; transition: .2s ease; }
.switch i::after { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: .2s ease; }
.switch input:checked + i { background: var(--clay); }
.switch input:checked + i::after { transform: translateX(17px); }

.upload-zone { padding: 15px; text-align: center; background: var(--paper-2); border: 1px dashed var(--line); border-radius: 6px; }
.upload-zone input { display: none; }
.upload-zone label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-size: 11px; }
.upload-zone svg { width: 18px; }
.image-previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.image-previews span { position: relative; }
.image-previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.image-previews button { position: absolute; top: 3px; right: 3px; width: 21px; height: 21px; padding: 0; color: #fff; background: rgba(0,0,0,.58); border: 0; border-radius: 50%; cursor: pointer; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.auth-tabs button { height: 40px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.auth-tabs button.active { color: var(--clay); border-bottom-color: var(--clay); font-weight: 700; }
.auth-note { color: var(--muted); font-size: 9px; line-height: 1.7; }

.detail-article { padding: 4px 0 16px; }
.detail-article .post-title { margin-top: 18px; font-size: 22px; }
.detail-article .post-content { display: block; overflow: visible; font-size: 13px; line-height: 1.9; white-space: pre-wrap; }
.detail-images { display: grid; gap: 8px; margin-top: 17px; }
.detail-images img { width: 100%; max-height: 500px; object-fit: cover; border-radius: 6px; }
.contact-box { margin-top: 16px; padding: 12px; background: var(--paper-2); border-left: 3px solid var(--clay); border-radius: 4px; color: var(--muted); font-size: 11px; }
.detail-toolbar { display: flex; gap: 8px; margin: 17px 0 5px; }
.detail-toolbar button { flex: 1; min-height: 37px; display: inline-flex; justify-content: center; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; cursor: pointer; }
.detail-toolbar svg { width: 16px; }
.detail-toolbar .active { color: var(--clay); border-color: color-mix(in srgb, var(--clay) 45%, var(--line)); }

.comments { margin-top: 23px; border-top: 1px solid var(--line); }
.comments h3 { margin: 18px 0 4px; font: 800 15px/1.3 "Songti SC", serif; }
.comment { padding: 14px 0; display: grid; grid-template-columns: 30px minmax(0,1fr); column-gap: 9px; border-bottom: 1px solid var(--line); }
.comment .avatar { width: 30px; height: 30px; margin: 0; }
.comment-head { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.comment-head strong { color: var(--ink); font-size: 10px; }
.comment-head time { margin-left: auto; }
.comment p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.comment-form { margin-top: 15px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.comment-form input { min-width: 0; height: 39px; padding: 0 10px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 5px; outline: none; }
.comment-form button { min-width: 65px; color: #fff; background: var(--ink); border: 0; border-radius: 5px; cursor: pointer; }

.search-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.search-bar input { min-width: 0; height: 42px; padding: 0 12px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 5px; outline: none; }
.search-bar button { min-width: 70px; color: #fff; background: var(--ink); border: 0; border-radius: 5px; cursor: pointer; }
.search-results { margin-top: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-bottom));
  z-index: 200;
  max-width: min(80vw, 370px);
  padding: 10px 14px;
  color: #fff;
  background: rgba(26, 25, 22, .9);
  border-radius: 5px;
  box-shadow: 0 9px 25px rgba(0,0,0,.18);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { opacity: .5; transform: translateY(40px); } }
@keyframes entry-piece-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes entry-logo-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-7px) rotate(1.5deg); }
}
@keyframes entry-orbit { to { transform: rotate(371deg); } }
@keyframes entry-stamp-float {
  0%, 100% { transform: translateY(0) rotate(10deg); }
  50% { transform: translateY(12px) rotate(14deg); }
}
@keyframes entry-live {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes community-reveal {
  from { opacity: .35; transform: scale(.975); }
  to { opacity: 1; transform: scale(1); }
}

@media (min-width: 700px) {
  .modal-layer { align-items: center; }
  .modal { border-radius: 8px; max-height: 88vh; }
  .modal.compact { margin: 0; }
}

@media (max-width: 820px) {
  .entry-header { width: calc(100% - 30px); height: 66px; }
  .entry-layout {
    width: min(520px, calc(100% - 30px));
    min-height: auto;
    padding: 42px 0 64px;
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .entry-logo-stage { width: 66px; height: 66px; margin-bottom: 27px; }
  .entry-logo-stage img { width: 66px; height: 66px; border-radius: 16px; }
  .entry-copy h1 { font-size: 66px; }
  .entry-slogan { margin-top: 24px; font-size: 23px; }
  .entry-preview { transform: none; }
  .entry-stamp { top: 130px; width: 112px; height: 112px; font-size: 31px; }
}

@media (max-width: 420px) {
  .topbar { padding-inline: 9px; }
  .topbar-leading { gap: 2px; }
  .brand-button { gap: 7px; }
  .brand-button small { max-width: 112px; }
  .entry-header { height: 61px; }
  .entry-brand { font-size: 17px; }
  .entry-domain { font-size: 9px; }
  .entry-layout { padding-top: 30px; gap: 42px; }
  .entry-logo-stage { margin-bottom: 24px; }
  .entry-badge { max-width: 100%; margin-bottom: 22px; padding: 9px 11px; font-size: 11px; }
  .entry-copy h1 { font-size: 57px; }
  .entry-slogan { font-size: 21px; }
  .entry-description { font-size: 13px; line-height: 1.85; }
  .entry-button { min-height: 52px; margin-top: 29px; }
  .entry-preview { padding: 16px; }
  .entry-preview-post { padding: 16px; }
  .entry-preview-post h2 { font-size: 16px; }
}

@media (max-width: 360px) {
  .brand-button small { max-width: 82px; }
  .category-grid { gap-inline: 2px; }
  .category-icon { width: 43px; height: 43px; }
  .hero { min-height: 180px; padding-inline: 18px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
