/**
 * 石家庄市国防动员办公室 - 视频标注地图
 * 版式沿用原地图系统，标注改为红色五角星
 */

:root {
  --primary: #1a73e8;
  --primary-deep: #0055ff;
  --primary-soft: rgba(26, 115, 232, 0.18);
  --star: #ff1f1f;
  --star-deep: #c62828;
  --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: 64px;
  --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;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

#app {
  position: absolute;
  inset: 0;
}

.view {
  display: none;
  position: absolute;
  inset: 0;
}

.view-active {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, rgba(198, 40, 40, 0.16), transparent 46%),
    radial-gradient(ellipse at top right, rgba(0, 85, 255, 0.16), transparent 42%),
    linear-gradient(180deg, #071225 0%, var(--bg) 48%, #06101e 100%);
}

.page-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.intro-panel {
  flex: 0 0 320px;
  width: 320px;
  max-width: 38vw;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  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;
}

.intro-eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #ff8a80;
  margin-bottom: 12px;
}

.intro-title {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #ffffff 10%, #ffb4b4 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;
}

.map-panel-tag {
  font-size: 13px;
  font-weight: 700;
  color: #ffb4b4;
}

.map-panel-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: #d8eefa;
}

#map-container {
  position: absolute;
  inset: 0;
  background: #d8eefa;
}

.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;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(26, 115, 232, 0.25);
  border-top-color: var(--star);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-tip {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 25;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  background: rgba(18, 34, 56, 0.95);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.amap-marker,
.amap-marker-content {
  overflow: visible !important;
}

.venue-pin {
  position: relative;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
}

.venue-pin-body {
  position: relative;
  width: 36px;
  height: 36px;
}

.venue-pin-ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: rgba(255, 40, 40, 0.42);
  animation: pinRipple 1.4s ease-out infinite;
}

.venue-pin-star {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  overflow: visible;
  filter: drop-shadow(0 3px 6px rgba(180, 0, 20, 0.5));
  animation: pinBounce 0.9s ease-in-out infinite;
  transform-origin: 50% 80%;
}

.venue-pin-star polygon,
.video-splash-core polygon {
  fill: var(--star);
  stroke: #fff;
  stroke-width: 1.15;
  stroke-linejoin: round;
}

.venue-pin-name {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 180px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(198, 40, 40, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(120, 0, 0, 0.28);
}

@keyframes pinBounce {
  0%,
  100% { transform: translateY(0); }
  45% { transform: translateY(-9px); }
}

@keyframes pinRipple {
  0% { transform: scale(0.55); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}

.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: 14px;
  background: radial-gradient(circle at center, #4a1218 0%, #14080c 62%, #000 100%);
  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(255, 120, 120, 0.9);
}

.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: 48px;
  height: 48px;
  animation: splashPulse 0.9s ease-out both;
}

.video-splash-core svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 16px rgba(255, 40, 40, 0.75));
}

.video-splash-name {
  position: relative;
  z-index: 1;
  max-width: 80%;
  color: #fff;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.video-splash-intro {
  position: relative;
  z-index: 1;
  max-width: 78%;
  color: rgba(255, 220, 220, 0.86);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

@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; }
}

.video-overlay-bar {
  position: relative;
  z-index: 8;
  flex-shrink: 0;
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.72);
}

.video-overlay-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-overlay-back {
  position: absolute;
  left: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
}

.video-overlay-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.45s ease, transform 0.45s 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: #c9b4b4;
  font-size: 15px;
}

.btn-back,
a.btn-back {
  border: 1px solid rgba(255, 180, 180, 0.45);
  cursor: pointer;
  background: rgba(198, 40, 40, 0.72);
  color: #fff;
  border-radius: 22px;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
}

.icon-back {
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

.gate,
.login-view {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at top, rgba(198, 40, 40, 0.28), transparent 52%),
    radial-gradient(ellipse at bottom, rgba(0, 85, 255, 0.18), transparent 46%),
    linear-gradient(180deg, #071225 0%, #0a1628 100%);
}

.btn-music {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 650;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 180, 180, 0.45);
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.82);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 20, 60, 0.35);
  padding: 0;
}

.btn-music svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn-music .icon-music-off,
.btn-music.is-off .icon-music-on {
  display: none;
}

.btn-music.is-off .icon-music-off {
  display: block;
}

.btn-music:active {
  transform: scale(0.94);
}

.btn-music.is-waiting {
  animation: musicPulse 1.2s ease-in-out infinite;
}

@keyframes musicPulse {
  0%,
  100% { box-shadow: 0 6px 18px rgba(0, 20, 60, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(229, 57, 53, 0.35); }
}

.gate-logo {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 14px;
  background: #fff;
  border-radius: 12px;
  object-fit: contain;
}

.gate-card {
  width: min(440px, 100%);
  padding: 22px 24px 22px;
  border-radius: 18px;
  background: rgba(18, 34, 56, 0.96);
  border: 1px solid rgba(255, 90, 90, 0.38);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  animation: gateIn 0.28s ease;
}

@keyframes gateIn {
  from { transform: translateY(16px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.gate-mark {
  color: #ff8a80;
  letter-spacing: 0.18em;
  font-size: 12px;
  margin-bottom: 8px;
}

.gate-card h1 {
  font-size: 26px;
  line-height: 1.35;
  margin-bottom: 10px;
}

.gate-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.gate-label {
  display: block;
  margin-bottom: 8px;
  color: #ffcdd2;
  font-size: 13px;
}

.gate-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 120, 120, 0.35);
  background: rgba(7, 16, 32, 0.8);
  color: #fff;
  font-size: 18px;
  letter-spacing: 0.08em;
  outline: none;
}

.gate-input:focus {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 60, 60, 0.16);
}

.gate-error {
  min-height: 22px;
  margin-top: 8px;
  color: #ff8a80;
  font-size: 13px;
}

.gate-submit {
  width: 100%;
  margin-top: 8px;
}

body.admin-page {
  overflow: hidden;
}

#admin-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.admin-header {
  min-height: var(--nav-h);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.admin-heading {
  flex: 1;
  min-width: 0;
}

.admin-title {
  font-size: 18px;
  line-height: 1.3;
}

.admin-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 14px 0;
}

.admin-tab {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.admin-tab.is-on {
  background: linear-gradient(135deg, var(--star-deep), #ff4d4d);
  border-color: transparent;
  color: #fff;
}

.admin-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 32px;
}

.admin-pane { max-width: 980px; margin: 0 auto; }

.pane-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pane-tip,
.card-stat {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.admin-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}

.table-wrap { overflow-x: auto; }

.venue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 560px;
}

.venue-table th,
.venue-table td {
  padding: 10px 8px;
  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;
}

.code-text {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
}

.badge-ok {
  background: rgba(45, 212, 168, 0.16);
  color: var(--success);
}

.badge-used {
  background: rgba(138, 160, 192, 0.16);
  color: var(--text-muted);
}

.ops { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-link {
  border: none;
  background: transparent;
  color: #8ec1ff;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
}

.btn-link.danger { color: var(--danger); }

.empty-list {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 8px;
}

.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 textarea,
.gate-input {
  border-radius: 8px;
}

.form-item input,
.form-item textarea {
  width: 100%;
  padding: 10px 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 textarea {
  min-height: 76px;
  resize: vertical;
}

.form-item input:focus,
.form-item textarea: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;
}

.card-form {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  align-items: end;
}

.card-form .form-item { margin-bottom: 0; }
.card-form .btn-primary { height: 42px; }

.card-result {
  margin-top: 14px;
}

.card-result p {
  margin-bottom: 8px;
  color: #ffcdd2;
  font-size: 13px;
}

.card-result textarea {
  width: 100%;
  min-height: 96px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 120, 120, 0.35);
  background: rgba(7, 16, 32, 0.8);
  color: #fff;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.6;
}

.form-actions,
.modal-footer {
  display: flex;
  gap: 10px;
}

.form-actions .btn-primary,
.form-actions .btn-ghost,
.modal-footer button { 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;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, #e53935 0%, #b71c1c 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 rgba(255, 120, 120, 0.45);
  background: rgba(229, 57, 53, 0.1);
  color: #ffcdd2;
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.btn-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.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: 560px;
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-elevated);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pick-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pick-map {
  width: 100%;
  height: 42vh;
  min-height: 240px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.pick-coords {
  margin: 10px 0;
  font-size: 13px;
  color: #ffcdd2;
  font-variant-numeric: tabular-nums;
}

.pick-star {
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(160, 0, 0, 0.45));
}

.pick-star polygon {
  fill: var(--star);
  stroke: #fff;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.amap-logo,
.amap-copyright {
  opacity: 0.65 !important;
}

@media (min-width: 768px) {
  .modal { align-items: center; }
  .modal-panel {
    border-radius: 16px;
    border-bottom: 1px solid var(--border);
  }
  .pick-map { height: 380px; }
}

@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-title {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .intro-desc { font-size: 13px; }

  .intro-meta {
    margin-top: 12px;
    padding-top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .map-stage {
    flex: 1 1 auto;
    min-height: 320px;
  }

  .gate-logo {
    width: 132px;
    height: 132px;
  }

  .gate-card h1 { font-size: 22px; }

  .card-form,
  .pane-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn-ghost { flex: 1; }
}
