/**
 * 河北体育局球场宣传H5地图系统 - 全局样式
 * 主色调：科技体育蓝 #1A73E8 / #0055FF
 * 背景：深蓝 #0A1628
 */

/* ---------- CSS 变量 ---------- */
:root {
  --primary: #1a73e8;
  --primary-deep: #0055ff;
  --primary-soft: rgba(26, 115, 232, 0.18);
  --bg: #0a1628;
  --bg-elevated: #122238;
  --surface: rgba(18, 34, 56, 0.92);
  --text: #e8f1ff;
  --text-muted: #8aa0c0;
  --border: rgba(26, 115, 232, 0.35);
  --danger: #ff5a6a;
  --success: #2dd4a8;
  --radius: 12px;
  --nav-h: 52px;
  --shadow: 0 8px 32px rgba(0, 20, 60, 0.45);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font-family: inherit;
}

/* ---------- 视图切换（SPA） ---------- */
.view {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.view-active {
  display: block;
}

#view-map.view-active {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, rgba(0, 85, 255, 0.2), transparent 55%),
    linear-gradient(180deg, #071225 0%, var(--bg) 45%, #06101e 100%);
}

/* ---------- 顶部导航（后台仍用） ---------- */
.top-nav,
.intro-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.intro-nav {
  margin-bottom: 28px;
}

.breadcrumb {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb .crumb {
  color: var(--text);
}

.breadcrumb .sep {
  margin: 0 6px;
  color: var(--text-muted);
  font-weight: 400;
}

.breadcrumb .crumb-city {
  color: #7eb6ff;
}

.btn-back,
.btn-admin,
a.btn-back {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  background: rgba(26, 115, 232, 0.2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}

.btn-back:active,
.btn-admin:active {
  transform: scale(0.96);
  background: rgba(26, 115, 232, 0.35);
}

.btn-back[hidden] {
  display: none !important;
}

.icon-back {
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

/* ---------- 页面主体：左文案 + 右地图 ---------- */
.page-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.intro-panel {
  flex: 0 0 320px;
  width: 320px;
  max-width: 38vw;
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: linear-gradient(180deg, rgba(7, 18, 37, 0.96) 0%, rgba(10, 22, 40, 1) 100%);
  border-right: 1px solid rgba(26, 115, 232, 0.22);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.intro-eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7eb6ff;
  margin-bottom: 10px;
}

.intro-title {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #ffffff 0%, #9ec5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro-desc {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
}

.intro-meta {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 城市模式下保留说明区 */
.page-body.is-city .intro-desc {
  display: block;
}

.page-body.is-city .intro-title {
  font-size: clamp(20px, 2vw, 26px);
}

/* 右侧整块地图 */
.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: #d8eefa;
}

.map-panel-tag {
  font-size: 13px;
  font-weight: 700;
  color: #9ec5ff;
}

.map-panel-hint {
  font-size: 12px;
  color: var(--text-muted);
}

#map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #d8eefa;
}

/* 自定义地市标注（亮色地图适配） */
.district-label {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 40, 100, 0.35);
  white-space: nowrap;
  padding: 4px 8px;
  background: rgba(26, 115, 232, 0.92);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.35);
}

@media (max-width: 768px) {
  .page-body {
    flex-direction: column;
  }

  .intro-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    padding: 16px 16px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(26, 115, 232, 0.22);
  }

  .intro-nav {
    margin-bottom: 12px;
  }

  .intro-title {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .intro-desc {
    font-size: 13px;
  }

  .intro-meta {
    margin-top: 10px;
    padding-top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .map-stage {
    flex: 1 1 auto;
    min-height: 280px;
  }
}

/* ---------- 加载 / Toast ---------- */
.loading-mask {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(240, 245, 251, 0.78);
  color: #5a7aa8;
  font-size: 14px;
  transition: opacity 0.3s;
}

.loading-mask.is-hide,
.loading-mask[hidden] {
  opacity: 0;
  pointer-events: none !important;
  display: none !important;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(26, 115, 232, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast-tip {
  position: absolute;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  z-index: 25;
  padding: 10px 18px;
  background: rgba(18, 34, 56, 0.95);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.toast-tip[hidden] {
  display: none !important;
}

/* 球场蓝点 + 名称 */
.venue-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transform: translate(-50%, -28px);
}

.venue-pin-dot {
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #1a73e8, #0055ff);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 85, 255, 0.5);
}

.venue-pin-name {
  margin-top: 6px;
  max-width: 120px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(26, 115, 232, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 40, 100, 0.28);
}

/* 全屏视频 + 开屏动画 */
.video-overlay[hidden] {
  display: none !important;
}

.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.video-overlay.is-open {
  opacity: 1;
}

.video-overlay.is-closing {
  opacity: 0;
}

.video-splash {
  position: absolute;
  inset: 52px 0 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(circle at center, #12305a 0%, #050b16 62%, #000 100%);
  opacity: 1;
  transition: opacity 0.45s ease;
}

.video-overlay.is-playing .video-splash {
  opacity: 0;
  pointer-events: none;
}

.video-splash-ring {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(126, 182, 255, 0.9);
  box-sizing: border-box;
}

.video-splash-ring-a {
  animation: splashRipple 1.05s ease-out forwards;
}

.video-splash-ring-b {
  animation: splashRipple 1.05s ease-out 0.18s forwards;
}

.video-splash-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7eb6ff, #0055ff);
  box-shadow: 0 0 24px rgba(26, 115, 232, 0.85);
  animation: splashPulse 0.9s ease-out both;
}

.video-splash-name {
  position: relative;
  z-index: 1;
  max-width: 80%;
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-shadow: 0 6px 24px rgba(0, 85, 255, 0.45);
  animation: splashTitle 0.7s ease 0.12s both;
}

@keyframes splashRipple {
  0% {
    transform: scale(0.35);
    opacity: 0.95;
  }
  100% {
    transform: scale(16);
    opacity: 0;
  }
}

@keyframes splashPulse {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  55% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes splashTitle {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.video-overlay-bar {
  position: relative;
  flex-shrink: 0;
  height: 52px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.72);
  opacity: 1;
  transform: none;
  z-index: 8;
}

.video-overlay-back {
  background: rgba(26, 115, 232, 0.35);
  color: #fff;
  border-color: rgba(158, 197, 255, 0.45);
}

.video-overlay-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-overlay-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.video-overlay.is-playing .video-overlay-stage {
  opacity: 1;
  transform: scale(1);
}

.video-overlay-stage video,
.video-overlay-stage iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.video-overlay-empty {
  color: #9aa;
  font-size: 14px;
}

/* ---------- 后台管理 ---------- */
#view-admin {
  background:
    radial-gradient(ellipse at top right, rgba(0, 85, 255, 0.18), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(26, 115, 232, 0.12), transparent 45%),
    var(--bg);
  overflow: hidden;
}

body.admin-page {
  overflow: hidden;
}

body.admin-page #view-admin.view-active {
  display: flex;
  flex-direction: column;
}

.admin-header {
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0) 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.admin-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.admin-main {
  height: calc(100% - var(--nav-h) - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px 28px;
}

.admin-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.venue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 320px;
}

.venue-table th,
.venue-table td {
  padding: 10px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(138, 160, 192, 0.15);
  vertical-align: middle;
}

.venue-table th {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.venue-table td {
  color: var(--text);
}

.venue-table .ops {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-link {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}

.btn-link.danger {
  color: var(--danger);
}

.empty-list {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 28px 8px;
}

.empty-list[hidden] {
  display: none !important;
}

/* ---------- 表单 ---------- */
.form-card .form-title {
  font-size: 16px;
  margin-bottom: 14px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.form-item input,
.form-item select {
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(10, 22, 40, 0.65);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.form-item input:focus,
.form-item select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.form-actions .btn-primary,
.form-actions .btn-ghost {
  flex: 1;
}

.btn-primary,
.btn-outline,
.btn-ghost,
.btn-sm {
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  height: 42px;
  padding: 0 16px;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-primary:active,
.btn-outline:active,
.btn-ghost:active {
  transform: scale(0.98);
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-outline {
  width: 100%;
  margin-bottom: 12px;
  border: 1px dashed var(--border);
  background: var(--primary-soft);
  color: #9ec5ff;
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}

.btn-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

/* ---------- 选点弹窗 ---------- */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 8, 24, 0.65);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: var(--bg-elevated);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: var(--shadow);
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.modal-header h3 {
  font-size: 16px;
}

.pick-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pick-map {
  width: 100%;
  height: 42vh;
  min-height: 220px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.pick-coords {
  margin: 10px 0;
  font-size: 13px;
  color: #9ec5ff;
  font-variant-numeric: tabular-nums;
}

.modal-footer {
  display: flex;
  gap: 10px;
}

.modal-footer button {
  flex: 1;
}

/* 桌面端弹窗居中 */
@media (min-width: 768px) {
  .modal {
    align-items: center;
  }

  .modal-panel {
    border-radius: 16px;
    border-bottom: 1px solid var(--border);
    max-height: 80vh;
  }

  .pick-map {
    height: 360px;
  }
}

/* 隐藏高德默认版权部分可保留，避免违规 */
.amap-logo,
.amap-copyright {
  opacity: 0.7 !important;
}
