:root {
  --ink: #101820;
  --ink-2: #172433;
  --navy: #24384c;
  --snow: #f3efe6;
  --paper: #faf7f1;
  --cream: #f7f1e4;
  --gold: #e2b15c;
  --gold-deep: #a9792d;
  --crimson: #a33b38;
  --glacier: #3e7eab;
  --ok: #2f6b4f;
  --muted: #5e6b78;
  --line: rgba(16, 24, 32, 0.1);
  --max: 900px;
  --sans: Outfit, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html,
body {
  max-width: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--snow);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; margin: 0; word-break: break-word; }

.bk-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(16, 24, 32, 0.92);
  color: var(--cream);
  backdrop-filter: blur(10px);
}
.bk-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}
.bk-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}
.bk-brand small {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  opacity: 0.7;
  font-size: 12px;
}
.bk-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.bk-nav a { opacity: 0.82; }
.bk-nav a:hover,
.bk-nav a.is-on { opacity: 1; color: var(--gold); }

.bk-hero {
  /* event-peak3.jpg 为超宽条幅 4794×874，用宽度铺满避免 cover 裁切上下 */
  background-color: #101820;
  background-image:
    linear-gradient(
      180deg,
      rgba(8, 12, 18, 0.78) 0%,
      rgba(8, 12, 18, 0.55) 45%,
      rgba(8, 12, 18, 0.82) 100%
    ),
    url("../images/event-peak3.jpg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
  color: #fff8ea;
  padding: clamp(36px, 7.5vw, 92px) 16px clamp(28px, 5.5vw, 64px);
  text-align: center;
  min-height: calc(100vw * 874 / 4794);
  box-sizing: border-box;
}
.bk-hero h1 {
  font-size: clamp(22px, 3.2vw, 32px);
  margin-bottom: 14px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 2px 12px rgba(0, 0, 0, 0.55),
    0 0 1px rgba(0, 0, 0, 0.9);
}
.bk-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.bk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(12, 16, 22, 0.82);
  border: 1px solid rgba(226, 177, 92, 0.75);
  color: #ffe7b0;
  font-size: 12.5px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.bk-chip a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wrap {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
}
.bk-section { padding: 26px 0; }
.bk-section h2,
.bk-section h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}
.bk-section .sub {
  color: var(--muted);
  margin: -4px 0 14px;
  font-size: 13px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.route-card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(16, 24, 32, 0.05);
}
.route-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #ddd;
}
.route-card-zoom {
  cursor: zoom-in;
}
.route-card-zoom:hover {
  border-color: rgba(226, 177, 92, 0.55);
  box-shadow: 0 10px 24px rgba(16, 24, 32, 0.1);
}
.route-card figcaption {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--navy);
}

.slot-photo-board { display: grid; gap: 16px; }
.slot-photo-route h3 { margin-bottom: 8px; font-size: 1.15rem; }
.slot-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.slot-photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(16, 24, 32, 0.05);
}
.slot-photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #d7d2c8;
}
.slot-photo-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 24, 32, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.slot-photo-state {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(47, 107, 79, 0.92);
  color: #fff;
}
.slot-photo.is-full { opacity: 0.72; cursor: not-allowed; }
.slot-photo.is-full .slot-photo-state {
  background: rgba(163, 59, 56, 0.92);
}
.slot-photo.is-on {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(226, 177, 92, 0.35);
}
.slot-photo.is-open:hover:not(:disabled) {
  border-color: rgba(226, 177, 92, 0.7);
}

.slot-board {
  display: grid;
  gap: 22px;
}
.slot-route h4 { margin-bottom: 12px; }
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.slot-pill {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  background: #fff;
}
.slot-pill strong { display: block; font-size: 15px; }
.slot-pill span {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}
.slot-pill.is-open span {
  background: rgba(47, 107, 79, 0.12);
  color: var(--ok);
}
.slot-pill.is-full {
  opacity: 0.72;
  background: #f4f1ea;
}
.slot-pill.is-full span {
  background: rgba(163, 59, 56, 0.12);
  color: var(--crimson);
}
.slot-pill button {
  all: unset;
  cursor: pointer;
  display: block;
  width: 100%;
}
.slot-pill.is-open:hover {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 2px rgba(226, 177, 92, 0.25);
}

.booked-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.booked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.booked-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.booked-list b { color: var(--gold-deep); }
.booked-list time { color: var(--muted); font-size: 13px; }
.empty {
  color: var(--muted);
  padding: 18px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 1px dashed var(--line);
}

.form-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 12px;
  align-items: start;
}
.panel { padding: 16px; }
.panel h3 { margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
}
.btn-gold { background: var(--gold); color: #1c1408; }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-line {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-danger { background: var(--crimson); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.notice-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--navy);
}
.notice-card li { margin: 8px 0; }
.cc-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(226, 177, 92, 0.12);
  border: 1px solid rgba(226, 177, 92, 0.28);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  display: none;
}
.toast.show { display: block; }
.toast.err { background: #5c1f1d; }
.toast.ok { background: #1d3d2f; }

.bk-foot {
  margin-top: 12px;
  padding: 18px 16px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.activity-list {
  display: grid;
  gap: 14px;
}
.activity-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.activity-card h3 { margin-bottom: 6px; }
.activity-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* Admin */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
.admin-side {
  background: var(--ink);
  color: var(--cream);
  padding: 22px 16px;
}
.admin-side h1 {
  font-size: 20px;
  margin-bottom: 18px;
}
.admin-side button,
.admin-side a {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
}
.admin-side button.is-on,
.admin-side a.is-on,
.admin-side button:hover,
.admin-side a:hover {
  background: rgba(226, 177, 92, 0.18);
  color: var(--gold);
}
.admin-main { padding: 24px; }
.admin-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.stat {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stat b { display: block; font-size: 28px; font-family: var(--serif); }
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}
.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}
.table th { background: #f7f1e4; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.tag-pending { background: #fff3d6; color: #8a5a00; }
.tag-approved { background: #ddf0e4; color: #1d5a38; }
.tag-rejected { background: #f5d9d8; color: #7a2422; }
.login-box {
  max-width: 420px;
  margin: 12vh auto;
  padding: 28px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
}
.hidden { display: none !important; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); }
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.admin-slot-boards { display: grid; gap: 22px; }
.admin-route-block {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}
.admin-route-title {
  margin: 0 0 12px;
  font-size: 18px;
}
.admin-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.admin-slot-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.admin-slot-card.route-a { border-color: rgba(62, 126, 171, 0.45); }
.admin-slot-card.route-b { border-color: rgba(169, 121, 45, 0.45); }
.admin-slot-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #ddd;
}
.admin-slot-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(16, 24, 32, 0.06), rgba(16, 24, 32, 0.02)),
    repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(16, 24, 32, 0.04) 8px, rgba(16, 24, 32, 0.04) 16px);
}
.admin-slot-card.route-a .admin-slot-empty { color: #2f5f82; background-color: #e7f1f8; }
.admin-slot-card.route-b .admin-slot-empty { color: #8a5a16; background-color: #f7eedc; }
.admin-slot-card .meta {
  padding: 10px;
  display: grid;
  gap: 8px;
}
.admin-slot-card strong { font-size: 14px; }
.admin-slot-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.slot-photo-route.route-a,
.slot-photo-route.route-b {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.slot-photo-route.route-a { border-color: rgba(62, 126, 171, 0.35); box-shadow: inset 3px 0 0 #3e7eab; }
.slot-photo-route.route-b { border-color: rgba(169, 121, 45, 0.35); box-shadow: inset 3px 0 0 #a9792d; }
.slot-photo-hint {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12.5px;
}
.slot-photo-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  text-align: center;
  font-weight: 700;
  line-height: 1.4;
  color: var(--muted);
  background: #ece7dc;
}
.slot-photo.route-a .slot-photo-empty { color: #2f5f82; background: #e7f1f8; }
.slot-photo.route-b .slot-photo-empty { color: #8a5a16; background: #f7eedc; }
.slot-photo.route-a .slot-photo-tag { background: rgba(47, 95, 130, 0.9); }
.slot-photo.route-b .slot-photo-tag { background: rgba(138, 90, 22, 0.9); }

.activity-card { cursor: pointer; }
.activity-card:hover { border-color: var(--gold-deep); }

.route-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin: 0 4px 4px 0;
}
.route-badge.route-a { background: #e7f1f8; color: #2f5f82; }
.route-badge.route-b { background: #f7eedc; color: #8a5a16; }
.slot-pick { min-width: 180px; }
.slot-pick-block + .slot-pick-block { margin-top: 10px; }
.slot-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  background: #f3efe6;
}
.slot-chip.route-a { background: #d9eaf6; color: #234e6d; }
.slot-chip.route-b { background: #f3e2c2; color: #7a5014; }
.slot-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.slot-thumb {
  width: 64px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
  cursor: zoom-in;
}
.slot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slot-thumb span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  color: var(--muted);
}
.slot-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(16, 24, 32, 0.72);
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.slot-preview-mask img {
  max-width: min(960px, 100%);
  max-height: min(85vh, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  background: #111;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.table-scroll .table {
  min-width: 560px;
  border-radius: 0;
  border: 0;
}

@media (max-width: 900px) {
  .wrap {
    width: min(var(--max), calc(100% - 20px));
  }
  .bk-section { padding: 20px 0; }
  .bk-hero {
    padding: clamp(28px, 8vw, 48px) 14px clamp(22px, 6vw, 36px);
    background-size: 100% auto;
  }
  .bk-top {
    padding: 10px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .bk-nav { gap: 12px; font-size: 13px; }
  .route-grid,
  .slotmap-grid,
  .booked-grid,
  .form-layout,
  .admin-shell,
  .split-2,
  .activity-card {
    grid-template-columns: 1fr;
  }
  .slot-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .slot-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }
  .booked-list li {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }
  .activity-card {
    gap: 12px;
    padding: 14px 16px;
  }
  .activity-card .btn {
    width: 100%;
  }
  .panel { padding: 14px; }
  .admin-side {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 12px;
  }
  .admin-side h1 { width: 100%; margin-bottom: 8px; }
  .admin-side button,
  .admin-side a { width: auto; margin-bottom: 0; }
  .admin-main {
    padding: 14px 12px 28px;
    min-width: 0;
  }
  .admin-bar { align-items: stretch; }
  .admin-bar .btn { width: 100%; }
  .admin-slot-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .login-box {
    margin: 8vh 14px;
    padding: 22px 18px;
  }
  .slot-pick { min-width: 0; width: 100%; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .bk-brand span { font-size: 14px; }
  .bk-brand small { font-size: 11px; }
  .bk-section h2,
  .bk-section h3 { font-size: 1.2rem; }
  .slot-photo-grid {
    grid-template-columns: 1fr;
  }
  .slot-photo img,
  .route-card img {
    aspect-ratio: 16 / 10;
  }
  .field input,
  .field textarea,
  .field select,
  .admin-slot-card input,
  .login-box input {
    font-size: 16px; /* 避免 iOS 聚焦时自动放大 */
    padding: 12px;
  }
  .btn {
    min-height: 44px;
    padding: 12px 16px;
  }
  .notice-card ul {
    padding-left: 1.15em;
  }
  .cc-box { word-break: break-word; }
}
