:root {
  color-scheme: light;
  --ink: #10231b;
  --muted: #4e5c53; /* was #58685f — bumped for WCAG AA on small muted text */
  --panel: rgba(255, 252, 242, 0.74);
  --panel-strong: rgba(255, 252, 242, 0.9);
  --line: rgba(23, 48, 35, 0.16);
  --accent: #b88a3d;
  --accent-2: #183d2c;
  --button-ink: #fff9ea;
  --focus: #9c7430; /* visible focus ring, darker gold for contrast */
  --shadow: 0 28px 70px rgba(34, 26, 12, 0.28);
  --shadow-sm: 0 8px 22px rgba(34, 26, 12, 0.12);
  --shadow-md: 0 16px 40px rgba(34, 26, 12, 0.16);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --t-fast: 0.18s ease;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
}

body.site {
  background: #ecdabc; /* 暖色兜底（渐变失败时不至变黑） */
  overflow-x: hidden;
}

body.site::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  /* 地中海暖色（暖陶土·象牙）：上浅下暖竖向渐变 + 右上柔光 + 底部极淡晕影。
     用 CSS 渐变而非图片，任何屏幕比例都完整呈现，更轻更快。 */
  background:
    linear-gradient(180deg, transparent 68%, rgba(60, 32, 18, 0.10) 100%),
    radial-gradient(58% 42% at 74% 12%, rgba(251, 242, 226, 0.55), transparent 62%),
    linear-gradient(180deg, #f4ecdc 0%, #ecdabc 33%, #dcbd93 66%, #cba079 100%);
}

body.site::after {
  content: none;
}

a {
  color: inherit;
}

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

.page-shell {
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 42px 0 46px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.34));
  color: var(--accent-2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-text strong {
  font-size: 18px;
  line-height: 1;
}

.brand-text span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: 100%;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  padding: 0 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.share {
  border-color: #d8c390; /* fallback for browsers without color-mix */
  border-color: color-mix(in srgb, var(--accent) 55%, rgba(255, 255, 255, 0.72));
  background: #ecdcbb; /* fallback for browsers without color-mix */
  background: color-mix(in srgb, var(--accent) 16%, rgba(255, 255, 255, 0.7));
  cursor: pointer;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-panel,
.status-panel,
.section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(24px) saturate(128%);
  backdrop-filter: blur(24px) saturate(128%);
  box-shadow: var(--shadow);
}

.hero-panel {
  min-height: 286px;
  padding: 34px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--accent);
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(52px, 6vw, 82px);
  line-height: 0.94;
  overflow-wrap: break-word;
}

.subtitle {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.52;
  font-weight: 620;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(620px, 100%);
  margin-top: 26px;
  padding: 10px 10px 10px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 999px;
  background: var(--panel-strong);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-weight: 650;
}

.search button,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  color: var(--button-ink);
  background: var(--accent-2);
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.status-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 286px;
  padding: 24px;
  background: var(--panel-strong);
}

.status-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.02;
}

.status-grid {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.status-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 720;
}

.status-item span:last-child {
  color: var(--accent-2);
}

.sections {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.section {
  overflow: hidden;
  /* 高度自适应内容：去掉写死的 min-height，链接多则高、少则矮 */
}

.section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.section h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.link-list {
  display: grid;
  padding: 4px 24px 18px;
}

.item {
  display: grid;
  grid-template-columns: minmax(88px, 0.38fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.item:last-child {
  border-bottom: 0;
}

.item b {
  font-size: 14px;
  line-height: 1.15;
}

.item span {
  min-width: 0;
  color: color-mix(in srgb, var(--ink) 72%, var(--accent-2));
  font-size: 15px;
  font-weight: 760;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  width: fit-content;
  border: 1px solid #d8c390; /* fallback */
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 999px;
  padding: 0 11px;
  color: var(--accent-2);
  background: #f2e7cf; /* fallback */
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 12px;
  font-weight: 820;
}

.empty {
  color: var(--muted);
  font-weight: 650;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  color: color-mix(in srgb, var(--ink) 74%, white);
  font-size: 12px;
  font-weight: 650;
}

body.admin {
  color: #18231f;
  background: #f7f4ec;
}

.admin h1 {
  max-width: none;
  font-family: var(--font-body);
  font-size: 34px;
  line-height: 1.1;
}

.auth-card h1 {
  font-size: 32px;
}

.admin-panel h2 {
  font-size: 22px;
  line-height: 1.2;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card,
.admin-panel,
.admin-topbar {
  border: 1px solid rgba(31, 44, 38, 0.12);
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 16px 42px rgba(31, 28, 20, 0.08);
}

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

.auth-card h1,
.admin-topbar h1,
.admin-panel h2 {
  margin: 0;
}

.muted,
.admin-panel header p {
  color: #6f766f;
}

.alert,
.notice {
  border: 1px solid rgba(184, 138, 61, 0.26);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(184, 138, 61, 0.1);
  color: #533b12;
  font-weight: 700;
}

.auth-form,
.settings-grid,
.admin-list {
  display: grid;
  gap: 14px;
}

.auth-form label,
.field,
.admin-row label {
  display: grid;
  gap: 7px;
  color: #4e574f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.auth-form input,
.settings-grid input,
.settings-grid textarea,
.admin-row input,
.admin-row select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(31, 44, 38, 0.16);
  border-radius: 8px;
  padding: 9px 10px;
  color: #18231f;
  background: #fff;
}

.auth-form button,
.settings-grid button,
.admin-row button,
.admin-panel.compact button,
.admin-actions button,
.admin-actions a {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff9ea;
  background: #183d2c;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.admin-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

.admin-kicker {
  margin: 0 0 4px;
  color: #8a6b31;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.admin-actions form {
  margin: 0;
}

.admin-panel {
  margin-top: 18px;
  padding: 22px;
}

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

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

.field.wide,
.link-row .wide {
  grid-column: 1 / -1;
}

.settings-grid button {
  width: fit-content;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr 86px 90px auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(31, 44, 38, 0.1);
  border-radius: 8px;
  background: #fbfaf5;
}

.row-main {
  display: contents;
}

.link-row {
  grid-template-columns: 140px 1fr 1.2fr 90px 86px 92px auto auto;
}

.delete-form {
  margin: 0;
}

.delete-form .danger {
  color: #fff;
  background: #8a2e2a;
}

code {
  border-radius: 6px;
  padding: 2px 5px;
  background: rgba(24, 61, 44, 0.08);
}

@media (max-width: 980px) {
  .page-shell {
    width: min(calc(100% - 28px), 680px);
    padding-top: 24px;
  }

  .topbar,
  .footer,
  .admin-topbar,
  .admin-panel header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero-grid,
  .sections,
  .settings-grid,
  .admin-row,
  .link-row {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .status-panel {
    min-height: auto;
  }

  .hero-panel {
    padding: 26px;
  }

  h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .search {
    border-radius: 18px;
  }

  .nav-pill,
  .share {
    min-height: 44px;
    padding: 0 14px;
  }
}

/* ── Email capture form ── */
.email-capture { margin-top: 18px; }
.email-row { display: flex; gap: 10px; align-items: stretch; }
.email-row input[type=email] { flex: 1; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.6); font: inherit; }
.email-row button { padding: 0 20px; border: 0; border-radius: 12px; background: var(--accent-2); color: #fff; font-weight: 600; cursor: pointer; }
.email-note { margin: 8px 0 0; font-size: .9rem; }
.email-note.ok { color: var(--accent-2); }
.email-note.err { color: #a3331f; }
.email-privacy { display: block; margin-top: 8px; color: var(--muted); font-size: .8rem; }
.email-privacy a { color: var(--accent-2); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ── Promo card (right box) ── */
.promo-card { background: var(--panel-strong); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.promo-card img { width: 100%; height: auto; display: block; aspect-ratio: 16/10; object-fit: cover; }
.promo-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
/* right box off → left occupies full width */
.hero-grid.no-promo { grid-template-columns: 1fr; }

/* ── Admin: move buttons, leads table, see link, promo preview ── */
.move-form { display: inline; }
.move-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.admin-panel .see { font-size: .8rem; margin-left: 10px; font-weight: 500; }
.leads-actions { margin-bottom: 10px; }
.leads-wrap { overflow-x: auto; }
.leads-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.leads-table th, .leads-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.lead-badge { font-size: .78rem; }
.promo-preview { max-width: 220px; border-radius: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; background: #fff; font-size: .85rem; font-weight: 700; text-decoration: none; color: var(--ink); cursor: pointer; }

/* 背景（2026-07）：整站统一"地中海暖色"渐变（手机+电脑同款），见 body.site::before */

/* ══ Accessibility & interaction polish (added 2026-07) ══ */

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Visible keyboard focus (was entirely missing). Outline follows each element's own radius. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.email-row:focus-within { border-color: var(--accent); }
/* the success/error note is focused after the PRG redirect — keep it in view */
.email-note[tabindex] { scroll-margin-top: 24px; }

/* Hover / active / transitions (none existed before) */
.nav-pill, .share, .primary-action, .search button,
.email-row button, .item, .btn, .move-btn,
.auth-form button, .settings-grid button, .admin-row button,
.admin-actions a, .admin-actions button {
  transition: background-color var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast), color var(--t-fast);
}
.nav-pill:hover { background: rgba(255, 255, 255, 0.62); }
.share:hover { border-color: var(--accent); }
.item:hover { background: rgba(184, 138, 61, 0.07); }
.item:hover b { color: var(--accent-2); }
.primary-action:hover, .search button:hover, .email-row button:hover { background: #12301f; }
.primary-action:active, .search button:active, .email-row button:active { transform: translateY(1px); }
.btn:hover { border-color: var(--accent); background: #fffdf7; }
.move-btn:hover { border-color: var(--accent); }
.delete-form .danger:hover { background: #75231f; }

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  body.site::before { transform: none; }
}

/* Opaque fallback where backdrop-filter is unsupported (keeps text readable over the photo bg) */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero-panel, .section, .promo-card, .legal-card { background: var(--panel-strong); }
  .nav-pill { background: rgba(255, 255, 255, 0.85); }
}

/* Footer links */
.footer-links a { color: color-mix(in srgb, var(--ink) 74%, white); text-decoration: underline; }
.footer-links a { color: #3a4a41; } /* fallback if color-mix unsupported */
.footer-links a:hover { color: var(--accent-2); }

/* Intermediate breakpoints: 3 → 2 columns, and stack the hero when the promo box squeezes it */
@media (min-width: 981px) and (max-width: 1080px) {
  .sections { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 981px) and (max-width: 1050px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ── Legal pages (privacy / terms) ── */
.legal-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel-strong);
  -webkit-backdrop-filter: blur(24px) saturate(128%);
  backdrop-filter: blur(24px) saturate(128%);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 44px);
  max-width: 820px;
}
.legal-card h1 { font-family: var(--font-display); font-size: clamp(34px, 5vw, 52px); line-height: 1; margin: 0; }
.legal-body { margin-top: 20px; color: var(--ink); font-weight: 520; line-height: 1.62; }
.legal-body h2 { margin: 26px 0 8px; font-size: 18px; }
.legal-body ul { padding-left: 20px; }
.legal-body li { margin: 6px 0; }
.legal-meta { color: var(--muted); font-weight: 650; }

/* ── Admin: leads stats / filter / pager / ghost button ── */
.leads-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.leads-stats { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.82rem; color: #4e574f; }
.leads-stats b { color: var(--accent-2); font-size: 1rem; }
.leads-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.leads-filter input[type=search] { flex: 1; min-width: 180px; min-height: 38px; border: 1px solid rgba(31, 44, 38, 0.16); border-radius: var(--r-sm); padding: 0 12px; background: #fff; }
.leads-filter select { min-height: 38px; border: 1px solid rgba(31, 44, 38, 0.16); border-radius: var(--r-sm); padding: 0 10px; background: #fff; }
.leads-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 0.85rem; color: #4e574f; }
.btn.ghost { background: transparent; }
.move-btn { min-height: 32px; min-width: 32px; }
