:root {
  color-scheme: light;
  --bg: #f5f7f5;
  --panel: #ffffff;
  --ink: #16201b;
  --muted: #66716c;
  --line: #dce3df;
  --green: #23735a;
  --green-dark: #15523f;
  --blue: #2367a2;
  --amber: #9a651c;
  --danger: #a33939;
  --shadow: 0 16px 40px rgba(25, 38, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  align-items: stretch;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.workspace,
.results {
  min-width: 0;
}

.workspace {
  display: flex;
  flex-direction: column;
}

.intro {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro p:last-child {
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.input-panel,
.results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.input-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

textarea {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  color: var(--ink);
  font: 16px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 115, 90, 0.13);
}

.actions,
.map-actions,
.map-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions {
  margin-top: 14px;
}

button,
.map-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 15px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.map-button:hover {
  border-color: #b8c6bf;
}

.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.primary:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.results {
  padding: 18px;
}

.status {
  min-height: 44px;
  border-radius: 6px;
  padding: 11px 12px;
  background: #edf3ef;
  color: var(--green-dark);
  font-weight: 700;
}

.status.error {
  background: #f8eaea;
  color: var(--danger);
}

.status.warning {
  background: #fbf0dc;
  color: var(--amber);
}

.result-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.result-card h2,
.details h2 {
  margin-bottom: 7px;
  font-size: 15px;
}

.details h2 {
  font-size: 14px;
}

.result-card p {
  margin-bottom: 0;
  overflow-wrap: anywhere;
  color: var(--blue);
  font: 17px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.copy-button {
  flex: 0 0 auto;
}

.map-actions {
  margin-top: 16px;
}

.map-settings {
  align-items: center;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.map-settings span {
  font-weight: 700;
  color: var(--ink);
}

.map-settings label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
  cursor: pointer;
}

.map-settings input {
  accent-color: var(--green);
}

.map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 120px;
  background: var(--ink);
  color: #fff;
}

.map-button.disabled {
  border-color: #cbd5d0;
  background: #d9e0dc;
  color: #7d8983;
}

.details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.details ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.credit {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.credit a {
  color: inherit;
  text-decoration: none;
}

.credit a:hover {
  color: var(--green);
  text-decoration: underline;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 24px 0;
  }

  h1 {
    font-size: 40px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .result-card {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
  }
}
