:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #16202a;
  --muted: #667485;
  --border: #dce3ea;
  --accent: #1d7f64;
  --accent-dark: #0f5f4a;
  --danger: #b42318;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

.shell {
  width: min(1240px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 20px;
  align-items: stretch;
  padding: 24px 0;
}

.status-panel,
.map-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(24, 37, 53, 0.08);
}

.status-panel {
  padding: 22px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 74px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #111820;
  border: 1px solid var(--border);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

p {
  margin: 5px 0 0;
  color: var(--muted);
}

.config-form {
  display: grid;
  gap: 14px;
}

.history-control {
  margin-top: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.summary {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.summary span {
  color: var(--muted);
}

.summary strong {
  text-align: right;
}

.history-section {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

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

.history-list {
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 0;
}

.history-list button {
  width: 100%;
  min-height: 54px;
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 8px 10px;
  background: #f8fafb;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: none;
  text-align: left;
}

.history-list button:hover {
  background: #eef6f2;
  border-color: #bddace;
}

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

.history-list strong {
  font-size: 13px;
  font-weight: 700;
}

.map-panel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
}

.map {
  width: 100%;
  height: 100%;
  min-height: 620px;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(135deg, #eef5f2, #f7f9fb);
}

.map-actions {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
}

.map-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(22, 32, 42, 0.12);
}

.is-stale {
  color: var(--danger);
}

@media (max-width: 840px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(100vw - 20px, 560px);
    padding: 10px 0;
  }

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