/* ==========================================================================
   Island's forum · 离岛的论坛
   A monochrome, editorial community theme with an app-like mobile shell.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  --bg: #f2f2f2;
  --bg-glow: rgba(0, 0, 0, 0.035);
  --surface: #ffffff;
  --surface-2: #ececec;
  --surface-3: #e1e1e1;
  --ink: #101010;
  --ink-soft: #2c2c2c;
  --muted: #626262;
  --faint: #8b8b8b;
  --line: #d8d8d8;
  --line-strong: #bcbcbc;
  --accent: #444444;
  --accent-strong: #000000;
  --accent-soft: #eeeeee;
  --green: #111111;
  --green-strong: #111111;
  --green-deep: #0a0a0a;
  --green-soft: #f0f0f0;
  --green-line: #d7d7d7;
  --primary-bg: #111111;
  --primary-ink: #ffffff;
  --primary-hover: #2c2c2c;
  --on-accent: #ffffff;
  --cream: #ffffff;
  --danger: #222222;
  --danger-soft: #f2f2f2;
  --gold: #545454;
  --gold-soft: #efefef;
  --topbar: rgba(250, 250, 250, 0.88);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 14px 34px -18px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 28px 70px -26px rgba(0, 0, 0, 0.25);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --topbar-height: 70px;
  --safe-top: env(safe-area-inset-top, 0px);
  --topbar-total: calc(var(--topbar-height) + var(--safe-top));
  --mobile-nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="dark"] {
  --bg: #0b0b0b;
  --bg-glow: rgba(255, 255, 255, 0.035);
  --surface: #141414;
  --surface-2: #1d1d1d;
  --surface-3: #292929;
  --ink: #f4f4f4;
  --ink-soft: #d2d2d2;
  --muted: #a0a0a0;
  --faint: #777777;
  --line: #2b2b2b;
  --line-strong: #464646;
  --accent: #cfcfcf;
  --accent-strong: #ffffff;
  --accent-soft: #242424;
  --green: #f4f4f4;
  --green-strong: #f4f4f4;
  --green-deep: #050505;
  --green-soft: #1d1d1d;
  --green-line: #333333;
  --primary-bg: #f4f4f4;
  --primary-ink: #0b0b0b;
  --primary-hover: #ffffff;
  --on-accent: #0b0b0b;
  --cream: #f4f4f4;
  --danger: #ffffff;
  --danger-soft: #242424;
  --gold: #c8c8c8;
  --gold-soft: #242424;
  --topbar: rgba(11, 11, 11, 0.88);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 16px 36px -20px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 32px 80px -30px rgba(0, 0, 0, 0.95);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 88% -8%, var(--bg-glow), transparent 62%),
    radial-gradient(760px 560px at -10% 24%, var(--bg-glow), transparent 64%),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  color: var(--bg);
  background: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: var(--cream);
  background: var(--green-deep);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  z-index: 60;
  top: 0;
  height: var(--topbar-total);
  padding-top: var(--safe-top);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  background: var(--topbar);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1240px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  border-radius: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 13px 13px 13px 4px;
  box-shadow: 0 5px 14px -8px rgba(0, 0, 0, 0.55);
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-short {
  display: none;
}

.brand-text small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.desktop-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  color: var(--muted);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.18s ease, background 0.18s ease;
}

.desktop-nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.desktop-nav a.is-active {
  color: var(--green);
  background: var(--green-soft);
}

.nav-badge,
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.nav-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  box-shadow: 0 0 0 2px var(--bg);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(290px, 26vw);
  height: 40px;
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--faint);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.header-search:focus-within {
  background: var(--surface);
  border-color: var(--green-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 10%, transparent);
}

.header-search .icon {
  width: 17px;
  height: 17px;
}

.header-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.header-search input::placeholder {
  color: var(--faint);
}

.header-search kbd {
  padding: 1px 5px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 10px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.auth-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-link {
  padding: 8px 13px;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.18s ease, background 0.18s ease;
}

.login-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.join-button {
  padding: 8px 16px;
  color: var(--primary-ink);
  border: 0;
  background: var(--primary-bg);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, transform 0.18s ease;
}

.join-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.user-menu-wrap {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.user-trigger:hover {
  background: var(--surface-2);
}

.user-trigger .icon {
  width: 14px;
  height: 14px;
  color: var(--faint);
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 226px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.user-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.user-menu-head {
  padding: 10px 11px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.user-menu-head strong {
  display: block;
  font-size: 14px;
}

.user-menu-head span {
  color: var(--muted);
  font-size: 12px;
}

.admin-mark {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 1px 5px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}

.user-menu a,
.user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 13.5px;
  text-align: left;
}

.user-menu a:hover,
.user-menu button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.user-menu .icon {
  width: 17px;
  height: 17px;
  color: var(--faint);
}

.user-menu .menu-count {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.user-menu .menu-separator {
  height: 1px;
  margin: 6px 8px;
  background: var(--line);
}

.user-menu button.danger {
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   Reusable elements
   -------------------------------------------------------------------------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(140deg, var(--av-from, #1a1a1a), var(--av-from, #1a1a1a) 58%, var(--av-to, #e6e6e6));
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.avatar-xs {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.avatar-lg {
  width: 50px;
  height: 50px;
  font-size: 20px;
}

.avatar-xl {
  width: 94px;
  height: 94px;
  font-size: 38px;
  border: 4px solid var(--surface);
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn-primary {
  color: var(--primary-ink);
  background: var(--primary-bg);
  box-shadow: 0 5px 14px -8px rgba(0, 0, 0, 0.55);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-accent {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 5px 14px -8px rgba(0, 0, 0, 0.45);
}

.btn-accent:hover {
  background: var(--accent-strong);
}

.btn-soft {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green-line);
}

.btn-soft:hover {
  background: color-mix(in srgb, var(--green-soft) 65%, var(--surface-3));
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.btn-danger {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.btn-danger:hover {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--ink);
}

.modal .btn-danger {
  color: var(--primary-ink);
  background: var(--primary-bg);
  border-color: transparent;
}

.modal .btn-danger:hover {
  background: var(--primary-hover);
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-lg {
  min-height: 47px;
  padding: 0 22px;
  font-size: 14.5px;
  border-radius: 13px;
}

.btn-block {
  width: 100%;
}

.text-button {
  padding: 0;
  color: var(--accent);
  border: 0;
  background: transparent;
  font-size: inherit;
  font-weight: 600;
}

.text-button:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

.chip .icon {
  width: 13px;
  height: 13px;
}

.chip-green {
  color: var(--green);
  border-color: var(--green-line);
  background: var(--green-soft);
}

.chip-accent {
  color: var(--accent-strong);
  border-color: transparent;
  background: var(--accent-soft);
}

.chip-gold {
  color: var(--gold);
  border-color: transparent;
  background: var(--gold-soft);
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.dot-separator::before {
  content: "·";
  margin: 0 5px;
  color: var(--faint);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* --------------------------------------------------------------------------
   Feed shell
   -------------------------------------------------------------------------- */

#main {
  width: min(1240px, 100%);
  min-height: calc(100vh - var(--topbar-total));
  margin: 0 auto;
  padding: 28px 28px 64px;
}

.boot-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: calc(100vh - var(--topbar-total) - 110px);
  min-height: calc(100dvh - var(--topbar-total) - 110px);
  padding: 32px 20px;
  color: var(--faint);
}

.boot-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.boot-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: none;
}

.boot-emblem::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: boot-orbit 2.8s linear infinite;
}

.boot-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.boot-brand-text strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: 0.01em;
}

.boot-brand-text small {
  margin-top: 4px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.2em;
}

.loading-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 13px 13px 13px 4px;
  font-family: var(--font-serif);
  font-size: 21px;
  animation: soft-pulse 1.8s ease-in-out infinite;
}

.boot-progress {
  position: relative;
  width: 136px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.boot-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  animation: boot-progress 1.3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.boot-note {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.feed-layout {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr) 284px;
  gap: 24px;
  align-items: start;
}

.left-rail,
.right-rail {
  position: sticky;
  top: calc(var(--topbar-total) + 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.rail-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rail-card-title span {
  color: var(--faint);
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.category-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--ink-soft);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}

.category-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.category-link.is-active {
  color: var(--green);
  background: var(--green-soft);
  font-weight: 600;
}

.category-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.category-icon .icon {
  width: 15px;
  height: 15px;
}

.category-link.is-active .category-icon {
  color: var(--green);
  border-color: var(--green-line);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}

.category-link .count {
  margin-left: auto;
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.compose-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rail-hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.rail-note {
  position: relative;
  overflow: hidden;
  padding: 20px;
  color: var(--cream);
  border-radius: var(--radius);
  background:
    radial-gradient(130px 110px at 100% 0, rgba(255, 255, 255, 0.13), transparent 70%),
    linear-gradient(145deg, #1d1d1d, #050505);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.rail-note::after {
  content: "";
  position: absolute;
  right: -19px;
  bottom: -27px;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.rail-note .icon {
  width: 20px;
  height: 20px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.72);
}

.rail-note p {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.8;
}

.rail-note small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.feed-column {
  min-width: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 214px;
  padding: 34px 36px;
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(280px 220px at 92% 8%, rgba(255, 255, 255, 0.12), transparent 70%),
    linear-gradient(125deg, #080808 0%, #171717 62%, #262626 100%);
  box-shadow: 0 22px 54px -30px rgba(0, 0, 0, 0.65);
}

.hero::before {
  content: "";
  position: absolute;
  top: -76px;
  right: -34px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.hero::after {
  content: "";
  position: absolute;
  right: 88px;
  bottom: -122px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 490px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.66);
}

.hero h1 {
  margin-top: 9px;
  font-family: var(--font-serif);
  font-size: clamp(27px, 3vw, 35px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.hero p {
  max-width: 400px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.hero .btn-cream {
  color: var(--green-deep);
  background: var(--cream);
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.5);
}

.hero .btn-cream:hover {
  background: #ffffff;
}

.hero .btn-ghost {
  color: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.24);
  background: transparent;
}

.hero .btn-ghost:hover {
  color: var(--cream);
  border-color: rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.07);
}

.hero-footnote {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.hero-orbit {
  position: absolute;
  right: 50px;
  top: 50%;
  width: 130px;
  height: 130px;
  transform: translateY(-50%);
  opacity: 0.9;
}

.hero-orbit span {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

.hero-orbit span:nth-child(1) {
  inset: 0;
}

.hero-orbit span:nth-child(2) {
  inset: 21px;
}

.hero-orbit span:nth-child(3) {
  inset: 46px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.07);
}

.hero-orbit .icon {
  width: 25px;
  height: 25px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 2px 22px;
  border-bottom: 1px solid var(--line);
}

.page-head-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.page-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  color: var(--green);
  border: 1px solid var(--green-line);
  border-radius: 14px;
  background: var(--green-soft);
}

.page-icon .icon {
  width: 23px;
  height: 23px;
}

.page-head h1 {
  font-family: var(--font-serif);
  font-size: 27px;
  line-height: 1.3;
}

.page-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 13px;
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.segmented a,
.segmented button {
  padding: 6px 13px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.segmented a:hover,
.segmented button:hover {
  color: var(--ink);
}

.segmented .is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feed-count {
  color: var(--faint);
  font-size: 11.5px;
  white-space: nowrap;
}

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.topic-card {
  position: relative;
  padding: 19px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.topic-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.topic-card.is-pinned {
  border-color: var(--green-line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--green-soft) 55%, transparent), transparent 38%),
    var(--surface);
}

.topic-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topic-author {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.topic-author-text {
  min-width: 0;
  line-height: 1.35;
}

.topic-author-text strong {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.topic-author-text span {
  display: block;
  color: var(--faint);
  font-size: 10.5px;
}

.topic-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
}

.pin-badge .icon {
  width: 11px;
  height: 11px;
}

.topic-title-link {
  display: block;
  margin-top: 12px;
  border-radius: 6px;
}

.topic-title {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.48;
  letter-spacing: 0.005em;
  transition: color 0.16s ease;
}

.topic-title-link:hover .topic-title {
  color: var(--accent);
}

.topic-excerpt {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.topic-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--line) 66%, transparent);
}

.topic-stats {
  display: flex;
  align-items: center;
  gap: 15px;
}

.topic-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.topic-stat .icon {
  width: 14px;
  height: 14px;
}

.topic-last {
  overflow: hidden;
  color: var(--faint);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 0 2px;
}

/* Right rail */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--line);
}

.stat-item {
  padding: 11px 5px;
  background: var(--surface);
  text-align: center;
}

.stat-item strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.stat-item span {
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 10.5px;
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 13%, transparent);
}

.active-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
}

.active-person {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px;
  margin: 0 -6px;
  border-radius: 9px;
}

.active-person:hover {
  background: var(--surface-2);
}

.active-person-text {
  min-width: 0;
  line-height: 1.35;
}

.active-person-text strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-person-text span {
  color: var(--faint);
  font-size: 10px;
}

.active-person .online-dot {
  margin-left: auto;
  flex: none;
}

.install-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.install-card:hover {
  background: var(--surface);
  border-color: var(--green-line);
}

.install-card .icon-box {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--green);
  border-radius: 9px;
  background: var(--green-soft);
}

.install-card .icon {
  width: 18px;
  height: 18px;
}

.install-card strong {
  display: block;
  font-size: 12px;
}

.install-card span {
  color: var(--faint);
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   Empty, error, loading states
   -------------------------------------------------------------------------- */

.state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  padding: 38px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 15px;
  color: var(--green);
  border: 1px solid var(--green-line);
  border-radius: 50%;
  background: var(--green-soft);
}

.state-icon .icon {
  width: 24px;
  height: 24px;
}

.state-card h3 {
  font-family: var(--font-serif);
  font-size: 18px;
}

.state-card p {
  max-width: 350px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.state-card .btn {
  margin-top: 18px;
}

.skeleton-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.skeleton-line {
  height: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-line.w-30 {
  width: 30%;
}

.skeleton-line.w-70 {
  width: 70%;
}

.skeleton-line.w-95 {
  width: 95%;
}

.skeleton-line.tall {
  height: 19px;
  margin: 15px 0 12px;
  border-radius: 7px;
}

.skeleton-line.avatar-line {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Topic detail
   -------------------------------------------------------------------------- */

.detail-shell {
  width: min(900px, 100%);
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.back-link:hover {
  color: var(--ink);
}

.back-link .icon {
  width: 16px;
  height: 16px;
}

.topic-article {
  padding: 34px 38px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.article-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.article-eyebrow .category-link {
  display: inline-flex;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--green-soft);
  color: var(--green);
}

.article-eyebrow .plain-meta {
  color: var(--faint);
  font-size: 11px;
}

.topic-article h1 {
  margin-top: 15px;
  font-family: var(--font-serif);
  font-size: clamp(27px, 3.4vw, 37px);
  line-height: 1.42;
  letter-spacing: 0.005em;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.byline-text {
  line-height: 1.4;
}

.byline-text strong {
  display: inline-block;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.byline-text span {
  display: block;
  color: var(--faint);
  font-size: 10.5px;
}

.byline-role {
  margin-left: auto;
}

.prose {
  padding: 25px 0 12px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 2;
  overflow-wrap: anywhere;
}

.prose p + p {
  margin-top: 1em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.like-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 37px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.like-button .icon {
  width: 17px;
  height: 17px;
}

.like-button:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft);
}

.like-button.is-liked {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft);
}

.like-button.is-liked .icon {
  fill: currentColor;
}

.article-meta-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  color: var(--faint);
  font-size: 10.5px;
}

.article-meta-right span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-meta-right .icon {
  width: 14px;
  height: 14px;
}

.replies-section {
  margin-top: 28px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 19px;
}

.section-heading h2 span {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
}

.reply-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reply-card {
  display: flex;
  gap: 12px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.reply-body {
  min-width: 0;
  flex: 1;
}

.reply-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.35;
}

.reply-head strong {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.reply-head span {
  color: var(--faint);
  font-size: 10.5px;
}

.reply-content {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
}

.reply-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  color: var(--faint);
  border: 0;
  background: transparent;
  font-size: 10.5px;
}

.reply-like:hover,
.reply-like.is-liked {
  color: var(--accent);
}

.reply-like.is-liked .icon {
  fill: currentColor;
}

.reply-like .icon {
  width: 13px;
  height: 13px;
}

.reply-number {
  color: var(--faint);
  font-size: 10.5px;
}

.reply-composer {
  margin-top: 16px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.composer-row {
  display: flex;
  gap: 12px;
}

.composer-field {
  flex: 1;
  min-width: 0;
}

.composer-field textarea {
  width: 100%;
  min-height: 94px;
  resize: vertical;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.composer-hint {
  color: var(--faint);
  font-size: 10.5px;
}

.login-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.login-prompt p {
  color: var(--muted);
  font-size: 12.5px;
}

.login-prompt strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 15px;
}

.locked-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 14px 16px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 12px;
}

.locked-note .icon {
  width: 17px;
  height: 17px;
}

.reply-empty {
  padding: 22px 20px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  font-size: 12.5px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Messages
   -------------------------------------------------------------------------- */

.messages-page {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.messages-shell {
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
  height: min(760px, calc(100dvh - var(--topbar-total) - 56px));
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.conversation-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, var(--surface-2));
}

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 12px;
}

.conversation-head h1 {
  font-family: var(--font-serif);
  font-size: 22px;
}

.conversation-head .icon-button {
  width: 34px;
  height: 34px;
  color: var(--green);
  border-color: var(--line);
  background: var(--surface);
}

.conversation-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px 12px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--faint);
}

.conversation-search:focus-within {
  border-color: var(--green-line);
  background: var(--surface);
}

.conversation-search .icon {
  width: 15px;
  height: 15px;
}

.conversation-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 12px;
  overscroll-behavior: contain;
}

.conv-item {
  display: flex;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.conv-item:hover {
  background: var(--surface-2);
}

.conv-item.is-active {
  background: var(--green-soft);
}

.conv-main {
  min-width: 0;
  flex: 1;
}

.conv-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.4;
}

.conv-top strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-time {
  margin-left: auto;
  color: var(--faint);
  font-size: 9.5px;
  white-space: nowrap;
}

.conv-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-item.has-unread .conv-preview {
  color: var(--ink-soft);
  font-weight: 500;
}

.conv-preview .mine-prefix {
  color: var(--faint);
}

.conv-unread {
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: auto;
  padding: 0 5px;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.conversation-empty {
  padding: 44px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.conversation-empty .icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 10px;
  color: var(--faint);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(500px 260px at 100% 0, color-mix(in srgb, var(--green-soft) 48%, transparent), transparent 70%),
    var(--surface);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  min-height: 70px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.chat-head-text {
  min-width: 0;
  line-height: 1.4;
}

.chat-head-text strong {
  display: block;
  font-size: 13.5px;
}

.chat-head-text span {
  color: var(--faint);
  font-size: 10.5px;
}

.chat-head .icon-button {
  margin-left: auto;
}

.mobile-chat-back {
  display: none;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px 12px;
  overscroll-behavior: contain;
}

.chat-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 18px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-align: center;
}

.chat-day::before,
.chat-day::after {
  content: "";
  height: 1px;
  flex: 1;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.msg-row.mine {
  flex-direction: row-reverse;
}

.msg-stack {
  max-width: min(72%, 520px);
}

.msg-bubble {
  padding: 10px 13px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px 15px 15px 15px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

.msg-row.mine .msg-bubble {
  color: var(--primary-ink);
  border-color: transparent;
  border-radius: 15px 4px 15px 15px;
  background: linear-gradient(150deg, var(--primary-bg), var(--primary-hover));
}

.msg-time {
  margin-top: 4px;
  color: var(--faint);
  font-size: 9px;
}

.msg-row.mine .msg-time {
  text-align: right;
}

.chat-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px;
  text-align: center;
}

.chat-empty-mark {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 18px;
  color: var(--green);
  border: 1px solid var(--green-line);
  border-radius: 50% 50% 50% 14px;
  background: var(--green-soft);
}

.chat-empty-mark .icon {
  width: 28px;
  height: 28px;
}

.chat-empty h2 {
  font-family: var(--font-serif);
  font-size: 21px;
}

.chat-empty p {
  max-width: 300px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.chat-empty .btn {
  margin-top: 18px;
}

.chat-composer {
  flex: none;
  padding: 12px 18px 15px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.chat-composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.chat-composer-inner:focus-within {
  border-color: var(--green-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 8%, transparent);
}

.chat-composer textarea {
  flex: 1;
  width: 100%;
  min-height: 24px;
  max-height: 130px;
  padding: 5px 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.65;
}

.chat-send {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: none;
  padding: 0;
  color: var(--primary-ink);
  border: 0;
  border-radius: 10px;
  background: var(--primary-bg);
}

.chat-send:hover {
  background: var(--primary-hover);
}

.chat-send .icon {
  width: 17px;
  height: 17px;
}

.chat-composer-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  padding: 0 4px;
  color: var(--faint);
  font-size: 9.5px;
}

.chat-auth-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 32px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.chat-auth-wall h1 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 25px;
}

.chat-auth-wall p {
  max-width: 380px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.chat-auth-wall .btn {
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */

.profile-page {
  width: min(980px, 100%);
  margin: 0 auto;
}

.profile-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.profile-cover {
  position: relative;
  height: 148px;
  overflow: hidden;
  background:
    radial-gradient(300px 190px at 80% 10%, rgba(255, 255, 255, 0.17), transparent 70%),
    linear-gradient(120deg, #101010, #2a2a2a 60%, #080808);
}

.profile-cover::before {
  content: "";
  position: absolute;
  top: -90px;
  right: 80px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.profile-cover::after {
  content: "离岛";
  position: absolute;
  right: 34px;
  bottom: 16px;
  color: rgba(255, 255, 255, 0.13);
  font-family: var(--font-serif);
  font-size: 53px;
  letter-spacing: 0.12em;
}

.profile-main {
  position: relative;
  padding: 0 32px 26px;
}

.profile-avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 17px;
  margin-top: -46px;
}

.profile-avatar-row .avatar {
  flex: none;
}

.profile-headline {
  flex: 1;
  min-width: 0;
  padding-top: 50px;
}

.profile-headline h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.3;
}

.profile-handle {
  color: var(--faint);
  font-size: 11.5px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  padding-top: 53px;
}

.profile-bio {
  max-width: 580px;
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--faint);
  font-size: 10.5px;
}

.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-meta .icon {
  width: 13px;
  height: 13px;
}

.profile-stats {
  display: flex;
  gap: 26px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.3;
}

.profile-stat span {
  color: var(--faint);
  font-size: 10px;
}

.profile-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.profile-section {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.profile-section-head h2 {
  font-family: var(--font-serif);
  font-size: 17px;
}

.profile-section-head span {
  color: var(--faint);
  font-size: 10.5px;
}

.profile-topic-list {
  display: flex;
  flex-direction: column;
}

.profile-topic {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.profile-topic:first-child {
  padding-top: 2px;
}

.profile-topic:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-topic-main {
  min-width: 0;
  flex: 1;
}

.profile-topic h3 {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-topic h3 a:hover {
  color: var(--accent);
}

.profile-topic p {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}

.profile-topic .chip {
  flex: none;
}

.about-card {
  position: sticky;
  top: calc(var(--topbar-total) + 24px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.about-card h2 {
  font-family: var(--font-serif);
  font-size: 16px;
}

.about-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.85;
}

.about-card .about-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 11px;
}

.about-card .about-line:last-child {
  border-bottom: 0;
}

.about-card .about-line span {
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */

.search-page {
  width: min(850px, 100%);
  margin: 0 auto;
}

.search-hero {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(320px 200px at 100% 0, var(--green-soft), transparent 72%),
    var(--surface);
}

.search-hero h1 {
  font-family: var(--font-serif);
  font-size: 30px;
}

.search-hero p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  padding: 6px 7px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.search-form:focus-within {
  border-color: var(--green-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 8%, transparent);
}

.search-form .icon {
  width: 19px;
  height: 19px;
  color: var(--faint);
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.search-tags button {
  padding: 5px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
}

.search-tags button:hover {
  color: var(--green);
  border-color: var(--green-line);
  background: var(--green-soft);
}

.search-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 25px 0 13px;
}

.search-results-head h2 {
  font-family: var(--font-serif);
  font-size: 18px;
}

.search-results-head span {
  color: var(--faint);
  font-size: 11px;
}

.search-empty {
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Forms and modals
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal {
  position: relative;
  width: min(470px, 100%);
  max-height: min(88dvh, 850px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition: opacity 0.2s ease, transform 0.2s ease;
  overscroll-behavior: contain;
}

.modal-backdrop.is-open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-wide {
  width: min(620px, 100%);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.modal-close .icon {
  width: 18px;
  height: 18px;
}

.modal-eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.modal h2 {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 25px;
  line-height: 1.35;
}

.modal-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 21px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-2);
}

.auth-tab {
  padding: 8px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
}

.auth-tab.is-active {
  color: #0b0b0b;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 19px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.field-label small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 400;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.55;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--green-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 8%, transparent);
}

.textarea {
  min-height: 180px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--faint) 50%),
    linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 1px),
    calc(100% - 12px) calc(50% - 1px);
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.form-error {
  padding: 9px 11px;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  border-radius: 8px;
  background: var(--danger-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.delete-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 17px;
  padding: 12px 13px;
  color: var(--ink-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 11.5px;
  line-height: 1.65;
}

.delete-warning .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  flex: none;
}

.form-note {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
}

.form-actions .btn-primary {
  flex: 1;
}

.demo-box {
  margin-top: 18px;
  padding: 12px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  font-size: 11px;
  line-height: 1.65;
}

.demo-box strong {
  color: var(--green);
  font-weight: 700;
}

.demo-box code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10.5px;
}

.demo-box .text-button {
  margin-left: 4px;
  font-size: 11px;
}

.compose-intro {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.compose-intro .avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.compose-char-count {
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.compose-char-count.is-near {
  color: var(--accent);
}

.picker-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--faint);
}

.picker-search:focus-within {
  border-color: var(--green-line);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 8%, transparent);
}

.picker-search .icon {
  width: 17px;
  height: 17px;
}

.picker-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.user-picker-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 380px;
  margin-top: 10px;
  overflow-y: auto;
}

.user-picker-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px;
  text-align: left;
  border: 0;
  border-radius: 11px;
  background: transparent;
}

.user-picker-item:hover {
  background: var(--surface-2);
}

.user-picker-text {
  min-width: 0;
  flex: 1;
  line-height: 1.4;
}

.user-picker-text strong {
  display: block;
  font-size: 12.5px;
}

.user-picker-text span {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-picker-item .icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Toasts and install banner
   -------------------------------------------------------------------------- */

.toast-root {
  position: fixed;
  z-index: 130;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 15px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: #111111;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  line-height: 1.55;
  pointer-events: auto;
  animation: toast-in 0.25s ease both;
}

.toast.is-error {
  background: #1a1a1a;
  border: 1px solid #4a4a4a;
}

.toast .icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.toast.is-leaving {
  animation: toast-out 0.2s ease both;
}

.install-tip {
  position: fixed;
  z-index: 90;
  right: 20px;
  bottom: 20px;
  display: none;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--green-line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.install-tip.is-visible {
  display: flex;
}

.install-tip-copy {
  flex: 1;
  line-height: 1.55;
}

.install-tip-copy strong {
  display: block;
  font-size: 12.5px;
}

.install-tip-copy span {
  color: var(--muted);
  font-size: 10.5px;
}

.install-tip .icon-button {
  width: 28px;
  height: 28px;
}

/* --------------------------------------------------------------------------
   Mobile tab bar
   -------------------------------------------------------------------------- */

.mobile-tabbar {
  position: fixed;
  z-index: 70;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--mobile-nav-height) + var(--safe-bottom));
  padding: 5px 8px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.mobile-tabbar a,
.mobile-tabbar button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  color: var(--faint);
  border: 0;
  background: transparent;
  font-size: 9.5px;
  font-weight: 500;
}

.mobile-tabbar a.is-active,
.mobile-tabbar button.is-active {
  color: var(--green);
}

.mobile-tabbar .icon {
  width: 21px;
  height: 21px;
}

.tab-icon-wrap {
  position: relative;
  display: inline-flex;
}

.tab-badge {
  position: absolute;
  top: -6px;
  left: 11px;
  min-width: 15px;
  height: 15px;
  font-size: 8.5px;
}

.tab-compose {
  margin-top: -17px;
}

.tab-compose-inner {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  color: var(--primary-ink);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--primary-bg), var(--primary-hover));
  box-shadow: 0 8px 18px -9px rgba(0, 0, 0, 0.7);
}

.tab-compose .icon {
  width: 23px;
  height: 23px;
}

.tab-compose > span:last-child {
  margin-top: 1px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 901px) {
  .install-button {
    display: none !important;
  }
}

@media (max-width: 1120px) {
  .topbar-inner {
    gap: 18px;
  }

  .feed-layout {
    grid-template-columns: 196px minmax(0, 1fr) 260px;
    gap: 19px;
  }

  .header-search {
    width: 210px;
  }

  .hero-orbit {
    right: 28px;
    width: 112px;
    height: 112px;
  }

  .hero {
    padding: 30px;
  }
}

@media (max-width: 1000px) {
  .feed-layout {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .right-rail {
    display: none;
  }

  .profile-body {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 60px;
  }

  body {
    padding-bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 8px);
  }

  .topbar-inner {
    gap: 12px;
    padding: 0 18px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px 11px 11px 4px;
    font-size: 19px;
  }

  .brand-text strong {
    font-size: 18px;
  }

  .brand-text small {
    display: none;
  }

  .desktop-nav,
  .header-search {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .mobile-tabbar {
    display: grid;
  }

  #main {
    min-height: calc(100dvh - var(--topbar-total) - var(--mobile-nav-height));
    padding: 18px 16px 40px;
  }

  .feed-layout {
    display: block;
  }

  .left-rail {
    display: none;
  }

  .hero {
    min-height: 203px;
    padding: 27px 25px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p {
    max-width: 76%;
  }

  .hero-orbit {
    right: -16px;
    width: 108px;
    height: 108px;
    opacity: 0.55;
  }

  .hero-footnote {
    display: none;
  }

  .page-head {
    padding-top: 3px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .page-head p {
    font-size: 11.5px;
  }

  .page-head .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }

  .search-hero {
    padding: 25px 22px;
  }

  .search-hero h1 {
    font-size: 26px;
  }

  .topic-card {
    padding: 16px 16px 13px;
    border-radius: 15px;
  }

  .topic-title {
    font-size: 17.5px;
  }

  .topic-author-text strong {
    max-width: 120px;
  }

  .topic-card-tags .chip {
    display: none;
  }

  .topic-card-tags .pin-badge {
    display: inline-flex;
  }

  .topic-last {
    display: none;
  }

  .detail-shell {
    width: 100%;
  }

  .topic-article {
    padding: 24px 20px 20px;
    border-radius: 18px;
  }

  .topic-article h1 {
    font-size: 26px;
  }

  .prose {
    font-size: 14.5px;
    line-height: 1.95;
  }

  .article-byline {
    flex-wrap: wrap;
  }

  .byline-message {
    display: none;
  }

  .article-meta-right {
    width: 100%;
    margin: 9px 0 0;
  }

  .reply-card {
    padding: 15px;
  }

  .reply-composer {
    padding: 15px;
  }

  .profile-page {
    width: 100%;
  }

  .profile-cover {
    height: 125px;
  }

  .profile-main {
    padding: 0 20px 22px;
  }

  .profile-avatar-row {
    gap: 13px;
    margin-top: -39px;
  }

  .profile-headline h1 {
    font-size: 23px;
  }

  .profile-headline {
    padding-top: 39px;
  }

  .profile-actions {
    align-self: flex-start;
    padding-top: 39px;
  }

  .profile-actions .btn span {
    display: none;
  }

  .profile-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .profile-section,
  .about-card {
    width: 100%;
  }

  .about-card {
    position: static;
  }

  .messages-page {
    width: 100%;
  }

  .messages-shell {
    display: block;
    height: calc(100dvh - var(--topbar-total) - var(--mobile-nav-height) - 34px);
    min-height: 400px;
    border-radius: 18px;
  }

  .conversation-panel {
    height: 100%;
    border-right: 0;
  }

  .messages-shell.has-active .conversation-panel {
    display: none;
  }

  .chat-panel {
    display: none;
    height: 100%;
  }

  .messages-shell.has-active .chat-panel {
    display: flex;
  }

  .mobile-chat-back {
    display: grid;
    margin-left: 0;
  }

  .chat-head .icon-button:not(.mobile-chat-back) {
    margin-left: auto;
  }

  .chat-head {
    padding: 9px 14px;
    min-height: 62px;
  }

  .chat-messages {
    padding: 18px 14px 10px;
  }

  .msg-stack {
    max-width: 82%;
  }

  .chat-composer {
    padding: 9px 11px 11px;
  }

  .toast-root {
    right: 16px;
    bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 14px);
    left: 16px;
    align-items: center;
  }

  .toast {
    max-width: 100%;
  }

  .install-tip {
    right: 16px;
    bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 14px);
  }

  body.chat-mode .mobile-tabbar {
    display: none;
  }

  body.chat-mode {
    padding-bottom: 0;
  }

  body.chat-mode .messages-shell {
    height: calc(100dvh - var(--topbar-total) - 18px);
  }

  body.chat-mode .toast-root {
    bottom: calc(var(--safe-bottom) + 14px);
  }

  body.modal-open .mobile-tabbar {
    display: none;
  }

  .modal-backdrop {
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 94dvh;
    margin-top: auto;
    padding: 25px 20px calc(24px + var(--safe-bottom));
    border-radius: 24px 24px 0 0;
    transform: translateY(30px);
  }

  .modal-backdrop {
    align-items: end;
  }

  .modal-wide {
    width: 100%;
  }

  .user-picker-list {
    max-height: 45dvh;
  }

  /* Keep iOS Safari from zooming the page when a field receives focus. */
  .input,
  .textarea,
  .select,
  .search-form input,
  .chat-composer textarea,
  .picker-search input,
  .conversation-search input {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  #main {
    padding: 14px 12px 36px;
  }

  .hero {
    min-height: 186px;
    padding: 23px 21px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .hero p {
    max-width: 100%;
    margin-top: 7px;
    font-size: 11.5px;
    line-height: 1.7;
  }

  .hero-actions {
    margin-top: 17px;
  }

  .hero .btn {
    min-height: 40px;
    padding: 0 16px;
  }

  .hero-orbit {
    display: none;
  }

  .hero-actions .btn-ghost {
    color: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.24);
  }

  .feed-toolbar {
    margin-top: 17px;
  }

  .segmented {
    max-width: 100%;
  }

  .segmented a,
  .segmented button {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .feed-count {
    display: none;
  }

  .topic-card {
    padding: 14px 14px 12px;
  }

  .topic-title {
    margin-top: 10px;
    font-size: 16.5px;
  }

  .topic-excerpt {
    font-size: 11.5px;
    -webkit-line-clamp: 2;
  }

  .topic-stats {
    gap: 12px;
  }

  .topic-card-foot {
    margin-top: 11px;
    padding-top: 10px;
  }

  .page-head {
    align-items: center;
  }

  .page-head-main {
    gap: 10px;
  }

  .page-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .page-icon .icon {
    width: 20px;
    height: 20px;
  }

  .page-head h1 {
    font-size: 21px;
  }

  .page-head p {
    display: none;
  }

  .topic-article {
    padding: 20px 16px 17px;
  }

  .topic-article h1 {
    font-size: 23px;
  }

  .article-byline {
    margin-top: 17px;
    padding-bottom: 17px;
  }

  .prose {
    padding-top: 19px;
    font-size: 14px;
  }

  .article-actions {
    gap: 7px;
  }

  .like-button,
  .article-actions .btn {
    min-height: 35px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .article-meta-right {
    gap: 9px;
  }

  .replies-section {
    margin-top: 22px;
  }

  .reply-card {
    gap: 9px;
    padding: 13px;
  }

  .reply-card .avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .reply-content {
    font-size: 12.5px;
  }

  .login-prompt {
    flex-direction: column;
    align-items: flex-start;
  }

  .composer-row {
    gap: 9px;
  }

  .composer-row > .avatar {
    display: none;
  }

  .composer-actions {
    align-items: flex-end;
  }

  .profile-cover {
    height: 105px;
  }

  .profile-avatar-row {
    align-items: flex-start;
  }

  .profile-avatar-row .avatar {
    width: 78px;
    height: 78px;
    margin-top: 0;
    font-size: 31px;
  }

  .profile-headline h1 {
    font-size: 21px;
  }

  .profile-actions {
    padding-top: 39px;
  }

  .profile-bio {
    margin-top: 12px;
    font-size: 12px;
  }

  .profile-stats {
    gap: 20px;
    margin-top: 16px;
    padding-top: 15px;
  }

  .profile-stat strong {
    font-size: 17px;
  }

  .profile-section {
    padding: 18px 16px;
  }

  .profile-topic .chip {
    display: none;
  }

  .messages-shell {
    height: calc(100dvh - var(--topbar-total) - var(--mobile-nav-height) - 28px);
    border-radius: 16px;
  }

  .conversation-head {
    padding: 17px 16px 9px;
  }

  .conversation-head h1 {
    font-size: 20px;
  }

  .conversation-search {
    margin: 0 16px 9px;
  }

  .chat-head {
    min-height: 59px;
    padding: 8px 11px;
  }

  .chat-head .avatar {
    width: 34px;
    height: 34px;
  }

  .chat-messages {
    padding: 15px 11px 8px;
  }

  .msg-row {
    margin-bottom: 11px;
  }

  .msg-bubble {
    padding: 9px 11px;
    font-size: 12.5px;
  }

  .msg-row .avatar {
    display: none;
  }

  .msg-stack {
    max-width: 87%;
  }

  .chat-composer {
    padding: 8px 9px 10px;
  }

  .chat-composer-meta {
    display: none;
  }

  .search-hero {
    padding: 22px 17px;
  }

  .search-hero h1 {
    font-size: 24px;
  }

  .search-form {
    margin-top: 17px;
  }

  .brand-text strong {
    font-size: 16px;
  }

  .topbar-inner {
    padding: 0 14px;
  }

  .header-actions {
    gap: 1px;
  }

  .icon-button {
    width: 35px;
    height: 35px;
  }

  .join-button {
    padding: 8px 11px;
    font-size: 12.5px;
  }

  .login-link {
    padding: 8px 6px;
    font-size: 12.5px;
  }

  .modal {
    padding: 23px 17px calc(22px + var(--safe-bottom));
  }

  .modal h2 {
    font-size: 23px;
  }

  .article-eyebrow .plain-meta {
    display: none;
  }
}

@media (max-width: 380px) {
  .brand-text {
    display: none;
  }

  .hero h1 {
    font-size: 23px;
  }

  .topic-title {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes soft-pulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-4px);
    opacity: 0.84;
  }
}

@keyframes boot-progress {
  0% {
    transform: translateX(-115%);
  }
  55%,
  100% {
    transform: translateX(260%);
  }
}

@keyframes boot-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}
