:root {
  color-scheme: dark;
  --ink: #edf7ff;
  --ink-soft: #b8cad8;
  --muted: #8ca6bb;
  --line: rgba(198, 222, 241, 0.22);
  --paper: #071521;
  --panel: #102235;
  --panel-blue: #123149;
  --sea: #071521;
  --sea-light: #183b54;
  --land: #5aa6a6;
  --land-soft: #84c7bf;
  --accent: #f2ad4d;
  --accent-dark: #d78924;
  --danger: #c85050;
  --ok: #4db7a2;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0b1724;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

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

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  max-width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--accent-dark);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  background: #f0a33e;
  box-shadow: 0 10px 22px rgba(215, 137, 36, 0.22);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.button.secondary,
button.secondary {
  color: var(--ink);
  background: #17344b;
  border: 1px solid var(--line);
}

.button.secondary:hover,
button.secondary:hover {
  background: #214860;
}

.button.ghost,
button.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.button.danger,
button.danger {
  background: var(--danger);
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), #0b1724;
  background-size: 64px 64px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px clamp(18px, 5vw, 72px);
  color: #ffffff;
  background: rgba(9, 22, 35, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #0b1724;
  background: var(--land-soft);
  font-weight: 800;
}

.brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-title {
  font-weight: 800;
}

.brand-subtitle {
  color: #b9d2e6;
  font-size: 13px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  border-radius: 8px;
  padding: 9px 12px;
  color: #dbeafa;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
}

.home-hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(68vh, 680px);
  overflow: hidden;
  padding: 76px clamp(18px, 6vw, 88px) 72px;
  color: #ffffff;
  background: #0b1724;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.hero-map-backdrop {
  position: absolute;
  inset: 8% 0 auto;
  height: 84%;
  opacity: 0.34;
  pointer-events: none;
}

.hero-map-backdrop svg {
  width: 100%;
  height: 100%;
}

.home-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  width: min(760px, 100%);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  color: #cbe0ef;
  background: rgba(8, 25, 39, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.home-hero h1,
.theme-hero h1 {
  max-width: 880px;
  margin: 0;
  font-size: 48px;
  line-height: 1.06;
}

.home-hero p,
.theme-hero p {
  max-width: 680px;
  margin: 0;
  color: #d6e7f4;
  font-size: 18px;
  line-height: 1.8;
}

.home-actions,
.theme-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-main {
  display: grid;
  gap: 32px;
  padding: 42px clamp(18px, 6vw, 88px) 72px;
  color: #ffffff;
  background: #0b1724;
}

.section-heading {
  display: grid;
  gap: 8px;
  max-width: 820px;
}

.section-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 30px;
}

.section-heading p {
  margin: 0;
  color: #c7d9e8;
  line-height: 1.75;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.theme-entry,
.map-panel,
.detail-panel,
.timeline-panel,
.admin-panel,
.admin-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.feature-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  color: var(--ink);
}

.feature-card h3,
.theme-entry h3 {
  margin: 0;
  font-size: 20px;
}

.feature-card p,
.theme-entry p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.theme-entry p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--sea-light);
  font-weight: 800;
}

.theme-entry {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  color: var(--ink);
}

.theme-entry-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.category-directory {
  display: grid;
  gap: 26px;
}

.category-section {
  display: grid;
  gap: 16px;
}

.category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.category-head h3 {
  margin: 0;
  font-size: 24px;
}

.category-head p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.theme-entry-copy {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
}

.theme-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-category-pill {
  border: 1px solid rgba(242, 173, 77, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffd9a7;
  background: rgba(215, 137, 36, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.theme-entry-art {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  background: #10283c;
  border-bottom: 1px solid var(--line);
}

.theme-entry-art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

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

.stat-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  font-weight: 700;
}

.theme-page {
  min-height: calc(100vh - 68px);
  padding: 34px clamp(14px, 4vw, 56px) 54px;
  background: var(--paper);
}

.theme-hero {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
  border-radius: 8px;
  padding: 34px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(11, 23, 36, 0.96), rgba(13, 45, 63, 0.78)),
    #0b1724;
  overflow: hidden;
}

.theme-hero h1 {
  font-size: 36px;
}

.theme-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.visual-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.map-panel {
  position: relative;
  overflow: hidden;
  min-height: 570px;
  background: #10283c;
}

.map-topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: #ffffff;
  pointer-events: none;
}

.map-topbar strong {
  display: block;
  font-size: 14px;
}

.map-topbar span {
  color: #b9d4e6;
  font-size: 13px;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 9px 11px;
  color: #d5e8f6;
  background: rgba(3, 18, 32, 0.56);
  font-size: 12px;
  white-space: nowrap;
}

.map-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(242, 173, 77, 0.5);
  border-radius: 8px;
  padding: 8px;
  color: #ffffff;
  background: rgba(3, 18, 32, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

.floating-map-zoom {
  position: fixed;
  top: 84px;
  right: 22px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(188, 216, 236, 0.24);
  border-radius: 8px;
  padding: 7px;
  color: #ffffff;
  background: rgba(8, 26, 41, 0.88);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.floating-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.floating-control-group + .floating-control-group {
  border-left: 1px solid rgba(188, 216, 236, 0.18);
  padding-left: 8px;
}

.floating-control-group-rotation {
  min-width: 0;
}

.floating-map-zoom .zoom-caption {
  padding: 0 6px 0 4px;
  color: #9fb9cb;
  font-size: 12px;
  font-weight: 800;
}

.floating-map-zoom button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid rgba(188, 216, 236, 0.22);
  padding: 6px 9px;
  color: #e8f4ff;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
  font-weight: 900;
}

.floating-map-zoom button:hover {
  background: rgba(242, 173, 77, 0.18);
  box-shadow: none;
}

.floating-map-zoom button.is-active {
  border-color: rgba(242, 173, 77, 0.48);
  color: #ffffff;
  background: rgba(215, 137, 36, 0.22);
}

.floating-map-zoom .zoom-value {
  min-width: 52px;
  color: #d7e8f5;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.floating-map-zoom .zoom-static {
  min-width: 64px;
  padding: 0 4px;
}

.floating-map-zoom .zoom-note {
  color: #9fb9cb;
}

.floating-map-zoom .rotation-slider {
  width: 120px;
  min-width: 120px;
  accent-color: #f2ad4d;
}

.map-zoom-controls strong {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.map-zoom-controls button {
  min-width: 38px;
  min-height: 36px;
  padding: 6px 10px;
}

.map-zoom-controls span {
  min-width: 48px;
  color: #d7e8f5;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(215, 137, 36, 0.18);
}

.map-svg {
  display: block;
  width: 100%;
  height: 570px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.is-map-dragging .map-svg {
  cursor: grabbing;
}

.map-ocean {
  fill: #10283c;
}

.map-focus-ring {
  fill: none;
  stroke: rgba(198, 222, 241, 0.22);
  stroke-width: 1.2;
  pointer-events: none;
}

.map-globe-ocean {
  fill: url(#map-globe-ocean-gradient);
  stroke: none;
}

.map-globe-lighting {
  pointer-events: none;
}

.map-globe-shine {
  fill: url(#map-globe-shine-gradient);
  mix-blend-mode: screen;
}

.map-globe-terminator {
  fill: url(#map-globe-terminator-gradient);
}

.map-globe-vignette {
  fill: url(#map-globe-vignette-gradient);
}

.map-graticule {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.globe-mode .map-graticule {
  stroke: rgba(213, 240, 255, 0.15);
}

.country-layer {
  opacity: 0.94;
}

.country-layer-globe {
  opacity: 0.98;
}

.country-shape {
  fill: #6fb8ac;
  fill-rule: evenodd;
  stroke: rgba(236, 255, 251, 0.62);
  stroke-width: 0.62;
  cursor: help;
  transition:
    fill 120ms ease,
    stroke 120ms ease,
    opacity 120ms ease;
}

.country-shape:not(.country-shape-static):hover,
.country-shape.is-country-active {
  fill: #a9ded3;
  stroke: #ffffff;
  stroke-width: 1.2;
}

.country-shape:focus {
  outline: none;
}

.country-shape-globe {
  stroke: none;
  opacity: 0.98;
}

.country-shape-static {
  pointer-events: none;
  cursor: default;
}

.country-interaction-off .country-shape {
  pointer-events: none;
  cursor: default;
}

.country-outline {
  fill: none;
  stroke: rgba(236, 255, 251, 0.62);
  stroke-width: 0.62;
  pointer-events: none;
}

.country-outline-globe {
  stroke: rgba(238, 255, 251, 0.58);
  stroke-width: 0.82;
}

.country-globe-group.is-country-active .country-outline-globe {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.2;
}

.globe-mode .routes {
  filter: drop-shadow(0 0 6px rgba(242, 173, 77, 0.16));
}

.map-empty-label {
  fill: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 800;
}

.route-line {
  fill: none;
  stroke: rgba(232, 157, 60, 0.66);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 8 10;
  filter: drop-shadow(0 5px 10px rgba(4, 12, 20, 0.5));
  animation: routeMarch 1.7s linear infinite;
  pointer-events: none;
}

.route-line.future {
  opacity: 0;
}

@keyframes routeMarch {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -36;
  }
}

.event-node {
  cursor: pointer;
}

.event-node.future {
  cursor: default;
  opacity: 0.2;
}

.event-node .hit-area {
  fill: transparent;
  pointer-events: visiblePainted;
}

.event-node .pulse {
  fill: rgba(242, 173, 77, 0.15);
  transform-origin: center;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.event-node.visible .pulse {
  animation: nodePulse 2.6s ease-out infinite;
}

.event-node.selected .pulse {
  fill: rgba(255, 203, 118, 0.34);
  animation-duration: 1.4s;
}

@keyframes nodePulse {
  0% {
    r: 6;
    opacity: 0.72;
  }
  100% {
    r: 18;
    opacity: 0;
  }
}

.event-node .core {
  fill: rgba(242, 173, 77, 0.86);
  stroke: rgba(255, 255, 255, 0.74);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.event-node.selected .core {
  fill: #ffd28a;
  stroke: var(--accent);
  stroke-width: 2.4;
  filter: drop-shadow(0 0 8px rgba(242, 173, 77, 0.62));
}

.event-node-number {
  fill: rgba(7, 21, 33, 0.62);
  font-size: 6.8px;
  font-weight: 900;
  pointer-events: none;
}

.event-node.selected .event-node-number {
  fill: rgba(7, 21, 33, 0.78);
}

.timeline-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timeline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.year-readout {
  display: grid;
  gap: 2px;
}

.year-readout strong {
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
}

.year-readout span {
  color: var(--muted);
  font-size: 13px;
}

.slider-wrap {
  display: grid;
  gap: 10px;
}

.slider-row {
  position: relative;
  height: 52px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-dark);
}

.timeline-ticks {
  position: relative;
  height: 34px;
}

.timeline-dot {
  position: absolute;
  top: 4px;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  aspect-ratio: 1 / 1;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1px rgba(3, 18, 32, 0.2);
  transform: translateX(-50%);
  color: #081a29;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.timeline-dot:hover,
.timeline-dot:focus {
  transform: translateX(-50%);
  box-shadow:
    0 0 0 1px rgba(3, 18, 32, 0.2),
    0 0 0 6px rgba(242, 173, 77, 0.18);
}

.timeline-dot.reached {
  background: var(--accent-dark);
}

.timeline-dot.active {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  top: 2px;
  background: var(--accent);
}

.timeline-years {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.event-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.event-chip {
  flex: 0 0 auto;
  max-width: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.event-chip strong {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-number {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  color: #102235;
  background: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.event-chip span {
  color: var(--muted);
  font-size: 12px;
}

.event-chip.active {
  border-color: var(--accent);
  background: rgba(215, 137, 36, 0.18);
}

.detail-panel {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.detail-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.18;
}

.detail-place {
  margin: 0;
  color: var(--accent-dark);
  font-weight: 800;
}

.detail-summary,
.detail-body {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  background: #1c4a64;
  font-size: 12px;
  font-weight: 800;
}

.detail-empty {
  color: var(--muted);
  line-height: 1.7;
}

.admin-page {
  min-height: calc(100vh - 68px);
  padding: 34px clamp(14px, 4vw, 56px) 58px;
  background: var(--paper);
}

.admin-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-hero h1 {
  margin: 0;
  font-size: 34px;
}

.admin-hero p {
  max-width: 800px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.75;
}

.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-switcher-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.theme-switcher a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.theme-switcher a:hover,
.theme-switcher a.active {
  border-color: rgba(242, 173, 77, 0.7);
  color: #ffffff;
  background: rgba(215, 137, 36, 0.18);
}

.admin-theme-groups {
  display: grid;
  gap: 12px;
  flex: 1 1 auto;
}

.admin-theme-group {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-theme-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-theme-group-head strong {
  display: block;
  color: var(--ink);
}

.admin-theme-group-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.category-editor-list {
  display: grid;
  gap: 14px;
}

.category-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.category-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category-editor-head strong {
  color: var(--ink);
}

.category-editor-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-control {
  display: grid;
  gap: 10px;
}

.access-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(157, 184, 204, 0.24);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
}

.access-badge.allow {
  color: #dff6e7;
  border-color: rgba(89, 196, 123, 0.32);
  background: rgba(89, 196, 123, 0.12);
}

.access-badge.deny {
  color: #f6dede;
  border-color: rgba(228, 115, 115, 0.28);
  background: rgba(228, 115, 115, 0.12);
}

.access-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.access-toggle button {
  min-height: 36px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(157, 184, 204, 0.22);
  box-shadow: none;
}

.access-toggle button:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.08);
}

.access-toggle button.active {
  color: #ffffff;
  border-color: rgba(242, 173, 77, 0.45);
  background: rgba(215, 137, 36, 0.22);
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.admin-panel,
.admin-preview {
  padding: 22px;
}

.admin-panel {
  display: grid;
  gap: 22px;
}

.admin-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(242, 173, 77, 0.28);
  border-radius: 8px;
  padding: 14px;
  background: rgba(215, 137, 36, 0.1);
}

.admin-savebar div {
  display: grid;
  gap: 4px;
}

.admin-savebar strong {
  color: var(--ink);
}

.admin-savebar span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.form-section {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.form-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.form-section h2 {
  margin: 0;
  font-size: 22px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

input:not([type="range"]),
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #081a29;
}

input:not([type="range"]):focus,
textarea:focus,
select:focus {
  border-color: rgba(242, 173, 77, 0.72);
  outline: 2px solid rgba(242, 173, 77, 0.18);
}

textarea {
  min-height: 94px;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #9db8cc 50%),
    linear-gradient(135deg, #9db8cc 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.event-editor-list {
  display: grid;
  gap: 14px;
}

.event-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.event-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-editor-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-editor-head .toolbar {
  flex: 0 0 auto;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-preview {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 16px;
}

.admin-preview h2 {
  margin: 0;
  font-size: 22px;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.metric strong {
  font-size: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-preview-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-preview-card strong {
  color: var(--ink);
}

.admin-preview-card span {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.import-box {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.openclaw-page {
  padding-bottom: 70px;
}

.openclaw-layout {
  display: grid;
  gap: 18px;
}

.openclaw-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.openclaw-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.openclaw-card-head h2 {
  margin: 0;
  font-size: 22px;
}

.openclaw-status {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.openclaw-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(242, 173, 77, 0.3);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent);
  background: rgba(215, 137, 36, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.openclaw-access-list {
  margin-top: 10px;
}

.openclaw-lock-note {
  margin: 10px 0 0;
  color: #cfe5f2;
  font-size: 12px;
  line-height: 1.7;
}

.openclaw-lock-note.is-locked {
  color: #ffd8b2;
}

.openclaw-contract {
  margin: 0;
  overflow-x: auto;
  border: 1px dashed rgba(157, 184, 204, 0.28);
  border-radius: 8px;
  padding: 14px;
  color: #c8dfef;
  background: #081a29;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.openclaw-box {
  min-height: 260px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 13px 15px;
  color: #ffffff;
  background: #10283c;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--danger);
}

.country-tooltip {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 150px;
  max-width: 220px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffffff;
  background: rgba(4, 18, 30, 0.94);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.country-tooltip[hidden] {
  display: none;
}

.country-tooltip strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.country-tooltip span {
  overflow-wrap: anywhere;
  color: #c8dfef;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1080px) {
  .theme-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel,
  .admin-preview {
    position: static;
  }
}

@media (max-width: 860px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .home-hero {
    min-height: auto;
    padding-top: 56px;
  }

  .home-hero h1 {
    font-size: 36px;
  }

  .theme-hero h1 {
    font-size: 30px;
  }

  .feature-grid,
  .theme-entry,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .category-head,
  .admin-theme-group-head {
    flex-direction: column;
  }

  .map-panel {
    min-height: 480px;
  }

  .map-svg {
    height: 480px;
  }
}

@media (max-width: 560px) {
  .home-hero h1 {
    font-size: 31px;
  }

  .home-hero p,
  .theme-hero p {
    font-size: 16px;
  }

  .theme-page,
  .admin-page {
    padding-inline: 12px;
  }

  .theme-hero {
    padding: 24px;
  }

  .timeline-head,
  .map-topbar,
  .event-editor-head,
  .theme-switcher-wrap,
  .openclaw-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-legend {
    white-space: normal;
  }

  .map-zoom-controls {
    flex-wrap: wrap;
  }

  .floating-map-zoom {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    flex-wrap: wrap;
  }

  .floating-control-group + .floating-control-group {
    border-left: 0;
    padding-left: 0;
  }

  .floating-map-zoom .rotation-slider {
    width: 100px;
    min-width: 100px;
  }
}


.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  padding: 22px 20px 34px;
  color: #9fb7c8;
  font-size: 13px;
  line-height: 1.5;
}

.beian-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9fb7c8;
  text-decoration: none;
}

.beian-link:hover,
.beian-link:focus-visible {
  color: #e8f4ff;
}

.beian-icon {
  display: inline-block;
  width: 18px;
  height: 20px;
  object-fit: contain;
}


@media (max-width: 560px) {
  .site-footer {
    margin: 0 12px;
    border-top: 1px solid rgba(198, 222, 241, 0.16);
    padding: 18px 12px 28px;
    background: rgba(7, 21, 33, 0.96);
    font-size: 12px;
  }

  .site-footer-with-floating-controls {
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
  }

  .beian-link {
    justify-content: center;
  }
}
