:root {
  --bg: #02040d;
  --bg-deep: #050816;
  --real-space-image: url('https://svs.gsfc.nasa.gov/vis/a010000/a011500/a011543/s1-1920.jpg');
  --space-position: center center;
  --overlay-opacity: .64;
  --card: rgba(7, 12, 26, .58);
  --card-strong: rgba(10, 16, 36, .82);
  --card-soft: rgba(255, 255, 255, .055);
  --line: rgba(207, 226, 255, .16);
  --line-bright: rgba(171, 215, 255, .34);
  --text: #f6fbff;
  --muted: #aebbd3;
  --faint: #7d8aa4;
  --accent: #a9dcff;
  --accent-2: #dac6ff;
  --accent-3: #a4ffd8;
  --danger: #ff7896;
  --warning: #ffe2a8;
  --shadow: 0 24px 90px rgba(0, 0, 0, .46);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --content: 1180px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { user-select: none; }
::selection { background: rgba(169, 220, 255, .32); }

.cosmos-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  overflow: hidden;
  background: radial-gradient(circle at 50% 12%, #112044 0%, #050816 44%, #02040d 100%);
}
.cosmos-image {
  position: absolute;
  inset: -4vh -4vw;
  background-image: var(--real-space-image);
  background-size: cover;
  background-position: var(--space-position);
  filter: saturate(1.08) contrast(1.05) brightness(.86);
  transform: scale(1.035);
  animation: cosmicDrift 72s ease-in-out infinite alternate;
}
.cosmos-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(170, 219, 255, .16), transparent 24%),
    radial-gradient(circle at 82% 24%, rgba(221, 196, 255, .13), transparent 28%),
    linear-gradient(180deg, rgba(2, 4, 13, .18), rgba(2, 4, 13, .84) 72%, rgba(2, 4, 13, .94));
  opacity: var(--overlay-opacity);
}
.cosmos-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 36%, transparent 0%, rgba(0, 0, 0, .12) 45%, rgba(0, 0, 0, .74) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .52), transparent 28%, transparent 72%, rgba(0, 0, 0, .52));
}
.cosmos-film {
  position: absolute;
  inset: 0;
  opacity: .16;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.9) 0 1px, transparent 1.8px),
    radial-gradient(circle at 70% 20%, rgba(190,225,255,.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 45% 75%, rgba(255,235,210,.65) 0 1px, transparent 1.7px);
  background-size: 220px 220px, 310px 310px, 410px 410px;
}
#starFieldCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .42;
}

.glass-panel {
  background: linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
.glass-inner {
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 80;
  width: min(calc(100% - 32px), var(--content));
  margin: 18px auto 0;
  min-height: 76px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px 12px 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}
.brand strong { display:block; font-size: 18px; letter-spacing: .02em; }
.brand em { display:block; color: var(--muted); font-size: 12px; font-style: normal; margin-top: 2px; }
.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(169, 220, 255, .42);
  box-shadow: inset 0 0 18px rgba(169, 220, 255, .1), 0 0 34px rgba(169, 220, 255, .16);
}
.brand-mark::before {
  content: "";
  position: absolute;
  width: 56px;
  height: 20px;
  border: 1px solid rgba(218, 198, 255, .42);
  border-radius: 50%;
  transform: rotate(-22deg);
}
.brand-mark span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 18px var(--accent), 0 0 36px rgba(218, 198, 255, .72);
}
.nav-list {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.nav-list a,
.mobile-nav a {
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.nav-list a:hover,
.nav-list a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--text);
  background: rgba(169, 220, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(169, 220, 255, .16);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.mobile-only { display: none !important; }
.mobile-nav {
  display: none;
  position: fixed;
  z-index: 78;
  right: 16px;
  top: 102px;
  width: min(280px, calc(100vw - 32px));
  border-radius: 24px;
  padding: 10px;
}
.mobile-nav.open { display: grid; }

.ghost-btn,
.secondary-btn,
.icon-btn,
.danger-btn,
.tab-btn,
.sort-btn,
.text-btn {
  border: 0;
  cursor: pointer;
  color: var(--text);
}
.ghost-btn,
.secondary-btn,
.icon-btn,
.danger-btn,
.tab-btn,
.sort-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.ghost-btn,
.secondary-btn,
.danger-btn,
.tab-btn,
.sort-btn { padding: 11px 15px; }
.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  color: #071020;
  font-weight: 800;
  background: linear-gradient(135deg, #b8e6ff, #eadbff 52%, #b4ffd9);
  box-shadow: 0 16px 44px rgba(169, 220, 255, .22);
}
.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover,
.sort-btn:hover,
.tab-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(169, 220, 255, .14);
}
.secondary-btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; }
.text-btn { background: transparent; color: var(--accent); padding: 8px 0; }
.danger-btn { color: #ffd6df; border-color: rgba(255,120,150,.32); background: rgba(255,120,150,.09); }

.page-shell {
  width: min(calc(100% - 32px), var(--content));
  margin: 44px auto 90px;
  display: grid;
  gap: 26px;
}
.hero-section {
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 24px;
  align-items: stretch;
}
.hero-panel,
.profile-panel,
.section-card {
  border-radius: var(--radius-xl);
}
.hero-panel {
  position: relative;
  min-height: 620px;
  padding: clamp(28px, 5vw, 66px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(169, 220, 255, .11), transparent 28%),
    radial-gradient(circle at 18% 24%, rgba(255,255,255,.14), transparent 12%),
    radial-gradient(circle at 92% 8%, rgba(218, 198, 255, .2), transparent 22%);
}
.hero-panel > * { position: relative; }
.eyebrow {
  color: var(--accent);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 12px;
}
.hero-panel h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 108px);
  line-height: .9;
  letter-spacing: -.06em;
}
.hero-panel h1 span { display: block; }
.hero-panel h1 em {
  display: block;
  font-style: normal;
  font-size: .42em;
  letter-spacing: .12em;
  margin-top: 16px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(246,251,255,.72);
  text-transform: uppercase;
}
.signature {
  margin: 24px 0 0;
  color: var(--accent-3);
  font-size: clamp(16px, 2.2vw, 22px);
}
.hero-intro {
  width: min(720px, 100%);
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
}
.hero-search {
  margin-top: 30px;
  width: min(620px, 100%);
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: 999px;
}
.hero-search span { color: var(--accent); font-size: 22px; }
.hero-search input,
.post-tools input,
.form-grid input,
.form-grid textarea,
.code-editor {
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  outline: none;
}
.hero-search input {
  width: 100%;
  background: transparent;
  border: 0;
  min-height: 54px;
}
.hero-search input::placeholder,
.form-grid input::placeholder { color: rgba(225,235,255,.52); }
.profile-panel {
  min-height: 620px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.profile-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 52% 38%, rgba(169,220,255,.2), transparent 28%),
    linear-gradient(180deg, transparent, rgba(4,7,18,.5));
}
.profile-panel > * { position: relative; }
.avatar-system {
  width: min(280px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  position: relative;
}
.avatar-system img {
  width: 158px;
  height: 158px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.38);
  box-shadow: 0 0 0 10px rgba(255,255,255,.04), 0 0 60px rgba(169,220,255,.32);
  background: rgba(0,0,0,.4);
}
.avatar-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.82), rgba(169,220,255,.34) 24%, transparent 62%);
  filter: blur(18px);
  opacity: .48;
}
.ring {
  position: absolute;
  border: 1px solid rgba(218,198,255,.38);
  border-radius: 50%;
}
.ring-one { width: 230px; height: 86px; transform: rotate(24deg); animation: ringFloat 8s ease-in-out infinite alternate; }
.ring-two { width: 270px; height: 112px; transform: rotate(-32deg); animation: ringFloat 9s ease-in-out infinite alternate-reverse; }
.profile-panel strong { font-size: 28px; }
.profile-panel span { color: var(--muted); margin-top: 8px; }
.profile-links { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.profile-links a { color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.05); }

.portal-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.portal-card,
.metric-card {
  min-height: 154px;
  border-radius: 26px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.portal-card::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(169,220,255,.18), transparent 34%);
  pointer-events: none;
}
.portal-card strong,
.metric-card strong { position: relative; display: block; font-size: 28px; margin-bottom: 8px; }
.portal-card span,
.metric-card span { position: relative; color: var(--muted); line-height: 1.65; }
.portal-card b { position: relative; display: inline-block; color: var(--accent); margin-bottom: 16px; }

.section-card { padding: clamp(22px, 3vw, 34px); }
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}
.section-head h2 { margin: 0; font-size: clamp(26px, 4vw, 44px); letter-spacing: -.04em; }
.section-note { max-width: 420px; color: var(--muted); line-height: 1.7; margin: 0; }
.post-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sort-btn.active { color: #071020; background: linear-gradient(135deg, #b8e6ff, #eadbff); border-color: transparent; font-weight: 800; }
.hot-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.hot-tag,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  color: #dff5ff;
  background: rgba(169,220,255,.105);
  border: 1px solid rgba(169,220,255,.18);
  font-size: 12px;
}
.hot-tag { cursor: pointer; }
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.post-card {
  min-height: 340px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--line-bright); background: rgba(255,255,255,.08); }
.post-cover {
  height: 150px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.post-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(3,6,17,.84));
}
.post-cover.fallback {
  background:
    radial-gradient(circle at 22% 28%, rgba(255,255,255,.9) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 44%, rgba(169,220,255,.74) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 84%, rgba(218,198,255,.6) 0 1px, transparent 2px),
    linear-gradient(135deg, rgba(24,41,87,.78), rgba(7,12,26,.9));
}
.post-body { padding: 18px; display: flex; flex: 1; flex-direction: column; }
.post-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--faint); font-size: 12px; }
.post-card h3 { margin: 13px 0 10px; line-height: 1.35; font-size: 20px; }
.post-card p { margin: 0; color: var(--muted); line-height: 1.75; flex: 1; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.reading-time { margin-left: auto; color: var(--accent-3); }

.galaxy-map {
  min-height: 600px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.12);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(169,220,255,.12), transparent 22%),
    radial-gradient(circle at 20% 30%, rgba(218,198,255,.12), transparent 22%),
    rgba(0,0,0,.16);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding: clamp(18px, 3vw, 34px);
}
.galaxy-map::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    radial-gradient(circle at 12% 30%, #fff 0 1px, transparent 1.8px),
    radial-gradient(circle at 84% 22%, #b8e6ff 0 1px, transparent 1.8px),
    radial-gradient(circle at 54% 70%, #eadbff 0 1px, transparent 1.8px);
  background-size: 180px 180px, 260px 260px, 340px 340px;
}
.system-card {
  position: relative;
  min-height: 250px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.05);
  cursor: pointer;
  padding: 18px;
  overflow: hidden;
  isolation: isolate;
}
.system-card:hover { border-color: rgba(169,220,255,.42); transform: translateY(-3px); }
.system-orbits-preview {
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.preview-sun {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 12%, #fff3bd 18%, #8fdfff 52%, transparent 72%);
  box-shadow: 0 0 34px rgba(169,220,255,.8), 0 0 90px rgba(218,198,255,.38);
}
.preview-orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); }
.preview-orbit.o1 { width: 150px; height: 80px; transform: rotate(18deg); }
.preview-orbit.o2 { width: 220px; height: 120px; transform: rotate(-28deg); }
.system-card-content { position: relative; z-index: 2; display: flex; height: 100%; flex-direction: column; justify-content: flex-end; }
.system-card h3 { margin: 0 0 10px; font-size: 24px; }
.system-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.branch-count { color: var(--accent); margin-top: 12px; }

.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.archive-card { border-radius: 26px; padding: 20px; border: 1px solid var(--line); background: rgba(255,255,255,.055); }
.archive-card h3 { margin: 0 0 16px; }
.archive-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.09); color: var(--muted); }
.archive-item:first-of-type { border-top: 0; }
.archive-item strong { color: var(--text); }
.about-text { font-size: 17px; line-height: 1.9; color: var(--muted); }
.credit-line { margin-top: 18px; color: var(--faint); font-size: 13px; }
.empty-state { color: var(--muted); padding: 24px; border-radius: 20px; border: 1px dashed var(--line); background: rgba(255,255,255,.035); }

.music-player {
  position: fixed;
  z-index: 90;
  right: 22px;
  bottom: 22px;
  width: min(420px, calc(100vw - 44px));
  border-radius: 28px;
  padding: 12px;
  display: grid;
  grid-template-columns: 18px 58px minmax(0, 1fr) 126px;
  align-items: center;
  gap: 12px;
}
.drag-handle { color: var(--faint); cursor: move; letter-spacing: -4px; }
.music-cover {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  color: #071020;
  background-color: #b8e6ff;
  box-shadow: 0 0 24px rgba(169,220,255,.24);
}
.music-info { min-width: 0; }
.music-info strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.music-info span { display:block; color: var(--muted); font-size: 12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.music-info input { width: 100%; accent-color: var(--accent); }
.music-controls { display: flex; gap: 7px; align-items: center; justify-content: flex-end; }
.play-btn { width: 46px; height: 46px; border-radius: 50%; border:0; background: linear-gradient(135deg, #b8e6ff, #eadbff); color: #071020; cursor:pointer; font-weight: 900; }

.modal {
  width: min(920px, calc(100vw - 34px));
  max-height: min(86vh, 920px);
  overflow: auto;
  border-radius: 32px;
  color: var(--text);
  padding: 30px;
  border: 1px solid var(--line);
}
.modal::backdrop { background: rgba(0,0,0,.64); backdrop-filter: blur(7px); }
.modal-close { position: sticky; top: 0; float: right; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); cursor:pointer; z-index: 4; }
.small-modal { width: min(460px, calc(100vw - 34px)); }
.admin-modal { width: min(1120px, calc(100vw - 34px)); padding: 0; }
.admin-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-height: 680px; }
.admin-tabs { padding: 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.tab-btn { width: 100%; text-align: left; border-radius: 16px; }
.tab-btn.active { color: #071020; background: linear-gradient(135deg, #b8e6ff, #eadbff); font-weight: 800; }
.admin-content { padding: 28px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { color: var(--muted); display: grid; gap: 7px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input,
.form-grid textarea,
.code-editor { width: 100%; padding: 12px 14px; }
.form-grid textarea,
.code-editor { resize: vertical; line-height: 1.65; }
.code-editor { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.admin-hint { color: var(--muted); line-height: 1.7; }
.admin-split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; }
.admin-list { display: grid; gap: 10px; margin-top: 14px; max-height: 520px; overflow: auto; }
.admin-list button { text-align: left; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.055); color: var(--text); padding: 12px; cursor: pointer; }
.admin-list button.active { border-color: var(--accent); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.check-line { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.form-msg { min-height: 20px; color: var(--accent-3); }

.system-view { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: center; }
.system-orbit { position: relative; width: min(460px, 78vw); aspect-ratio: 1; margin: auto; border-radius: 50%; background: radial-gradient(circle, rgba(169,220,255,.12), transparent 62%); }
.system-orbit::before,
.system-orbit::after { content:""; position:absolute; inset: 16%; border-radius:50%; border: 1px solid rgba(255,255,255,.16); transform: rotate(20deg) scaleX(1.25); }
.system-orbit::after { inset: 8%; transform: rotate(-28deg) scaleX(1.15); }
.system-sun { position: absolute; left:50%; top:50%; transform:translate(-50%,-50%); width: 112px; height:112px; border-radius:50%; display:grid; place-items:center; text-align:center; padding:12px; color:#071020; font-weight:900; background: radial-gradient(circle, #fff 0 20%, #ffe9a6 38%, #8fdfff 70%); box-shadow: 0 0 44px rgba(169,220,255,.78), 0 0 120px rgba(218,198,255,.34); z-index:2; }
.planet { position:absolute; width: 88px; height:88px; margin:-44px 0 0 -44px; border-radius:50%; border:1px solid rgba(255,255,255,.2); background: radial-gradient(circle at 35% 30%, #fff, #9fdfff 14%, #243a74 62%, #070b18); color: var(--text); cursor:pointer; box-shadow: 0 0 28px rgba(169,220,255,.24); z-index:3; }
.planet span { display:block; font-size:12px; line-height:1.25; padding: 8px; }
.branch-panel { border-radius: 24px; padding: 24px; border:1px solid var(--line); background: rgba(255,255,255,.06); }
.branch-panel h2 { margin: 0 0 12px; }
.branch-panel p { color: var(--muted); line-height: 1.85; }

.back-top { position: fixed; right: 28px; bottom: 118px; z-index: 70; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); cursor: pointer; opacity: 0; pointer-events:none; transition:.2s; }
.back-top.show { opacity: 1; pointer-events:auto; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@keyframes cosmicDrift { from { transform: scale(1.035) translate3d(-1%, -1%, 0); } to { transform: scale(1.07) translate3d(1%, 1%, 0); } }
@keyframes ringFloat { from { opacity:.45; } to { opacity:.82; transform: rotate(36deg) scale(1.03); } }

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

@media (max-width: 1100px) {
  .posts-grid, .galaxy-map, .archive-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .portal-grid, .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-section { grid-template-columns: 1fr; min-height: auto; }
  .hero-panel, .profile-panel { min-height: 520px; }
}
@media (max-width: 760px) {
  .site-header { top: 10px; width: calc(100% - 20px); margin-top: 10px; min-height: 66px; border-radius: 22px; padding: 10px; }
  .brand { min-width: 0; }
  .brand em { display: none; }
  #desktopNav { display: none; }
  .mobile-only { display: grid !important; }
  .header-actions .ghost-btn { display: none; }
  .page-shell { width: calc(100% - 20px); margin-top: 24px; gap: 18px; }
  .hero-panel, .profile-panel { min-height: auto; padding: 24px; }
  .hero-panel h1 { font-size: clamp(42px, 15vw, 68px); }
  .portal-grid, .metrics-grid, .posts-grid, .galaxy-map, .archive-grid { grid-template-columns: 1fr; }
  .section-head { display: grid; }
  .music-player { grid-template-columns: 16px 48px minmax(0,1fr); width: calc(100vw - 24px); right: 12px; bottom: 12px; }
  .music-controls { grid-column: 2 / -1; justify-content: flex-start; }
  .back-top { bottom: 142px; right: 18px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-tabs { border-right:0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x:auto; }
  .tab-btn { min-width: max-content; }
  .admin-content { padding: 18px; }
  .form-grid.two-col, .admin-split, .system-view { grid-template-columns: 1fr; }
  .modal { padding: 20px; }
  .system-orbit { width: min(360px, 76vw); }
  .planet { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
}
.post-detail-cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}
#postDetail h1 { font-size: clamp(30px, 5vw, 56px); line-height: 1.1; margin: 16px 0; }
#postDetail p { color: var(--muted); line-height: 1.95; font-size: 16px; }

/* V2.0.1 · VerseFirmament-inspired immersive sky system */
.demo-badge {
  position: fixed;
  left: 50%;
  top: 110px;
  transform: translateX(-50%);
  z-index: 75;
  padding: 9px 16px;
  border-radius: 999px;
  color: rgba(241, 248, 255, .82);
  font-size: 12px;
  letter-spacing: .18em;
  white-space: nowrap;
  background: linear-gradient(90deg, rgba(7,14,32,.54), rgba(35,44,76,.4), rgba(7,14,32,.54));
  box-shadow: 0 0 32px rgba(169, 220, 255, .12);
  pointer-events: none;
}
.sky-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.sky-hud-card {
  min-height: 82px;
  border-radius: 22px;
  padding: 16px 18px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
}
.sky-hud-card span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .2em;
}
.sky-hud-card strong {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
  text-shadow: 0 0 20px rgba(169, 220, 255, .28);
}
.firmament-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.firmament-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(169,220,255,.14), transparent 26%),
    radial-gradient(circle at 48% 62%, rgba(218,198,255,.11), transparent 34%);
  pointer-events: none;
}
.compact-avatar {
  width: 118px;
  height: 118px;
  margin-top: 12px;
  flex: 0 0 auto;
}
.profile-panel.firmament-panel > strong,
.profile-panel.firmament-panel > span,
.profile-panel.firmament-panel > .profile-links {
  position: relative;
  z-index: 3;
}
.hero-firmament {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  min-height: 360px;
  margin: 18px auto 0;
  border-radius: 34px;
  border: 1px solid rgba(180, 220, 255, .18);
  background:
    radial-gradient(circle at 50% 52%, rgba(169, 220, 255, .16), transparent 22%),
    radial-gradient(circle at 50% 50%, rgba(2, 4, 13, .18), rgba(2, 4, 13, .72) 70%);
  box-shadow: inset 0 0 70px rgba(169, 220, 255, .08), 0 24px 80px rgba(0,0,0,.24);
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform .22s ease, border-color .22s ease;
}
.hero-firmament:hover {
  border-color: rgba(169, 220, 255, .38);
}
.hero-firmament::before,
.hero-firmament::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%) rotateX(68deg) rotateZ(-18deg);
  border-radius: 50%;
  border: 1px solid rgba(220, 240, 255, .17);
  width: 360px;
  height: 360px;
  box-shadow: 0 0 46px rgba(169, 220, 255, .08);
}
.hero-firmament::after {
  width: 260px;
  height: 260px;
  transform: translate(-50%, -50%) rotateX(68deg) rotateZ(28deg);
  border-color: rgba(218, 198, 255, .18);
}
.firmament-label {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(244, 250, 255, .82);
  font-size: 12px;
}
.firmament-label span {
  letter-spacing: .16em;
}
.firmament-label b {
  color: var(--muted);
  font-weight: 500;
}
.earth-core {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 122px;
  height: 122px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 26%, rgba(255,255,255,.96) 0 5%, rgba(144,218,255,.72) 6% 16%, transparent 18%),
    radial-gradient(circle at 38% 42%, #2ec7ff 0 8%, #1165a4 18%, #08214d 48%, #020815 72%);
  box-shadow:
    inset -18px -22px 34px rgba(0,0,0,.55),
    inset 12px 10px 28px rgba(255,255,255,.2),
    0 0 36px rgba(93, 194, 255, .5),
    0 0 120px rgba(93, 194, 255, .22);
  z-index: 4;
}
.earth-core::before {
  content: "";
  position: absolute;
  inset: 16px 18px 24px 24px;
  border-radius: 48% 52% 42% 58%;
  background: linear-gradient(135deg, rgba(166, 255, 205, .56), transparent 34%, rgba(121, 209, 161, .35) 52%, transparent 70%);
  filter: blur(.2px);
}
.earth-shine {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255,255,255,.28), transparent 34%);
  mix-blend-mode: screen;
}
.earth-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 240px;
  height: 72px;
  border: 1px solid rgba(202, 230, 255, .3);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-16deg);
  box-shadow: 0 0 28px rgba(169,220,255,.12);
}
.er-2 { width: 310px; height: 94px; transform: translate(-50%, -50%) rotate(22deg); opacity: .62; }
.er-3 { width: 184px; height: 54px; transform: translate(-50%, -50%) rotate(58deg); opacity: .42; }
.hero-constellation {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.constellation-dot {
  position: absolute;
  left: 50%;
  top: 55%;
  width: var(--size);
  height: var(--size);
  padding: 0;
  transform: rotate(var(--angle)) translateX(var(--radius)) rotate(calc(-1 * var(--angle)));
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,.85), 0 0 32px rgba(169,220,255,.42);
  pointer-events: auto;
}
.constellation-dot.star {
  background: #fff6ca;
  box-shadow: 0 0 16px rgba(255,246,202,.95), 0 0 44px rgba(255,226,168,.52);
}
.constellation-dot span {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  color: rgba(244,250,255,.78);
  opacity: 0;
  transition: opacity .2s ease;
  text-shadow: 0 2px 12px #000;
}
.constellation-dot:hover span { opacity: 1; }
.control-deck {
  position: relative;
  z-index: 5;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.control-deck span {
  border-radius: 999px;
  padding: 8px 10px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.12);
  color: var(--muted);
  background: rgba(255,255,255,.055);
  font-size: 11px;
}
.portal-card,
.post-card,
.system-card,
.archive-card {
  position: relative;
  isolation: isolate;
}
.portal-card::after,
.post-card::after,
.system-card::after,
.archive-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle at 18% 8%, rgba(255,255,255,.16), transparent 36%);
  opacity: .65;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .sky-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-badge { top: 94px; }
}
@media (max-width: 760px) {
  .demo-badge { display: none; }
  .sky-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
  .sky-hud-card { min-height: 70px; padding: 12px 14px; border-radius: 18px; }
  .sky-hud-card span { font-size: 10px; }
  .hero-firmament { min-height: 300px; margin-top: 12px; border-radius: 26px; }
  .hero-firmament::before { width: 300px; height: 300px; }
  .hero-firmament::after { width: 220px; height: 220px; }
  .earth-core { width: 98px; height: 98px; }
  .earth-ring { width: 198px; height: 58px; }
  .er-2 { width: 250px; height: 74px; }
  .control-deck { grid-template-columns: 1fr; }
  .control-deck span { padding: 7px 8px; }
}
