/* NFC 碰一碰管理系统 · 后台与登录页样式（无外部 CDN 依赖） */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: #1f2329;
  background: #f2f4f7;
  font-size: 14px;
}

a { text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f1f4f9, #e6ebf3); padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: 18px; padding: 32px 28px; box-shadow: 0 18px 40px rgba(16, 24, 40, .1); }
.login-logo { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 14px; background: #2563eb; display: flex; align-items: center; justify-content: center; color: #fff; }
.login-logo svg { width: 28px; height: 28px; }
.login-card h1 { font-size: 19px; margin: 0; text-align: center; font-weight: 600; }
.login-sub { text-align: center; color: #98a2b3; font-size: 13px; margin: 6px 0 22px; }
.login-foot { text-align: center; color: #b3bcc9; font-size: 12px; margin: 22px 0 0; }
.alert-error { background: #fef2f2; color: #b42318; border: 1px solid #fecdd3; border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }

.field-label { display: block; font-size: 13px; color: #5b6675; margin: 0 0 6px; }
.field {
  width: 100%; padding: 10px 12px; border: 1px solid #e3e8ef; border-radius: 10px;
  font-size: 14px; background: #fff; color: #1f2329; outline: none; transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.field:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.field + .field-label { margin-top: 14px; }

.btn-primary { background: #2563eb; color: #fff; border: 0; padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-block { width: 100%; margin-top: 20px; padding: 12px; font-size: 15px; }
.btn-ghost { background: #f2f4f7; color: #475467; border: 0; padding: 9px 16px; border-radius: 10px; font-size: 14px; cursor: pointer; font-family: inherit; }
.btn-ghost:hover { background: #e8ebf0; }
.btn-ghost.active { background: #2563eb; color: #fff; }
.btn-ghost.active:hover { background: #1d4ed8; }
.link-btn { background: none; border: 0; color: #2563eb; font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.danger-btn { background: none; border: 0; color: #d92d20; font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; }
.danger-btn:hover { text-decoration: underline; }

/* ---------- 顶栏 ---------- */
.topbar { background: #fff; border-bottom: 1px solid #e9edf3; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1180px; margin: 0 auto; height: 64px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; background: #2563eb; display: flex; align-items: center; justify-content: center; color: #fff; }
.brand-logo svg { width: 20px; height: 20px; }
.brand-title { font-weight: 600; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: #98a2b3; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #5b6675; }

/* ---------- 主体 ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { background: #fff; color: #5b6675; border: 0; padding: 9px 16px; border-radius: 10px; font-size: 14px; cursor: pointer; font-family: inherit; }
.tab:hover { background: #eef1f6; }
.tab.active { background: #2563eb; color: #fff; }

.card { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); margin-bottom: 18px; overflow: hidden; }
.card-head { padding: 16px 18px; border-bottom: 1px solid #f2f4f7; display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; font-weight: 500; color: #667085; padding: 11px 14px; background: #fafbfc; white-space: nowrap; }
.table td { padding: 12px 14px; border-top: 1px solid #f2f4f7; vertical-align: middle; }
.table .td-actions { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 500; color: #1f2329; }
.cell-sub { font-size: 12px; color: #98a2b3; margin-top: 3px; }
.empty { text-align: center; color: #98a2b3; padding: 36px 0; }

.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.badge-blue { background: #eff4ff; color: #175cd3; }
.badge-purple { background: #f4f0ff; color: #6938ef; }
.badge-green { background: #ecfdf3; color: #067647; }
.badge-gray { background: #f2f4f7; color: #667085; }
.badge-orange { background: #fff4ed; color: #b93815; }

/* ---------- 统计卡片 ---------- */
.stat-card { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.stat-label { font-size: 12px; color: #98a2b3; }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 4px; color: #1f2329; line-height: 1.2; }
.stat-value.accent { color: #175cd3; }
.stat-value.green { color: #067647; }
.stat-note { font-size: 12px; color: #98a2b3; margin-top: 4px; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 300px; }
.chart-sm { width: 100%; height: 280px; }

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 760px; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid #f2f4f7; display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-sub { font-size: 12px; color: #98a2b3; margin-top: 4px; word-break: break-all; }
.modal-close { background: none; border: 0; font-size: 22px; line-height: 1; color: #98a2b3; cursor: pointer; padding: 0 4px; }
.modal-body { padding: 20px; }

/* ---------- 编辑器容器 ---------- */
.editor-wrap { border: 1px solid #e3e8ef; border-radius: 12px; overflow: hidden; }
#toolbar-container { border-bottom: 1px solid #f2f4f7; }
#editor-container { height: 280px; overflow-y: auto; }

/* ---------- 提示 ---------- */
.hint { font-size: 12px; color: #98a2b3; margin-top: 12px; line-height: 1.6; }
.hint code { background: #f2f4f7; padding: 1px 5px; border-radius: 4px; color: #475467; }
.form-msg { font-size: 13px; color: #5b6675; margin-left: 10px; }
.form-msg.error { color: #d92d20; }
.form-msg.ok { color: #067647; }
.toast {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%);
  background: #1f2937; color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 9px; z-index: 60;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.hidden { display: none !important; }

/* ================= 落地页可视化装修 ================= */
.mode-switch { display: inline-flex; background: #f2f4f7; border-radius: 10px; padding: 3px; }
.mode-btn { background: none; border: 0; padding: 6px 12px; border-radius: 8px; font-size: 13px; color: #5b6675; cursor: pointer; font-family: inherit; }
.mode-btn.active { background: #fff; color: #175cd3; font-weight: 500; box-shadow: 0 1px 2px rgba(16,24,40,.08); }

.ve { display: flex; gap: 12px; align-items: flex-start; }
.ve-left { flex: 0 0 190px; }
.ve-center { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.ve-right { flex: 0 0 290px; }
@media (max-width: 900px) {
  .ve { flex-wrap: wrap; }
  .ve-left, .ve-right, .ve-center { flex: 1 1 100%; position: static; }
}

.ve-left, .ve-right {
  background: #fafbfc; border: 1px solid #eef1f6; border-radius: 12px; padding: 12px; position: sticky; top: 84px;
}
.ve-title { font-size: 12px; color: #98a2b3; margin: 0 0 8px; font-weight: 500; }
.ve-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ve-title-row .ve-title { margin: 0; }

.ve-palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ve-pal-btn { background: #fff; border: 1px solid #e3e8ef; border-radius: 8px; padding: 8px 6px; font-size: 12px; color: #475467; cursor: pointer; font-family: inherit; }
.ve-pal-btn:hover { border-color: #2563eb; color: #175cd3; background: #f5f8ff; }

.ve-blocks { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.ve-blk {
  display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e3e8ef; border-radius: 8px;
  padding: 6px 8px; font-size: 12px; cursor: pointer; color: #475467;
}
.ve-blk.active { border-color: #2563eb; background: #f5f8ff; color: #175cd3; }
.ve-blk .ve-drag { color: #c0c8d4; cursor: grab; font-size: 12px; }
.ve-blk .ve-blk-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ve-blk .ve-blk-del { border: 0; background: none; color: #d92d20; cursor: pointer; font-size: 12px; padding: 0 2px; }
.ve-empty-state { color: #98a2b3; font-size: 12px; text-align: center; padding: 14px 0; }

.ve-center { display: flex; justify-content: center; }
.ve-phone { width: 375px; max-width: 100%; }
.ve-phone-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid #eef1f6; border-bottom: 0; border-radius: 12px 12px 0 0;
  padding: 7px 12px; font-size: 12px; color: #98a2b3;
}
.ve-screen {
  position: relative; height: 620px; overflow-y: auto; overflow-x: hidden;
  border: 1px solid #eef1f6; border-radius: 0 0 12px 12px; background: #f5f6f8;
}
.ve-screen .lp { min-height: 100%; }
.ve-screen .lp-inner { min-height: auto; }
.ve-empty { text-align: center; color: #98a2b3; font-size: 13px; padding: 60px 20px; line-height: 1.8; }

.ve-tool {
  position: absolute; z-index: 20; display: flex; gap: 4px; background: #1f2937;
  border-radius: 8px; padding: 3px; box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.ve-tool button { background: none; border: 0; color: #fff; font-size: 12px; padding: 4px 7px; cursor: pointer; border-radius: 5px; font-family: inherit; }
.ve-tool button:hover { background: rgba(255,255,255,.16); }
.ve-tool button[data-act="del"]:hover { background: #d92d20; }

.ve-panel label.field-label { margin-top: 12px; }
.ve-panel .field { font-size: 13px; padding: 8px 10px; }
.ve-panel textarea.field { min-height: 92px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6; }
.ve-row { display: flex; gap: 6px; align-items: center; }
.ve-color { width: 42px; height: 34px; padding: 0; border: 1px solid #e3e8ef; border-radius: 8px; background: #fff; }
.ve-hint { font-size: 12px; color: #98a2b3; line-height: 1.7; margin: 10px 0 0; }
.ve-card-item { border: 1px solid #eef1f6; border-radius: 10px; padding: 10px; margin-top: 10px; background: #fff; }
.ve-card-item .ve-title-row { margin-bottom: 0; }
.ve-mini-del { border: 0; background: none; color: #d92d20; font-size: 12px; cursor: pointer; }
.ve-mini-add { width: 100%; margin-top: 10px; padding: 8px; border: 1px dashed #c8d2e0; background: #fff; border-radius: 8px; color: #475467; font-size: 12px; cursor: pointer; font-family: inherit; }
.ve-mini-add:hover { border-color: #2563eb; color: #175cd3; }

/* 图片上传按钮 */
.ve-upload { background: #2563eb; color: #fff; border: 0; border-radius: 8px; font-size: 12px; padding: 9px 12px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.ve-upload:hover { background: #1d4ed8; }
