:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #edf2ec;
  --ink: #17211c;
  --muted: #64706a;
  --line: #d9e0db;
  --primary: #1f6f5b;
  --primary-dark: #124636;
  --accent: #b48b3c;
  --danger: #a53c35;
  --shadow: 0 18px 50px rgba(24, 39, 31, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(244, 246, 243, 0.92), rgba(244, 246, 243, 1) 460px),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1800&q=80") center top / cover fixed;
  min-height: 100vh;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 7vw;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(217, 224, 219, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(180, 139, 60, 0.95), rgba(180, 139, 60, 0.55)),
    linear-gradient(45deg, var(--primary-dark), var(--primary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #435047;
  font-size: 14px;
}

.nav a,
.nav-button {
  padding: 8px 2px;
  background: transparent;
  color: inherit;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: 46px;
  align-items: center;
  min-height: auto;
  padding: 86px 0 46px;
}

.search-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.search-copy p:not(.eyebrow) {
  max-width: 600px;
  color: #4d5a53;
  font-size: 18px;
  line-height: 1.8;
}

.search-box,
.admin-login,
.upload-panel,
.summary-panel,
.table-section {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 224, 219, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-box {
  padding: 28px;
}

.search-box label,
.login-form label,
.lead-form label {
  display: grid;
  gap: 8px;
  color: #334039;
  font-weight: 700;
}

.search-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  margin-top: 10px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid #cfd8d2;
  border-radius: 6px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  background: #ffffff;
  border-color: rgba(31, 111, 91, 0.7);
  box-shadow: 0 0 0 4px rgba(31, 111, 91, 0.12);
}

.search-line button,
.lead-form button,
.login-form button,
.upload-panel button {
  min-height: 46px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--primary);
  border-radius: 6px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search-line button:hover,
.lead-form button:hover,
.login-form button:hover,
.upload-panel button:hover {
  background: var(--primary-dark);
  box-shadow: 0 14px 26px rgba(31, 111, 91, 0.22);
  transform: translateY(-1px);
}

.form-note,
.form-message {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head.compact {
  align-items: center;
}

.results-section,
.solution-band,
.message-band,
.case-band {
  padding: 44px 0;
}

.result-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  color: var(--primary-dark);
  background: #e5eee8;
  border: 1px solid #c9d9cf;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.loading,
.empty-state,
.result-guide {
  padding: 26px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed #c9d3cc;
  border-radius: 8px;
}

.loading {
  display: none;
}

.result-guide {
  display: none;
  margin-top: 16px;
  border-style: solid;
  background: #eef5f1;
}

.result-guide.is-visible {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.result-guide strong {
  color: var(--primary-dark);
}

.result-guide span {
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #d7e2db;
  border-radius: 999px;
  font-size: 13px;
}

.result-grid,
.solution-grid,
.case-grid {
  display: grid;
  gap: 16px;
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.case-card,
.result-card,
.solution-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(217, 224, 219, 0.95);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(24, 39, 31, 0.08);
  transform: translateY(8px);
  opacity: 0;
  animation: riseIn 420ms ease forwards;
}

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

.result-card {
  padding: 22px;
}

.result-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.person-name {
  margin: 0;
  font-size: 24px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #204337;
  background: #e7f0eb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.info-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  color: #2d3832;
  line-height: 1.55;
}

.info-row dt {
  color: var(--muted);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.ghost-button,
.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 800;
}

.solid-button {
  color: #ffffff;
  background: var(--primary);
}

.ghost-button {
  color: var(--primary-dark);
  background: #edf4ef;
  border: 1px solid #cbdcd2;
}

.solution-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.solution-card {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: end;
  isolation: isolate;
}

.solution-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--image) center / cover;
  transition: transform 300ms ease;
}

.solution-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(12, 24, 19, 0.12), rgba(12, 24, 19, 0.76));
}

.solution-card:hover::before {
  transform: scale(1.05);
}

.solution-content {
  padding: 24px;
  color: #ffffff;
}

.solution-content h3,
.solution-content p {
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.28);
}

.solution-content p {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
}

.case-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.case-card {
  display: grid;
  min-height: 390px;
  cursor: pointer;
}

.case-thumb {
  min-height: 170px;
  background: var(--image) center / cover;
}

.case-body {
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 20px;
}

.case-body p {
  color: var(--muted);
  line-height: 1.65;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-meta span {
  padding: 6px 9px;
  color: #274237;
  background: #edf4ef;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 18, 14, 0.58);
}

.modal.is-open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(780px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.lead-card {
  width: min(720px, 100%);
}

.icon-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.modal-image {
  min-height: 230px;
  background: var(--image) center / cover;
}

.modal-body {
  padding: 26px;
}

.modal-body p {
  color: #56645d;
  line-height: 1.8;
}

.modal-points {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.modal-points div {
  padding: 12px 14px;
  background: #f2f6f3;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
}

.lead-form {
  display: grid;
  gap: 16px;
}

.settings-form {
  display: grid;
  gap: 20px;
}

.settings-form label {
  display: grid;
  gap: 8px;
  color: #334039;
  font-weight: 700;
}

.settings-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background: #f7faf8;
  border: 1px solid #dce5df;
  border-radius: 8px;
}

.settings-group > div:first-child,
.settings-group label:has(textarea),
.card-editor-grid,
.case-editor-list {
  grid-column: 1 / -1;
}

.settings-group h3 {
  margin: 0;
  font-size: 20px;
}

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

.case-editor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.edit-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #d9e2dc;
  border-radius: 8px;
}

.edit-card strong {
  color: var(--primary-dark);
  font-size: 16px;
}

.settings-form button {
  width: fit-content;
  min-height: 44px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--primary);
  border-radius: 6px;
  font-weight: 800;
}

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

.message-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  gap: 28px;
  align-items: start;
  padding: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 224, 219, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.message-layout p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
}

.inline-lead-form {
  padding: 0;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 40px auto 0;
  padding: 26px 0 36px;
  color: #65736c;
  border-top: 1px solid rgba(217, 224, 219, 0.9);
  font-size: 13px;
}

.admin-body {
  background: #f5f7f4;
}

.admin-shell {
  padding: 42px 0 60px;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
  padding: 34px;
}

.admin-login h1,
.admin-workspace h1 {
  font-size: 42px;
}

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

.admin-workspace {
  display: grid;
  gap: 24px;
}

.is-hidden {
  display: none !important;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.upload-panel,
.summary-panel,
.table-section {
  padding: 22px;
}

.file-drop {
  display: grid;
  gap: 10px;
  min-height: 142px;
  padding: 22px;
  border: 1px dashed #b9c7be;
  border-radius: 8px;
  background: #f8faf8;
}

.file-drop input {
  padding: 10px;
}

.file-drop span {
  font-weight: 800;
}

.file-drop small {
  color: var(--muted);
  line-height: 1.6;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #405048;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: center;
}

.summary-panel div {
  padding: 18px;
  background: #f3f7f4;
  border-radius: 8px;
}

.summary-panel p {
  margin-bottom: 8px;
  color: var(--muted);
}

.summary-panel strong {
  font-size: 34px;
}

.table-search {
  max-width: 280px;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: #46544c;
  background: #f3f6f4;
  font-size: 13px;
}

td {
  color: #26332d;
  font-size: 14px;
}

@media (max-width: 920px) {
  .search-panel,
  .admin-login,
  .admin-grid,
  .message-layout {
    grid-template-columns: 1fr;
  }

  .search-panel {
    min-height: auto;
    padding-top: 42px;
  }

  .result-grid,
  .solution-grid,
  .case-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 16px;
  }
}

@media (max-width: 640px) {
  main,
  .footer {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    min-height: 64px;
  }

  .nav {
    gap: 12px;
    font-size: 13px;
  }

  h1,
  .admin-login h1,
  .admin-workspace h1 {
    font-size: 38px;
  }

  .search-line,
  .field-grid,
  .settings-group,
  .card-editor-grid,
  .case-editor-list,
  .summary-panel {
    grid-template-columns: 1fr;
  }

  .section-head,
  .footer {
    align-items: start;
    flex-direction: column;
  }
}
