:root {
  --blue-900: #0b2f6f;
  --blue-800: #123f91;
  --blue-700: #1858c8;
  --blue-600: #1f6fe5;
  --blue-100: #e9f2ff;
  --blue-50: #f4f8ff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e2f1;
  --bg: #f4f8fd;
  --card: #ffffff;
  --danger: #c63f3f;
  --success: #17855b;
  --shadow: 0 16px 40px rgba(17, 55, 126, 0.12);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.6;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(16px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 800;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.header-actions a {
  padding: 9px 12px;
  color: var(--blue-800);
  font-weight: 700;
  border-radius: 999px;
}

.header-actions .admin-link {
  color: #fff;
  background: var(--blue-800);
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(11, 47, 111, 0.94), rgba(31, 111, 229, 0.9)),
    linear-gradient(90deg, #0b2f6f, #1f6fe5);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -28% 35%;
  height: 380px;
  background: rgba(255, 255, 255, 0.12);
  transform: skewY(-9deg);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 72px;
}

.hero-content {
  color: #fff;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero .section-kicker {
  color: #bcd8ff;
}

.hero h1,
.qr-copy h1,
.admin-topbar h1,
.login-card h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.16;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 680px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: var(--blue-700);
  box-shadow: 0 10px 24px rgba(31, 111, 229, 0.26);
}

.hero .btn-primary {
  color: var(--blue-900);
  background: #fff;
}

.btn-secondary {
  color: var(--blue-800);
  background: var(--blue-100);
  border: 1px solid rgba(31, 111, 229, 0.18);
}

.hero .btn-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.hero-panel,
.form-shell,
.qr-card,
.login-card,
.table-card {
  border: 1px solid rgba(217, 226, 241, 0.86);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-panel {
  align-self: center;
  padding: 22px;
}

.hero-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
}

.hero-panel-head strong {
  color: var(--blue-800);
  font-size: 20px;
}

.consult-card {
  padding: 16px;
  border-radius: 14px;
  background: var(--blue-50);
}

.consult-card + .consult-card {
  margin-top: 12px;
}

.consult-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.consult-card a,
.consult-card p {
  display: block;
  margin: 4px 0 0;
  color: var(--blue-900);
  font-size: 18px;
  font-weight: 800;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.hero-points span,
.hero-points a {
  padding: 9px 10px;
  color: var(--blue-800);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  border-radius: 999px;
  background: #eef5ff;
  text-decoration: none;
}

.section {
  padding: 58px 0;
}

.section-about,
.section-path {
  background: #fff;
}

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

.section-title {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-title h2,
.form-intro h2 {
  margin: 0;
  color: var(--blue-900);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.22;
}

.lead-text {
  max-width: 980px;
  margin: 0 0 22px;
  color: #344054;
  font-size: 17px;
}

.info-grid,
.card-grid,
.path-grid,
.major-grid,
.stats-grid {
  display: grid;
  gap: 16px;
}

.info-grid {
  grid-template-columns: repeat(4, 1fr);
}

.info-card,
.feature-card,
.path-step,
.major-card,
.stat-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(17, 55, 126, 0.06);
}

.info-card span,
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.info-card strong,
.stat-card strong {
  display: block;
  margin-top: 7px;
  color: var(--blue-900);
  font-size: 18px;
}

.card-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.feature-card h3,
.path-step h3,
.major-card h3 {
  margin: 0 0 8px;
  color: var(--blue-900);
  font-size: 19px;
}

.feature-card p,
.path-step p {
  margin: 0;
  color: var(--muted);
}

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

.path-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  color: #fff;
  font-weight: 900;
  border-radius: 12px;
  background: var(--blue-700);
}

.major-grid {
  grid-template-columns: repeat(6, 1fr);
}

.major-card {
  grid-column: span 2;
}

.major-card:nth-child(3) {
  grid-column: span 2;
}

.major-card:nth-child(4),
.major-card:nth-child(5) {
  grid-column: span 3;
}

.major-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.major-card li {
  padding: 10px 12px;
  color: #344054;
  border-radius: 12px;
  background: var(--blue-50);
}

.form-section {
  background: linear-gradient(180deg, #f4f8fd, #eaf2ff);
}

.form-shell {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 24px;
  padding: 24px;
}

.form-intro {
  padding: 14px;
}

.form-intro p {
  color: var(--muted);
}

.notice {
  margin-top: 18px;
  padding: 15px;
  color: var(--blue-900);
  font-weight: 700;
  border-radius: 14px;
  background: var(--blue-50);
}

.privacy {
  font-size: 13px;
}

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

label span {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

label em {
  color: var(--danger);
  font-style: normal;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--text);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(31, 111, 229, 0.12);
}

.full {
  grid-column: 1 / -1;
}

.submit-btn {
  width: 100%;
  margin-top: 16px;
}

.form-message {
  min-height: 24px;
  margin: 12px 0 0;
  font-weight: 800;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 22px rgba(17, 55, 126, 0.05);
}

.faq-list summary {
  color: var(--blue-900);
  font-weight: 900;
  cursor: pointer;
}

.faq-list p {
  margin: 10px 0 0;
  color: var(--muted);
}

.site-footer {
  padding: 32px 16px;
  color: #dbeafe;
  text-align: center;
  background: var(--blue-900);
}

.site-footer strong,
.site-footer p {
  display: block;
  margin: 5px 0;
}

.admin-body {
  background: #eef4fb;
}

.admin-layout {
  min-height: 100dvh;
}

.hidden {
  display: none !important;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 30px;
}

.login-card h1 {
  color: var(--blue-900);
  font-size: 30px;
}

.login-card p {
  color: var(--muted);
}

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

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
}

.code-btn {
  min-height: 46px;
  padding: 0 12px;
  color: var(--blue-800);
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid rgba(31, 111, 229, 0.26);
  border-radius: 12px;
  background: var(--blue-100);
  cursor: pointer;
}

.code-btn:disabled {
  color: var(--muted);
  background: #eef2f7;
  cursor: not-allowed;
}

.admin-dashboard {
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

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

.admin-topbar h1 {
  color: var(--blue-900);
  font-size: clamp(26px, 4vw, 38px);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

.stat-card strong {
  font-size: 30px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table-card {
  overflow: hidden;
}

.table-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
}

.lead-table {
  width: 100%;
  min-width: 1420px;
  border-collapse: collapse;
  background: #fff;
}

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

.lead-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--blue-900);
  background: #f0f6ff;
  white-space: nowrap;
}

.lead-table td {
  color: #344054;
}

.lead-table select {
  min-width: 120px;
}

.delete-btn {
  min-height: 36px;
  padding: 8px 12px;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
}

.empty-state {
  padding: 36px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.qr-page {
  min-height: calc(100dvh - 78px);
  padding: 48px 16px;
}

.qr-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 24px;
  width: min(1040px, 100%);
  margin: 0 auto;
  align-items: start;
}

.qr-copy {
  padding: 28px 0;
}

.qr-copy h1 {
  color: var(--blue-900);
}

.qr-copy p {
  color: var(--muted);
  font-size: 17px;
}

.offline-tip {
  padding: 15px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.qr-card {
  padding: 24px;
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.qr-output {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #b8c8df;
  border-radius: var(--radius);
  background: #f8fbff;
}

.qr-output canvas,
.qr-output img {
  display: block;
  width: 220px;
  height: 220px;
}

@media (max-width: 980px) {
  .hero-inner,
  .form-shell,
  .qr-shell {
    grid-template-columns: 1fr;
  }

  .info-grid,
  .card-grid.four,
  .path-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .major-card,
  .major-card:nth-child(3),
  .major-card:nth-child(4),
  .major-card:nth-child(5) {
    grid-column: auto;
  }

  .admin-topbar,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    display: grid;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 14px;
  }

  .header-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 13px;
  }

  .header-actions a {
    padding: 7px 9px;
  }

  .hero-inner {
    width: min(100% - 28px, 1180px);
    padding: 42px 0 48px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .section {
    padding: 42px 0;
  }

  .container,
  .admin-dashboard {
    width: calc(100% - 28px);
  }

  .info-grid,
  .card-grid.four,
  .path-grid,
  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: auto;
  }

  .form-shell,
  .login-card,
  .qr-card {
    padding: 18px;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .hero-buttons,
  .qr-actions,
  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .lead-table th,
  .lead-table td {
    font-size: 13px;
  }
}
