:root {
  --green: #2da247;
  --green-dark: #137d2f;
  --green-soft: #edf8f0;
  --ink: #233028;
  --muted: #66716a;
  --line: #d7e9dc;
  --paper: #ffffff;
  --page: min(1180px, calc(100vw - 40px));
  --font-default: "Aa大标宋", "Aa DaBiaoSong", "FZDaBiaoSong-B06S", "FZDaBiaoSongS-B-GB", "FangZhengDaBiaoSongJianTi", "方正大标宋简体", "方正大标宋_GBK", "方正大标宋", "STSong", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f7fbf8;
  color: var(--ink);
  font-family: var(--font-default);
}

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 74px;
  padding: 14px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    linear-gradient(90deg, rgba(247, 251, 248, 0.96), rgba(247, 251, 248, 0.72)),
    url("assets/hero-airplane.jpg") center / cover;
}

.login-home-link {
  position: absolute;
  top: 32px;
  right: max(24px, calc((100vw - 1180px) / 2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--green-dark);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 14px 36px rgba(18, 64, 31, 0.1);
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(18, 64, 31, 0.16);
}

.login-card img {
  width: 220px;
  max-width: 100%;
  height: auto;
}

.login-card h1 {
  margin: 8px 0 0;
  color: var(--green-dark);
  font-size: 30px;
}

.login-card p,
.login-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-card label {
  display: grid;
  gap: 8px;
}

.login-card label span {
  color: var(--green-dark);
  font-weight: 900;
}

.login-card input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #fff;
}

.login-actions {
  display: grid;
  gap: 12px;
}

.login-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--green);
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
}

.login-card button {
  background: var(--green);
  color: #fff;
}

.admin-brand img {
  display: block;
  width: 210px;
  height: auto;
}

.admin-header strong,
.admin-header span {
  display: block;
}

.admin-header strong {
  color: var(--green-dark);
  font-size: 22px;
}

.admin-header span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.admin-actions a,
.admin-actions button,
.button-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(45, 162, 71, 0.26);
  border-radius: 6px;
  background: var(--paper);
  color: var(--green-dark);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.admin-actions button[data-save],
.admin-actions button[data-publish],
.admin-actions button[data-export],
.publish-main-row button[data-publish] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.admin-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  width: var(--page);
  margin: 28px auto 70px;
}

.admin-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 8px;
  align-self: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.admin-sidebar a {
  padding: 12px 14px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.admin-sidebar a:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

.admin-form {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 20px 50px rgba(24, 80, 39, 0.06);
  overflow: hidden;
}

.panel-head {
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7fcf8);
}

.panel-head span {
  display: block;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.panel-head h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 28px;
}

.panel-head p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 24px 26px 28px;
}

.field-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-block.wide {
  grid-column: 1 / -1;
}

.field-block span {
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.field-block small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-block input,
.field-block textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field-block input {
  min-height: 42px;
  padding: 0 12px;
}

.field-block input[type="color"] {
  width: 74px;
  padding: 4px;
}

.field-block.checkbox-field {
  align-content: start;
}

.field-block.checkbox-field input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  padding: 0;
  accent-color: var(--green);
}

.field-block textarea {
  min-height: 96px;
  resize: vertical;
  padding: 12px;
  line-height: 1.7;
}

.field-block textarea[data-json-field],
.publish-panel textarea {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.image-field img {
  width: 120px;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fcf8;
}

.image-field.logo-image-field img {
  width: 180px;
  aspect-ratio: 15 / 8;
  padding: 10px;
}

.image-field input[type="file"] {
  padding: 9px 12px;
}

.publish-panel {
  padding-bottom: 26px;
}

.publish-panel > .field-block,
.publish-panel > .button-row {
  margin: 20px 26px 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.publish-main-row {
  align-items: center;
}

.publish-main-row span {
  color: var(--muted);
  font-size: 13px;
}

.button-row button[data-reset] {
  margin-left: auto;
  border-color: #e7b6b6;
  color: #a52929;
}

.lead-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
}

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

.lead-toolbar button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.lead-toolbar button[data-export-leads] {
  background: #fff;
  color: var(--green-dark);
}

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

.lead-table-wrap {
  overflow-x: auto;
  padding: 0 26px 26px;
}

.lead-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.lead-table th,
.lead-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.lead-table th {
  color: var(--green-dark);
  font-weight: 900;
  white-space: nowrap;
}

.lead-table td {
  color: var(--ink);
  line-height: 1.55;
}

.lead-table small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.lead-delete-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #e7b6b6;
  border-radius: 6px;
  background: #fff;
  color: #a52929;
  font-weight: 900;
  cursor: pointer;
}

.admin-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(380px, calc(100vw - 44px));
  padding: 14px 18px;
  border-radius: 8px;
  background: #1d2a20;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.admin-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .admin-header {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    flex-wrap: wrap;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .login-actions {
    grid-template-columns: 1fr;
  }

  .login-home-link {
    top: 18px;
    right: 18px;
    min-height: 40px;
    padding: 0 16px;
  }
}

@media (max-width: 620px) {
  .admin-brand img {
    width: 180px;
  }

  .admin-sidebar {
    grid-template-columns: 1fr;
  }
}
