/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --blue: #1e6fff;
  --blue-dark: #1658d8;
  --blue-light: #e6efff;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --border: #e9edf2;
  --danger: #e53935;
  --green: #43a047;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(31, 41, 55, 0.06);
}

html, body {
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

/* ============ 顶栏 ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--blue-dark);
  white-space: nowrap;
}
.brand svg { width: 22px; height: 22px; flex: none; }

.tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 10px; padding: 4px; }

.tab-btn {
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-2);
  transition: all 0.2s;
}
.tab-btn.active { background: var(--card); color: var(--blue); font-weight: 600; box-shadow: var(--shadow); }

/* ============ 主布局 ============ */
.layout {
  display: grid;
  grid-template-rows: minmax(320px, 45vh) 1fr;
  height: calc(100vh - 56px);
}

/* ============ 地图区 ============ */
.map-wrap { position: relative; min-height: 0; }
#map { width: 100%; height: 100%; }

.map-tools {
  position: absolute;
  right: 14px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}
.tool-btn {
  width: 44px;
  height: 44px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-dark);
  transition: background 0.2s;
}
.tool-btn:hover { background: var(--blue-light); }
.tool-btn svg { width: 22px; height: 22px; }

.map-tip {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  z-index: 10;
}

/* ============ 侧边面板 ============ */
.side {
  min-height: 0;
  overflow-y: auto;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.panel { padding: 16px; }
.panel.hidden { display: none; }

.panel-empty { color: var(--text-2); font-size: 14px; padding: 12px 2px; }
.panel-empty p + p { margin-top: 6px; }

/* ============ 导航表单 ============ */
.route-form { display: flex; flex-direction: column; gap: 10px; }

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 111, 255, 0.12); }
.field input {
  flex: 1;
  border: none;
  background: none;
  padding: 12px 0;
  font-size: 16px;
  color: var(--text);
  outline: none;
}
.field input::placeholder { color: #9ca3af; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.start { background: var(--green); }
.dot.end { background: var(--danger); }

.mode-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.mode-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.mode-btn.active { background: var(--blue-light); color: var(--blue); border-color: var(--blue); font-weight: 600; }

.primary-btn {
  margin-left: auto;
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
}
.primary-btn:hover { background: var(--blue-dark); }
.primary-btn:disabled { background: #a9c6f5; cursor: not-allowed; }

.ghost-btn {
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.ghost-btn:hover { color: var(--danger); border-color: var(--danger); }

/* ============ 路线结果 ============ */
.route-result { margin-top: 14px; }
.route-summary {
  display: flex;
  gap: 18px;
  padding: 12px 14px;
  background: var(--blue-light);
  border-radius: 10px;
  font-size: 14px;
  color: var(--blue-dark);
  font-weight: 600;
  flex-wrap: wrap;
}

.route-steps {
  margin-top: 12px;
  max-height: 42vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ============ 模拟导航 ============ */
.sim-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px dashed var(--blue);
  border-radius: 10px;
}
.sim-nav[hidden] { display: none; }
.sim-btn { margin-left: 0; padding: 6px 14px; font-size: 13px; }
.sim-speed {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.sim-speed select {
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--text-1);
}
.sim-progress {
  margin-left: auto;
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
  white-space: nowrap;
}
.step-item.sim-active {
  background: var(--blue-light);
  box-shadow: inset 3px 0 0 var(--blue);
}
.step-item.sim-done { opacity: 0.55; }

/* 模拟导航小车图标 */
.sim-car {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FF3B30;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.step-item {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.step-item:last-child { border-bottom: none; }
.step-index {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-body { flex: 1; min-width: 0; }
.step-instr { color: var(--text); }
.step-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.step-meta .road { color: var(--blue); }

/* ============ 地址联想 ============ */
.suggest-inline {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  overflow: hidden;
  max-height: 264px;
  overflow-y: auto;
}
.suggest-inline[hidden] { display: none; }
.suggest-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--blue-light); }
.suggest-item .s-dist { color: var(--text-2); font-size: 12px; margin-left: 6px; }

/* ============ 视频上传 ============ */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px 16px;
  text-align: center;
  color: var(--text-2);
  transition: all 0.2s;
  cursor: pointer;
}
.upload-box:hover, .upload-box.dragover { border-color: var(--blue); background: var(--blue-light); }
.upload-box svg { width: 34px; height: 34px; color: var(--blue); margin-bottom: 8px; }
.upload-title { font-size: 15px; color: var(--text); font-weight: 600; }
.upload-hint { font-size: 13px; margin-top: 4px; }

.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.upload-progress.hidden { display: none; }
.upload-progress[hidden] { display: none; }
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.15s;
}

/* ============ 播放器 ============ */
.video-player { position: relative; margin-top: 14px; }
.video-player.hidden { display: none; }
.video-player video {
  width: 100%;
  max-height: 40vh;
  border-radius: var(--radius);
  background: #000;
}
.player-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.player-close:hover { background: rgba(0, 0, 0, 0.85); }

/* ============ 视频列表 ============ */
.video-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.list-loading { color: var(--text-2); font-size: 14px; padding: 8px 2px; }
.list-empty { color: var(--text-2); font-size: 14px; padding: 12px 2px; }

.video-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.video-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }

.video-thumb {
  flex: none;
  width: 56px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e6fff, #4d8dff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.video-thumb svg { width: 20px; height: 20px; }

.video-info { flex: 1; min-width: 0; }
.video-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.video-actions { display: flex; gap: 6px; flex: none; }
.video-actions button {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-play { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.btn-play:hover { background: var(--blue); color: #fff; }
.btn-del { background: var(--bg); color: var(--text-2); }
.btn-del:hover { background: #fdecea; color: var(--danger); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}
.toast.error { background: rgba(190, 24, 24, 0.92); }
.toast.success { background: rgba(22, 122, 55, 0.92); }

/* ============ 桌面端 ============ */
@media (min-width: 900px) {
  .layout {
    grid-template-columns: 1fr 420px;
    grid-template-rows: 1fr;
  }
  .side { border-top: none; border-left: 1px solid var(--border); }
  .route-steps { max-height: 50vh; }
}

/* ============ 管理后台 ============ */
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}
.gate {
  display: flex;
  justify-content: center;
  padding: 60px 16px;
}
.gate[hidden] { display: none; }
.gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.gate-card h1 { font-size: 22px; margin-bottom: 6px; color: var(--blue-dark); }
.gate-tip { color: var(--text-2); font-size: 14px; margin-bottom: 14px; }
.gate-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 10px;
}
.gate-card input:last-of-type { margin-bottom: 0; }
.gate-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 111, 255, 0.12); }
.gate-btn { width: 100%; margin-left: 0; margin-top: 14px; padding: 12px; border-radius: 10px; }
.gate-err { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }
.gate-switch { font-size: 13px; color: var(--text-2); margin-top: 14px; }
.gate-switch a { color: var(--blue); text-decoration: none; font-weight: 600; cursor: pointer; }
.gate-switch a:hover { text-decoration: underline; }

.admin-user {
  font-size: 13px;
  color: var(--text-2);
  background: var(--blue-light);
  color: var(--blue-dark);
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* 顶栏用户菜单（用户名下拉：修改密码 / 退出管理） */
.user-menu {
  position: relative;
  display: inline-flex;
}
.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 999px;
  transition: box-shadow 0.2s;
}
.user-menu-trigger:hover {
  box-shadow: 0 0 0 3px rgba(30, 111, 255, 0.14);
}
.user-menu-trigger[aria-expanded="true"] .user-menu-caret {
  transform: rotate(180deg);
}
.user-menu-caret {
  color: var(--blue-dark);
  opacity: 0.7;
  transition: transform 0.2s;
}
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 30, 50, 0.12);
  padding: 6px;
  z-index: 100;
  animation: menuPop 0.16s ease-out;
}
@keyframes menuPop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-menu-dropdown[hidden] { display: none; }
.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  background: none;
  border: none;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-menu-item:hover { background: var(--blue-light); }
.user-menu-item:last-child { margin-top: 2px; }
.user-menu-item.danger-item { color: var(--danger); }
.user-menu-item.danger-item:hover { background: rgba(229, 72, 77, 0.08); }

/* 账号管理列表 */
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.user-row:last-child { margin-bottom: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; }
.user-status {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: 1px;
}
.user-status.active { color: #2e7d32; background: rgba(67, 160, 71, 0.12); }
.user-status.frozen { color: #e65100; background: rgba(255, 152, 0, 0.15); }
.user-date { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.user-row .mini-btn { margin-left: 0; }
.mini-btn.warn:hover { background: #fff3e0; color: #e65100; border-color: #e65100; }

.admin-panel .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.admin-panel .toolbar h2 { font-size: 20px; }
.toolbar-actions { display: flex; gap: 8px; }
.toolbar-search input {
  width: 240px;
  padding: 9px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
}
.toolbar-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 111, 255, 0.12); outline: none; }
.panel-hint { color: var(--text-2); font-size: 13px; margin-bottom: 18px; }

/* 卡片置顶标签 */
.card-pinned-tag {
  margin-left: 8px;
  font-size: 11px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.15);
  padding: 1px 8px;
  border-radius: 999px;
}

/* 视频管理列表 */
.video-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.video-row:last-child { margin-bottom: 0; }
.video-info { flex: 1; min-width: 0; }
.video-name { font-size: 14px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-meta { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.video-usage {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  margin-top: 4px;
}
.video-usage.used { color: #2e7d32; background: rgba(67, 160, 71, 0.12); }
.video-usage.orphan { color: #e65100; background: rgba(255, 152, 0, 0.15); }
.video-used-link {
  color: #1e6fff;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(30, 111, 255, 0.4);
}
.video-used-link:hover { color: #1658d8; border-bottom-style: solid; }
.video-owner { color: #64748b; font-size: 12px; }
.video-frozen {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  width: fit-content;
}
.mini-btn.ok {
  color: #2e7d32;
  background: #f1f8f1;
  border-color: #81c784;
}
.mini-btn.ok:hover { background: #e2f1e3; color: #1b5e20; }

/* 封面预览 */
.cover-preview { margin-top: 10px; }
.cover-preview img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.cover-preview .link-like { margin-top: 6px; }
.cover-upload-box { padding: 22px 16px; }
.import-box { padding: 26px 16px; }
.field-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
}
.field-select:focus { border-color: var(--blue); outline: none; }
.import-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.import-preview-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-preview-cat {
  flex-shrink: 0;
  font-size: 11px;
  color: #1e6fff;
  background: rgba(30, 111, 255, 0.1);
  padding: 1px 8px;
  border-radius: 999px;
}

/* 分类筛选条 */
.cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.cat-bar[hidden] { display: none; }
.cat-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cat-chip:hover { border-color: var(--blue); color: var(--blue); }
.cat-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}

/* 用户筛选行 */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.filter-row[hidden] { display: none; }
.filter-label { font-size: 13px; color: var(--text-2); flex-shrink: 0; }
.filter-select { width: auto; min-width: 140px; padding: 7px 10px; }

/* 批量操作条 */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #f0f9f8;
  border: 1px solid #cdebe7;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.batch-bar[hidden] { display: none; }
.batch-bar.video-batch { background: #f1f5f9; border-color: #dbe3ef; }
.batch-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.batch-check input { width: 16px; height: 16px; accent-color: var(--blue); }
.batch-count { font-weight: 600; color: var(--text-1); }

/* 分页条 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 8px;
}
.pager[hidden] { display: none; }
.pager-info { font-size: 13px; color: var(--text-2); min-width: 110px; text-align: center; }

/* 卡片弹窗分类：下拉 + 新建输入 */
.cat-input-row { display: flex; gap: 8px; }
.cat-input-row select { flex: 1; }

/* 视频管理统计 */
#videoStats { color: var(--text-2); }

/* 操作日志列表 */
.audit-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.audit-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.audit-item:last-child { border-bottom: none; }
.audit-time { color: var(--text-3, #94a3b8); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.audit-body { flex: 1; min-width: 0; }
.audit-user { font-weight: 600; color: var(--blue); }
.audit-action { color: var(--text-2); margin-left: 6px; }
.audit-detail { color: var(--text-2); margin-top: 2px; word-break: break-all; }
.card-owner-tag {
  margin-left: 6px;
  font-size: 11px;
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.08);
  padding: 1px 8px;
  border-radius: 999px;
}

/* 分组标题 */
.card-group { display: contents; }
.card-group-title {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  margin: 6px 0 -4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 卡片上的分类小标签 */
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-cat-tag {
  font-size: 11px;
  color: var(--blue);
  background: rgba(30, 111, 255, 0.08);
  border: 1px solid rgba(30, 111, 255, 0.25);
  padding: 1px 8px;
  border-radius: 999px;
  flex: none;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
.card-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card-item:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.card-title { font-size: 16px; font-weight: 700; color: var(--text); }
.card-meta { display: flex; flex-direction: column; gap: 4px; }
.card-meta-row { font-size: 13px; color: var(--text); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-meta-row.muted { color: var(--text-2); font-size: 12px; }
.card-desc {
  font-size: 13px;
  color: var(--text-2);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
}
.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
}
.mini-btn {
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.mini-btn:hover { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }
.mini-btn.danger:hover { background: #fdecea; color: var(--danger); border-color: var(--danger); }

/* ============ 弹窗 ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
body.no-scroll { overflow: hidden; }
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.modal-card h3 { font-size: 18px; margin-bottom: 18px; color: var(--blue-dark); }
.form-row { margin-bottom: 16px; }
.form-row > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.req { color: var(--danger); }
.form-row input[type="text"], .form-row input[type="url"], .form-row input[type="password"],
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 111, 255, 0.12); }
.form-row textarea { resize: vertical; font-family: inherit; line-height: 1.6; }

.seg {
  display: inline-flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 10px;
}
.seg-btn {
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.2s;
}
.seg-btn.active { background: var(--card); color: var(--blue); font-weight: 600; box-shadow: var(--shadow); }
.vsrc-pane { margin-top: 4px; }

.file-picked {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--blue-light);
  border-radius: 10px;
  font-size: 14px;
  color: var(--blue-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.file-picked[hidden] { display: none; }
.file-picked #cardFileName { font-weight: 600; word-break: break-all; }
.link-like {
  color: var(--blue);
  font-size: 13px;
  text-decoration: underline;
  margin-left: auto;
}
.link-like:hover { color: var(--danger); }

.place-picked {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--green);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.place-picked[hidden] { display: none; }
.place-picked #fPlaceName { font-weight: 600; }
.place-picked .link-like { color: #fff; margin-left: auto; text-decoration: underline; }

/* 地图点选（精确位置） */
.place-map-wrap { margin-top: 12px; }
#placePickMap {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #e8f0f7;
  overflow: hidden;
}
.place-map-tip {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 6px;
  line-height: 1.6;
}
@media (max-width: 480px) {
  #placePickMap { height: 180px; }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.modal-actions .primary-btn { margin-left: 0; }

/* 移动端触控适配（QQ 风：白底 + 圆角 + 大热区） */
@media (max-width: 640px) {
  .gate { padding: 40px 16px; }
  .gate-card { padding: 28px 20px; border-radius: 20px; box-shadow: 0 8px 30px rgba(31, 41, 55, 0.08); }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card {
    max-width: none;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  }
  .admin-main { padding: 20px 14px 56px; }
  .toolbar-search { order: 3; width: 100%; }
  .toolbar-search input { width: 100%; padding: 12px 14px; font-size: 16px; }
  .toolbar-actions { flex-wrap: wrap; }
  .toolbar-actions .primary-btn, .toolbar-actions .ghost-btn { padding: 12px 18px; font-size: 15px; }
  .card-item { padding: 14px; }
  .mini-btn { padding: 10px 14px; }
  .field input { font-size: 16px; padding: 13px 0; }
  .video-actions button { padding: 9px 14px; }
  .sim-btn { padding: 9px 16px; }
}

/* ============ 分享页（清新简约高级风） ============ */
.share-body {
  background:
    radial-gradient(900px 460px at 82% -10%, rgba(30, 111, 255, 0.08), transparent 62%),
    radial-gradient(700px 420px at 4% 106%, rgba(74, 168, 232, 0.06), transparent 60%),
    linear-gradient(180deg, #f7f9fc 0%, #fbfdfd 55%, #f6f8fa 100%);
  min-height: 100vh;
}
.share-header {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 41, 59, 0.07);
  position: sticky;
  top: 0;
  z-index: 50;
}
.share-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
}
.share-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid rgba(30, 41, 59, 0.10);
  border-radius: 20px;
  color: #475569;
  font-size: 14px;
  padding: 6px 13px;
  margin-right: 14px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.share-back:hover { background: #fff; color: #1e6fff; border-color: rgba(30, 111, 255, 0.4); box-shadow: 0 4px 14px rgba(30, 111, 255, 0.10); }
.share-back svg { width: 16px; height: 16px; flex: none; }
.share-back[hidden] { display: none; }

.share-header .brand { color: #1e293b; }
.share-header .brand svg { color: #1e6fff; }

.share-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* 标题区 */
.share-hero { padding: 6px 2px 24px; }
.share-hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.35;
}
.share-desc {
  font-size: 15px;
  color: #64748b;
  white-space: pre-wrap;
  line-height: 1.9;
}
.share-desc[hidden] { display: none; }

/* 内容区块：白色简约卡片 */
.share-block {
  background: #fff;
  border: 1px solid rgba(30, 41, 59, 0.07);
  border-radius: 20px;
  padding: 22px 20px;
  margin-top: 16px;
  box-shadow: 0 10px 30px rgba(30, 41, 59, 0.05);
}
.share-block-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1e6fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.share-block-title::before {
  content: '';
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #1e6fff, rgba(30, 111, 255, 0.2));
}
.video-wrap video {
  width: 100%;
  border-radius: 14px;
  background: #0b1220;
  max-height: 55vh;
  object-fit: contain; /* 竖屏/异形比例视频等比缩放居中，不压扁不变形 */
}
.video-wrap[hidden] { display: none; }
.video-wrap { position: relative; }
/* 无首帧/封面时（外链视频）的"点击播放"覆盖层：避免展开后一片黑被误以为加载失败 */
.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(11, 18, 32, 0.55);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  font-size: 14px;
}
.video-play-overlay svg {
  width: 56px;
  height: 56px;
  padding: 14px;
  border-radius: 50%;
  background: rgba(30, 111, 255, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.video-play-overlay[hidden] { display: none; }

/* ===== NFC 落地页：首屏导航 CTA ===== */
.share-hero-cta { padding: 4px 2px 10px; }
.hero-head h1 { margin-bottom: 10px; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.hero-meta[hidden] { display: none; }
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 111, 255, 0.10);
  color: #1f7f7b;
  font-size: 13px;
  font-weight: 600;
}
.hero-chip-time { background: rgba(30, 41, 59, 0.06); color: #475569; }
.hero-chip[hidden] { display: none; }

.hero-cta {
  width: 100%;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e6fff, #1658d8);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(30, 111, 255, 0.28);
  transition: transform 0.15s, filter 0.15s;
}
.hero-cta svg { width: 22px; height: 22px; flex: none; }
.hero-cta:hover { filter: brightness(1.04); }
.hero-cta:active { transform: scale(0.985); }
.hero-cta:disabled { cursor: default; box-shadow: none; }
.hero-hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: #94a3b8;
  text-align: center;
}

/* 视频折叠按钮 */
.share-block-video { padding: 12px 16px; }
.video-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: #1e293b;
}
.video-toggle[hidden] { display: none; }
.video-toggle-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(30, 111, 255, 0.12);
  color: #1e6fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.video-toggle-icon svg { width: 20px; height: 20px; }
.video-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.video-toggle-text strong { font-size: 15px; }
.video-toggle-text small { color: #94a3b8; font-size: 12.5px; }

@media (max-width: 640px) {
  .share-main { padding: 20px 14px 36px; }
  .share-hero h1 { font-size: 24px; }
  .hero-cta { padding: 17px 20px; font-size: 17.5px; }
  .share-block { padding: 18px 16px; border-radius: 18px; }
}

/* ===== NFC 标签弹窗 ===== */
.tag-current-card {
  margin: 2px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #1e6fff;
  background: rgba(30, 111, 255, 0.08);
  padding: 8px 12px;
  border-radius: 10px;
}
.tag-card-summary {
  border: 1px dashed rgba(30, 111, 255, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #f6fbfa;
  font-size: 13px;
}
.tag-sum-row {
  display: flex;
  gap: 8px;
  padding: 2px 0;
}
.tag-sum-key {
  flex: none;
  width: 46px;
  color: #64748b;
}
.tag-sum-val {
  color: #1e293b;
  word-break: break-all;
}
.tag-create {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}
.tag-create .field-select { flex: 1 1 180px; min-width: 140px; }
.tag-create input {
  flex: 1 1 200px;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid rgba(30, 41, 59, 0.14);
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
}
.tag-create input:focus {
  outline: none;
  border-color: rgba(30, 111, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 111, 255, 0.12);
}
.tag-create .primary-btn { flex: none; }

.tag-row {
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
  background: #fff;
}
.tag-row.is-disabled { opacity: 0.58; }
.tag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.tag-code {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 14px;
  font-weight: 700;
  color: #1e6fff;
  background: rgba(30, 111, 255, 0.08);
  padding: 4px 8px;
  border-radius: 8px;
}
.tag-badge {
  font-size: 12px;
  font-weight: 700;
  color: #1b5e20;
  background: #e2f1e3;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-badge.off {
  color: #64748b;
  background: #eef2f6;
}
.tag-hits { font-size: 12.5px; color: #64748b; }
.tag-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13px;
  color: #475569;
}
.tag-label { font-weight: 600; cursor: pointer; border-bottom: 1px dashed transparent; }
.tag-label:hover { border-bottom-color: #1e6fff; }
.tag-label-empty { font-weight: 400; color: #94a3b8; font-style: italic; }
.tag-dest { color: #1e6fff; }
.tag-card { color: #64748b; }
.tag-ops {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}
.tag-rebind { max-width: 200px; padding: 6px 8px; font-size: 12.5px; }
.tag-tip { margin-top: 14px; line-height: 1.7; }
.no-video {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 34px 0;
  background: #f8fafc;
  border: 1px dashed rgba(30, 41, 59, 0.15);
  border-radius: 14px;
}
.no-video[hidden] { display: none; }

/* 目的地 + 地图 */
.dest-bar {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dest-bar svg { width: 15px; height: 15px; color: #1e6fff; flex: none; }
.dest-name { color: #1e293b; font-weight: 600; }

.map-goto {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(30, 41, 59, 0.10);
  position: relative;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(30, 41, 59, 0.08);
}
.share-map { height: 240px; }
/* 地图可自由拖动/缩放查看；只有中央导航胶囊可点击触发导航 */
.map-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-bottom: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, 0.78) 100%);
  pointer-events: none;
  z-index: 10;
}
.goto-icon,
.goto-text {
  pointer-events: auto;
}
.goto-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4d8dff, #1e6fff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(30, 111, 255, 0.4);
  transition: transform 0.16s;
}
.goto-icon svg { width: 24px; height: 24px; }
.goto-text {
  background: rgba(255, 255, 255, 0.94);
  color: #1e293b;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(30, 41, 59, 0.08);
  box-shadow: 0 4px 14px rgba(30, 41, 59, 0.08);
  transition: transform 0.16s;
}
.map-goto:hover .goto-icon { transform: scale(1.06); }
.map-goto:hover .goto-text { transform: scale(1.03); }

/* 出行方式（分享页清新版） */
.share-body .mode-row { margin-top: 14px; }
.share-body .mode-label { font-size: 14px; color: #64748b; margin-right: 2px; }
.share-body .mode-btn {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 14px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}
.share-body .mode-btn:hover { color: #1e6fff; background: #e9f1ff; }
.share-body .mode-btn.active {
  background: rgba(30, 111, 255, 0.10);
  color: #1e6fff;
  border-color: rgba(30, 111, 255, 0.45);
  font-weight: 600;
}

/* 主 CTA：青蓝渐变 */
.goto-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4d8dff 0%, #1e6fff 60%, #1658d8 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(30, 111, 255, 0.25);
  transition: transform 0.16s, box-shadow 0.2s, filter 0.2s;
}
.goto-btn:hover { filter: brightness(1.04); box-shadow: 0 14px 30px rgba(30, 111, 255, 0.32); }
.goto-btn:active { transform: scale(0.985); }
.goto-btn svg { width: 20px; height: 20px; }
.goto-tip {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 12px;
  text-align: center;
  line-height: 1.7;
}

.share-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 44px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0.05em;
}

/* 分享页封面图 */
.share-cover {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.10);
}
.share-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.share-cover[hidden] { display: none; }

/* 地图加载失败降级提示 */
.map-fallback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}
.map-fallback[hidden] { display: none; }

