/* 漫展导览 · 管理后台样式 */

:root {
  --bg: #0d0f14;
  --bg-soft: #14171f;
  --panel: #191d27;
  --panel-2: #1f2430;
  --line: #2a3040;
  --text: #e9ebf2;
  --muted: #8b93a7;
  --primary: #f0b429;
  --primary-dim: #6b5216;
  --accent: #22d3ee;
  --danger: #ef4444;
  --ok: #34d399;
  --radius: 12px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  background: #0a0c11;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
  color: var(--accent);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.t-right { text-align: right; }
.warn { color: var(--primary); }
.err { color: var(--danger); }
.pad { padding: 14px 4px; }

/* ---------------- 登录 ---------------- */

.mask {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.login-card .logo { font-size: 40px; text-align: center; }
.login-card h1 { margin: 0; font-size: 20px; text-align: center; font-weight: 650; }
.login-card .hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.75; }

/* ---------------- 布局 ---------------- */

.shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-dot {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  background: transparent; border: 0; color: var(--muted);
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; text-align: left; font-family: inherit; transition: 0.14s;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--primary); }
.ni-icon { font-size: 15px; }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.main { flex: 1; min-width: 0; overflow: hidden; position: relative; }
.tab { display: none; height: 100%; overflow-y: auto; padding: 22px 26px 60px; }
.tab.active { display: block; }
#tab-map.active { display: flex; flex-direction: column; padding: 14px 16px 14px; overflow: hidden; }

/* ---------------- 通用组件 ---------------- */

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h2 { margin: 0 0 4px; font-size: 19px; font-weight: 650; }
.page-head p { margin: 0; font-size: 13px; max-width: 720px; }

.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 13px;
  font-family: inherit; transition: 0.14s; white-space: nowrap;
}
.btn:hover { border-color: #3b4459; background: #262c3a; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #241c05; font-weight: 650; }
.btn.primary:hover { background: #ffc63f; }
.btn.danger { color: #ffb4b4; border-color: #4a2027; background: #2a161a; }
.btn.danger:hover { background: #3a1c22; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; padding: 11px; font-size: 14px; }
.icon-btn { background: transparent; border: 0; cursor: pointer; font-size: 14px; opacity: 0.7; padding: 2px 4px; }
.icon-btn:hover { opacity: 1; }

.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.right { margin-left: auto; }

input, select, textarea {
  background: #0f1218; color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 11px; font-size: 13.5px; font-family: inherit;
  width: 100%; outline: none; transition: 0.14s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; line-height: 1.7; }
input[type="color"] { padding: 2px; height: 36px; cursor: pointer; }
input[type="range"] { padding: 0; background: transparent; border: 0; accent-color: var(--primary); }
input[type="checkbox"] { width: auto; accent-color: var(--primary); }
.num { width: 70px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field > span i { color: var(--danger); font-style: normal; }
.field-label { font-size: 12.5px; color: var(--muted); }
.field-label em { font-style: normal; color: var(--primary); margin-left: 6px; font-size: 11.5px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; min-width: 0; }

.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.chk.field { flex-direction: row; }

.img-field { display: flex; gap: 8px; align-items: center; }
.img-field input { flex: 1; }
.thumb { max-height: 76px; border-radius: 8px; border: 1px solid var(--line); margin-top: 4px; }

.hint { font-size: 12.5px; color: var(--muted); line-height: 1.75; margin: 0 0 10px; }
.steps { font-size: 13px; color: var(--muted); line-height: 2; padding-left: 20px; margin: 6px 0 0; }
.code-block {
  background: #0a0c11; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 13px; font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; color: var(--accent); margin: 0 0 12px;
}

.pill {
  display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); margin: 0 4px 4px 0;
}
.pill.hot { background: #3a2a08; border-color: #6b5216; color: var(--primary); }
.pill.warn { background: #3a2020; border-color: #6b2a2a; color: #ffb4b4; }
.badge {
  display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, #64748b) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #64748b) 55%, transparent);
  color: var(--c, #94a3b8);
}

/* ---------------- 面板 ---------------- */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.panel-head b { font-size: 14.5px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.stat b { display: block; font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat span { font-size: 12.5px; color: var(--muted); }

dl.kv { display: grid; grid-template-columns: 84px 1fr; gap: 7px 14px; margin: 0 0 14px; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; font-size: 13.5px; word-break: break-word; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 9px 10px; border-bottom: 1px solid #212633; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #1c212c; }

.empty-box { text-align: center; padding: 34px 16px; }
.empty-box .big { font-size: 42px; margin-bottom: 8px; }
.empty-box p { margin: 0 0 12px; color: var(--muted); }
.map-preview { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }

.guest-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.guest-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.gc-top { display: flex; gap: 12px; align-items: center; }
.gc-top img, .avatar-fallback {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: 0 0 46px;
}
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #1a1405;
  font-weight: 700; font-size: 19px;
}
.gc-main { min-width: 0; }
.gc-main b { display: block; font-size: 14.5px; }
.gc-main small { display: block; font-size: 12px; color: var(--muted); }
.gc-intro { margin: 0; font-size: 13px; color: #c3c9d8; }

.subcard {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 9px;
}

.file-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.file-row img { width: 62px; height: 44px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.file-row b { display: block; font-size: 12px; font-family: "SF Mono", Menlo, monospace; word-break: break-all; }
.file-row small { font-size: 11.5px; }

/* ---------------- 弹窗 / toast ---------------- */

.modal {
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head b { font-size: 15px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-body.wide { max-height: 66vh; }
.modal-foot {
  padding: 13px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 9px;
}

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 20px; border-radius: 11px; z-index: 90; font-size: 13.5px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); max-width: 76vw;
}
.toast.error { border-color: #5a2329; background: #2a161a; color: #ffc9c9; }
.toast.ok { border-color: #35506b; }

/* ---------------- 地图编辑器 ---------------- */

.editor { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 10px; }

.editor-toolbar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 12px;
}
.tb-group { display: flex; gap: 7px; align-items: center; }
.tb-group.right { margin-left: auto; }
.tool.active { background: var(--primary); border-color: var(--primary); color: #241c05; font-weight: 650; }
.zoom { width: 96px; }

.editor-note {
  font-size: 12.5px; color: var(--accent); background: #10222a;
  border: 1px solid #1d4551; border-radius: 9px; padding: 7px 12px;
}

.editor-body { display: flex; gap: 12px; flex: 1; min-height: 0; }

.stage-scroll {
  flex: 1; min-width: 0; overflow: auto; background: #0a0c11;
  border: 1px solid var(--line); border-radius: var(--radius);
  display: block; position: relative;
}
.stage { position: relative; display: inline-block; line-height: 0; min-width: 100%; min-height: 100%; }
.stage > img { display: block; user-select: none; }
.stage > svg { position: absolute; inset: 0; display: block; }
.stage .region { cursor: pointer; transition: fill-opacity 0.12s; }
.stage .region:hover { fill-opacity: 0.46; }
.stage .handle { cursor: grab; }
.stage .handle:active { cursor: grabbing; }

.stage-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  color: var(--muted); line-height: 1.7; padding: 30px;
}
.stage-empty .big { font-size: 46px; }
.stage-empty p { margin: 0; font-size: 13px; }

.inspector {
  width: 336px; flex: 0 0 336px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px;
}

.auto-panel {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px; margin-bottom: 14px;
}
.seg { display: flex; gap: 5px; background: #0f1218; border-radius: 9px; padding: 4px; margin-bottom: 10px; }
.seg button {
  flex: 1; background: transparent; border: 0; color: var(--muted);
  padding: 7px 6px; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-family: inherit;
}
.seg button.active { background: var(--panel); color: var(--text); font-weight: 600; }

.range { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 12.5px; }
.range > span:first-child { flex: 0 0 86px; color: var(--muted); }
.range input[type="range"] { flex: 1; }
.range output { flex: 0 0 54px; text-align: right; color: var(--accent); font-size: 12px; }
.range .inline { display: flex; gap: 6px; align-items: center; flex: 1; }

.list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 9px; padding-top: 13px; border-top: 1px solid var(--line);
}
.region-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.region-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px;
  border-radius: 9px; cursor: pointer; border: 1px solid transparent;
}
.region-row:hover { background: var(--panel-2); }
.region-row.sel { background: var(--panel-2); border-color: var(--primary); }
.swatch { width: 13px; height: 13px; border-radius: 4px; flex: 0 0 13px; }
.rr-main { min-width: 0; flex: 1; }
.rr-main b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-main small { display: block; font-size: 11.5px; color: var(--muted); }

.block-list { display: flex; flex-direction: column; gap: 5px; }
.block-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px;
  background: #0f1218; border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
}
.block-item.on { border-color: var(--primary); background: #1c1a11; }
.bi-icon { font-size: 15px; line-height: 1.4; }
.bi-text b { display: block; font-size: 13px; }
.bi-text small { display: block; font-size: 11.5px; color: var(--muted); }

.kind-fields { border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 4px; }
