:root {
  --bg: #f4f6fa;
  --ink: #20242a;
  --muted: #778193;
  --line: #dfe5ee;
  --panel: #ffffff;
  --soft: #f8f9fc;
  --accent: #e95f8b;
  --accent-dark: #d94878;
  --ok: #23976b;
  --bad: #c94955;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(233, 95, 139, 0.13), transparent 32rem),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 42%);
}

a {
  color: inherit;
}

.page {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(28px, 7vh, 68px) 0;
}

.home {
  display: grid;
  gap: 24px;
}

.site-head {
  display: flex;
  align-items: center;
  gap: 22px;
}

.avatar {
  width: 96px;
  height: 96px;
  border: 4px solid #fff;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(30, 38, 52, 0.17);
  object-fit: cover;
}

.kicker {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.8;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(30, 38, 52, 0.09);
}

input {
  min-height: 52px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  color: var(--ink);
  background: #f2f5f9;
  font: inherit;
  outline: none;
}

input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(233, 95, 139, 0.34);
}

button,
.primary-link,
.ghost-link {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  padding: 0 22px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:hover,
.primary-link:hover {
  background: var(--accent-dark);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #edf1f6;
}

.search-results,
.recent {
  display: grid;
  gap: 12px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-title span {
  color: var(--ink);
  font-weight: 800;
}

.section-title small {
  color: var(--muted);
}

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

.map-card {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(30, 38, 52, 0.06);
  text-align: left;
}

.map-card:hover {
  border-color: rgba(233, 95, 139, 0.42);
  background: #fff;
  transform: translateY(-1px);
}

.map-cover {
  width: 112px;
  height: 64px;
  border-radius: 12px;
  background: #edf1f6;
  object-fit: cover;
}

.map-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.map-body strong,
.map-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-body strong {
  font-size: 1rem;
}

.map-body span {
  color: var(--muted);
  font-size: 0.86rem;
}

.map-pill {
  align-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: #f1f3f7;
  font-size: 0.76rem;
  font-weight: 800;
}

.status-ready .map-pill {
  color: var(--ok);
}

.status-failed .map-pill {
  color: var(--bad);
}

.empty,
.fallback-download {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 34, 0.42);
  backdrop-filter: blur(8px);
}

.detail-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 42%) 1fr;
  width: min(860px, 100%);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(12, 18, 28, 0.28);
}

.detail-cover {
  width: 100%;
  height: 100%;
  min-height: 360px;
  background: #edf1f6;
  object-fit: cover;
}

.detail-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px;
}

.detail-content h2 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.detail-meta,
.detail-extra,
.detail-status {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.detail-status {
  min-height: 3.2rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

.status-view {
  padding-top: 8vh;
}

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

.fallback-download {
  overflow-wrap: anywhere;
}

.fallback-download a {
  color: var(--accent-dark);
  font-weight: 800;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .map-grid {
    grid-template-columns: 1fr;
  }

  .detail-card {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
  }

  .detail-cover {
    min-height: 190px;
    height: 190px;
  }
}

@media (max-width: 620px) {
  .site-head {
    gap: 14px;
  }

  .avatar {
    width: 78px;
    height: 78px;
    border-radius: 22px;
  }

  .search-box,
  .map-card {
    grid-template-columns: 1fr;
  }

  .map-cover {
    width: 100%;
    height: 108px;
  }

  button,
  .primary-link,
  .ghost-link {
    width: 100%;
  }
}
