:root {
  color-scheme: light;
  --bg: #f5efe3;
  --bg-soft: #fbf7ef;
  --panel: rgba(255, 251, 244, 0.82);
  --panel-strong: #fffdf9;
  --line: rgba(78, 58, 34, 0.12);
  --text: #2d2317;
  --text-soft: #65533d;
  --brand: #b65a2e;
  --brand-strong: #8f401d;
  --accent: #2d6f68;
  --danger: #b83d3d;
  --shadow: 0 24px 60px rgba(92, 67, 34, 0.16);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-body: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-title: "STKaiti", "KaiTi", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(255, 199, 120, 0.36), transparent 34%),
    radial-gradient(circle at bottom right, rgba(106, 177, 170, 0.22), transparent 28%),
    linear-gradient(180deg, #f8f2e7 0%, #efe4cf 100%);
  color: var(--text);
  font-family: var(--font-body);
}

button,
input,
table {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page-backdrop,
.page-orb {
  pointer-events: none;
  position: fixed;
}

.page-backdrop {
  inset: 0;
  backdrop-filter: blur(24px);
}

.page-orb {
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.56;
}

.page-orb-left {
  top: 72px;
  left: -80px;
  width: 260px;
  height: 260px;
  background: rgba(230, 177, 101, 0.52);
}

.page-orb-right {
  right: -100px;
  bottom: 80px;
  width: 320px;
  height: 320px;
  background: rgba(87, 150, 144, 0.3);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 40px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.auth-view {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
}

.auth-card,
.panel,
.hero,
.control-bar {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(560px, 100%);
  padding: 36px;
  border-radius: var(--radius-xl);
  animation: rise-in 420ms ease;
}

.auth-card h1,
.hero h2,
.panel h3,
.modal-card h3 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-card h1 {
  font-size: clamp(34px, 5vw, 48px);
}

.auth-copy,
.hero-copy,
.panel-head p,
.empty-card span,
.inline-note,
.detail-grid dd {
  color: var(--text-soft);
}

.auth-copy {
  margin: 14px 0 28px;
  line-height: 1.7;
}

.login-form,
.marker-form {
  display: grid;
  gap: 18px;
}

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

.field span {
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(93, 72, 45, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.85);
  outline: none;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.field input:focus {
  border-color: rgba(182, 90, 46, 0.55);
  box-shadow: 0 0 0 4px rgba(182, 90, 46, 0.12);
  transform: translateY(-1px);
}

.button,
.segmented-button,
.icon-button {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.segmented-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button {
  padding: 12px 18px;
  font-weight: 700;
}

.button-primary {
  color: #fff9f4;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  box-shadow: 0 16px 28px rgba(182, 90, 46, 0.28);
}

.button-secondary {
  color: var(--brand-strong);
  background: rgba(255, 240, 231, 0.92);
}

.button-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.52);
}

.app-view {
  display: grid;
  gap: 18px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  animation: rise-in 420ms ease;
}

.hero h2 {
  font-size: clamp(28px, 4vw, 40px);
}

.hero-copy {
  max-width: 680px;
  margin: 10px 0 0;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 12px;
}

.control-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}

.view-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.segmented-button {
  padding: 10px 16px;
  color: var(--text-soft);
  background: transparent;
  font-weight: 700;
}

.segmented-button.is-active {
  color: #fffaf6;
  background: linear-gradient(135deg, #82502b 0%, #b65a2e 100%);
  box-shadow: 0 10px 18px rgba(130, 80, 43, 0.2);
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-box span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.search-box input {
  padding: 12px 14px;
  border: 1px solid rgba(93, 72, 45, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
}

.status-badge {
  justify-self: end;
  min-width: 110px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(45, 111, 104, 0.14);
  color: var(--accent);
  font-weight: 700;
  text-align: center;
}

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-map {
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
}

.panel {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px 14px;
  gap: 14px;
}

.panel-head h3 {
  font-size: 28px;
}

.panel-head p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.map-stage {
  position: relative;
  min-height: 620px;
  padding: 0 18px 18px;
}

.map-canvas,
.map-fallback {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border-radius: calc(var(--radius-xl) - 8px);
}

.map-canvas {
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(182, 90, 46, 0.16), transparent 0 24%),
    linear-gradient(140deg, rgba(255, 247, 236, 0.95) 0%, rgba(244, 230, 211, 0.95) 100%);
}

.map-fallback {
  position: absolute;
  inset: 0 18px 18px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--text-soft);
  text-align: center;
  background: rgba(255, 253, 248, 0.88);
  border: 1px dashed rgba(93, 72, 45, 0.18);
}

.map-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(45, 35, 23, 0.82);
  color: #fff8f1;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(45, 35, 23, 0.18);
}

.empty-card {
  display: grid;
  gap: 8px;
  margin: 0 20px 22px;
  padding: 24px;
  border: 1px dashed rgba(93, 72, 45, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.4);
}

.detail-content {
  display: grid;
  gap: 18px;
  padding: 0 20px 24px;
}

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

.detail-title h4 {
  margin: 0;
  font-size: 22px;
}

.detail-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(182, 90, 46, 0.12);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.detail-grid div {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.52);
}

.detail-grid dt {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.detail-grid dd {
  margin: 0;
  line-height: 1.6;
}

.detail-actions,
.inline-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-list {
  padding-bottom: 16px;
}

.table-wrap {
  overflow: auto;
  padding: 0 16px 12px;
}

.marker-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1080px;
}

.marker-table th,
.marker-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(93, 72, 45, 0.1);
  text-align: left;
  vertical-align: top;
}

.marker-table thead th {
  position: sticky;
  top: 0;
  background: rgba(251, 247, 239, 0.92);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-button {
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
}

.row-button.is-danger {
  color: #fff7f7;
  background: linear-gradient(135deg, #ca5b5b 0%, #a93a3a 100%);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(41, 28, 14, 0.26);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(760px, 100%);
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  border: 1px solid rgba(93, 72, 45, 0.12);
  box-shadow: 0 26px 60px rgba(56, 38, 18, 0.24);
  animation: rise-in 260ms ease;
}

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

.icon-button {
  width: 40px;
  height: 40px;
  color: var(--text);
  background: rgba(246, 239, 230, 0.9);
  font-size: 24px;
}

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

.form-error {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(184, 61, 61, 0.1);
  color: var(--danger);
  font-weight: 600;
}

.inline-note {
  font-size: 14px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 30;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(45, 35, 23, 0.92);
  color: #fff9f2;
  box-shadow: 0 18px 28px rgba(45, 35, 23, 0.2);
  animation: toast-in 180ms ease;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 1080px) {
  .hero,
  .control-bar,
  .workspace-map {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .status-badge {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 1360px);
    padding-top: 18px;
  }

  .auth-card,
  .hero,
  .control-bar,
  .panel,
  .modal-card {
    border-radius: 24px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .map-stage {
    min-height: 460px;
  }

  .map-canvas,
  .map-fallback {
    min-height: 420px;
  }
}
