:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --ink: #10223c;
  --muted: #62728a;
  --line: #cfe0f4;
  --surface: #ffffff;
  --page: #f5f9ff;
  --accent: #0878ff;
  --accent-dark: #1238c9;
  --accent-cyan: #05c8d7;
  --warn: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(5, 200, 215, 0.18), transparent 40%),
    linear-gradient(315deg, rgba(8, 120, 255, 0.16), transparent 45%),
    var(--page);
}

.backend-link {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.08);
}

.backend-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 42px 18px 56px;
}

.hero {
  padding: 8px 2px 22px;
}

.brand-mark {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 18px;
}

.brand-mark img {
  width: 86px;
  height: 86px;
  border: 1px solid rgba(8, 120, 255, 0.18);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 14px 32px rgba(8, 120, 255, 0.14);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
}

.hero p:last-child,
.admin-head p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.lead-form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(8, 120, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(8, 51, 144, 0.12);
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 400;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 120, 255, 0.16);
}

textarea {
  resize: vertical;
}

.consent {
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

button,
.admin-export {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.admin-export:hover {
  background: linear-gradient(135deg, var(--accent-dark), #0878ff);
}

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

.message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.message[data-type="success"] {
  color: #075fbf;
}

.message[data-type="error"] {
  color: var(--warn);
}

.admin-body {
  background: #f6f8fb;
}

.admin-shell {
  width: min(100% - 28px, 1180px);
  margin: 0 auto;
  padding: 34px 0;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

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

.admin-export,
.admin-logout {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  white-space: nowrap;
}

.admin-logout {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
}

.admin-logout:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
}

.login-form {
  width: min(100%, 420px);
}

.csv-preview {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: #1f2933;
  background: #fff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  white-space: pre;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #edf3f8;
  font-weight: 700;
}

td {
  color: #27313d;
}

@media (max-width: 640px) {
  .page {
    padding-top: 26px;
  }

  .brand-mark {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }

  .brand-mark img {
    width: 64px;
    height: 64px;
  }

  .backend-link {
    position: static;
    margin: 14px 18px 0 auto;
    width: fit-content;
  }

  h1 {
    font-size: 28px;
  }

  .lead-form {
    padding: 18px;
  }

  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
