:root {
  --bg: #0e1119;
  --bg-raised: rgba(25, 30, 45, .78);
  --card: rgba(27, 33, 49, .84);
  --card-strong: rgba(31, 37, 55, .96);
  --text: #f4f5f9;
  --muted: #a9afc0;
  --quiet: #717a90;
  --line: rgba(255,255,255,.09);
  --accent: #a58bff;
  --accent-soft: rgba(165,139,255,.17);
  --green: #72d7ba;
  --danger: #ef8e9d;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0,0,0,.26);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
body { min-height: 100dvh; overflow-x: hidden; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.ambient { position: fixed; pointer-events: none; border-radius: 999px; filter: blur(68px); opacity: .42; z-index: 0; }
.ambient-a { width: 320px; height: 320px; top: -140px; right: -100px; background: #4a3a83; }
.ambient-b { width: 280px; height: 280px; bottom: 10%; left: -160px; background: #1f6e73; opacity: .25; }
.community-head, .page-shell, .bottom-nav { position: relative; z-index: 1; }
.community-head { display: grid; grid-template-columns: 48px 1fr 70px; align-items: start; gap: 12px; padding: calc(20px + env(safe-area-inset-top)) 18px 8px; max-width: 760px; margin: 0 auto; }
.back-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; color: var(--text); background: rgba(35,40,57,.76); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.back-button svg, .icon-button svg, .head-publish svg, .nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.head-title { min-width: 0; }
.kicker { color: #bbb0ff; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.head-title h1 { margin: 3px 0 1px; font-size: 28px; line-height: 1.15; letter-spacing: -.03em; }
.head-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-publish { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 42px; padding: 0 9px; border: 0; border-radius: 14px; color: #161321; background: linear-gradient(135deg,#bca8ff,#8d76f1); font-weight: 700; font-size: 13px; box-shadow: 0 10px 24px rgba(131,102,243,.26); }
.head-publish svg { width: 17px; height: 17px; stroke-width: 2; }
.page-shell { width: min(100% - 28px, 720px); margin: 0 auto; }
.status-strip { display: flex; align-items: center; gap: 26px; padding: 18px 4px 20px; color: var(--muted); }
.status-strip div { display: grid; gap: 1px; }
.status-strip strong { font-size: 20px; color: var(--text); letter-spacing: -.02em; }
.status-strip span { font-size: 11px; }
.status-strip .status-note { display: flex; align-items: center; gap: 7px; margin-left: auto; font-size: 11px; color: var(--green); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(114,215,186,.1); }
.feed-panel { min-height: 300px; }
.feed-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 12px; }
.feed-head h2 { margin: 3px 0 0; font-size: 18px; line-height: 1.3; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: rgba(31,37,53,.65); }
.icon-button:disabled { opacity: .5; cursor: wait; }
.feed { display: grid; gap: 12px; }
.state-card, .post-card, .empty-card { border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.post-card { padding: 16px; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.post-card:active { transform: scale(.985); }
.post-card.is-pinned { border-color: rgba(165,139,255,.44); background: linear-gradient(140deg, rgba(61,48,90,.78), var(--card)); }
.post-top { display: flex; align-items: center; gap: 9px; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 12px; display: grid; place-items: center; color: #dad3ff; background: linear-gradient(145deg,#544a7e,#292d42); overflow: hidden; font-weight: 700; font-size: 13px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-meta { min-width: 0; display: grid; gap: 2px; }
.author-line { display: flex; gap: 6px; align-items: center; min-width: 0; }
.author-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: #d2c9ff; font-size: 9px; white-space: nowrap; }
.post-time { color: var(--quiet); font-size: 10px; }
.type-chip { margin-left: auto; flex: 0 0 auto; color: var(--muted); font-size: 10px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.06); }
.pin-chip { color: #dbcfff; background: rgba(165,139,255,.2); }
.post-card h3 { margin: 13px 0 7px; font-size: 16px; line-height: 1.45; letter-spacing: -.01em; }
.post-body { margin: 0; color: #c8ccda; font-size: 13px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-cover { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; margin: 12px 0 0; }
.character-share { display: grid; grid-template-columns: 68px 1fr; gap: 12px; margin-top: 13px; padding: 10px; border-radius: 15px; background: rgba(255,255,255,.055); }
.character-share img { width: 68px; height: 82px; border-radius: 11px; object-fit: cover; background: #25293a; }
.character-share strong { display: block; margin-top: 3px; font-size: 13px; }
.character-share span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.post-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.action-button { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 11px; }
.action-button:hover, .action-button:focus-visible { background: rgba(255,255,255,.08); outline: none; }
.action-button.active { color: #ddcfff; background: var(--accent-soft); }
.action-spacer { margin-left: auto; color: var(--quiet); font-size: 10px; }
.empty-card { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-card strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 15px; }
.loading-card { padding: 20px; }
.shimmer { border-radius: 8px; background: linear-gradient(100deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.14) 37%, rgba(255,255,255,.06) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.shimmer-line { width: 38%; height: 12px; margin-bottom: 12px; }
.shimmer-line.short { width: 22%; height: 9px; }
.shimmer-block { width: 100%; height: 72px; margin-top: 18px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 760px); display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(15,18,29,.86); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.nav-item { display: grid; justify-items: center; gap: 3px; min-height: 46px; padding: 5px 4px; border: 0; border-radius: 13px; color: var(--quiet); background: transparent; font-size: 10px; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item.active { color: #ded6ff; background: rgba(165,139,255,.16); }
.dialog { width: 100%; max-width: 560px; padding: 0; border: 0; background: transparent; color: var(--text); }
.dialog::backdrop { background: rgba(4,5,10,.72); backdrop-filter: blur(8px); }
.dialog-card { max-height: min(84dvh, 760px); overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 24px; background: var(--card-strong); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 19px; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 6px 0; }
.detail-text { color: #d4d7e1; font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.comments { display: grid; gap: 9px; margin-top: 20px; }
.comments h3 { margin: 0 0 2px; font-size: 13px; }
.comment { display: grid; grid-template-columns: 30px 1fr; gap: 9px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.045); }
.comment .avatar { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
.comment-head { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.comment-head small { margin-left: auto; color: var(--quiet); font-size: 9px; }
.comment-body { margin: 5px 0 0; color: #c9ccda; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: 4px; margin-top: 4px; }
.comment-actions button { border: 0; background: transparent; color: var(--quiet); font-size: 10px; padding: 2px 0; }
.comment-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }
.comment-form textarea { width: 100%; min-height: 44px; max-height: 140px; resize: vertical; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(11,14,22,.66); outline: none; font-size: 12px; line-height: 1.5; }
.comment-form textarea:focus { border-color: rgba(165,139,255,.72); box-shadow: 0 0 0 3px rgba(165,139,255,.14); }
.comment-form .primary-button { min-height: 44px; padding: 0 13px; }
.form-card { display: grid; gap: 12px; }
.form-card .dialog-head { grid-column: 1 / -1; }
.form-card label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.form-card input, .form-card textarea, .form-card select { width: 100%; color: var(--text); background: rgba(11,14,22,.66); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; outline: none; }
.form-card textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.form-card input:focus, .form-card textarea:focus, .form-card select:focus { border-color: rgba(165,139,255,.72); box-shadow: 0 0 0 3px rgba(165,139,255,.14); }
.helper { margin: 0; color: var(--quiet); font-size: 10px; line-height: 1.55; }
.primary-button { min-height: 44px; border: 0; border-radius: 13px; color: #171321; background: linear-gradient(135deg,#bca8ff,#8d76f1); font-size: 13px; font-weight: 700; }
.form-message { min-height: 16px; margin: 0; color: var(--danger); font-size: 11px; }
.toast { position: fixed; z-index: 4; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px); max-width: calc(100% - 36px); padding: 10px 14px; border-radius: 12px; color: var(--text); background: rgba(37,43,62,.96); box-shadow: 0 12px 30px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; font-size: 12px; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 680px) {
  .community-head { padding-top: 32px; }
  .head-title h1 { font-size: 32px; }
  .post-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
