/* =========================================================
   临沂24中论坛 · Design System
   Warm paper, deep green, quiet editorial details.
   ========================================================= */

:root {
  --bg: #f5f3ec;
  --bg-soft: #ede9df;
  --surface: #fffdf8;
  --surface-raised: #ffffff;
  --surface-soft: #f1eee5;
  --ink: #1f2924;
  --ink-soft: #56625b;
  --muted: #8a938c;
  --line: #e4dfd3;
  --line-strong: #d3ccbd;
  --accent: #2f6f5e;
  --accent-hover: #245849;
  --accent-soft: #e5efe9;
  --on-accent: #ffffff;
  --gold: #a8783f;
  --gold-soft: #f3e9d6;
  --danger: #b5544a;
  --danger-soft: #f7e7e4;
  --info: #4e7196;
  --info-soft: #e8eef5;
  --shadow-sm: 0 1px 2px rgba(41, 51, 45, 0.04), 0 6px 20px rgba(41, 51, 45, 0.04);
  --shadow-md: 0 18px 48px rgba(31, 41, 36, 0.1);
  --shadow-lg: 0 30px 80px rgba(31, 41, 36, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sidebar-w: 232px;
  --rail-w: 300px;
  --content-max: 1440px;
}

[data-theme="dark"] {
  --bg: #111714;
  --bg-soft: #161e1a;
  --surface: #1a231f;
  --surface-raised: #202b26;
  --surface-soft: #222e28;
  --ink: #edf2ed;
  --ink-soft: #b6c1b9;
  --muted: #849289;
  --line: #2a3731;
  --line-strong: #3a4a41;
  --accent: #82bea6;
  --accent-hover: #98ceb8;
  --accent-soft: #20372e;
  --on-accent: #0e1c16;
  --gold: #ddb076;
  --gold-soft: #352a1b;
  --danger: #df8a7f;
  --danger-soft: #382422;
  --info: #93b6d8;
  --info-soft: #1e2d3a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 20px 52px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, 0.45);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 72% -10%, rgba(180, 199, 178, 0.18), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

::selection { background: var(--accent-soft); color: var(--accent); }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}
a:hover { color: var(--accent); }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: 0.6; }

img { max-width: 100%; display: block; }
p { margin: 0; }
h1, h2, h3, h4, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
kbd, code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

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

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  vertical-align: -3px;
  pointer-events: none;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; color: var(--on-accent); }

/* ---------------------------------------------------------
   Boot / loading
   --------------------------------------------------------- */
.boot-loading,
.auth-loading,
.route-loading {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}
.boot-loading { min-height: 100vh; }
.auth-loading { min-height: 100vh; }

.spinner {
  width: 26px;
  height: 26px;
  display: inline-block;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.spinner-sm { width: 15px; height: 15px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------------------------------------
   Typography helpers
   --------------------------------------------------------- */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-soft);
}
.text-link:hover { color: var(--accent); }
.text-muted { color: var(--muted); font-size: 13px; }
.danger-text { color: var(--danger) !important; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  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 {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 18px rgba(47, 111, 94, 0.18);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-soft); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); color: #fff; }
.btn-ghost-danger { color: var(--danger); border-color: var(--line); background: transparent; }
.btn-ghost-danger:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-xs { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-xs .icon { width: 14px; height: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { box-shadow: none; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--ink-soft);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); border-color: var(--line); }
.icon-btn .icon { width: 19px; height: 19px; }

/* ---------------------------------------------------------
   Badges / avatars / tags
   --------------------------------------------------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--avatar-color) 88%, #ffffff), var(--avatar-color));
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 40px; height: 40px; font-size: 16px; }
.avatar-lg { width: 58px; height: 58px; font-size: 22px; }
.avatar-xl { width: 108px; height: 108px; font-size: 38px; }
.avatar-link { display: inline-flex; flex: 0 0 auto; }

.level-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.role-admin { background: var(--gold-soft); color: var(--gold); }
.role-moderator { background: var(--info-soft); color: var(--info); }
.self-chip {
  display: inline-flex;
  height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.role-plain { color: var(--muted); font-size: 13px; }

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 9px 0 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.category-pill:hover { border-color: color-mix(in srgb, var(--cat-color) 45%, var(--line)); color: var(--ink); }
.category-pill.is-active { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.category-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cat-color) 14%, var(--surface));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.mini-badge .icon { width: 11px; height: 11px; }
.badge-pin { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.tags, .post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.tag:hover { color: var(--accent); }

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--ink-soft);
  white-space: nowrap;
}
.status-active, .status-published { background: var(--accent-soft); color: var(--accent); }
.status-banned, .status-deleted, .status-pending { background: var(--danger-soft); color: var(--danger); }
.status-hidden, .status-dismissed { background: var(--surface-soft); color: var(--muted); }
.status-resolved { background: var(--info-soft); color: var(--info); }

/* ---------------------------------------------------------
   App shell
   --------------------------------------------------------- */
#app { min-height: 100vh; }

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  gap: 28px;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 28px;
  align-items: start;
}
.app-layout.no-rail { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.app-layout.no-rail .rail { display: none; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 0 22px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-top { display: flex; flex-direction: column; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  padding: 2px 6px;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background:
    radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.2), transparent 40%),
    var(--accent);
  color: var(--on-accent);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(47, 111, 94, 0.18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--serif); font-size: 20px; letter-spacing: 0.06em; }
.brand-text small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: 0.22em; }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 32px;
}
.side-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.side-nav-item .icon { width: 19px; height: 19px; color: var(--muted); transition: color 0.18s ease; }
.side-nav-item:hover { background: var(--surface); color: var(--ink); }
.side-nav-item:hover .icon { color: var(--accent); }
.side-nav-item.is-active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}
.side-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
}
.side-nav-item.is-active .icon { color: var(--accent); }
.side-nav-item .nav-badge { margin-left: auto; }
.side-nav-admin { margin-top: 10px; }
.side-nav-admin::after { content: ""; position: absolute; top: -6px; left: 12px; right: 12px; height: 1px; background: var(--line); }
.side-nav-admin small {
  margin-left: auto;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}
.nav-badge { margin-left: auto; }

.sidebar-compose {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 14px;
  background:
    radial-gradient(120px 80px at 110% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.sidebar-compose:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); transform: translateY(-1px); }
.sidebar-compose-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-compose span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.sidebar-compose strong { font-size: 13px; }
.sidebar-compose small { color: var(--muted); font-size: 10px; }
.compose-arrow { margin-left: auto; width: 14px !important; height: 14px !important; color: var(--muted); }

.sidebar-bottom { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.sidebar-guest {
  padding: 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.sidebar-guest-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  margin-bottom: 8px;
}
.sidebar-guest strong { display: block; font-size: 12px; line-height: 1.45; }
.sidebar-guest p { margin: 4px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.sidebar-guest .btn { width: 100%; }

.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.account-summary:hover { background: var(--surface); border-color: var(--line); }
.account-summary-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.account-summary-text strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary-text small { color: var(--muted); font-size: 9px; }
.account-chevron { margin-left: auto; width: 14px !important; height: 14px !important; color: var(--muted); transition: transform 0.2s ease; }
.account-menu[open] .account-chevron { transform: rotate(180deg); }
.account-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 50;
  width: 208px;
  padding: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.account-popover a,
.account-popover button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
}
.account-popover a:hover,
.account-popover button:hover { background: var(--surface-soft); color: var(--ink); }
.account-popover .icon { width: 16px; height: 16px; }
.account-popover .popover-badge { margin-left: auto; }
.account-popover button { margin-top: 3px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; padding-top: 11px; color: var(--danger); }
.account-popover button:hover { color: var(--danger); background: var(--danger-soft); }

.main-column { min-width: 0; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 76px;
  padding: 0 4px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.mobile-brand { display: none; align-items: center; gap: 8px; color: var(--ink); }
.mobile-brand:hover { color: var(--ink); }
.mobile-brand .brand-mark { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
.mobile-brand strong { font-family: var(--serif); font-size: 17px; letter-spacing: 0.06em; }

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(430px, 58%);
  height: 40px;
  padding: 0 10px 0 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.global-search:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.global-search .search-icon { position: absolute; left: 13px; color: var(--muted); display: inline-flex; }
.global-search .search-icon .icon { width: 17px; height: 17px; }
.global-search input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}
.global-search input::placeholder { color: var(--muted); }
.global-search input::-webkit-search-cancel-button { display: none; }
.global-search kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-account { display: flex; align-items: center; gap: 8px; }
.topbar-bell {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--ink-soft);
}
.topbar-bell:hover { background: var(--surface-soft); color: var(--ink); }
.topbar-bell .unread-badge {
  position: absolute;
  top: 1px;
  right: -1px;
  min-width: 16px;
  height: 16px;
  font-size: 9px;
  border: 2px solid var(--bg);
}
.topbar-avatar { display: inline-flex; border-radius: 50%; }
.topbar-login { min-height: 34px; }
.topbar-compose { min-height: 34px; }
.theme-toggle { flex: 0 0 auto; }

.page { padding: 25px 0 90px; min-height: calc(100vh - 76px); }
.page:focus { outline: none; }

.rail {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  padding: 25px 0 40px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * + * { margin-top: 16px; }

.mobile-nav { display: none; }

/* ---------------------------------------------------------
   Common surface / page headings
   --------------------------------------------------------- */
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.page-narrow { max-width: 880px; margin: 0 auto; }
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 22px;
}
.page-heading h1 { font-family: var(--serif); font-size: 38px; line-height: 1.25; letter-spacing: -0.02em; margin: 6px 0 5px; }
.page-heading p { color: var(--ink-soft); font-size: 14px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-heading h2 { font-family: var(--serif); font-size: 23px; line-height: 1.3; letter-spacing: -0.01em; }
.section-heading p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.heading-stats { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.heading-stats .icon { width: 14px; height: 14px; }

.back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--accent); }

/* ---------------------------------------------------------
   Home
   --------------------------------------------------------- */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.75fr);
  min-height: 310px;
  padding: 38px 36px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(440px 300px at 92% 10%, rgba(224, 191, 135, 0.24), transparent 65%),
    linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 72%, var(--surface)) 0%, var(--surface) 65%);
  box-shadow: var(--shadow-sm);
}
.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 12px 0 14px;
  font-weight: 700;
}
.accent-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: 0.42em;
  box-shadow: 0 0 0 4px var(--gold-soft);
}
.hero-copy p { color: var(--ink-soft); font-size: 14px; line-height: 1.85; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-size: 10px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta .icon { width: 13px; height: 13px; }

.hero-art { position: relative; min-height: 230px; }
.hero-sun {
  position: absolute;
  top: 18px;
  right: 42px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(140deg, #f2d9aa, #e3b877);
  box-shadow: 0 0 54px rgba(228, 185, 119, 0.4);
}
.hero-hill {
  position: absolute;
  border-radius: 50%;
  opacity: 0.9;
}
.hill-one { width: 300px; height: 160px; right: -50px; bottom: -10px; background: #bdd0bd; transform: rotate(-9deg); }
.hill-two { width: 260px; height: 110px; right: 40px; bottom: -40px; background: #8fad98; transform: rotate(8deg); opacity: 0.75; }
.hero-book {
  position: absolute;
  right: 70px;
  bottom: 36px;
  width: 126px;
  height: 74px;
  padding: 0;
  background: #f7f1e4;
  border: 1px solid rgba(47, 111, 94, 0.28);
  border-radius: 4px 9px 9px 4px;
  box-shadow: 12px 14px 0 -4px rgba(47, 111, 94, 0.2);
  transform: rotate(-8deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding-left: 22px;
}
.hero-book span { width: 70px; height: 2px; background: rgba(47, 111, 94, 0.25); border-radius: 2px; }
.hero-book span:nth-child(2) { width: 52px; }
.hero-book span:nth-child(3) { width: 62px; }
.hero-book::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 1px; background: rgba(47, 111, 94, 0.18); }
.hero-leaves { position: absolute; width: 70px; height: 110px; }
.leaf-one { right: 16px; top: 92px; transform: rotate(18deg); }
.leaf-two { right: 204px; top: 14px; transform: rotate(-30deg) scale(0.8); }
.hero-leaves::before,
.hero-leaves::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 19px;
  border-radius: 50% 50% 50% 4px;
  background: rgba(47, 111, 94, 0.32);
}
.hero-leaves::before { top: 20px; left: 6px; transform: rotate(-25deg); }
.hero-leaves::after { top: 52px; left: 20px; transform: rotate(18deg) scale(0.8); }
.hero-note {
  position: absolute;
  left: 10px;
  bottom: 14px;
  color: rgba(47, 111, 94, 0.55);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.18em;
}
[data-theme="dark"] .hero-hill { opacity: 0.35; }
[data-theme="dark"] .hero-book { background: #d9cdb4; }

.announcement-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}
.announcement-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
}
.announcement-icon .icon { width: 16px; height: 16px; }
.announcement-copy { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
.announcement-copy strong { font-size: 12px; white-space: nowrap; }
.announcement-copy span { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement-tag { color: var(--gold); font-size: 9px; letter-spacing: 0.08em; white-space: nowrap; }

.compact-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 2px 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.compact-head h1 { font-family: var(--serif); font-size: 36px; line-height: 1.25; letter-spacing: -0.02em; margin: 8px 0 6px; }
.compact-head p { color: var(--muted); font-size: 13px; }

.feed { margin-top: 28px; }
.home-hero + .announcement-strip + .feed { margin-top: 26px; }
.feed-toolbar { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.seg-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.seg-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 29px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.seg-tab:hover { color: var(--ink); }
.seg-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px rgba(31, 41, 36, 0.08); }
.feed-sort-note { color: var(--muted); font-size: 10px; letter-spacing: 0.03em; }

.category-scroller {
  display: flex;
  gap: 7px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.category-scroller::-webkit-scrollbar { display: none; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}
.filter-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.filter-chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter-chip em { font-style: normal; font-size: 9px; color: var(--muted); }
.filter-chip.is-active em { color: color-mix(in srgb, var(--bg) 72%, transparent); }
.filter-chip span { font-size: 12px; line-height: 1; }

.active-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.active-filter strong { color: var(--accent); }
.active-filter a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.post-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.post-card {
  position: relative;
  padding: 20px 22px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.post-card:hover { border-color: var(--line-strong); box-shadow: 0 10px 34px rgba(31, 41, 36, 0.07); transform: translateY(-2px); }
.post-card.is-pinned { border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); }
.post-card.is-pinned::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.post-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.post-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.post-title {
  display: block;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.post-title:hover { color: var(--accent); }
.post-excerpt {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-cover {
  position: relative;
  display: block;
  margin-top: 14px;
  height: 190px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-soft);
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.post-cover:hover img { transform: scale(1.025); }
.cover-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(16, 24, 20, 0.56);
  color: #fff;
  font-size: 10px;
  backdrop-filter: blur(6px);
}
.cover-count .icon { width: 13px; height: 13px; }
.image-hint { display: inline-flex; align-items: center; gap: 5px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.image-hint .icon { width: 14px; height: 14px; }
.post-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 9px; }
.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.post-author { display: flex; align-items: center; gap: 9px; min-width: 0; }
.post-author-text { display: flex; align-items: center; gap: 6px; min-width: 0; }
.author-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.author-name:hover { color: var(--accent); }
.author-meta { display: inline-flex; align-items: center; gap: 4px; }
.post-stats { display: flex; align-items: center; gap: 13px; }
.post-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.post-stat .icon { width: 15px; height: 15px; }
.stat-action { border-radius: 6px; transition: color 0.18s ease, background 0.18s ease; }
.stat-action:hover { color: var(--accent); }
.stat-action.is-liked { color: var(--danger); }
.stat-action.is-liked .icon { fill: color-mix(in srgb, var(--danger) 16%, transparent); }

.load-more-wrap { display: flex; justify-content: center; padding: 22px 0 4px; }
.load-more { min-width: 160px; color: var(--muted); }
.list-end { color: var(--muted); font-size: 11px; letter-spacing: 0.02em; }

/* ---------------------------------------------------------
   Right rail
   --------------------------------------------------------- */
.rail-card {
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.rail-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.rail-head .icon { width: 15px; height: 15px; color: var(--accent); }
.rail-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.rail-footnote { display: flex; align-items: center; gap: 5px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.rail-footnote .icon { width: 13px; height: 13px; color: var(--accent); }
.rail-text { color: var(--ink-soft); font-size: 12px; line-height: 1.75; }
.rail-text strong { color: var(--accent); }

.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-item + .notice-item { padding-top: 11px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.notice-title { display: flex; align-items: flex-start; gap: 6px; }
.notice-title strong { font-size: 11px; line-height: 1.5; font-weight: 600; }
.notice-dot { width: 5px; height: 5px; flex: 0 0 auto; margin-top: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.notice-item p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notice-item time { display: block; margin-top: 3px; color: color-mix(in srgb, var(--muted) 75%, transparent); font-size: 9px; }

.hot-list { display: flex; flex-direction: column; gap: 9px; }
.hot-list li { display: flex; gap: 9px; align-items: flex-start; }
.hot-index { width: 18px; flex: 0 0 auto; color: var(--line-strong); font-family: var(--serif); font-size: 12px; font-weight: 700; line-height: 1.6; }
.hot-index.is-top { color: var(--gold); }
.hot-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hot-body a {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-body a:hover { color: var(--accent); }
.hot-body span { color: var(--muted); font-size: 9px; }

.mini-user-list { display: flex; flex-direction: column; gap: 6px; }
.user-mini { display: flex; align-items: center; gap: 8px; padding: 4px 3px; border-radius: 8px; }
.user-mini:hover { background: var(--surface-soft); }
.user-mini-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.user-mini-text strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini-text small { color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini .level-badge { margin-left: auto; }

.rail-stats .stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 8px; }
.stat-grid > div { display: flex; flex-direction: column; gap: 1px; }
.stat-grid strong { font-family: var(--serif); font-size: 21px; line-height: 1.2; font-weight: 700; color: var(--ink); }
.stat-grid span { color: var(--muted); font-size: 9px; }

.rail-quote {
  position: relative;
  padding: 22px 20px 18px;
  border-radius: 15px;
  background:
    radial-gradient(120px 90px at 100% 0%, rgba(224, 191, 135, 0.22), transparent 60%),
    var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  overflow: hidden;
}
.quote-mark { position: absolute; top: 2px; left: 14px; font-family: Georgia, serif; font-size: 54px; line-height: 1; color: color-mix(in srgb, var(--accent) 24%, transparent); }
.rail-quote p { position: relative; z-index: 1; padding-top: 12px; font-family: var(--serif); font-size: 15px; line-height: 1.75; color: var(--accent); letter-spacing: 0.02em; }
.quote-source { display: block; margin-top: 10px; color: color-mix(in srgb, var(--accent) 60%, var(--muted)); font-size: 9px; letter-spacing: 0.08em; }

.rail-footer { display: flex; justify-content: center; gap: 6px; padding: 2px 0 10px; color: var(--muted); font-size: 9px; }

.related-list { display: flex; flex-direction: column; }
.related-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.related-item:last-child { border-bottom: 0; padding-bottom: 0; }
.related-item:first-child { padding-top: 0; }
.related-cat { color: var(--cat-color); font-size: 9px; font-weight: 600; }
.related-item strong { font-size: 11px; line-height: 1.55; font-weight: 550; }
.related-item small { color: var(--muted); font-size: 9px; }
.related-item:hover strong { color: var(--accent); }
.community-rules ul { display: flex; flex-direction: column; gap: 7px; }
.community-rules li { position: relative; padding-left: 12px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.community-rules li::before { content: "·"; position: absolute; left: 2px; top: -1px; color: var(--accent); font-size: 16px; }

/* ---------------------------------------------------------
   Discover
   --------------------------------------------------------- */
.discover-head {
  padding: 16px 0 26px;
  max-width: 680px;
}
.discover-head h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 52px);
  line-height: 1.3;
  letter-spacing: -0.035em;
  margin: 10px 0 12px;
  font-weight: 700;
}
.discover-head p { color: var(--ink-soft); font-size: 14px; }
.discover-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 7px 7px 7px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}
.discover-search:focus-within { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.discover-search .search-icon { position: absolute; left: 14px; color: var(--muted); display: inline-flex; }
.discover-search input { flex: 1; min-width: 0; height: 34px; background: transparent; border: 0; outline: 0; font-size: 13px; }
.discover-search .btn { min-height: 34px; }

.discover-section { margin-top: 30px; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.category-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px;
  min-height: 104px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.category-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cat-color) 8%, transparent);
}
.category-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--cat-color) 34%, var(--line)); box-shadow: var(--shadow-sm); }
.category-card-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--cat-color) 11%, var(--surface));
  font-size: 18px;
}
.category-card strong { font-size: 14px; font-weight: 650; }
.category-card p { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.category-card-count { position: absolute; top: 16px; right: 16px; color: var(--muted); font-size: 9px; }
.category-card-arrow { position: absolute; right: 16px; bottom: 14px; color: var(--line-strong); }
.category-card-arrow .icon { width: 15px; height: 15px; }
.category-card:hover .category-card-arrow { color: var(--cat-color); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cloud-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
}
.cloud-tag em { color: var(--muted); font-size: 9px; font-style: normal; }
.cloud-tag:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); }
.cloud-tag.size-lg { font-family: var(--serif); font-size: 17px; padding: 9px 14px; }
.cloud-tag.size-md { font-size: 13px; }
.cloud-tag.size-sm { font-size: 11px; opacity: 0.84; }

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 30px;
  padding: 16px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stats-band > div { display: flex; flex-direction: column; align-items: center; gap: 1px; border-right: 1px solid var(--line); }
.stats-band > div:last-child { border-right: 0; }
.stats-band strong { font-family: var(--serif); font-size: 23px; line-height: 1.2; }
.stats-band span { color: var(--muted); font-size: 9px; }

.user-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.user-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.user-card:hover { color: inherit; border-color: color-mix(in srgb, var(--user-color) 28%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.user-card-main { min-width: 0; flex: 1; }
.user-card-name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.user-card-name strong { font-size: 13px; font-weight: 650; }
.user-handle { display: block; color: var(--muted); font-size: 9px; }
.user-bio { margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.user-bio.muted { color: var(--muted); }
.user-card-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.user-card-arrow { position: absolute; right: 13px; bottom: 13px; color: var(--line-strong); }
.user-card-arrow .icon { width: 14px; height: 14px; }
.user-card:hover .user-card-arrow { color: var(--user-color); }

.search-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}
.search-summary strong { color: var(--accent); }
.search-summary a { color: var(--muted); font-size: 11px; }
.search-summary a:hover { color: var(--accent); }

/* ---------------------------------------------------------
   Post detail
   --------------------------------------------------------- */
.post-page { min-width: 0; }
.post-detail-cat { display: inline-flex; }
.post-detail {
  padding: 30px 34px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12px;
}
.status-banner .icon { width: 16px; height: 16px; }
.post-detail-head { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.post-detail-head .post-badges { margin-bottom: 10px; }
.post-detail-head h1 {
  margin: 0 0 17px;
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.4;
  letter-spacing: -0.025em;
  font-weight: 700;
  word-break: break-word;
}
.post-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 11px; }
.post-detail-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.post-detail-meta .icon { width: 14px; height: 14px; }
.detail-author { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.detail-author:hover { color: var(--ink); }
.detail-author > span { display: flex; flex-direction: column; line-height: 1.35; }
.detail-author strong { font-size: 12px; font-weight: 650; }
.detail-author small { color: var(--muted); font-size: 9px; }
.meta-sep { width: 1px; height: 20px; background: var(--line); }

.post-body {
  padding: 26px 0 6px;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 2;
  word-break: break-word;
}
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-gallery { display: grid; gap: 7px; margin: 18px 0 8px; grid-template-columns: 1fr; }
.post-gallery.count-2 { grid-template-columns: 1fr 1fr; }
.post-gallery.count-3 { grid-template-columns: 1.35fr 1fr; }
.post-gallery.count-3 .gallery-item:first-child { grid-row: span 2; }
.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 11px;
  background: var(--surface-soft);
  aspect-ratio: 16 / 9;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.015); }
.post-gallery.count-2 .gallery-item { aspect-ratio: 4 / 3; }
.post-gallery.count-3 .gallery-item { aspect-ratio: auto; height: 100%; min-height: 120px; }
.detail-tags { margin-top: 18px; }
.post-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.action-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.action-btn:hover { background: var(--surface-soft); color: var(--ink); }
.action-btn .icon { width: 15px; height: 15px; }
.action-btn em { font-style: normal; color: var(--muted); font-size: 10px; }
.action-btn.is-active { color: var(--danger); background: var(--danger-soft); }
.action-btn.is-active .icon { fill: color-mix(in srgb, var(--danger) 14%, transparent); }
.action-btn.is-active em { color: var(--danger); }
.action-btn.manage-btn { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 10%, transparent); margin-left: 2px; }

.author-spotlight {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(340px 120px at 0% 100%, var(--accent-soft), transparent 70%),
    var(--surface);
}
.author-spotlight-main { flex: 1; min-width: 0; }
.author-spotlight-main h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; margin: 3px 0 4px; }
.author-spotlight-main p { color: var(--ink-soft); font-size: 11px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.author-spotlight-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.author-spotlight .btn { flex: 0 0 auto; }

.comments-section { margin-top: 18px; padding: 26px 26px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.comments-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.comments-head h2 { font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em; }
.comments-head h2 span { color: var(--muted); font-family: var(--sans); font-size: 12px; font-weight: 500; margin-left: 4px; }
.comments-head p { color: var(--muted); font-size: 10px; margin-top: 3px; }
.comments-rule { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; }
.comments-rule .icon { width: 12px; height: 12px; }

.comment-composer { display: flex; align-items: flex-start; gap: 11px; padding: 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 13px; }
.composer-main { flex: 1; min-width: 0; }
.composer-main textarea { width: 100%; min-height: 66px; resize: vertical; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: 0; font-size: 12px; line-height: 1.7; }
.composer-main textarea:focus { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; }
.char-count { color: var(--muted); font-size: 9px; }
.comment-closed, .comment-login-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 12px;
}
.comment-login-cta > div { flex: 1; }
.comment-login-cta strong { display: block; color: var(--ink); font-size: 12px; }
.comment-login-cta p { font-size: 10px; margin-top: 1px; }
.comment-login-cta > .icon { width: 20px; height: 20px; color: var(--accent); }
.comment-closed .icon { width: 16px; height: 16px; }

.comment-list { margin-top: 18px; display: flex; flex-direction: column; gap: 1px; }
.comment { padding: 16px 0; border-top: 1px solid color-mix(in srgb, var(--line) 74%, transparent); }
.comment:first-child { border-top: 0; padding-top: 0; }
.comment-main { display: flex; gap: 11px; align-items: flex-start; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.comment-author { color: var(--ink); font-size: 12px; font-weight: 650; }
.comment-head time { margin-left: auto; color: var(--muted); font-size: 9px; }
.reply-to { color: var(--muted); font-size: 10px; }
.reply-to a { color: var(--accent); }
.comment-content { margin-top: 4px; color: var(--ink-soft); font-size: 12.5px; line-height: 1.8; word-break: break-word; }
.comment-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.comment-actions { display: flex; gap: 3px; margin-top: 5px; }
.comment-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 9px;
}
.comment-action:hover { background: var(--surface-soft); color: var(--ink); }
.comment-action .icon { width: 12px; height: 12px; }
.comment-action.is-active { color: var(--danger); }
.comment-action.is-active .icon { fill: color-mix(in srgb, var(--danger) 14%, transparent); }
.comment-delete:hover { color: var(--danger); }
.comment-replies { margin-left: 51px; padding-left: 14px; border-left: 2px solid var(--surface-soft); }
.comment.is-reply { padding: 12px 0; }
.comment.is-reply:first-child { padding-top: 10px; }
.comment-replies > .comment { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.comment-replies > .comment:first-child { border-top: 0; }
.comments-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 10px 12px; color: var(--muted); font-size: 11px; }
.comments-empty .icon { width: 22px; height: 22px; color: var(--line-strong); }
.comment-deleted { display: flex; align-items: center; gap: 5px; padding: 8px 0; color: var(--muted); font-size: 10px; }
.comment-deleted .icon { width: 13px; height: 13px; }
.reply-form { margin-top: 9px; padding: 9px; background: var(--surface-soft); border-radius: 9px; border: 1px solid var(--line); }
.reply-form textarea { width: 100%; min-height: 50px; resize: vertical; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; outline: 0; background: var(--surface); font-size: 11px; line-height: 1.6; }
.reply-form textarea:focus { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.reply-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.reply-form-foot .char-count { margin-right: auto; }

/* ---------------------------------------------------------
   Compose
   --------------------------------------------------------- */
.compose-page { max-width: 840px; }
.compose-head { padding: 4px 0 18px; }
.compose-head h1 { font-family: var(--serif); font-size: clamp(32px, 4vw, 44px); line-height: 1.3; letter-spacing: -0.03em; margin: 9px 0 7px; }
.compose-head p { color: var(--ink-soft); font-size: 13px; }
.compose-save-note { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.compose-save-note .icon { width: 13px; height: 13px; color: var(--accent); }
.compose-form {
  padding: 8px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.form-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-label { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; color: var(--ink); font-size: 12px; font-weight: 650; }
.form-label em { color: var(--muted); font-style: normal; font-weight: 400; font-size: 10px; }
.form-hint { color: var(--muted); font-size: 9px; }
.form-label-row .form-hint { margin-bottom: 9px; }
.category-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.category-option { position: relative; }
.category-option input { position: absolute; opacity: 0; pointer-events: none; }
.category-option-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  height: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.category-option:hover .category-option-inner { border-color: var(--line-strong); background: var(--surface-soft); }
.category-option input:checked + .category-option-inner { border-color: color-mix(in srgb, var(--cat-color) 55%, var(--line)); background: color-mix(in srgb, var(--cat-color) 7%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat-color) 22%, transparent); }
.category-option-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background: color-mix(in srgb, var(--cat-color) 11%, var(--surface));
  font-size: 13px;
}
.category-option-inner > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.category-option-inner strong { font-size: 11px; font-weight: 600; }
.category-option-inner small { color: var(--muted); font-size: 8px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.title-input {
  width: 100%;
  height: 54px;
  padding: 0 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.title-input:focus { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.content-input {
  width: 100%;
  min-height: 260px;
  padding: 13px 15px;
  resize: vertical;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  font-size: 14px;
  line-height: 1.9;
}
.content-input:focus { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.tags-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.tags-input-wrap:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.tags-input-wrap .icon { width: 15px; height: 15px; color: var(--muted); }
.tags-input-wrap input { flex: 1; height: 42px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.tag-suggestions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tag-suggestions > span { color: var(--muted); font-size: 9px; }
.tag-suggestion { color: var(--muted); font-size: 9px; padding: 3px 7px; border-radius: 5px; background: var(--surface-soft); }
.tag-suggestion:hover { color: var(--accent); background: var(--accent-soft); }
.upload-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-top: 4px; }
.upload-grid:empty { display: none; }
.upload-item { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: var(--surface-soft); }
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(18, 24, 21, 0.65);
  color: #fff;
}
.upload-remove .icon { width: 11px; height: 11px; }
.compose-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
}
.draft-status { margin-left: auto; color: var(--muted); font-size: 9px; }
.compose-submit { min-width: 132px; }
.draft-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  background: var(--accent-soft);
}
.draft-banner > .icon { width: 17px; height: 17px; color: var(--accent); }
.draft-banner > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.draft-banner strong { font-size: 11px; }
.draft-banner span { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-tips ol { display: flex; flex-direction: column; gap: 12px; counter-reset: tip; }
.compose-tips li { position: relative; padding-left: 25px; }
.compose-tips li::before {
  counter-increment: tip;
  content: counter(tip, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
}
.compose-tips li strong { display: block; font-size: 11px; font-weight: 600; }
.compose-tips li span { display: block; color: var(--muted); font-size: 9px; line-height: 1.65; margin-top: 1px; }

/* ---------------------------------------------------------
   Profile
   --------------------------------------------------------- */
.profile-page { max-width: 900px; }
.profile-hero {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.profile-cover {
  position: relative;
  height: 154px;
  overflow: hidden;
  background:
    radial-gradient(400px 180px at 78% 40%, rgba(255, 255, 255, 0.24), transparent 65%),
    linear-gradient(115deg, color-mix(in srgb, var(--profile-color) 78%, #5c7564), color-mix(in srgb, var(--profile-color) 34%, #e0d2b7));
}
.cover-circle { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); }
.cover-circle.c1 { width: 220px; height: 220px; right: 9%; top: -80px; }
.cover-circle.c2 { width: 120px; height: 120px; right: 28%; bottom: -60px; background: rgba(255, 255, 255, 0.08); }
.cover-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: linear-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to left, black, transparent 55%);
}
.cover-caption { position: absolute; right: 21px; bottom: 16px; color: rgba(255, 255, 255, 0.7); font-size: 8px; letter-spacing: 0.2em; }
.profile-head { position: relative; display: flex; gap: 18px; padding: 0 24px 22px; align-items: flex-start; }
.profile-avatar { margin-top: -46px; flex: 0 0 auto; border-radius: 50%; border: 5px solid var(--surface); background: var(--surface); box-shadow: var(--shadow-sm); }
.profile-avatar .avatar-xl { width: 104px; height: 104px; }
.profile-info { flex: 1; min-width: 0; padding-top: 13px; }
.profile-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.profile-name-row h1 { font-family: var(--serif); font-size: 27px; line-height: 1.3; letter-spacing: -0.01em; margin-right: 2px; }
.profile-handle { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--muted); font-size: 9px; margin-top: 2px; }
.profile-handle span { color: var(--line-strong); }
.profile-bio { margin-top: 8px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; max-width: 560px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta .icon { width: 12px; height: 12px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 16px; flex: 0 0 auto; }

.level-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 15px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.level-icon { width: 35px; height: 35px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--gold-soft); color: var(--gold); flex: 0 0 auto; }
.level-icon .icon { width: 18px; height: 18px; }
.level-main { flex: 1; min-width: 0; }
.level-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.level-line strong { font-size: 11px; font-weight: 650; }
.level-line span { color: var(--muted); font-size: 9px; }
.level-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--surface-soft); overflow: hidden; }
.level-bar span { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.level-main p { margin-top: 4px; color: var(--muted); font-size: 9px; }
.checkin-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  flex: 0 0 auto;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
}
.checkin-button small { color: var(--muted); font-size: 8px; font-weight: 400; }
.checkin-button:hover { border-color: var(--accent); }
.checkin-button.is-done { opacity: 0.65; background: var(--surface-soft); color: var(--muted); border-color: var(--line); }
.checkin-button .icon { width: 15px; height: 15px; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 12px;
  padding: 14px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.profile-stats > div { display: flex; flex-direction: column; align-items: center; gap: 1px; border-right: 1px solid var(--line); }
.profile-stats > div:last-child { border-right: 0; }
.profile-stats strong { font-family: var(--serif); font-size: 20px; line-height: 1.25; }
.profile-stats span { color: var(--muted); font-size: 9px; }

.profile-tabs {
  display: flex;
  gap: 3px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}
.profile-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 15px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
.profile-tab .icon { width: 15px; height: 15px; }
.profile-tab em { color: var(--muted); font-size: 9px; font-style: normal; background: var(--surface-soft); padding: 0 5px; border-radius: 5px; line-height: 16px; }
.profile-tab:hover { color: var(--ink); }
.profile-tab.is-active { color: var(--accent); }
.profile-tab.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
.profile-tab-body { padding-top: 16px; }
.activity-list { display: flex; flex-direction: column; gap: 9px; }
.activity-item {
  display: block;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.activity-item:hover { color: inherit; border-color: var(--line-strong); transform: translateY(-1px); }
.activity-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.activity-type { display: inline-flex; align-items: center; gap: 4px; }
.activity-type .icon { width: 12px; height: 12px; color: var(--accent); }
.activity-post { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; }
.activity-content { margin-top: 4px; color: var(--ink-soft); font-size: 11px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.activity-meta { display: flex; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.activity-meta span { display: inline-flex; align-items: center; gap: 3px; }
.activity-meta .icon { width: 11px; height: 11px; }

/* ---------------------------------------------------------
   Notifications
   --------------------------------------------------------- */
.notification-page { max-width: 840px; }
.notification-tabs { margin-top: 0; }
.notification-list { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.notification-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px 17px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: background 0.18s ease;
}
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: var(--surface-soft); color: var(--ink); }
.notification-item.is-unread { background: color-mix(in srgb, var(--accent-soft) 44%, var(--surface)); }
.notification-item.is-unread:hover { background: var(--accent-soft); }
.notification-icon { width: 26px; height: 26px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface-soft); color: var(--muted); }
.notification-icon .icon { width: 14px; height: 14px; }
.notification-icon.type-like { background: var(--danger-soft); color: var(--danger); }
.notification-icon.type-comment, .notification-icon.type-reply { background: var(--accent-soft); color: var(--accent); }
.notification-icon.type-report { background: var(--gold-soft); color: var(--gold); }
.notification-icon.type-notice { background: var(--info-soft); color: var(--info); }
.notification-brand { width: 40px; height: 40px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.notification-brand .icon { width: 18px; height: 18px; }
.notification-body { flex: 1; min-width: 0; }
.notification-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.notification-line strong { color: var(--ink); font-weight: 650; }
.notification-line span { word-break: break-word; }
.unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); display: inline-block; margin-left: 3px; }
.notification-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 3px; color: var(--muted); font-size: 9px; }
.notification-post { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.notification-arrow { margin-left: 4px; color: var(--line-strong); display: inline-flex; }
.notification-arrow .icon { width: 14px; height: 14px; }
.notification-item:hover .notification-arrow { color: var(--accent); }

/* ---------------------------------------------------------
   Admin
   --------------------------------------------------------- */
.admin-page { max-width: 1180px; margin: 0 auto; }
.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 22px;
}
.admin-head h1 { font-family: var(--serif); font-size: clamp(29px, 3.4vw, 40px); line-height: 1.3; letter-spacing: -0.025em; margin: 8px 0 5px; }
.admin-head p { color: var(--ink-soft); font-size: 12px; }
.admin-head p strong { color: var(--accent); }
.admin-head-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.admin-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}
.admin-tab .icon { width: 15px; height: 15px; }
.admin-tab:hover { background: var(--surface-soft); color: var(--ink); }
.admin-tab.is-active { background: var(--ink); color: var(--bg); }
.admin-tab.is-active .icon { color: var(--bg); }
.admin-tab em { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 9px; font-style: normal; }
.admin-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.admin-toolbar-right { margin-left: auto; display: flex; gap: 8px; }
.admin-filter-form { display: flex; align-items: center; gap: 7px; flex: 1; flex-wrap: wrap; }
.admin-search { position: relative; display: flex; align-items: center; width: min(310px, 100%); }
.admin-search .icon { position: absolute; left: 11px; width: 14px; height: 14px; color: var(--muted); }
.admin-search input {
  width: 100%;
  height: 34px;
  padding: 0 11px 0 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  font-size: 11px;
}
.admin-search input:focus { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.admin-filter-form select,
.admin-toolbar select {
  height: 34px;
  padding: 0 28px 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  outline: 0;
}
.admin-report-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.admin-report-tabs a { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 550; }
.admin-report-tabs a:hover { background: var(--surface-soft); color: var(--ink); }
.admin-report-tabs a.is-active { background: var(--ink); color: var(--bg); }
.admin-body { margin-top: 14px; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.admin-stat-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.admin-stat-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); color: inherit; }
.admin-stat-card.is-alert { border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.admin-stat-icon { width: 33px; height: 33px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.admin-stat-icon .icon { width: 16px; height: 16px; }
.admin-stat-card.is-alert .admin-stat-icon { background: var(--danger-soft); color: var(--danger); }
.admin-stat-card > div { display: flex; flex-direction: column; line-height: 1.35; }
.admin-stat-label { color: var(--muted); font-size: 9px; }
.admin-stat-card strong { font-family: var(--serif); font-size: 24px; line-height: 1.25; font-weight: 700; }
.admin-stat-card small { color: var(--muted); font-size: 9px; }
.admin-stat-arrow { position: absolute; right: 12px; top: 14px; color: var(--line-strong); }
.admin-stat-arrow .icon { width: 13px; height: 13px; }

.admin-overview-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 11px; margin-top: 11px; }
.admin-panel {
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { font-size: 12px; font-weight: 650; }
.panel-head p { color: var(--muted); font-size: 9px; margin-top: 2px; }
.panel-link { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.panel-link:hover { color: var(--accent); }
.panel-link .icon { width: 11px; height: 11px; }
.panel-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.panel-hint .icon { width: 12px; height: 12px; }
.panel-empty { display: flex; align-items: center; gap: 6px; padding: 20px 0; color: var(--muted); font-size: 10px; }
.panel-empty .icon { width: 16px; height: 16px; color: var(--accent); }
.chart-legend { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend span::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.chart-legend .legend-comments::before { background: var(--gold); }
.bar-chart { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; height: 190px; padding-top: 8px; }
.bar-column { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-stack { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.bar { width: 10px; border-radius: 3px 3px 1px 1px; transition: filter 0.18s ease; }
.bar:hover { filter: brightness(1.1); }
.bar-posts { background: var(--accent); }
.bar-comments { background: color-mix(in srgb, var(--gold) 75%, var(--surface)); }
.bar-label { color: var(--muted); font-size: 8px; }

.category-bars { display: flex; flex-direction: column; gap: 10px; }
.category-bar-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 24px; gap: 7px; align-items: center; }
.category-bar-label { color: var(--ink-soft); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-bar-track { height: 6px; border-radius: 3px; background: var(--surface-soft); overflow: hidden; }
.category-bar-track span { display: block; height: 100%; border-radius: 3px; }
.category-bar-row em { color: var(--muted); font-size: 9px; text-align: right; font-style: normal; }

.admin-compact-list { display: flex; flex-direction: column; gap: 1px; }
.compact-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.compact-item:last-child { border-bottom: 0; }
.compact-item:hover { color: inherit; }
.compact-item .mini-badge { width: fit-content; margin-bottom: 1px; }
.compact-item strong { font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-item small { color: var(--muted); font-size: 8px; }
.compact-item:hover strong { color: var(--accent); }

.admin-timeline { display: flex; flex-direction: column; gap: 11px; }
.timeline-item { position: relative; padding-left: 14px; }
.timeline-item::before { content: ""; position: absolute; left: 1px; top: 5px; width: 1px; bottom: -6px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; left: -2px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.timeline-item strong { display: block; font-size: 9px; font-weight: 600; }
.timeline-item p { color: var(--muted); font-size: 9px; line-height: 1.55; margin-top: 1px; }
.timeline-item time { color: color-mix(in srgb, var(--muted) 75%, transparent); font-size: 8px; }

.admin-list-panel { padding: 18px; }
.admin-table { display: flex; flex-direction: column; overflow-x: auto; }
.admin-table-head, .admin-table-row { display: grid; align-items: center; gap: 10px; min-width: 860px; }
.admin-table-head {
  padding: 0 6px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
}
.admin-table-row { padding: 11px 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); font-size: 10px; }
.admin-table-row:last-child { border-bottom: 0; }
.admin-table-row:hover { background: color-mix(in srgb, var(--surface-soft) 45%, transparent); }
.user-admin-table .admin-table-head, .user-admin-table .admin-table-row { grid-template-columns: minmax(190px, 1.4fr) 92px 82px minmax(125px, 1fr) 135px 85px; }
.post-admin-table .admin-table-head, .post-admin-table .admin-table-row { grid-template-columns: minmax(240px, 2fr) 90px 78px minmax(160px, 1.2fr) 126px 78px; }
.admin-user-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.admin-user-cell > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.admin-user-cell strong { font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-cell span { color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-count-cell { color: var(--ink-soft); font-size: 9px; white-space: nowrap; }
.admin-count-cell strong { color: var(--ink); font-weight: 600; }
.admin-date-cell { color: var(--muted); font-size: 8px; white-space: nowrap; }
.admin-row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.admin-row-actions .icon-btn { width: 27px; height: 27px; border-radius: 7px; }
.admin-row-actions .icon-btn .icon { width: 14px; height: 14px; }
.admin-post-cell { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.admin-post-cell a { font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-post-cell > span { color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-author-cell { color: var(--ink-soft); font-size: 9px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.page-btn { min-width: 28px; height: 28px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); font-size: 10px; background: var(--surface); }
.page-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.page-btn.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.page-btn.is-disabled { pointer-events: none; opacity: 0.35; }
.page-btn .icon { width: 13px; height: 13px; }
.page-info { color: var(--muted); font-size: 9px; margin-left: 4px; }

.report-admin-list { display: flex; flex-direction: column; gap: 9px; }
.report-admin-card { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); overflow: hidden; }
.report-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 13px; background: var(--surface-soft); }
.report-reason { display: inline-flex; align-items: center; gap: 5px; color: var(--danger); font-size: 10px; font-weight: 600; }
.report-reason .icon { width: 13px; height: 13px; }
.report-card-head > div:last-child { display: flex; align-items: center; gap: 8px; }
.report-card-head time { color: var(--muted); font-size: 8px; }
.report-card-body { padding: 12px 13px; }
.report-target { display: flex; flex-direction: column; gap: 2px; }
.report-target-label { color: var(--muted); font-size: 8px; letter-spacing: 0.05em; }
.report-target a { font-size: 11px; font-weight: 600; }
.report-target p { margin-top: 3px; padding: 7px 9px; border-radius: 7px; background: var(--surface-soft); color: var(--ink-soft); font-size: 10px; }
.report-detail { margin-top: 8px; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.report-byline { margin-top: 8px; color: var(--muted); font-size: 8px; }
.report-card-actions { display: flex; justify-content: flex-end; gap: 5px; padding: 8px 13px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-soft) 40%, transparent); }

.admin-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.admin-category-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.admin-category-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 9px; background: color-mix(in srgb, var(--cat-color) 10%, var(--surface)); font-size: 16px; }
.admin-category-main { flex: 1; min-width: 0; }
.admin-category-title { display: flex; align-items: baseline; gap: 8px; }
.admin-category-title strong { font-size: 11px; }
.admin-category-title span { color: var(--muted); font-size: 8px; }
.admin-category-main p { color: var(--muted); font-size: 9px; line-height: 1.6; margin-top: 2px; }
.admin-category-meta { display: flex; gap: 9px; margin-top: 5px; color: var(--muted); font-size: 8px; }
.admin-category-actions { display: flex; gap: 2px; flex: 0 0 auto; }
.admin-category-actions .icon-btn { width: 27px; height: 27px; }
.admin-category-actions .icon-btn .icon { width: 13px; height: 13px; }

.announcement-admin-list { display: flex; flex-direction: column; }
.announcement-admin-row { display: flex; align-items: flex-start; gap: 11px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.announcement-admin-row:last-child { border-bottom: 0; }
.announcement-admin-icon { width: 29px; height: 29px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.announcement-admin-icon.is-important { background: var(--gold-soft); color: var(--gold); }
.announcement-admin-icon .icon { width: 14px; height: 14px; }
.announcement-admin-main { flex: 1; min-width: 0; }
.announcement-admin-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.announcement-admin-title strong { font-size: 11px; }
.announcement-admin-main p { color: var(--muted); font-size: 9px; line-height: 1.6; margin-top: 3px; }
.announcement-admin-time { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.announcement-admin-row .admin-row-actions { align-self: center; }

/* ---------------------------------------------------------
   Modals
   --------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 24, 21, 0.48);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-backdrop.is-visible { opacity: 1; }
.modal {
  width: min(480px, 100%);
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.99);
  transition: transform 0.2s ease;
}
.modal-backdrop.is-visible .modal { transform: translateY(0) scale(1); }
.modal-wide { width: min(620px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 19px 20px 13px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.modal-head p { color: var(--muted); font-size: 10px; margin-top: 3px; }
.modal-close { flex: 0 0 auto; width: 30px; height: 30px; margin-top: -3px; margin-right: -4px; }
.modal-close .icon { width: 16px; height: 16px; }
.modal-body { padding: 17px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 12px 20px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot-spacer { flex: 1; }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.confirm-message { color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.modal-post-preview { padding: 11px 12px; margin-bottom: 13px; border-radius: 9px; background: var(--surface-soft); border: 1px solid var(--line); }
.modal-post-preview p { color: var(--ink-soft); font-size: 11px; line-height: 1.7; margin: 5px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.modal-post-preview > span:last-child { color: var(--muted); font-size: 8px; }
.security-note { display: flex; align-items: flex-start; gap: 6px; padding: 9px 10px; border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 9px; line-height: 1.6; }
.security-note .icon { width: 13px; height: 13px; flex: 0 0 auto; color: var(--gold); margin-top: 1px; }
.user-admin-summary { display: flex; align-items: flex-start; gap: 12px; padding: 12px; margin-bottom: 14px; border-radius: 10px; background: var(--surface-soft); }
.user-admin-summary > div { flex: 1; min-width: 0; }
.user-admin-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; font-weight: 650; }
.user-admin-summary p { color: var(--ink-soft); font-size: 10px; line-height: 1.6; margin-top: 3px; }
.user-admin-summary > div > span { color: var(--muted); font-size: 8px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row > div { display: flex; flex-direction: column; }
.toggle-row strong { font-size: 11px; font-weight: 600; }
.toggle-row span { color: var(--muted); font-size: 8px; margin-top: 1px; }
.switch { position: relative; width: 36px; height: 21px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background 0.18s ease; margin: 0; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.18s ease; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.inline-select { height: 32px; padding: 0 26px 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 10px; outline: 0; }
.reason-list { display: flex; flex-direction: column; gap: 6px; }
.reason-list legend { margin-bottom: 5px; color: var(--ink); font-size: 11px; font-weight: 600; }
.reason-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 11px; color: var(--ink-soft); }
.reason-option:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); color: var(--accent); }
.reason-option input { accent-color: var(--accent); }
.report-modal-target { padding: 12px; margin-bottom: 13px; border-radius: 9px; background: var(--surface-soft); }
.report-modal-target strong { display: block; margin-top: 5px; font-size: 12px; }
.report-modal-target p { color: var(--ink-soft); font-size: 10px; line-height: 1.7; margin-top: 4px; }
.report-modal-target > span { color: var(--muted); font-size: 8px; }
.avatar-edit-row { display: flex; align-items: center; gap: 14px; padding-bottom: 4px; }
.avatar-edit-row > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.avatar-edit-row .form-hint { width: 100%; margin-top: 1px; }
.image-lightbox { display: flex; justify-content: center; align-items: center; min-height: 160px; }
.image-lightbox img { max-height: 70vh; width: auto; max-width: 100%; border-radius: 10px; object-fit: contain; }

/* ---------------------------------------------------------
   Forms globally
   --------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.field > span em { color: var(--muted); font-size: 8px; font-weight: 400; font-style: normal; }
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  font-size: 12px;
  line-height: 1.6;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[type="color"] { padding: 3px; height: 36px; cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-foot { display: flex; justify-content: space-between; }
.check-line { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; cursor: pointer; }
.check-line input { margin-top: 2px; accent-color: var(--accent); }
.password-wrap { position: relative; display: flex; width: 100%; }
.password-wrap input { padding-right: 38px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 29px; height: 29px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 6px; }
.password-toggle:hover { color: var(--ink); background: var(--surface-soft); }
.password-toggle .icon { width: 15px; height: 15px; }
.password-toggle.is-active { color: var(--accent); }

/* ---------------------------------------------------------
   Toasts / empty states
   --------------------------------------------------------- */
#toast-root {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast .icon { width: 16px; height: 16px; flex: 0 0 auto; }
.toast-success .icon { color: #8fd4b6; }
.toast-error { background: var(--danger); color: #fff; }
.toast-error .icon { color: #ffe1dc; }
.toast-info { background: var(--info); color: #fff; }
.toast-info .icon { color: #dbeafd; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 58px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.empty-icon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--surface-soft); color: var(--muted); margin-bottom: 3px; }
.empty-icon .icon { width: 21px; height: 21px; }
.empty-state h3 { font-size: 14px; font-weight: 600; }
.empty-state p { max-width: 420px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.empty-state .btn { margin-top: 7px; }

.page-error { padding-top: 20px; }
.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 300;
  padding: 13px 16px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}

/* ---------------------------------------------------------
   Auth
   --------------------------------------------------------- */
body.auth-mode { background: var(--bg); }
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  background: var(--bg);
}
.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 34px 38px 30px;
  overflow: hidden;
  background:
    radial-gradient(680px 430px at 80% 14%, rgba(213, 189, 145, 0.24), transparent 65%),
    radial-gradient(540px 400px at 15% 85%, rgba(94, 137, 116, 0.28), transparent 70%),
    #1c3a32;
  color: #f0f2e9;
}
.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 0.6px, transparent 0.6px);
  background-size: 7px 7px;
}
.auth-art-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.auth-brand { color: #f0f2e9; }
.auth-brand:hover { color: #fff; }
.auth-brand .brand-mark { background: rgba(240, 242, 233, 0.12); color: #f0f2e9; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px); }
.auth-brand .brand-text small { color: rgba(240, 242, 233, 0.5); }
.auth-season { color: rgba(240, 242, 233, 0.48); font-family: var(--serif); font-size: 10px; letter-spacing: 0.18em; }
.auth-quote { position: relative; z-index: 2; max-width: 500px; margin: auto 0; padding: 42px 0; }
.auth-quote .quote-mark { position: static; display: block; color: rgba(218, 193, 149, 0.42); font-size: 66px; line-height: 0.7; margin-bottom: 16px; }
.auth-quote h1 {
  font-family: var(--serif);
  color: #f4f1e7;
  font-size: clamp(31px, 3.5vw, 48px);
  line-height: 1.45;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.auth-quote p { max-width: 390px; margin-top: 17px; color: rgba(236, 239, 230, 0.62); font-size: 12px; line-height: 1.9; }
.auth-art-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(248, 244, 233, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(8px);
}
.auth-art-avatars { display: flex; }
.auth-art-avatars span {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font-family: var(--serif);
  font-size: 10px;
  border: 2px solid #29483f;
}
.auth-art-avatars span:first-child { margin-left: 0; }
.auth-art-card p { font-size: 9px; color: rgba(240, 242, 233, 0.55); }
.auth-art-card strong { color: rgba(246, 243, 233, 0.9); font-weight: 600; }
.auth-art-lines { position: absolute; left: 38px; right: 38px; bottom: 142px; z-index: 1; display: flex; flex-direction: column; gap: 10px; opacity: 0.18; }
.auth-art-lines span { height: 1px; background: linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 70%); }
.auth-art-lines span:nth-child(2) { width: 82%; }
.auth-art-lines span:nth-child(3) { width: 62%; }
.auth-art-sun {
  position: absolute;
  right: 12%;
  top: 19%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1px solid rgba(220, 196, 151, 0.2);
  box-shadow: inset 0 0 60px rgba(220, 196, 151, 0.06);
}
.auth-art-sun::after { content: ""; position: absolute; inset: 38px; border-radius: 50%; border: 1px solid rgba(220, 196, 151, 0.15); }
.auth-art-caption { position: absolute; right: 20px; bottom: 50%; transform: translateY(50%) rotate(90deg); transform-origin: right center; z-index: 2; color: rgba(240, 242, 233, 0.22); font-size: 8px; letter-spacing: 0.3em; }

.auth-panel { display: flex; flex-direction: column; min-height: 100vh; padding: 24px 40px 18px; }
.auth-mobile-head { display: none; align-items: center; justify-content: space-between; }
.auth-panel-inner { width: min(400px, 100%); margin: auto; padding: 30px 0; }
.auth-back-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.auth-back-row .text-link { color: var(--muted); }
.auth-back-row .text-link:hover { color: var(--accent); }
.auth-back-row .icon-btn { width: 32px; height: 32px; }
.auth-form { display: flex; flex-direction: column; }
.auth-form h2 { font-family: var(--serif); font-size: 33px; line-height: 1.35; letter-spacing: -0.02em; margin: 9px 0 7px; }
.auth-sub { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.auth-form .field { margin-bottom: 14px; }
.auth-form .field > span { color: var(--ink-soft); font-size: 11px; }
.auth-form .field input { height: 42px; font-size: 13px; background: var(--surface); }
.auth-error { margin-bottom: 14px; padding: 9px 11px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 11px; line-height: 1.6; }
.auth-submit { width: 100%; height: 44px; margin-top: 6px; font-size: 13px; }


.auth-switch { display: inline-flex; align-items: center; gap: 4px; margin-top: 22px; color: var(--ink-soft); font-size: 11px; width: fit-content; }
.auth-switch:hover { color: var(--accent); }
.auth-switch .icon { width: 13px; height: 13px; }
.auth-legal { margin-top: 26px; color: var(--muted); font-size: 9px; line-height: 1.7; }
.auth-footer { color: var(--muted); font-size: 8px; letter-spacing: 0.03em; text-align: center; padding-top: 10px; }
.auth-form .field-row .field { margin-bottom: 14px; }
.auth-form .check-line { margin: 0 0 10px; }
.auth-error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 30px; }

.admin-comment-list { display: flex; flex-direction: column; }
.admin-comment-row { padding: 13px 4px; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.admin-comment-row:last-child { border-bottom: 0; }
.admin-comment-author { display: flex; align-items: center; gap: 8px; }
.admin-comment-author > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.admin-comment-author strong { font-size: 11px; font-weight: 600; }
.admin-comment-author span { color: var(--muted); font-size: 9px; }
.admin-comment-author .status-badge { margin-left: auto; }
.admin-comment-content { margin: 7px 0 7px 40px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; word-break: break-word; }
.admin-comment-content em { font-style: normal; }
.admin-comment-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-left: 40px; color: var(--muted); font-size: 9px; }
.admin-comment-bottom > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-comment-bottom .icon { width: 12px; height: 12px; }
.admin-comment-bottom a { color: var(--ink-soft); }
.admin-comment-bottom a:hover { color: var(--accent); }
.admin-comment-bottom .admin-row-actions { margin-left: auto; }

/* Readability pass: keep supporting copy small, but never illegible. */
.post-time { font-size: 11px; }
.author-name { font-size: 12.5px; }
.post-stat { font-size: 11.5px; }
.rail-head h2 { font-size: 12.5px; }
.notice-title strong { font-size: 11.5px; }
.notice-item p { font-size: 10.5px; }
.hot-body a { font-size: 11.5px; }
.user-mini-text strong { font-size: 11.5px; }
.user-mini-text small { font-size: 9.5px; }
.related-item strong { font-size: 11.5px; }
.community-rules li { font-size: 10.5px; }
.post-detail-meta { font-size: 11.5px; }
.comment-head time { font-size: 10px; }
.comment-content { font-size: 13px; }
.comment-action { font-size: 10px; }
.user-card-name strong { font-size: 13.5px; }
.user-handle { font-size: 9.5px; }
.user-bio { font-size: 10.5px; }
.user-card-meta { font-size: 9.5px; }
.category-card p { font-size: 10.5px; }
.cloud-tag { font-size: 11.5px; }
.stats-band span { font-size: 9.5px; }
.activity-content { font-size: 11.5px; }
.notification-line { font-size: 12.5px; }
.notification-meta { font-size: 9.5px; }
.admin-tab { font-size: 11.5px; }
.admin-stat-label { font-size: 9.5px; }
.admin-stat-card small { font-size: 9.5px; }
.panel-head h2 { font-size: 12.5px; }
.panel-head p { font-size: 9.5px; }
.admin-table-head { font-size: 8.5px; }
.admin-table-row { font-size: 10.5px; }
.admin-user-cell strong { font-size: 10.5px; }
.admin-count-cell { font-size: 9.5px; }
.admin-date-cell { font-size: 8.5px; }
.admin-post-cell a { font-size: 10.5px; }
.report-target a { font-size: 11.5px; }
.report-detail { font-size: 10.5px; }
.report-target p { font-size: 10.5px; }
.admin-category-main p { font-size: 9.5px; }

/* ---------------------------------------------------------
   Campus chat room
   --------------------------------------------------------- */
.chat-page { max-width: 900px; margin: 0 auto; }
.chat-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 5px 0 18px;
}
.chat-head h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 42px); line-height: 1.25; letter-spacing: -0.025em; margin: 7px 0 4px; }
.chat-head p { color: var(--ink-soft); font-size: 12px; }
.chat-presence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}
.chat-presence strong { color: var(--ink); font-family: var(--serif); font-size: 17px; }
.chat-live-dot, .chat-aside-count i {
  width: 7px; height: 7px; border-radius: 50%; background: #4ca87a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #4ca87a 17%, transparent);
}
.chat-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 226px);
  min-height: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.chat-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 75%, var(--surface-soft));
}
.chat-shell-head > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.chat-room-icon { width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.chat-room-icon .icon { width: 15px; height: 15px; }
.chat-shell-head strong { font-size: 12px; }
.chat-shell-head small { color: var(--muted); font-size: 9px; }
.chat-poll-hint { color: var(--muted); font-size: 9px; white-space: nowrap; }
.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.chat-message { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 15px; position: relative; }
.chat-message .avatar { margin-top: 1px; }
.chat-message-main { max-width: min(74%, 570px); min-width: 0; }
.chat-message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 0 3px 4px; color: var(--muted); font-size: 9px; }
.chat-message-meta strong { color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.chat-message-meta time { margin-left: 2px; color: var(--muted); }
.chat-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
  white-space: normal;
}
.chat-message.is-self { flex-direction: row-reverse; }
.chat-message.is-self .chat-message-main { display: flex; flex-direction: column; align-items: flex-end; }
.chat-message.is-self .chat-message-meta { flex-direction: row-reverse; }
.chat-message.is-self .chat-bubble {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 12px 4px 12px 12px;
  background: var(--accent-soft);
  color: var(--ink);
}
.chat-message.is-deleted .chat-bubble { background: transparent; border-style: dashed; }
.chat-deleted { color: var(--muted); font-size: 10px; font-style: normal; }
.chat-delete {
  align-self: center;
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  opacity: 0; cursor: pointer; transition: opacity 0.15s ease, color 0.15s ease;
}
.chat-message:hover .chat-delete { opacity: 1; }
.chat-delete:hover { color: var(--danger); background: var(--danger-soft); }
.chat-delete .icon { width: 13px; height: 13px; }
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.chat-composer > .avatar { margin-bottom: 4px; }
.chat-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 8px 45px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.chat-input-wrap:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-input-wrap textarea {
  display: block;
  width: 100%;
  min-height: 24px;
  max-height: 120px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
}
.chat-input-wrap textarea::placeholder { color: var(--muted); }
.chat-input-count { position: absolute; right: 9px; bottom: 5px; color: var(--muted); font-size: 8px; }
.chat-input-count em { font-style: normal; }
.chat-send {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  cursor: pointer; transition: transform 0.15s ease, opacity 0.15s ease;
}
.chat-send:hover { transform: translateY(-1px); }
.chat-send:disabled { opacity: 0.45; cursor: default; transform: none; }
.chat-send .icon { width: 17px; height: 17px; }
.chat-aside-card { padding: 14px; }
.chat-aside-count { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.chat-online-list { display: flex; flex-direction: column; gap: 2px; }
.chat-online-user { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-radius: 8px; color: var(--ink-soft); }
.chat-online-user:hover { background: var(--surface-soft); color: var(--ink); }
.chat-online-user > span { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.chat-online-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.chat-online-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.chat-online-user > i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #4ca87a; }
.chat-aside-empty { color: var(--muted); font-size: 10px; line-height: 1.6; }
.chat-rules { display: flex; flex-direction: column; gap: 7px; padding: 0; margin: 0; list-style: none; }
.chat-rules li { position: relative; padding-left: 12px; color: var(--muted); font-size: 9px; line-height: 1.65; }
.chat-rules li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.chat-back-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; color: var(--muted); font-size: 9px; }
.chat-back-link:hover { color: var(--accent); }
.chat-back-link .icon { width: 13px; height: 13px; }
.chat-entry-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 11px 13px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 11px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}
.chat-entry-banner span { color: var(--ink-soft); font-weight: 400; font-size: 10px; }
.chat-entry-banner .icon { width: 16px; height: 16px; }
.chat-entry-arrow { margin-left: auto; }

/* ---------------------------------------------------------
   App management
   --------------------------------------------------------- */
.admin-app-grid { display: grid; grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.2fr); gap: 11px; }
.app-preview-panel { display: flex; flex-direction: column; }
.app-phone-preview { border: 1px solid var(--line); border-radius: 17px; background: var(--bg); overflow: hidden; margin: 2px auto 14px; width: min(100%, 270px); box-shadow: 0 12px 28px rgba(32, 47, 40, 0.09); }
.app-phone-top { display: flex; align-items: center; gap: 7px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.app-phone-top .brand-mark { width: 27px; height: 27px; font-size: 13px; border-radius: 8px; }
.app-phone-top div { display: flex; flex-direction: column; line-height: 1.3; }
.app-phone-top strong { font-size: 11px; }
.app-phone-top small { color: var(--muted); font-size: 8px; }
.app-phone-body { padding: 16px 14px 20px; background: linear-gradient(145deg, var(--accent-soft), var(--surface) 70%); }
.app-phone-eyebrow { color: var(--accent); font-size: 7px; letter-spacing: 0.16em; }
.app-phone-body h3 { margin: 7px 0 5px; font-family: var(--serif); font-size: 18px; }
.app-phone-body p { color: var(--ink-soft); font-size: 9px; line-height: 1.65; min-height: 30px; }
.app-phone-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 11px; }
.app-phone-badges span { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 8px; }
.app-phone-badges .is-warn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.app-config-meta { margin-top: auto; display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 8px; }
.app-config-meta span { display: inline-flex; align-items: center; gap: 4px; }
.app-config-meta .icon { width: 12px; height: 12px; }
.app-config-meta code { padding: 1px 3px; border-radius: 3px; background: var(--surface-soft); font-size: 8px; }
.app-config-form .field { margin-bottom: 10px; }
.app-config-actions { display: flex; justify-content: flex-end; padding-top: 5px; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 1320px) {
  :root { --sidebar-w: 218px; --rail-w: 284px; }
  .app-layout { gap: 24px; padding: 0 22px; }
}

@media (max-width: 1180px) {
  .app-layout,
  .app-layout.no-rail { grid-template-columns: 218px minmax(0, 1fr); }
  .rail { display: none; }
  .home-hero { grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.6fr); }
  .hero-art { opacity: 0.85; }
}

@media (max-width: 980px) {
  :root { --sidebar-w: 205px; }
  .app-layout,
  .app-layout.no-rail { gap: 20px; padding: 0 18px; }
  .post-detail { padding: 26px 26px 0; }
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-overview-grid { grid-template-columns: 1fr; }
  .category-grid, .user-card-grid { grid-template-columns: 1fr; }
  .home-hero { grid-template-columns: 1fr; min-height: auto; padding: 30px; }
  .hero-art { position: absolute; right: -30px; bottom: -24px; width: 280px; height: 230px; min-height: 0; opacity: 0.45; pointer-events: none; }
  .hero-copy { max-width: 72%; }
  .auth-page { grid-template-columns: 0.9fr 1.1fr; }
  .auth-art { padding: 28px; }
  .auth-art-sun { right: 4%; }
}

@media (max-width: 860px) {
  .app-layout,
  .app-layout.no-rail { display: block; padding: 0; }
  .sidebar { display: none; }
  .topbar { height: 64px; padding: 0 16px; gap: 12px; }
  .mobile-brand { display: flex; flex: 0 0 auto; }
  .global-search { flex: 1; width: auto; max-width: none; height: 36px; padding-left: 31px; }
  .global-search .search-icon { left: 10px; }
  .global-search .search-icon .icon { width: 15px; height: 15px; }
  .global-search kbd { display: none; }
  .topbar-actions { gap: 4px; }
  .topbar-compose { display: none; }
  .theme-toggle { width: 32px; height: 32px; }
  .topbar-bell { width: 32px; height: 32px; }
  .topbar-account .avatar-md, .topbar-account .avatar-sm { width: 30px; height: 30px; }
  .page { padding: 18px 16px 98px; min-height: calc(100vh - 64px); }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: block;
    padding: 5px 12px calc(5px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px) saturate(130%);
    border-top: 1px solid var(--line);
  }
  .mobile-tabs-inner { display: flex; align-items: flex-end; justify-content: space-around; max-width: 520px; margin: 0 auto; }
  .mobile-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; padding: 5px 0 3px; color: var(--muted); font-size: 9px; }
  .mobile-tab .icon { width: 20px; height: 20px; }
  .mobile-tab.is-active { color: var(--accent); }
  .mobile-tab.is-active .icon { stroke-width: 2; }
  .mobile-tab-compose { flex: 0 0 64px; padding: 0; transform: translateY(-11px); }
  .mobile-compose-circle {
    width: 45px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 7px 18px rgba(47, 111, 94, 0.32);
  }
  .mobile-compose-circle .icon { width: 22px; height: 22px; }
  .mobile-badge { position: absolute; top: 2px; right: calc(50% - 18px); min-width: 16px; height: 16px; font-size: 8px; border: 2px solid var(--surface); }
  .post-page, .discover-page, .profile-page { max-width: none; }
  .page-heading h1, .discover-head h1, .admin-head h1 { font-size: 31px; }
  .post-detail { padding: 23px 20px 0; }
  .post-detail-head h1 { font-size: 25px; }
  .post-body { font-size: 14px; line-height: 1.95; padding-top: 21px; }
  .post-cover { height: 180px; }
  .author-spotlight { flex-wrap: wrap; }
  .author-spotlight .btn { margin-left: 74px; }
  .comments-section { padding: 20px 18px 24px; }
  .comments-head { align-items: flex-start; }
  .comment-replies { margin-left: 20px; padding-left: 10px; }
  .post-action-bar { align-items: flex-start; }
  .action-group:last-child { margin-left: auto; }
  .compose-form { padding: 4px 16px 16px; }
  .category-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compose-actions .draft-status { display: none; }
  .compose-submit { margin-left: auto; }
  .profile-head { padding: 0 18px 18px; gap: 14px; }
  .profile-cover { height: 128px; }
  .profile-avatar .avatar-xl { width: 86px; height: 86px; }
  .profile-avatar { margin-top: -38px; border-width: 4px; }
  .profile-name-row h1 { font-size: 23px; }
  .profile-info { padding-top: 8px; }
  .profile-actions { padding-top: 8px; }
  .profile-stats strong { font-size: 18px; }
  .profile-tab { padding: 0 10px; font-size: 11px; }
  .profile-tab em { display: none; }
  .level-card { padding: 13px; flex-wrap: wrap; }
  .checkin-button { width: 100%; justify-content: center; }
  .admin-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .admin-head-actions { align-self: stretch; }
  .admin-head-actions .btn { flex: 1; }
  .admin-app-grid { grid-template-columns: 1fr; }
  .app-preview-panel { order: 2; }
  .chat-shell { height: calc(100vh - 214px); min-height: 430px; }
  .chat-head h1 { font-size: 32px; }
  .chat-message-main { max-width: 82%; }
  .admin-tabs { border-radius: 10px; }
  .admin-tab { height: 31px; padding: 0 10px; font-size: 10px; }
  .admin-list-panel { padding: 14px; }
  .admin-filter-form { width: 100%; }
  .admin-search { flex: 1; min-width: 180px; width: auto; }
  .admin-category-grid { grid-template-columns: 1fr; }
  .announcement-admin-row { flex-wrap: wrap; }
  .announcement-admin-row .admin-row-actions { margin-left: 40px; }
  .notification-page { max-width: none; }
  .notification-item { padding: 13px; gap: 8px; }
  .notification-icon { display: none; }
  .notification-post { max-width: 180px; }
  .page-heading { align-items: flex-start; }
  .page-heading .btn { flex: 0 0 auto; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal, .modal-wide { width: 100%; max-height: 92vh; border-radius: 17px 17px 12px 12px; }
  .modal-body { padding: 15px 16px; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  #toast-root { bottom: 78px; }
  .field-row { grid-template-columns: 1fr; }
  .auth-page { display: block; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; padding: 18px 22px 12px; }
  .auth-mobile-head { display: flex; }
  .auth-panel-inner { width: min(420px, 100%); padding: 18px 0; }
  .auth-back-row { margin-bottom: 22px; }
  .auth-form h2 { font-size: 29px; }
  .auth-footer { margin-top: auto; }
  .desktop-theme { display: none; }
}

@media (max-width: 620px) {
  .global-search { display: none; }
  .topbar { justify-content: space-between; }
  .mobile-brand { margin-right: auto; }
  .topbar-actions { margin-left: 0; }
  .topbar-login { display: inline-flex; }
  .home-hero { padding: 24px 21px; border-radius: 18px; }
  .hero-copy h1 { font-size: 31px; }
  .hero-copy p { font-size: 12px; }
  .hero-copy { max-width: 82%; }
  .hero-actions { margin-top: 17px; }
  .hero-meta { display: none; }
  .hero-art { opacity: 0.32; right: -50px; width: 240px; }
  .announcement-strip { padding: 10px 12px; }
  .announcement-copy { flex-direction: column; gap: 1px; align-items: flex-start; }
  .announcement-copy span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  .announcement-tag { display: none; }
  .feed { margin-top: 20px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 20px; }
  .feed-sort-note { display: none; }
  .post-card { padding: 16px 15px 13px; border-radius: 15px; }
  .post-title { font-size: 17px; }
  .post-excerpt { font-size: 12px; }
  .post-cover { height: 150px; }
  .post-foot { align-items: flex-start; }
  .post-author-text { flex-direction: column; align-items: flex-start; gap: 2px; }
  .post-stats { gap: 9px; }
  .post-stat { font-size: 10px; }
  .post-stat .icon { width: 14px; height: 14px; }
  .filter-chip em { display: none; }
  .discover-head { padding-top: 8px; }
  .discover-head h1 { font-size: 32px; }
  .discover-search { flex-wrap: nowrap; padding: 5px 5px 5px 36px; }
  .discover-search .search-icon { left: 12px; }
  .discover-search .btn { padding: 0 12px; }
  .category-card { min-height: 92px; padding: 14px; }
  .category-card-count { display: none; }
  .stats-band { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  .stats-band > div:nth-child(2) { border-right: 0; }
  .tag-cloud { gap: 6px; }
  .cloud-tag.size-lg { font-size: 14px; padding: 7px 10px; }
  .user-card { padding: 13px; }
  .user-card .avatar-lg { width: 46px; height: 46px; font-size: 17px; }
  .user-card-arrow { display: none; }
  .search-summary { flex-direction: column; align-items: flex-start; gap: 4px; }
  .compact-head { flex-direction: column; align-items: flex-start; }
  .compact-head h1 { font-size: 28px; }
  .back-row { gap: 8px; }
  .post-detail { padding: 19px 15px 0; border-radius: 16px; }
  .post-detail-head h1 { font-size: 22px; margin-bottom: 13px; }
  .post-detail-meta { gap: 9px; }
  .post-detail-meta .meta-sep { display: none; }
  .detail-author { width: 100%; margin-bottom: 2px; }
  .post-body { font-size: 14px; line-height: 1.95; }
  .post-action-bar { padding: 11px 0; }
  .action-btn span { display: none; }
  .action-btn { padding: 0 8px; height: 30px; }
  .action-btn em { font-size: 9px; }
  .manage-btn span { display: inline; }
  .author-spotlight { padding: 15px; }
  .author-spotlight .avatar-lg { width: 48px; height: 48px; font-size: 18px; }
  .author-spotlight .btn { margin-left: 0; width: 100%; }
  .comments-section { padding: 17px 13px 20px; border-radius: 15px; }
  .comments-head h2 { font-size: 19px; }
  .comments-rule { display: none; }
  .comment-composer { padding: 10px; gap: 8px; }
  .comment-composer > .avatar { width: 32px; height: 32px; font-size: 12px; }
  .comment-head time { margin-left: 0; }
  .comment-replies { margin-left: 12px; padding-left: 8px; }
  .comment { padding: 13px 0; }
  .compose-page .back-row { margin-bottom: 9px; }
  .compose-head h1 { font-size: 30px; }
  .compose-form { border-radius: 16px; }
  .category-options { grid-template-columns: 1fr; }
  .category-option-inner { padding: 9px; }
  .category-option-inner small { display: none; }
  .form-section { padding: 17px 0; }
  .title-input { font-size: 16px; height: 49px; }
  .content-input { min-height: 210px; font-size: 13px; }
  .compose-actions { flex-wrap: wrap; }
  .compose-actions > .btn:first-child { order: 2; }
  .compose-actions .compose-submit { order: 1; flex: 1; }
  .profile-cover { height: 105px; }
  .profile-head { flex-wrap: wrap; padding: 0 14px 16px; }
  .profile-avatar .avatar-xl { width: 76px; height: 76px; font-size: 27px; }
  .profile-avatar { margin-top: -30px; }
  .profile-info { padding-top: 0; flex-basis: calc(100% - 92px); }
  .profile-name-row h1 { font-size: 21px; }
  .profile-handle { font-size: 8px; }
  .profile-bio { font-size: 11px; }
  .profile-actions { width: 100%; padding-top: 2px; }
  .profile-actions .btn { flex: 1; }
  .profile-stats { padding: 12px 0; }
  .profile-stats > div:nth-child(3) { border-right: 0; }
  .profile-stats strong { font-size: 17px; }
  .profile-stats span { font-size: 8px; }
  .profile-tabs { overflow-x: auto; scrollbar-width: none; }
  .profile-tabs::-webkit-scrollbar { display: none; }
  .level-card { gap: 9px; }
  .checkin-button { height: 36px; }
  .notification-item { padding: 12px; }
  .notification-line { font-size: 11px; }
  .notification-meta { gap: 5px; }
  .notification-arrow { display: none; }
  .page-heading { flex-direction: column; gap: 10px; }
  .page-heading .btn { align-self: flex-start; }
  .notification-list { border-radius: 13px; }
  .chat-head { align-items: flex-start; flex-direction: column; gap: 8px; padding-bottom: 12px; }
  .chat-head h1 { font-size: 30px; }
  .chat-presence { align-self: flex-start; padding: 6px 9px; }
  .chat-shell { height: calc(100dvh - 230px); min-height: 390px; border-radius: 14px; }
  .chat-shell-head { padding: 10px 12px; }
  .chat-poll-hint { display: none; }
  .chat-stream { padding: 14px 12px 8px; }
  .chat-message { gap: 7px; margin-bottom: 12px; }
  .chat-message-main { max-width: 82%; }
  .chat-bubble { padding: 8px 10px; font-size: 11px; }
  .chat-composer { padding: 9px 10px; gap: 6px; }
  .chat-composer > .avatar { display: none; }
  .chat-input-wrap { padding-right: 38px; }
  .chat-send { width: 34px; height: 34px; }
  .admin-app-grid { gap: 8px; }
  .app-phone-preview { width: min(100%, 245px); }
  .admin-head h1 { font-size: 27px; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .admin-stat-card { padding: 12px; gap: 8px; }
  .admin-stat-icon { width: 28px; height: 28px; }
  .admin-stat-icon .icon { width: 14px; height: 14px; }
  .admin-stat-card strong { font-size: 20px; }
  .admin-stat-card small { font-size: 8px; }
  .admin-stat-arrow { display: none; }
  .admin-panel { padding: 14px; }
  .bar-chart { height: 160px; }
  .bar-stack { height: 130px; }
  .bar { width: 7px; }
  .admin-tabs { padding: 3px; }
  .admin-tab { gap: 4px; padding: 0 8px; }
  .admin-tab .icon { width: 13px; height: 13px; }
  .admin-head-actions .btn { font-size: 11px; padding: 0 10px; }
  .admin-category-title { flex-wrap: wrap; }
  .modal-head h2 { font-size: 15px; }
  .btn { min-height: 38px; }
  .btn-sm { min-height: 32px; }
  .auth-panel { padding: 16px 18px 10px; }
  .auth-form h2 { font-size: 27px; }
  .auth-form .field-row { grid-template-columns: 1fr; gap: 0; }
  .auth-form .field-row .field { margin-bottom: 14px; }
  .auth-legal { margin-top: 18px; }
  .auth-art-card { display: none; }
  .toast { font-size: 11px; padding: 9px 12px; }
  .image-lightbox img { max-height: 60vh; }
}

@media (max-width: 380px) {
  .post-stats > .post-stat:first-child { display: none; }
  .hero-copy { max-width: 100%; }
  .hero-art { display: none; }
  .admin-stat-grid { grid-template-columns: 1fr; }
  .profile-tab { padding: 0 8px; }
}

/* ---------------------------------------------------------------------------
   Feedback & administration additions
--------------------------------------------------------------------------- */
.feedback-page { display: flex; flex-direction: column; gap: 20px; }
.feedback-head h1 { margin: 6px 0 8px; font-size: clamp(24px, 3vw, 34px); }
.feedback-head p { margin: 0; max-width: 720px; color: var(--ink-soft); }
.feedback-pending { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); font-size: 12px; }
.feedback-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.feedback-form-panel, .feedback-list-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feedback-form-panel h2, .feedback-list-head h2 { margin: 0 0 14px; font-size: 17px; }
.feedback-list-head { display: flex; align-items: baseline; justify-content: space-between; }
.feedback-list-head span { color: var(--ink-soft); font-size: 12px; }
.feedback-list { display: flex; flex-direction: column; gap: 12px; }
.feedback-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.feedback-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.feedback-card-head strong { font-size: 15px; }
.feedback-card-head time { margin-left: auto; color: var(--ink-soft); font-size: 11px; }
.feedback-card > p { margin: 8px 0 0; color: var(--ink-soft); white-space: pre-wrap; }
.feedback-reply { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.feedback-reply strong { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.feedback-reply p { margin: 4px 0; white-space: pre-wrap; }
.feedback-reply span { color: var(--ink-soft); font-size: 11px; }
.status-open { color: #a05a1f; background: #fbf0e2; }
.status-processing { color: #2f5f8a; background: #e8f1f8; }
.status-resolved { color: #2f6f5e; background: #e6f1ec; }
.status-closed { color: var(--ink-soft); background: var(--surface-2); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.role-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.role-group-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.role-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.role-group-head div { display: flex; flex-direction: column; gap: 2px; }
.role-group-head strong { font-size: 15px; }
.role-group-head span { color: var(--ink-soft); font-size: 11px; }
.role-group-card p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.role-perm-list { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { padding: 3px 8px; border-radius: 999px; background: var(--surface-2); font-size: 11px; }
.perm-chip.is-admin { background: #2f6f5e; color: #fff; }
.role-perm-empty { color: var(--ink-soft); font-size: 11px; }
.role-group-actions { display: flex; gap: 8px; margin-top: auto; }
.perm-check-list { display: flex; flex-direction: column; gap: 8px; }
.perm-check { display: flex; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; }
.perm-check input { margin-top: 3px; }
.perm-check span { display: flex; flex-direction: column; gap: 2px; }
.perm-check strong { font-size: 13px; }
.perm-check small { color: var(--ink-soft); }
.perm-check.is-locked { opacity: .6; }
.feedback-stat-row { display: flex; gap: 10px; margin-left: auto; }
.feedback-stat { display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; color: inherit; }
.feedback-stat.is-active { border-color: var(--accent); background: var(--surface-2); }
.feedback-stat strong { font-size: 17px; }
.feedback-stat span { color: var(--ink-soft); font-size: 11px; }
.feedback-admin-list { display: flex; flex-direction: column; gap: 12px; }
.feedback-admin-row { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.feedback-admin-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.feedback-admin-head strong { font-size: 15px; }
.feedback-admin-head time { margin-left: auto; color: var(--ink-soft); font-size: 11px; }
.feedback-admin-content { margin: 8px 0; white-space: pre-wrap; }
.feedback-admin-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--ink-soft); font-size: 11px; }
.feedback-admin-meta span { display: inline-flex; align-items: center; gap: 4px; }
.feedback-admin-reply { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.feedback-admin-reply p { margin: 4px 0; white-space: pre-wrap; }
.feedback-admin-actions { display: flex; gap: 8px; justify-content: flex-end; }
.email-status-card { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.email-status-card p { margin: 4px 0; }
.email-status-card span { color: var(--ink-soft); font-size: 12px; }
@media (max-width: 900px) {
  .feedback-layout { grid-template-columns: 1fr; }
  .feedback-stat-row { margin-left: 0; }
}
