/* 鹰牌生活 · 广州设计周 H5 问卷样式
 * 色板策略：Committed（鹰牌官方深森绿 #143A2E + 暖调自然石膏纸面 + 深松墨字）
 * 贴合品牌官方 Logo 与绿植展厅封面实景，确保展馆强光下手机高可读性
 */

:root {
  --kiln-deep: oklch(0.30 0.052 162);
  --kiln-mid: oklch(0.35 0.062 162);
  --kiln-hover: oklch(0.26 0.048 162);
  --kiln-tint: oklch(0.935 0.02 158);

  --plaster-bg: oklch(0.968 0.008 92);
  --plaster-surface: oklch(0.988 0.004 92);
  --plaster-recess: oklch(0.935 0.01 94);

  --ink-primary: oklch(0.20 0.022 162);
  --ink-secondary: oklch(0.42 0.02 160);
  --ink-muted: oklch(0.56 0.016 156);

  --line-hair: oklch(0.865 0.014 140);
  --line-strong: oklch(0.74 0.02 145);

  --danger: oklch(0.52 0.17 25);
  --danger-bg: oklch(0.95 0.03 25);
  --success: oklch(0.42 0.095 156);
  --success-bg: oklch(0.93 0.03 156);

  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  background-color: var(--plaster-recess);
  color: var(--ink-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--plaster-recess);
  line-height: 1.55;
}

/* 移动端优先，桌面预览时居中成 480px H5 画幅 */
.page-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background-color: var(--plaster-bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px oklch(0.21 0.018 44 / 0.08);
}

/* ================= 顶部品牌栏 ================= */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
  background-color: var(--plaster-surface);
  border-bottom: 1px solid var(--line-hair);
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

.event-stamp {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border: 1px solid oklch(0.30 0.052 162 / 0.28);
  border-radius: 999px;
  color: var(--kiln-deep);
  background-color: var(--kiln-tint);
  white-space: nowrap;
}

/* ================= 展馆封面视觉区 ================= */
.hero {
  background-color: var(--kiln-deep);
  color: oklch(0.965 0.008 92);
  padding: 18px 20px 26px;
  animation: fadeSlideIn 0.6s var(--ease-out-expo) both;
}

.hero-visual {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: oklch(0.22 0.035 162);
  margin-bottom: 18px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
  display: block;
}

.hero-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 6vw, 1.7rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.04em;
}

.hero-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: oklch(0.90 0.015 148);
}

/* ================= 问卷主表单 ================= */
.main-sheet {
  flex: 1;
  padding: 26px 20px 24px;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: 0.02em;
}

.req {
  color: var(--kiln-mid);
  margin-left: 2px;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* 文本输入框与下拉框 */
.text-input,
.select-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--ink-primary);
  background-color: var(--plaster-surface);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s var(--ease-out-expo), box-shadow 0.2s var(--ease-out-expo), background-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.text-input::placeholder {
  color: var(--ink-muted);
}

.text-input:focus,
.select-input:focus {
  border-color: var(--kiln-mid);
  box-shadow: 0 0 0 3px oklch(0.35 0.062 162 / 0.16);
}

.select-input:disabled {
  background-color: var(--plaster-recess);
  color: var(--ink-muted);
  cursor: not-allowed;
}

.field-group.has-error .text-input,
.field-group.has-error .select-input {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

/* 姓名 + 先生/女士切换 */
.name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.salutation-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--plaster-recess);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.seg-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.seg-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-secondary);
  border-radius: 4px;
  transition: background-color 0.2s var(--ease-out-expo), color 0.2s;
}

.seg-option input:checked + span {
  background-color: var(--kiln-deep);
  color: oklch(0.975 0.008 72);
}

/* 快捷标签 */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-btn {
  border: 1px solid var(--line-hair);
  background-color: var(--plaster-surface);
  color: var(--ink-secondary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.chip-btn:active,
.chip-btn.is-active {
  border-color: var(--kiln-mid);
  background-color: var(--kiln-tint);
  color: var(--kiln-deep);
  font-weight: 500;
}

/* 省份 + 地级市二级联动 */
.region-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.select-wrap {
  position: relative;
}

.select-input {
  padding-right: 32px;
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-secondary);
  border-bottom: 1.5px solid var(--ink-secondary);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

/* 合作模式选项 */
.coop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coop-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  background-color: var(--plaster-surface);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out-expo), background-color 0.2s;
}

.coop-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.coop-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coop-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.coop-sub {
  font-size: 0.78125rem;
  color: var(--ink-secondary);
}

.coop-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  position: relative;
  transition: border-color 0.2s, background-color 0.2s;
}

.coop-option:has(input:checked) {
  border-color: var(--kiln-mid);
  background-color: var(--kiln-tint);
}

.coop-option:has(input:checked) .coop-check {
  border-color: var(--kiln-mid);
  background-color: var(--kiln-mid);
}

.coop-option:has(input:checked) .coop-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--plaster-surface);
  border-bottom: 2px solid var(--plaster-surface);
  transform: rotate(40deg);
}

/* 「其他」补充说明平滑展开（使用 grid-template-rows 而非 height） */
.other-expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s var(--ease-out-expo);
}

.other-expand.is-open {
  grid-template-rows: 1fr;
}

.other-expand-inner {
  overflow: hidden;
  padding-top: 2px;
}

/* 错误提示 */
.error-msg {
  margin: 0;
  min-height: 0;
  font-size: 0.78125rem;
  color: var(--danger);
  display: none;
}

.field-group.has-error .error-msg {
  display: block;
}

/* 提交按钮区 */
.submit-bar {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.submit-btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--kiln-mid);
  color: oklch(0.98 0.008 72);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out-expo), transform 0.15s;
}

.submit-btn:hover {
  background-color: var(--kiln-hover);
}

.submit-btn:active {
  transform: scale(0.99);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.privacy-note {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* ================= 提交成功独立页 ================= */
.success-page-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.success-view {
  padding: 24px 4px 16px;
  text-align: center;
  animation: fadeSlideIn 0.45s var(--ease-out-expo) both;
}

.success-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.success-badge {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background-color: var(--success-bg);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-badge svg {
  width: 26px;
  height: 26px;
}

.success-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.success-desc {
  margin: 0 0 22px;
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

.receipt-list {
  margin: 0 0 24px;
  padding: 16px 18px;
  text-align: left;
  background-color: var(--plaster-surface);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
  border-bottom: 1px dashed var(--line-hair);
  padding-bottom: 9px;
}

.receipt-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.receipt-row dt {
  color: var(--ink-muted);
  flex-shrink: 0;
}

.receipt-row dd {
  margin: 0;
  color: var(--ink-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.secondary-btn {
  width: 100%;
  height: 46px;
  background-color: transparent;
  color: var(--kiln-deep);
  border: 1px solid var(--kiln-mid);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

/* ================= 页脚 ================= */
.site-footer {
  padding: 16px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  border-top: 1px solid var(--line-hair);
}

.footer-trigger {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 4px 8px;
}

/* ================= 展台工作人员后台抽屉 ================= */
.admin-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.admin-drawer[hidden] {
  display: none;
}

.admin-backdrop {
  position: absolute;
  inset: 0;
  background-color: oklch(0.18 0.015 44 / 0.52);
}

.admin-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 86dvh;
  background-color: var(--plaster-bg);
  border-radius: 16px 16px 0 0;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.admin-sub {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.icon-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-hair);
  background: var(--plaster-surface);
  color: var(--ink-primary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-cell {
  background-color: var(--plaster-surface);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--kiln-deep);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-primary-btn,
.admin-ghost-btn,
.admin-danger-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-primary-btn {
  flex: 1;
  border: none;
  background-color: var(--kiln-mid);
  color: oklch(0.98 0.008 72);
}

.admin-ghost-btn {
  border: 1px solid var(--line-strong);
  background-color: var(--plaster-surface);
  color: var(--ink-primary);
}

.admin-danger-btn {
  border: 1px solid oklch(0.75 0.08 25);
  background-color: transparent;
  color: var(--danger);
}

.webhook-box {
  background-color: var(--plaster-surface);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.webhook-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.webhook-help {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.webhook-row {
  display: flex;
  gap: 8px;
}

.webhook-row .text-input {
  height: 38px;
  font-size: 0.8125rem;
}

.admin-list-wrap {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--line-hair);
  padding-top: 10px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-item {
  background-color: var(--plaster-surface);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.8125rem;
}

.lead-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.lead-item-name {
  font-weight: 600;
  color: var(--ink-primary);
}

.lead-item-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: var(--kiln-tint);
  color: var(--kiln-deep);
  font-weight: 600;
}

.lead-item-meta {
  color: var(--ink-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
}

.empty-state {
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  padding: 24px 0;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-login {
  position: static;
  inset: auto;
  width: min(100% - 32px, 420px);
  height: auto;
  max-height: none;
  margin: clamp(24px, 12vh, 100px) auto;
  padding: 24px;
  overflow: visible;
}

.admin-login .lead-form {
  margin-top: 20px;
}

.admin-login .lead-form .field-label {
  margin-top: 8px;
}
