:root {
  color-scheme: dark;
  --bg: #020202;
  --panel: rgba(12, 12, 14, 0.92);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(212, 78, 255, 0.22);
  --text: #f4eff8;
  --muted: #968fa1;
  --pink: #d44eff;
  --cyan: #71deff;
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.62);
  --radius-xl: 32px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(212, 78, 255, 0.08), transparent 24%),
    radial-gradient(circle at 84% 14%, rgba(113, 222, 255, 0.05), transparent 18%),
    linear-gradient(180deg, #020202 0%, #050507 40%, #020202 100%);
  overflow-x: hidden;
}

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

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

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

.ambient {
  position: fixed;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.34;
  pointer-events: none;
  z-index: 0;
}

.ambient-left {
  left: -10rem;
  bottom: -10rem;
  background: radial-gradient(circle, rgba(212, 78, 255, 0.38), transparent 62%);
}

.ambient-right {
  right: -10rem;
  top: -10rem;
  background: radial-gradient(circle, rgba(113, 222, 255, 0.22), transparent 62%);
}

.birds-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
  mix-blend-mode: screen;
}

.bird {
  position: absolute;
  width: clamp(62px, 8vw, 120px);
  height: auto;
  right: -160px;
  fill: none;
  stroke: rgba(170, 195, 220, 0.82);
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(113, 222, 255, 0.24));
  animation-name: birdFlight;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.bird-1 {
  top: 10%;
  opacity: 0.7;
  animation-duration: 20s;
  animation-delay: -3s;
}

.bird-2 {
  top: 22%;
  opacity: 0.56;
  animation-duration: 26s;
  animation-delay: -14s;
}

.bird-3 {
  top: 36%;
  opacity: 0.62;
  animation-duration: 24s;
  animation-delay: -8s;
}

.bird-4 {
  top: 18%;
  opacity: 0.52;
  animation-duration: 30s;
  animation-delay: -18s;
}

.bird-5 {
  top: 44%;
  opacity: 0.5;
  animation-duration: 32s;
  animation-delay: -6s;
}

.brand-watermark {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  font-family: "Orbitron", sans-serif;
  font-size: clamp(3rem, 12vw, 9rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  text-shadow: 0 0 50px rgba(212, 78, 255, 0.06);
}

.page-shell,
.admin-shell {
  position: relative;
  z-index: 3;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.miniapp-shell {
  max-width: 1100px;
}

.miniapp-head {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.mini-back {
  min-width: 96px;
}

.theme-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 20px;
  color: currentColor;
}

.miniapp-title-group h1 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
}

.miniapp-view-wrap {
  min-height: 62vh;
}

.miniapp-view {
  opacity: 1;
  transform: translateY(0);
}

.miniapp-view.view-enter {
  animation: routeIn 220ms ease;
}

.mini-route-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.mini-route-head h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
}

.folder-card .feed-card-body {
  min-height: 160px;
  display: grid;
  align-content: space-between;
}

.folder-card {
  position: relative;
  overflow: hidden;
}

.folder-card::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 78, 255, 0), rgba(212, 78, 255, 0.5), rgba(113, 222, 255, 0));
  opacity: 0.8;
}

.folder-meta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 8px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(200, 96, 255, 0.32);
  background: rgba(200, 96, 255, 0.08);
  color: #d8c8ef;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-card {
  cursor: pointer;
}

.skeleton-lines {
  display: grid;
  gap: 12px;
}

.skeleton-line {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 14, 18, 0.96);
  color: #f4eff8;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.toast-info {
  border-color: rgba(113, 222, 255, 0.34);
}

.toast-success {
  border-color: rgba(67, 214, 127, 0.38);
}

.toast-error {
  border-color: rgba(255, 90, 122, 0.4);
}

.scroll-top-button {
  position: fixed;
  right: 14px;
  bottom: 84px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(200, 96, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
    rgba(12, 12, 16, 0.92);
  color: #efe6ff;
  font-size: 1.08rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 22;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.scroll-top-button.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-top-button:hover {
  border-color: rgba(212, 78, 255, 0.5);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.46),
    0 0 20px rgba(212, 78, 255, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.hero-panel,
.content-grid,
.admin-shell {
  display: grid;
  gap: 20px;
}

.hero-panel {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  min-height: 78vh;
}

.miniapp-hero {
  min-height: auto;
  padding-top: 24px;
}

.hero-copy h1,
.panel-head h1,
.panel-head h2,
.section-inline-head h3 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.02em;
}

.hero-copy h1 {
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  line-height: 0.98;
}

.hero-copy {
  max-width: 620px;
}

.brand-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] body {
  color: #1f2430;
  background:
    radial-gradient(circle at 18% 10%, rgba(120, 108, 255, 0.1), transparent 26%),
    radial-gradient(circle at 84% 14%, rgba(64, 167, 255, 0.12), transparent 20%),
    linear-gradient(180deg, #eef3fa 0%, #e8eef7 45%, #edf2f8 100%);
}

html[data-theme="light"] .brand-watermark {
  color: rgba(44, 59, 92, 0.06);
  text-shadow: none;
}

html[data-theme="light"] .panel,
html[data-theme="light"] .miniapp-shell .panel {
  border-color: rgba(30, 70, 120, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.98)),
    radial-gradient(circle at top right, rgba(105, 136, 255, 0.08), transparent 40%);
  box-shadow: 0 18px 36px rgba(26, 45, 80, 0.12);
}

html[data-theme="light"] .post-description,
html[data-theme="light"] .post-subtitle,
html[data-theme="light"] .status-line,
html[data-theme="light"] .feed-card-body p,
html[data-theme="light"] .brand-note {
  color: #5a6478;
}

html[data-theme="light"] .miniapp-view.reader-mode .post-subtitle {
  color: #4a5570;
}

html[data-theme="light"] .miniapp-view.reader-mode .post-description {
  color: #313b52;
}

html[data-theme="light"] .feed-card,
html[data-theme="light"] .admin-post-item,
html[data-theme="light"] .button-row {
  border-color: rgba(49, 85, 133, 0.16);
  background: rgba(255, 255, 255, 0.74);
}

html[data-theme="light"] .folder-meta {
  border-color: rgba(74, 110, 173, 0.3);
  background: rgba(93, 126, 188, 0.12);
  color: #475f8d;
}

html[data-theme="light"] .secondary-button,
html[data-theme="light"] .button-like,
html[data-theme="light"] .ghost-button,
html[data-theme="light"] .admin-page .primary-button,
html[data-theme="light"] .miniapp-shell .feed-button,
html[data-theme="light"] .miniapp-shell .action-button,
html[data-theme="light"] .scroll-top-button {
  color: #36425d;
  border-color: rgba(76, 109, 167, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.92));
  box-shadow:
    0 8px 18px rgba(46, 74, 123, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

html[data-theme="light"] .admin-page .field select {
  color-scheme: light;
}

html[data-theme="light"] .admin-page .field select option,
html[data-theme="light"] .admin-page .field select optgroup {
  background: #f6f9ff;
  color: #2a3550;
}

html[data-theme="light"] .secondary-button:hover,
html[data-theme="light"] .button-like:hover,
html[data-theme="light"] .admin-page .primary-button:hover,
html[data-theme="light"] .feed-button:hover,
html[data-theme="light"] .action-button:hover,
html[data-theme="light"] .scroll-top-button:hover {
  border-color: rgba(92, 124, 179, 0.38);
  box-shadow:
    0 12px 24px rgba(46, 74, 123, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset;
}

.hero-actions,
.toolbar-row,
.section-inline-head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-copy .hero-actions {
  margin-top: 28px;
}

.post-description,
.post-subtitle,
.status-line,
.feed-card-body p {
  color: var(--muted);
  line-height: 1.7;
}

.inline-link {
  color: #9fdfff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: #d4b5ff;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--cyan);
}

.primary-button,
.secondary-button,
.button-like,
.action-button,
.feed-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 14px 20px;
  min-height: 48px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.theme-toggle,
.secondary-button.theme-toggle,
.button-like.theme-toggle {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button,
.action-button,
.feed-button {
  position: relative;
  isolation: isolate;
  color: #0f0818;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%),
    linear-gradient(132deg, #c550ff 0%, #9f70ff 44%, #6fdcff 100%);
  box-shadow:
    0 12px 30px rgba(72, 30, 110, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.secondary-button,
.button-like,
.ghost-button {
  color: var(--text);
  border-color: rgba(200, 96, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01)),
    rgba(12, 12, 16, 0.9);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.danger {
  border-color: rgba(255, 90, 122, 0.4);
  color: #ffd1dc;
}

.primary-button:hover,
.secondary-button:hover,
.button-like:hover,
.action-button:hover,
.feed-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.04) saturate(1.02);
}

.primary-button:hover,
.action-button:hover,
.feed-button:hover {
  box-shadow:
    0 16px 34px rgba(88, 37, 128, 0.5),
    0 0 26px rgba(113, 222, 255, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.hero-stage {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at top right, rgba(212, 78, 255, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(8, 8, 10, 0.98), rgba(11, 11, 14, 0.96));
}

.hero-stage-strict {
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), var(--shadow);
}

.hero-stage-line {
  width: 120px;
  height: 2px;
  margin-bottom: auto;
  background: linear-gradient(90deg, rgba(113, 222, 255, 0), rgba(113, 222, 255, 0.7), rgba(212, 78, 255, 0));
  box-shadow: 0 0 22px rgba(113, 222, 255, 0.18);
}

.content-grid {
  grid-template-columns: 1.05fr 0.95fr;
  margin-top: 12px;
}

.miniapp-grid {
  align-items: stretch;
}

.panel {
  background:
    linear-gradient(180deg, rgba(10, 10, 12, 0.96), rgba(6, 6, 8, 0.98)),
    radial-gradient(circle at top right, rgba(212, 78, 255, 0.04), transparent 28%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  padding: 26px;
}

.miniapp-shell .panel {
  background:
    linear-gradient(180deg, rgba(10, 10, 12, 0.88), rgba(6, 6, 8, 0.9)),
    radial-gradient(circle at top right, rgba(212, 78, 255, 0.08), transparent 36%);
}

.post-showcase-strict,
.post-media-strict {
  border-color: rgba(255, 255, 255, 0.05);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.chip {
  align-self: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d5cedd;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.button-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.button-list .action-button {
  width: 100%;
}

.post-description {
  max-width: 60ch;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-showcase .panel-head {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 100%;
  min-width: 0;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.reader-size-controls {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: 0;
}

.miniapp-view.reader-mode .reader-size-controls {
  display: inline-flex;
}

.reader-btn {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.miniapp-view.reader-mode .content-grid {
  grid-template-columns: 1fr;
}

.miniapp-view.reader-mode .post-media {
  display: none;
}

.miniapp-view.reader-mode .post-subtitle {
  max-width: 72ch;
  font-size: calc(0.94rem * var(--reader-font-scale, 1));
  line-height: 1.75;
  color: #cbc4d6;
}

.miniapp-view.reader-mode .post-description {
  max-width: 72ch;
  font-size: calc(0.99rem * var(--reader-font-scale, 1));
  line-height: 1.78;
  color: #dfd8ea;
  letter-spacing: 0.01em;
}

.miniapp-view.reader-mode[data-reader-font="sans"] .post-description,
.miniapp-view.reader-mode[data-reader-font="sans"] .post-subtitle {
  font-family: "Manrope", "Segoe UI", -apple-system, sans-serif;
}

.miniapp-view.reader-mode[data-reader-font="serif"] .post-description,
.miniapp-view.reader-mode[data-reader-font="serif"] .post-subtitle {
  font-family: "Merriweather", "Georgia", "Times New Roman", serif;
}

.miniapp-view.reader-mode[data-reader-font="mono"] .post-description,
.miniapp-view.reader-mode[data-reader-font="mono"] .post-subtitle {
  font-family: "JetBrains Mono", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

.post-showcase {
  max-width: 100%;
  overflow: hidden;
}

.post-showcase .panel-head,
.post-showcase .reader-toolbar,
.post-showcase .button-list {
  max-width: 100%;
}

.image-wrap {
  overflow: hidden;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 100%;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.image-wrap-tall img {
  min-height: 520px;
}

.post-media .image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.86);
}

.post-media .image-wrap img {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: min(72vh, 780px);
  object-fit: contain;
}

.post-feed {
  margin-top: 20px;
  padding-top: 18px;
}

.feed-folder + .feed-folder {
  margin-top: 24px;
}

.feed-folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.feed-folder-title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d7d2de;
}

.feed-folder-count {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #b8b1c4;
  font-weight: 700;
  font-size: 0.8rem;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.feed-grid > * {
  opacity: 0;
  transform: translateY(8px);
  animation: cardEnter 240ms ease forwards;
}

.feed-grid > *:nth-child(1) { animation-delay: 30ms; }
.feed-grid > *:nth-child(2) { animation-delay: 70ms; }
.feed-grid > *:nth-child(3) { animation-delay: 110ms; }
.feed-grid > *:nth-child(4) { animation-delay: 150ms; }
.feed-grid > *:nth-child(5) { animation-delay: 190ms; }
.feed-grid > *:nth-child(6) { animation-delay: 230ms; }

.feed-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.feed-card,
.admin-post-item,
.button-row {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.feed-card {
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.feed-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
}

.post-card img {
  aspect-ratio: auto;
  max-height: 260px;
  object-fit: contain;
  background: rgba(6, 8, 12, 0.86);
  padding: 10px;
}

.feed-card-body {
  padding: 16px;
}

.feed-card-body h3,
.admin-post-item strong {
  margin: 0 0 8px;
  font-size: 1rem;
}

.feed-card-body p,
.admin-post-item p {
  margin: 0 0 14px;
}

.feed-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 78, 255, 0.22);
}

.feed-card:active,
.primary-button:active,
.secondary-button:active,
.button-like:active,
.feed-button:active,
.action-button:active {
  transform: translateY(0) scale(0.99);
}

.post-no-image {
  grid-template-columns: 1fr;
}

.feed-button,
.action-button {
  animation: buttonPulse 2.8s ease-in-out infinite;
  min-height: 50px;
  font-size: 0.98rem;
}

.miniapp-shell .feed-button,
.miniapp-shell .action-button {
  color: #efe6ff;
  border-color: rgba(200, 96, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
    rgba(12, 12, 16, 0.92);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.miniapp-shell .feed-button:hover,
.miniapp-shell .action-button:hover {
  border-color: rgba(212, 78, 255, 0.5);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.46),
    0 0 20px rgba(212, 78, 255, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.admin-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.admin-shell {
  grid-template-columns: 360px 1fr;
  align-items: start;
  max-width: 100%;
  overflow-x: clip;
}

.admin-shell > * {
  min-width: 0;
}

.admin-page .primary-button {
  color: var(--text);
  border-color: rgba(200, 96, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01)),
    rgba(12, 12, 16, 0.9);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.admin-page .primary-button:hover {
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.admin-divider {
  margin-top: 28px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-post-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

#adminPostList {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.stats-chart-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.stats-daily-chart {
  width: 100%;
  height: 92px;
  display: block;
}

.stats-chart-legend {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.stats-post-list {
  max-height: 220px;
  overflow: auto;
  margin-top: 12px;
  padding-right: 4px;
}

.stats-collapsed #statsPostViews,
.stats-collapsed #statsChartCard {
  display: none;
}

.admin-post-item {
  padding: 16px;
  cursor: pointer;
}

.admin-post-item.active {
  border-color: rgba(212, 78, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(212, 78, 255, 0.22);
}

.admin-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  outline: none;
}

.admin-page .field select {
  color-scheme: dark;
}

.admin-page .field select option,
.admin-page .field select optgroup {
  background: #0f121a;
  color: #f1ecfb;
}

.admin-page .field select option:disabled {
  color: #8f98aa;
}

.field textarea {
  resize: vertical;
}

.button-editor {
  margin-top: 8px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.batch-import-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  overflow: hidden;
  max-height: 720px;
  opacity: 1;
  transition: max-height 220ms ease, opacity 180ms ease;
}

.batch-import-panel.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.button-row-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 10px;
  padding: 12px;
}

.button-row input {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.remove-button {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 90, 122, 0.4);
  color: #ffd1dc;
  background: rgba(255, 90, 122, 0.08);
  cursor: pointer;
}

.upload-button {
  user-select: none;
}

.empty-state {
  color: var(--muted);
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.14);
}

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

@keyframes routeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes birdFlight {
  from {
    transform: translateX(0) translateY(0);
  }
  to {
    transform: translateX(calc(-100vw - 320px)) translateY(-18px);
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes buttonPulse {
  0%,
  100% {
    box-shadow: 0 12px 28px rgba(212, 78, 255, 0.24);
  }
  50% {
    box-shadow: 0 14px 34px rgba(113, 222, 255, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .miniapp-view.view-enter,
  .feed-grid > *,
  .feed-button,
  .action-button,
  .bird {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

@media (max-width: 1280px) {
  .admin-shell {
    grid-template-columns: 1fr;
    width: min(100dvw - 24px, 980px);
  }
}

@media (max-width: 980px) {
  .hero-panel,
  .content-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .page-shell,
  .admin-shell {
    width: min(100% - 30px, 1200px);
  }

  .miniapp-head {
    grid-template-columns: 1fr auto;
    grid-template-areas: "title title" "back back";
    padding-top: 6px;
  }

  .miniapp-title-group {
    grid-area: title;
  }

  .mini-back {
    grid-area: back;
    min-width: 88px;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .button-list {
    grid-template-columns: 1fr;
  }

  .brand-watermark {
    font-size: clamp(2.5rem, 14vw, 4.8rem);
    letter-spacing: 0.14em;
  }

  .post-subtitle {
    font-size: 0.92rem;
    line-height: 1.62;
  }

  .post-description {
    font-size: 0.95rem;
    line-height: 1.66;
  }

  .reader-btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .panel-head {
    flex-wrap: wrap;
  }

  .miniapp-grid .post-media {
    order: -1;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .miniapp-grid .post-media .image-wrap {
    border-radius: 20px;
  }

  .reader-toolbar {
    width: 100%;
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .reader-size-controls {
    margin-left: 0;
  }

  .reader-toolbar [data-reader-toggle] {
    width: auto;
    max-width: 100%;
    min-width: 0;
  }

  .miniapp-view.reader-mode .post-subtitle {
    font-size: calc(0.88rem * var(--reader-font-scale, 1));
    line-height: 1.64;
  }

  .miniapp-view.reader-mode .post-description {
    font-size: calc(0.93rem * var(--reader-font-scale, 1));
    line-height: 1.68;
    letter-spacing: 0;
  }
}
