:root {
  color-scheme: light;
  --page: #f3f6fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #eef4f8;
  --text: #142033;
  --muted: #66758a;
  --line: #d9e2ec;
  --line-strong: #c5d2df;
  --accent: #0f766e;
  --accent-strong: #0b5f5a;
  --accent-soft: #d9f2ed;
  --blue: #245b9f;
  --blue-soft: #e2edf8;
  --cnkd-blue: #3080b8;
  --cnkd-blue-strong: #205088;
  --gold: #b7791f;
  --error: #a8323a;
  --shadow-sm: 0 8px 22px rgba(21, 32, 51, 0.08);
  --shadow-md: 0 18px 42px rgba(21, 32, 51, 0.13);
  --hero-map-image: url("https://images.nebulapause.com/i/2026/05/23/6a110e5b69a66.png");
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(243, 246, 251, 0)),
    var(--page);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  appearance: none;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: var(--cnkd-blue);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  transform: translateY(calc(-100% - 16px));
  transition: transform 120ms ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  outline: 3px solid rgba(48, 128, 184, 0.28);
  outline-offset: 2px;
  transform: translateY(0);
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 64px;
}

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: #ffffff;
  font-size: 12px;
  background: #18324b;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.topbar-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.topbar-actions,
.auth-panel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.auth-panel {
  padding: 5px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-user {
  max-width: 180px;
  padding: 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-panel[data-auth-state="signed-in"] .auth-user {
  color: var(--accent-strong);
}

.auth-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-height: 36px;
  padding: 6px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(217, 226, 236, 0.9);
}

.footer-link {
  color: var(--blue);
  text-decoration: none;
}

.footer-link:hover {
  color: #173f70;
  text-decoration: underline;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 28px;
  align-items: end;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 44px max(20px, calc((100vw - 1180px) / 2)) 48px;
  color: #ffffff;
  background:
    linear-gradient(115deg, rgba(9, 20, 34, 0.88), rgba(15, 76, 82, 0.72), rgba(36, 91, 159, 0.58)),
    var(--hero-map-image) center/cover;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.14);
}

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

.doc-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 44px max(20px, calc((100vw - 1180px) / 2)) 42px;
  color: #ffffff;
  background:
    linear-gradient(115deg, rgba(9, 20, 34, 0.9), rgba(15, 76, 82, 0.76), rgba(36, 91, 159, 0.56)),
    var(--hero-map-image) center/cover;
}

.eyebrow,
.toolbar-kicker {
  margin: 0 0 10px;
  color: #bde8df;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 600px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.7;
}

.search-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 11px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.search-label {
  color: #26364e;
  font-size: 13px;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}

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

.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.filter-grid span,
.trigger-doc-link {
  color: #26364e;
  font-size: 12px;
  font-weight: 800;
}

.trigger-doc-link {
  width: max-content;
  color: var(--blue);
  text-decoration: none;
}

.trigger-doc-link:hover {
  color: #173f70;
  text-decoration: underline;
}

input,
select {
  width: 100%;
  min-height: 46px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input {
  padding: 0 14px;
}

select {
  padding: 0 36px 0 12px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.16);
  outline: none;
}

button,
.download-button,
.text-link {
  min-height: 42px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  color: #ffffff;
  font-weight: 800;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.primary-button:hover,
.download-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.2);
  transform: translateY(-1px);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--text);
  font-weight: 800;
  background: #ffffff;
  border: 1px solid var(--line);
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: #f7fcfb;
}

button:disabled,
.download-button[aria-disabled="true"],
.text-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin: 30px 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.toolbar h2 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.25;
}

.toolbar-kicker {
  color: var(--blue);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toolbar-actions select {
  width: 126px;
}

.status-panel {
  margin: 18px 0;
  padding: 18px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.status-panel.error {
  color: var(--error);
  border-color: rgba(168, 50, 58, 0.28);
  border-left-color: var(--error);
  background: #fff7f8;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.trigger-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.trigger-doc-card {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.trigger-doc-card h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.trigger-doc-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.map-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  contain: layout paint;
  transition: border-color 140ms ease;
}

.report-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-height: 30px;
  padding: 0 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  background: rgba(20, 32, 51, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(20, 32, 51, 0.22);
}

.report-button:hover:not(:disabled) {
  background: var(--error);
  border-color: rgba(255, 255, 255, 0.6);
}

.map-card--reported {
  border-color: rgba(168, 50, 58, 0.32);
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-card .thumb-link,
.skeleton-line {
  background: linear-gradient(90deg, #e9eff5, #f8fafc, #e9eff5);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton-line {
  width: 62%;
  height: 15px;
  border-radius: 8px;
}

.skeleton-line.wide {
  width: 84%;
  height: 19px;
}

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

  100% {
    background-position: -200% 0;
  }
}

.thumb-link {
  --thumb-fade-size: 28px;
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(36, 91, 159, 0.14)),
    var(--surface-strong);
}

.thumb-link::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--thumb-fade-size);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface));
  pointer-events: none;
}

.map-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 16px;
  padding: 16px;
}

.map-card-heading {
  min-height: 112px;
}

.map-name {
  display: -webkit-box;
  margin-bottom: 8px;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  line-height: 1.42;
  letter-spacing: 0;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-meta {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.map-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.map-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px 4px 9px;
  overflow: hidden;
  color: #26364e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 5px;
}

.map-tag--size {
  color: var(--blue);
  background: #edf6ff;
  border-color: #c9ddf4;
  border-left-color: var(--blue);
}

.map-tag--players {
  color: #8a5b13;
  background: #fff6df;
  border-color: #ead69b;
  border-left-color: var(--gold);
}

.map-tag--attribute {
  color: var(--accent-strong);
  background: #edf8f5;
  border-color: #cce8e0;
  border-left-color: var(--accent);
}

.map-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--blue);
  font-weight: 800;
  background: var(--blue-soft);
}

.text-link:hover {
  color: #173f70;
  background: #d4e4f5;
}

.download-button {
  background: var(--cnkd-blue);
  border-color: var(--cnkd-blue);
}

.download-button:hover {
  background: var(--cnkd-blue-strong);
  border-color: var(--cnkd-blue-strong);
  box-shadow: 0 10px 22px rgba(48, 128, 184, 0.24);
}

.infringement-notice {
  display: flex;
  flex-direction: column;
  grid-column: 1 / -1;
  gap: 2px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--error);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
  background: #fff2f3;
  border: 1px solid rgba(168, 50, 58, 0.24);
  border-radius: 8px;
}

body.modal-open {
  overflow: hidden;
}

.report-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 32, 51, 0.48);
}

.report-modal-backdrop[hidden] {
  display: none;
}

.report-modal {
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  padding: 24px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(168, 50, 58, 0.22);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.report-modal h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.report-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.report-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.report-modal-confirm {
  background: var(--error);
  border-color: var(--error);
}

.report-modal-confirm:hover:not(:disabled) {
  background: #8f2730;
  border-color: #8f2730;
  box-shadow: 0 10px 22px rgba(168, 50, 58, 0.22);
}

@media (hover: hover) and (pointer: fine) {
  .map-card:hover {
    border-color: rgba(15, 118, 110, 0.38);
  }
}

.pager {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-bottom: 12px;
}

#pageInfo {
  color: var(--muted);
  text-align: center;
}

.load-more-button {
  min-width: 168px;
}

.load-sentinel {
  width: 100%;
  height: 1px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }

  h1 {
    font-size: 44px;
  }

  .search-panel {
    max-width: 620px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 10px;
    padding-bottom: 62px;
  }

  .site-topbar {
    align-items: flex-start;
    min-height: 48px;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .topbar-text {
    display: none;
  }

  .auth-panel {
    max-width: min(62vw, 240px);
  }

  .auth-user {
    max-width: 110px;
  }

  .hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 28px 12px 30px;
  }

  .doc-hero {
    padding: 30px 12px 32px;
  }

  h1 {
    font-size: 36px;
    line-height: 1.05;
  }

  .hero-subtitle {
    font-size: 15px;
    line-height: 1.65;
  }

  .search-panel {
    padding: 14px;
  }

  .search-row,
  .filter-grid,
  .toolbar-actions {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    margin-top: 24px;
  }

  .toolbar h2 {
    font-size: 22px;
  }

  .toolbar-actions {
    display: grid;
  }

  .toolbar-actions select,
  .load-more-button {
    width: 100%;
  }

  .map-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .map-card-heading {
    min-height: 0;
  }

  .map-name {
    -webkit-line-clamp: 3;
  }

  .report-modal {
    padding: 20px;
  }

  .report-modal-actions {
    display: grid;
  }
}

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