/* ==========================================================
   全景展示系统 - 管理后台样式
   ========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f2f4f8; color: #333; font-size: 14px; }

.admin-wrap { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 200px; flex: 0 0 200px; background: #1b2333; color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-logo { padding: 22px 20px; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-logo span { font-size: 12px; font-weight: 400; color: #8fa0bd; }
.side-nav { flex: 1; padding: 14px 0; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 22px; color: #aeb9cf; text-decoration: none; font-size: 14px; transition: all .15s; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-nav a.active { color: #fff; background: rgba(52,120,246,.25); border-right: 3px solid #3478f6; }
.side-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 8px; }
.side-foot a { color: #8fa0bd; text-decoration: none; font-size: 13px; }
.side-foot a:hover { color: #fff; }

/* ---------- 主区域 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; background: #fff; border-bottom: 1px solid #e8ecf2; }
.main-head h1 { font-size: 18px; font-weight: 700; }
.who { color: #888; font-size: 13px; }
.main-body { padding: 24px 28px 40px; }

/* ---------- 卡片 ---------- */
.card { background: #fff; border-radius: 12px; padding: 20px 22px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(20,30,60,.06); }
.card h2 { font-size: 15px; margin-bottom: 14px; color: #222; }
.card .hint { font-size: 12px; color: #999; margin-bottom: 12px; }

/* ---------- 表格 ---------- */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #eef1f6; font-size: 13px; vertical-align: middle; }
table.list th { color: #889; font-weight: 600; background: #fafbfd; white-space: nowrap; }
table.list tr:hover td { background: #f8fafd; }
table.list img.thumb { width: 120px; height: 60px; object-fit: cover; border-radius: 6px; display: block; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.tag.on { background: #e8f7ee; color: #1a7f37; }
.tag.off { background: #fdeaea; color: #c62828; }

/* ---------- 按钮 ---------- */
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; cursor: pointer; text-decoration: none; background: #3478f6; color: #fff; }
.btn:hover { background: #2a66d4; }
.btn.gray { background: #fff; color: #555; border-color: #d9dee8; }
.btn.gray:hover { background: #f5f7fa; color: #333; }
.btn.danger { background: #fff; color: #d4380d; border-color: #ffccc7; }
.btn.danger:hover { background: #fff2f0; }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn.lg { padding: 11px 26px; font-size: 14px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-item input[type=text], .form-item input[type=number], .form-item input[type=password], .form-item select, .form-item textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d9dee8; border-radius: 8px; font-size: 13px; outline: none; background: #fff;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #3478f6; box-shadow: 0 0 0 3px rgba(52,120,246,.1); }
.form-item textarea { min-height: 90px; resize: vertical; }
.form-item .help { font-size: 12px; color: #999; margin-top: 5px; }
.form-item input[type=checkbox] { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.form-actions { margin-top: 20px; display: flex; gap: 12px; align-items: center; }

/* ---------- 上传框 ---------- */
.upload-box { border: 2px dashed #c9d3e0; border-radius: 10px; padding: 22px; text-align: center; color: #888; cursor: pointer; transition: all .2s; }
.upload-box:hover { border-color: #3478f6; color: #3478f6; background: #f7faff; }
.upload-box .up-img { max-width: 240px; max-height: 120px; border-radius: 8px; margin-bottom: 10px; object-fit: cover; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(20,30,60,.06); }
.stat-card .num { font-size: 28px; font-weight: 800; color: #222; }
.stat-card .lbl { font-size: 13px; color: #888; margin-top: 6px; }
.stat-card.blue .num { color: #3478f6; }
.stat-card.green .num { color: #52c41a; }
.stat-card.orange .num { color: #fa8c16; }

/* 柱状图（CSS） */
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 10px; }
.bar-chart .bar { flex: 1; background: linear-gradient(180deg, #3478f6, #79a9f9); border-radius: 3px 3px 0 0; min-width: 6px; position: relative; }
.bar-chart .bar:hover { opacity: .85; }
.bar-chart .bar .bv { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 10px; color: #666; white-space: nowrap; display: none; }
.bar-chart .bar:hover .bv { display: block; }
.bar-labels { display: flex; gap: 4px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 10px; color: #999; white-space: nowrap; overflow: hidden; }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert.ok { background: #e8f7ee; color: #1a7f37; }
.alert.err { background: #fdeaea; color: #c62828; }
.alert.info { background: #e8f1ff; color: #1d4ed8; }

/* ---------- 热点预览 ---------- */
.hs-wrap { display: flex; gap: 20px; align-items: flex-start; }
.hs-preview { flex: 1; min-width: 0; position: relative; }
.hs-preview #hotspotPreview { width: 100%; height: 420px; border-radius: 12px; overflow: hidden; background: #000; }
.hs-preview .hs-tip { margin-top: 10px; font-size: 12px; color: #888; line-height: 1.8; }
.hs-preview .hs-tip b { color: #3478f6; }
.hs-side { width: 320px; flex: 0 0 320px; }
.hs-list { max-height: 420px; overflow-y: auto; border: 1px solid #eef1f6; border-radius: 10px; }
.hs-item { padding: 10px 14px; border-bottom: 1px solid #f0f2f6; display: flex; align-items: center; gap: 10px; }
.hs-item:last-child { border-bottom: 0; }
.hs-item .hs-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; flex: 0 0 auto; }
.hs-item .hs-icon.scene { background: #ff9966; }
.hs-item .hs-icon.info { background: #3478f6; }
.hs-item .hs-icon.link { background: #52c41a; }
.hs-item .hs-main { flex: 1; min-width: 0; }
.hs-item .hs-title { font-size: 13px; font-weight: 600; color: #333; }
.hs-item .hs-meta { font-size: 11px; color: #999; margin-top: 2px; }
.hs-item .hs-ops { display: flex; gap: 6px; flex: 0 0 auto; }

@media (max-width: 900px) {
  .sidebar { width: 64px; flex-basis: 64px; }
  .side-logo span, .side-nav a { display: none; }
  .side-nav a { justify-content: center; padding: 14px 0; font-size: 18px; }
  .side-logo { justify-content: center; padding: 18px 0; font-size: 15px; }
  .side-foot a { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .hs-wrap { flex-direction: column; }
  .hs-side { width: 100%; flex-basis: auto; }
}

/* 通用隐藏 */
.hidden { display: none !important; }
