/* ==========================================================================
   江大π社区 · UJS CAMPUS NETWORK
   A warm, colorful campus forum. Built with plain CSS for easy extension.
   ========================================================================== */

:root {
  --bg: #f5f0e7;
  --bg-deep: #eee6da;
  --surface: #fffdf8;
  --surface-raised: #ffffff;
  --surface-soft: #f8f4eb;
  --ink: #182c27;
  --ink-soft: #344942;
  --muted: #77857e;
  --muted-light: #9ba59f;
  --line: rgba(24, 44, 39, 0.1);
  --line-strong: rgba(24, 44, 39, 0.17);

  --forest: #173a33;
  --forest-soft: #23584c;
  --coral: #ff6f4e;
  --coral-deep: #eb5338;
  --orange: #ff9e43;
  --sun: #ffc94a;
  --sun-soft: #ffe9a8;
  --mint: #76e0b9;
  --teal: #1c9b83;
  --sky: #4cb8e8;
  --blue: #4e7dff;
  --pink: #f25f9b;
  --violet: #9879f6;
  --cream: #fff8e9;

  --shadow-xs: 0 2px 8px rgba(30, 51, 43, 0.04);
  --shadow-sm: 0 8px 24px rgba(30, 51, 43, 0.06);
  --shadow-md: 0 20px 48px rgba(30, 51, 43, 0.1);
  --shadow-lg: 0 32px 80px rgba(20, 41, 34, 0.16);

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 26px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

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

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 4%, rgba(255, 201, 74, 0.08), transparent 24rem),
    radial-gradient(circle at 92% 14%, rgba(76, 184, 232, 0.07), transparent 30rem),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-navigating {
  cursor: progress;
}

body.has-modal {
  overflow: hidden;
}

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

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

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

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

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

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

:focus-visible {
  outline: 3px solid rgba(255, 111, 78, 0.45);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.tiny-icon {
  width: 14px;
  height: 14px;
}

.container {
  width: min(1280px, calc(100% - 48px));
  margin-inline: auto;
}

.site {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.page {
  position: relative;
  padding: 24px 0 72px;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ==========================================================================
   Ambient background
   ========================================================================== */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.36;
  will-change: transform;
}

.ambient-blob--one {
  top: -18rem;
  right: -10rem;
  width: 42rem;
  height: 42rem;
  background: radial-gradient(circle, rgba(255, 201, 74, 0.48), transparent 68%);
  animation: float-slow 22s ease-in-out infinite alternate;
}

.ambient-blob--two {
  top: 30%;
  left: -20rem;
  width: 36rem;
  height: 36rem;
  background: radial-gradient(circle, rgba(118, 224, 185, 0.36), transparent 68%);
  animation: float-slow 28s 2s ease-in-out infinite alternate-reverse;
}

.ambient-blob--three {
  right: -18rem;
  bottom: -18rem;
  width: 40rem;
  height: 40rem;
  background: radial-gradient(circle, rgba(152, 121, 246, 0.22), transparent 68%);
  animation: float-slow 25s 1s ease-in-out infinite alternate;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image: radial-gradient(rgba(24, 44, 39, 0.11) 0.8px, transparent 0.8px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 78%, transparent);
}

@keyframes float-slow {
  from { transform: translate3d(0, -2%, 0) scale(1); }
  to { transform: translate3d(3%, 3%, 0) scale(1.07); }
}

/* ==========================================================================
   Color tones & avatars
   ========================================================================== */

.tone--0 { --tone-a: #ffb296; --tone-b: #ff7694; --tone-c: #ffd267; }
.tone--1 { --tone-a: #ffd08b; --tone-b: #ed6383; --tone-c: #ffb9bd; }
.tone--2 { --tone-a: #88e0b9; --tone-b: #1d9b85; --tone-c: #d7f48d; }
.tone--3 { --tone-a: #ffe084; --tone-b: #f0913e; --tone-c: #ffbb7d; }
.tone--4 { --tone-a: #8eddf6; --tone-b: #4a7fe3; --tone-c: #bde8ff; }
.tone--5 { --tone-a: #b4a6ff; --tone-b: #6558e6; --tone-c: #e1d8ff; }
.tone--6 { --tone-a: #ffb087; --tone-b: #e8585d; --tone-c: #ffd479; }
.tone--7 { --tone-a: #99e8c9; --tone-b: #278f74; --tone-c: #d7f6a7; }
.tone--8 { --tone-a: #ffacd0; --tone-b: #986ff2; --tone-c: #ffd6e5; }
.tone--9 { --tone-a: #b6c1bd; --tone-b: #687670; --tone-c: #e3e7e4; }

.avatar {
  --av-a: #ffb296;
  --av-b: #ff7694;
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fffdf7;
  background: linear-gradient(140deg, var(--av-a), var(--av-b));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    inset 0 -10px 20px rgba(58, 25, 30, 0.09),
    0 6px 14px rgba(38, 48, 41, 0.12);
  font-size: 16px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 5px rgba(74, 28, 29, 0.18);
  user-select: none;
}

.avatar::before {
  content: "";
  position: absolute;
  top: -22%;
  left: -5%;
  width: 75%;
  height: 70%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.19);
  filter: blur(3px);
  transform: rotate(-20deg);
}

.avatar::after {
  content: "";
  position: absolute;
  right: -16%;
  bottom: -24%;
  width: 72%;
  height: 72%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.avatar > span {
  position: relative;
  z-index: 1;
  transform: translateY(-0.5px);
}

.avatar--v0 { --av-a: #ffb296; --av-b: #f96988; }
.avatar--v1 { --av-a: #ffd08b; --av-b: #e85b7d; }
.avatar--v2 { --av-a: #7dddb4; --av-b: #168f79; }
.avatar--v3 { --av-a: #ffe082; --av-b: #ed8d39; }
.avatar--v4 { --av-a: #88dcf7; --av-b: #3f73dc; }
.avatar--v5 { --av-a: #b7a8ff; --av-b: #5d50dd; }
.avatar--v6 { --av-a: #ffb489; --av-b: #de4f56; }
.avatar--v7 { --av-a: #98e4c5; --av-b: #258970; }
.avatar--v8 { --av-a: #ffabd0; --av-b: #8d64ed; }
.avatar--v9 { --av-a: #bcc6c2; --av-b: #64716c; }

.avatar--xs { width: 28px; height: 28px; font-size: 11px; }
.avatar--sm { width: 36px; height: 36px; font-size: 13px; }
.avatar--md { width: 44px; height: 44px; font-size: 16px; }
.avatar--lg { width: 60px; height: 60px; font-size: 21px; }
.avatar--xl { width: 108px; height: 108px; font-size: 38px; border: 4px solid rgba(255, 253, 248, 0.8); }

/* ==========================================================================
   Shared primitives
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid rgba(24, 44, 39, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

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

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

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

.btn--primary {
  color: var(--cream);
  background: var(--ink);
  box-shadow: 0 9px 20px rgba(23, 58, 51, 0.17);
}

.btn--primary:hover {
  background: var(--forest-soft);
  box-shadow: 0 12px 26px rgba(23, 58, 51, 0.22);
}

.btn--sun {
  color: #2c2917;
  background: var(--sun);
  box-shadow: 0 10px 24px rgba(153, 102, 9, 0.13);
}

.btn--sun:hover {
  background: #ffd563;
}

.btn--ghost {
  color: var(--ink-soft);
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.62);
}

.btn--ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  box-shadow: var(--shadow-xs);
}

.btn--ghost-light {
  color: var(--cream);
  border-color: rgba(255, 248, 232, 0.26);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
}

.btn--ghost-light:hover {
  color: var(--forest);
  border-color: var(--cream);
  background: var(--cream);
}

.btn--small {
  min-height: 36px;
  padding: 8px 13px;
  font-size: 12.5px;
}

.btn--small .icon {
  width: 15px;
  height: 15px;
}

.btn--wide {
  width: 100%;
}

.btn--danger-ghost {
  color: var(--coral-deep);
  border-color: rgba(255, 111, 78, 0.25);
  background: rgba(255, 111, 78, 0.05);
}

.btn--plain-danger {
  color: var(--muted);
  background: transparent;
}

.btn--plain-danger:hover {
  color: var(--coral-deep);
  background: rgba(255, 111, 78, 0.07);
}

.btn--compose {
  background: linear-gradient(135deg, var(--coral), #ff9456);
  color: #fffdf8;
  box-shadow: 0 10px 24px rgba(226, 77, 47, 0.23);
}

.btn--compose:hover {
  background: linear-gradient(135deg, #fa6040, #ff8a4a);
  box-shadow: 0 13px 28px rgba(226, 77, 47, 0.3);
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.8;
}

.button-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.58);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-btn .icon {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  transform: translateY(-1px);
}

.icon-btn--small {
  width: 34px;
  height: 34px;
}

.icon-btn--small .icon {
  width: 16px;
  height: 16px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.text-button .icon {
  width: 14px;
  height: 14px;
}

.text-button:hover {
  color: var(--coral-deep);
}

.kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-light);
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.17em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow--light {
  color: rgba(255, 248, 232, 0.57);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(118, 224, 185, 0.1);
  animation: live-pulse 2.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(118, 224, 185, 0.08); }
  50% { box-shadow: 0 0 0 6px rgba(118, 224, 185, 0.03); }
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border: 1px solid rgba(255, 111, 78, 0.19);
  border-radius: var(--radius-pill);
  color: var(--coral-deep);
  background: rgba(255, 111, 78, 0.07);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.muted-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.category-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--category-color, var(--teal));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color, var(--teal)) 12%, transparent);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--category-color, #4d8dff) 20%, transparent);
  border-radius: var(--radius-pill);
  color: color-mix(in srgb, var(--category-color, #4d8dff) 74%, #1a2e29);
  background: color-mix(in srgb, var(--category-color, #4d8dff) 8%, #fffdf8);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  transition: background-color 160ms ease, transform 160ms ease;
}

.category-pill:hover {
  background: color-mix(in srgb, var(--category-color, #4d8dff) 14%, #fffdf8);
  transform: translateY(-1px);
}

.category-pill--small {
  padding: 5px 9px;
  font-size: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: #5d6a63;
  background: #f3eee5;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.tag span {
  color: var(--coral);
  font-weight: 800;
}

.tag:hover {
  color: var(--ink);
  background: #ede5d8;
  transform: translateY(-1px);
}

.tag--small {
  padding: 3px 7px;
  font-size: 10px;
}

/* ==========================================================================
   Top navigation
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(24, 44, 39, 0.07);
  background: rgba(247, 242, 233, 0.82);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 78px;
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  overflow: hidden;
  border-radius: 15px;
  color: var(--cream);
  background:
    radial-gradient(circle at 74% 18%, rgba(255, 201, 74, 0.95) 0 4px, transparent 5px),
    linear-gradient(145deg, #1f4b40, #152f2a 72%);
  box-shadow: 0 8px 18px rgba(23, 58, 51, 0.2);
}

.brand-mark::before {
  content: "";
  position: absolute;
  right: -11px;
  bottom: -15px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 201, 74, 0.35);
  border-radius: 50%;
}

.brand-pi {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.brand-spark {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mint);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.brand-text strong {
  color: var(--ink);
  font-size: 17.5px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-text small {
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.brand--small .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.brand--small .brand-pi {
  font-size: 23px;
}

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

.brand--small .brand-text small {
  font-size: 6.5px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(24, 44, 39, 0.08);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, 0.55);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.nav-icon {
  width: 16px;
  height: 16px;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.8);
}

.nav-link.is-active {
  color: var(--cream);
  background: var(--ink);
  box-shadow: 0 5px 12px rgba(24, 44, 39, 0.16);
}

.top-search {
  display: flex;
  flex: 1 1 180px;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 265px;
  height: 41px;
  margin-left: auto;
  padding: 0 10px 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, 0.68);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.top-search:focus-within {
  border-color: rgba(28, 155, 131, 0.35);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(28, 155, 131, 0.07);
}

.search-icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--muted-light);
}

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

.top-search input::placeholder {
  color: var(--muted-light);
}

.top-search input::-webkit-search-cancel-button {
  display: none;
}

.search-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-light);
  background: rgba(255, 255, 255, 0.55);
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1;
}

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

.notification-wrap {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid #f7f2e9;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--coral);
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
}

.notification-badge.is-hidden {
  display: none;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px 3px 3px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.user-chip:hover,
.user-menu[open] .user-chip {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.72);
}

.user-chip-name {
  max-width: 78px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-chevron {
  width: 13px;
  height: 13px;
  color: var(--muted-light);
  transition: transform 180ms ease;
}

.user-menu[open] .user-chip-chevron {
  transform: rotate(180deg);
}

.user-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 258px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  transform-origin: top right;
  animation: pop-in 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.popover-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 5px 14px;
  border-bottom: 1px solid var(--line);
}

.popover-profile > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.popover-profile strong {
  font-size: 13.5px;
  font-weight: 800;
}

.popover-profile span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popover-profile .demo-chip {
  margin-left: auto;
  flex: none;
}

.popover-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 0;
}

.popover-menu a,
.popover-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease;
}

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

.popover-menu .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.popover-menu button {
  color: var(--muted);
}

.popover-menu button:hover {
  color: var(--coral-deep);
}

.popover-device-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  color: var(--muted-light);
  font-size: 10px;
}

.popover-device-state .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.popover-count {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 10px;
}

.popover-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 5px 1px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
}

/* ==========================================================================
   Notification panel
   ========================================================================== */

.notification-panel {
  position: absolute;
  top: calc(100% + 13px);
  right: -2px;
  z-index: 150;
  display: flex;
  width: 376px;
  max-height: min(560px, calc(100vh - 110px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
}

.notification-panel.is-open {
  animation: pop-in 170ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.notification-header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.notification-header strong {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.notification-count {
  color: var(--muted);
  font-size: 9px;
}

.notification-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.notification-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 13px 17px;
  border-bottom: 1px solid rgba(24, 44, 39, 0.06);
  text-align: left;
  transition: background-color 140ms ease;
}

.notification-item:hover {
  background: var(--surface-soft);
}

.notification-item.is-unread {
  background: rgba(255, 201, 74, 0.055);
}

.notification-item.is-unread:hover {
  background: rgba(255, 201, 74, 0.1);
}

.notification-avatar {
  position: relative;
  flex: none;
}

.notification-type-icon {
  position: absolute;
  right: -4px;
  bottom: -3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 2px solid var(--surface-raised);
  border-radius: 50%;
  color: var(--cream);
  background: var(--coral);
}

.notification-type-icon .icon {
  width: 9px;
  height: 9px;
}

.notification-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.notification-text {
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.notification-text strong {
  color: var(--ink);
  font-weight: 800;
}

.notification-context {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-time {
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 9.5px;
}

.unread-dot {
  width: 6px;
  height: 6px;
  flex: none;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.notification-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.notification-footer a {
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.notification-loading,
.notification-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  padding: 24px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 24px 32px;
  text-align: center;
}

.notification-empty > span {
  color: var(--sun);
  font-size: 25px;
}

.notification-empty p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

/* ==========================================================================
   Footer & mobile nav
   ========================================================================== */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  padding: 26px 0 32px;
  border-top: 1px solid rgba(24, 44, 39, 0.08);
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.footer-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-main p {
  color: var(--muted);
  font-size: 11px;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 18px;
  color: var(--muted-light);
  font-size: 9.5px;
}

.footer-device {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.55);
  font-size: 8.5px;
  font-weight: 650;
}

.footer-device .icon {
  width: 12px;
  height: 12px;
  color: var(--teal);
}

.footer-device-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 0;
  color: var(--teal);
  font-size: 8.5px;
  font-weight: 650;
}

.footer-device-switch .icon {
  width: 11px;
  height: 11px;
}

.footer-device-switch:hover {
  color: var(--coral-deep);
}

.mobile-nav {
  display: none;
}

/* ==========================================================================
   Route progress, skeleton, errors
   ========================================================================== */

body.is-navigating::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--coral), var(--sun), var(--mint), var(--sky));
  transform-origin: left;
  animation: route-progress 0.8s ease-in-out infinite;
}

@keyframes route-progress {
  0% { transform: scaleX(0); opacity: 0; }
  30% { opacity: 1; }
  70% { transform: scaleX(0.7); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

.route-loading-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.route-loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  animation: live-pulse 1.5s ease-in-out infinite;
}

.loading-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 310px;
  gap: 22px;
}

.loading-side,
.loading-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #eae2d5 25%, #f6f0e6 37%, #eae2d5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

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

.skeleton-card {
  padding: 22px;
  background: rgba(255, 253, 248, 0.64);
  box-shadow: none;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

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

.skeleton-stack {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.skeleton-line {
  width: 100%;
  height: 11px;
  margin-bottom: 10px;
}

.skeleton-line--short { width: 36%; }
.skeleton-line--tiny { width: 22%; height: 8px; }
.skeleton-line--medium { width: 74%; }
.skeleton-line--title { width: 60%; height: 18px; margin: 8px 0 14px; }
.skeleton-actions { display: flex; gap: 10px; margin-top: 18px; }
.skeleton-pill { width: 64px; height: 26px; border-radius: 999px; }
.skeleton-side-card { height: 160px; background: rgba(255, 253, 248, 0.6); box-shadow: none; }
.skeleton-side-card--tall { height: 280px; }

.error-page {
  position: relative;
  max-width: 650px;
  margin: 70px auto;
  padding: 70px 48px;
  overflow: hidden;
  text-align: center;
}

.error-pi {
  display: block;
  margin-bottom: 14px;
  color: var(--sun);
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 0.8;
}

.error-page h1 {
  margin: 10px 0 10px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.error-page p {
  margin: 0 auto;
  max-width: 390px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

/* fatal page */
.fatal-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 201, 74, 0.2), transparent 30rem),
    var(--forest);
}

.fatal-card {
  display: flex;
  width: min(520px, 100%);
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.fatal-mark {
  display: grid;
  width: 67px;
  height: 67px;
  border-radius: 20px;
  color: var(--forest);
  background: var(--sun);
  font-family: var(--font-display);
  font-size: 41px;
  place-items: center;
}

.fatal-card .brand-text strong { color: var(--cream); }
.fatal-card .brand-text small { color: rgba(255, 248, 232, 0.5); }
.fatal-card .eyebrow { color: rgba(255, 248, 232, 0.48); }
.fatal-card h1 { font-size: 27px; letter-spacing: -0.04em; }
.fatal-card p { color: rgba(255, 248, 232, 0.68); font-size: 12px; }
.fatal-card small { color: rgba(255, 248, 232, 0.4); font-size: 10px; line-height: 1.7; }
.fatal-card code { color: var(--sun); }

.boot-splash {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 201, 74, 0.18), transparent 25rem),
    var(--forest);
}

.boot-mark {
  display: grid;
  width: 78px;
  height: 78px;
  margin-bottom: 6px;
  border-radius: 23px;
  color: var(--forest);
  background: linear-gradient(145deg, var(--sun), #ffe49c);
  font-family: var(--font-display);
  font-size: 48px;
  place-items: center;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.23);
}

.boot-word {
  color: var(--cream);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.boot-word span { color: var(--sun); font-family: var(--font-display); }
.boot-splash p { color: rgba(255, 248, 232, 0.5); font-size: 11px; letter-spacing: 0.04em; }

.boot-dots {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.boot-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  animation: boot-bounce 1.2s ease-in-out infinite;
}

.boot-dots span:nth-child(2) { animation-delay: 0.15s; background: var(--sun); }
.boot-dots span:nth-child(3) { animation-delay: 0.3s; background: var(--coral); }

@keyframes boot-bounce {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* ==========================================================================
   Toasts
   ========================================================================== */

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

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 380px;
  padding: 11px 16px 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-pill);
  color: var(--cream);
  background: rgba(23, 58, 51, 0.94);
  box-shadow: 0 16px 34px rgba(16, 33, 28, 0.2);
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(14px);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast .icon {
  width: 15px;
  height: 15px;
  color: var(--mint);
}

.toast--error {
  background: rgba(157, 48, 34, 0.95);
}

.toast--error .icon {
  color: #ffd6c8;
}
