:root {
  --bg: #f7f9f7; --panel: #ffffff; --text: #2b3a32; --muted: #6b7a72;
  --accent: #4caf83; --accent-2: #c8a96a; --line: #e3e9e5; --radius: 16px;
  --shadow: 0 8px 28px rgba(40, 60, 50, .12); --font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
/* 白绿庄园 */
[data-style="white-green"] {
  --bg: #f3f8f4; --panel: #ffffff; --text: #25352c; --muted: #5f7268;
  --accent: #4caf83; --accent-2: #b9d8c2; --line: #e2efe7; --font: "PingFang SC", "Songti SC", "Microsoft YaHei", serif;
}
/* 现代简约 */
[data-style="modern"] {
  --bg: #f4f5f7; --panel: #ffffff; --text: #1d1f24; --muted: #6b7079;
  --accent: #2f6fed; --accent-2: #c9d4ee; --line: #e6e8ee; --font: "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  --radius: 10px;
}
/* 暖色法式 */
[data-style="warm-french"] {
  --bg: #fbf4ee; --panel: #fffaf5; --text: #4a3528; --muted: #8a6f5e;
  --accent: #c0743f; --accent-2: #e6c4a6; --line: #f0e0d2; --font: "PingFang SC", "STKaiti", "Microsoft YaHei", serif;
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  min-height: 100vh; line-height: 1.6; padding-bottom: env(safe-area-inset-bottom);
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 540px; margin: 0 auto; padding: 20px 16px 40px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
input[type="text"], input[type="password"], input[type="number"] {
  width: 100%; padding: 14px 14px; font-size: 17px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--text); font-family: var(--font);
}
input:focus { outline: 2px solid var(--accent-2); border-color: var(--accent); }
button {
  font-family: var(--font); font-size: 16px; border: none; border-radius: 12px;
  padding: 14px 18px; background: var(--accent); color: #fff; cursor: pointer; width: 100%;
  transition: transform .08s ease, opacity .2s; font-weight: 600;
}
button:active { transform: scale(.98); }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.small { width: auto; padding: 9px 14px; font-size: 14px; border-radius: 10px; }
button:disabled { opacity: .5; cursor: default; }
.primary-cta { margin-top: 14px; font-size: 17px; padding: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.candidates { list-style: none; padding: 0; margin: 10px 0 0; }
.candidates li { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; background: #fff; }
.candidates li:active { background: var(--bg); }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.result-table { font-size: 40px; font-weight: 800; color: var(--accent); text-align: center; margin: 6px 0; }
.big-btn { font-size: 18px; padding: 16px; }
.photo-card { margin-top: 14px; border: 1px dashed var(--accent); border-radius: 12px; padding: 12px; text-align: center; color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 50; max-width: 90%; }
.toast.show { opacity: .95; }
/* 地图 */
svg.map { width: 100%; height: auto; display: block; background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); touch-action: none; }
.table-rect { fill: #eef3f0; stroke: var(--line); stroke-width: 1.5; }
.table-rect.main { fill: var(--accent-2); }
.table-rect.target { fill: var(--accent); stroke: var(--accent); }
.table-label { font-size: 12px; fill: var(--text); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.occ-name { font-size: 9px; fill: var(--muted); }
.route-line { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 10 8; animation: dash 1s linear infinite; marker-end: url(#arrow); }
@keyframes dash { to { stroke-dashoffset: -36; } }
@media (prefers-reduced-motion: reduce) { .route-line { animation: none; } }
.entrance-dot, .stage-rect { }
/* 工作人员 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stat { background: var(--bg); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }
.kpi-warn { color: #c0392b; }
.guest-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.guest-item .name { font-weight: 600; }
.guest-item .meta { font-size: 12px; color: var(--muted); }
.pill { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.pill.in { background: var(--accent); color: #fff; }
.pill.vip { background: #7a5cff; color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.modal { background: var(--panel); border-radius: var(--radius); padding: 18px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }

/* ---- 顶部登录入口 ---- */
.topbar { display: flex; justify-content: flex-end; align-items: center; height: 34px; }
.login-link { font-size: 13px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; background: var(--panel); }
.login-link:active { background: var(--bg); }

/* ---- 专属二维码卡片 ---- */
.qr-card { text-align: center; }
.qr-frame { display: inline-block; background: #fff; padding: 12px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.qr-frame img { width: 190px; height: 190px; display: block; }
.qr-title { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.qr-actions { display: inline-flex; gap: 8px; margin-top: 12px; }
.qr-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---- 全场席位图 ---- */
.seatmap-wrap { position: relative; }
.seatmap-wrap svg.seatmap { width: 100%; height: auto; display: block; border-radius: 14px; touch-action: none; cursor: grab; }
.seatmap-controls { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.sm-zoom { width: 38px; height: 38px; padding: 0; border-radius: 10px; background: rgba(255,255,255,.94); color: #3a3a3a; border: 1px solid var(--line); font-size: 18px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sm-zoom:active { transform: scale(.95); }
.map-fullscreen { padding: 8px; }
.map-fullscreen .seatmap-wrap svg.seatmap { max-height: calc(100vh - 150px); width: auto; margin: 0 auto; }

/* 登录切换标签 */
.tab { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- 按桌编辑（管理后台 / 分享页共用）---- */
.gtable { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--panel); }
.gt-head { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.gt-rows { display: flex; flex-direction: column; gap: 6px; }
.grow { display: flex; gap: 8px; align-items: center; }
.grow input { flex: 1; }
.grow .g-del { width: auto; flex: 0 0 auto; padding: 9px 12px; }

/* ---- 编辑器画布 ---- */
svg.seatmap.editor { cursor: default; }
svg.seatmap.editor .tbl:active { cursor: grabbing; }
.editor .tbl { transition: none; }

/* ============ 登录页 ============ */
.login-page { background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%); }
.login-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border-radius: 18px; box-shadow: 0 16px 44px rgba(0,0,0,.18); padding: 26px 22px; }
.brand { text-align: center; margin-bottom: 16px; }
.brand-logo { font-size: 38px; }
.brand h1 { font-size: 20px; margin: 4px 0 2px; }
.login-card .primary-cta { margin-top: 16px; }
.login-foot { text-align: center; margin-top: 14px; }

/* ============ 应用顶栏 ============ */
.app-bar { justify-content: space-between; align-items: center; margin-bottom: 4px; }
.app-title { font-size: 19px; font-weight: 800; }
.app-back { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600; }
.app-back:active { color: var(--accent); }

/* ============ 项目库 ============ */
.project-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.pcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pcard-title { font-size: 17px; font-weight: 800; line-height: 1.3; }
.badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #fff; white-space: nowrap; }
.pcard-meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.pcard-actions { display: flex; gap: 8px; margin-top: 12px; }
.pcard-actions .small { flex: 1; text-align: center; text-decoration: none; display: inline-block; }
.pcard-actions .small[href] { line-height: 34px; }

/* ============ 后台双栏 ============ */
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }

/* ============ 手风琴名单 ============ */
.accordion-head { cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.accordion-head:active { opacity: .7; }
.acc-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.accordion-body { margin-top: 10px; }

/* ============ 表单弹层 ============ */
.field { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; flex: 1; }
.field > span { font-size: 13px; color: var(--muted); }
.field input, .field select { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============ 响应式：电脑 / 平板（Web 版）============ */
@media (min-width: 768px) {
  .wrap { max-width: 960px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1.25fr 1fr; align-items: start; }
  .login-card { max-width: 420px; }
  .pcard-title { font-size: 18px; }
}
@media (min-width: 1100px) {
  .wrap { max-width: 1140px; }
  .project-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ 宾客页：手机单列 / 电脑双栏 ============ */
.guest-layout { display: block; }
.guest-col > * { margin-top: 14px; }
.guest-col > *:first-child { margin-top: 14px; }
.guest-map { margin-top: 14px; }

@media (min-width: 900px) {
  .guest-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
  .guest-layout > #hero { grid-column: 1 / -1; }
  .guest-layout > * { margin-top: 0; }
  .guest-col > * { margin-top: 14px; }
  .guest-col > *:first-child { margin-top: 0; }
  .guest-map { margin-top: 0; position: sticky; top: 16px; }
  .guest-map .card { margin-top: 0; }
}

/* ================= 后台加宽 · 单栏大图 ================= */
.wide .wrap { max-width: 1280px; }
@media (max-width: 767px) { .wide .wrap { max-width: 100%; } }

.section { margin-top: 16px; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-title { font-size: 16px; font-weight: 800; margin: 0; }
.sec-desc { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; line-height: 1.55; max-width: 620px; }
.sec-tools { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.who { font-size: 12px; color: var(--muted); }

/* 桌位地图：全宽大图 */
.editor-map { margin-top: 4px; }
.editor-map .seatmap-wrap svg.seatmap { width: 100%; height: auto; max-height: none; }
.editor-map svg.seatmap.editor { min-height: 420px; }

/* 名单容器限高：滚动查看，不把页面拉长 */
.list-scroll { max-height: 470px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.list-scroll::-webkit-scrollbar { width: 8px; }
.list-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.acc-grid { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start; }
.acc-grid .gtable { margin-bottom: 0; }
@media (min-width: 900px) { .acc-grid { grid-template-columns: 1fr 1fr; } }

/* 子卡片 / 表单 */
.sub-card { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.sub-card .lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.link-form { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 760px) { .link-form { grid-template-columns: 1.2fr 1fr 1fr auto; align-items: center; } }
.link-form input, .link-form select { width: 100%; padding: 11px 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font-family: var(--font); }
.link-form .small { white-space: nowrap; }
.mini-input { width: 150px !important; padding: 8px 10px !important; font-size: 13px !important; border-radius: 10px !important; }
button.danger { color: #c0392b; border-color: #e8bdb7; }

/* 临时链接列表 */
.link-list { display: flex; flex-direction: column; gap: 8px; }
.link-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); }
.link-item.dead { opacity: .6; }
.link-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.link-url { font-size: 12px; color: var(--muted); word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; }
.link-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.link-ops { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pill.bad { background: #fdecea; color: #c0392b; }

/* ================= AI 导入 ================= */
.ai-steps { display: grid; gap: 6px; margin-bottom: 12px; }
.ai-step { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.ai-step b { flex: 0 0 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.ai-copy-row { gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.ai-input { width: 100%; padding: 12px; font-size: 14px; line-height: 1.6; border: 1px solid var(--line); border-radius: 12px; font-family: ui-monospace, Menlo, Consolas, var(--font); background: #fff; color: var(--text); resize: vertical; }
.ai-input:focus { outline: 2px solid var(--accent-2); border-color: var(--accent); }
.ai-mode-row { gap: 16px; margin: 10px 0; flex-wrap: wrap; }
.ai-radio { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.ai-preview { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.ai-sum { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.ai-badge.ok { background: #e8f6ef; color: #2e7d5b; border-color: #bfe6d4; }
.ai-badge.warn { background: #fdf3e3; color: #9a6b18; border-color: #f0dcb8; }
.ai-badge.err { background: #fdecea; color: #c0392b; border-color: #f3c8c2; }
.ai-rows { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.ai-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 8px; padding: 7px 10px; font-size: 13px; border-bottom: 1px solid var(--line); align-items: center; }
.ai-row:last-child { border-bottom: none; }
.ai-t { font-weight: 700; }
.ai-n { color: var(--muted); word-break: break-all; }
.ai-c { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ai-c.over { color: #c0392b; font-weight: 700; }
.ai-warn { font-size: 12px; color: #9a6b18; margin: 8px 0 0; }
.ai-empty { font-size: 13px; color: #c0392b; }

/* ================= 账号管理 ================= */
.acc-form { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 760px) { .acc-form { grid-template-columns: 1fr 1fr; } }
.perm-box { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.perm-item { font-size: 13.5px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.perm-item input { width: 16px; height: 16px; accent-color: var(--accent); }
.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.acc-item.dead { opacity: .62; }
.acc-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acc-name { font-size: 15px; font-weight: 800; }
.acc-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.acc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.perm-tag { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.acc-ops { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.acc-edit { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 4px; }

/* 分享页：限桌/到期提示 */
.scope-note { font-size: 12.5px; color: #9a6b18; background: #fdf3e3; border: 1px solid #f0dcb8; border-radius: 10px; padding: 7px 10px; margin-top: 8px; }
.list-toolbar { margin: 14px 0 0; }

/* ---- 修正：顶栏可换行、分享页桌面端限高 ---- */
.app-bar { height: auto; min-height: 34px; padding: 4px 0; }
@media (min-width: 900px) {
  .editor-map svg.seatmap.editor { min-height: 0; }
  .share-list { max-height: 72vh; overflow-y: auto; padding-right: 4px; }
  .share-list::-webkit-scrollbar { width: 8px; }
  .share-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
}

/* ---- 分享/填写页：链接打不开时的错误卡片 ---- */
.err-card { border-color: #e9c2c2; background: #fff8f8; text-align: center; padding: 26px 20px 22px; }
.err-card h1 { font-size: 20px; margin: 0 0 8px; color: #a33a3a; }
.err-card .sub { margin: 0 0 10px; color: var(--ink); font-size: 14px; }
.err-hint { font-size: 13px; color: var(--muted); line-height: 1.65; margin: 6px 0 0; }
.err-hint.muted { font-size: 12px; opacity: .85; }

/* ================= 宾客端不设公开入口：拦截卡片 ================= */
.entry-note { font-size: 12px; color: var(--muted); text-align: center; margin: 16px 0 0; line-height: 1.6; opacity: .9; }
.gate-card { max-width: 460px; margin: 8vh auto 0; text-align: center; padding: 30px 22px 26px; }
.gate-card h1 { font-size: 21px; margin: 10px 0 6px; }
.gate-card .sub { margin: 0 0 12px; }
.gate-icon { font-size: 42px; line-height: 1; }

/* ================= 照片直播二维码（项目编辑面板上传） ================= */
.live-card { text-align: center; }
.live-frame { display: inline-block; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.live-frame img { display: block; width: 168px; max-width: 60vw; height: auto; border-radius: 8px; }
.qr-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-preview { margin-top: 10px; }
.upload-preview img { width: 120px; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; display: block; }
.field > .upload-row { margin-top: 4px; }

/* ================= 全局广告位 ================= */
.global-ads { margin-top: 16px; display: grid; gap: 10px; }
.global-ads.hidden { display: none; }
.ad-slot { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.ad-slot:active { opacity: .85; }
.ad-media img { display: block; width: 100%; height: auto; }
.ad-title { font-size: 13px; padding: 8px 12px 10px; color: var(--muted); text-align: center; }

/* ================= 全局联系方式 ================= */
.contact-bar { margin-top: 14px; }
.contact-bar.hidden { display: none; }
.contact-inner { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.contact-item {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--text); text-decoration: none;
  font-family: var(--font); font-size: 13px; width: auto; font-weight: 500;
}
.contact-item:active { background: var(--bg); }
.c-label { font-size: 11px; color: var(--muted); }
.c-value { font-size: 13px; font-weight: 600; color: var(--accent); }

/* ================= 全局设置弹层 ================= */
.modal-wide { max-width: 640px; }
.set-rows { display: grid; gap: 10px; margin: 10px 0 10px; }
.set-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.set-row input[type="text"] { padding: 10px 12px; font-size: 14px; border-radius: 10px; }
.contact-row select { flex: 0 0 84px; }
.contact-row input[data-k="label"] { flex: 1 1 120px; }
.contact-row input[data-k="value"] { flex: 1 1 150px; }
.ad-row { align-items: flex-start; }
.ad-thumb { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 10px; border: 1px dashed var(--line); background: var(--panel); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-fields { flex: 1 1 220px; display: grid; gap: 6px; }
.mini-select { padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fff; font-family: var(--font); color: var(--text); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.chk input { width: auto; }

@media (max-width: 480px) {
  .contact-row { flex-wrap: wrap; }
  .ad-thumb { width: 60px; height: 60px; flex-basis: 60px; }
}

/* ================= 手机端预览弹层（iframe 真实宽度渲染） ================= */
.preview-modal { max-width: 860px; }
.preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.dev-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.phone-stage {
  margin-top: 14px; display: flex; justify-content: center;
  background: linear-gradient(160deg, #eef2ef, #f7f9f7); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 12px;
}
.phone-wrap { position: relative; }
.phone-frame {
  position: relative; width: 375px; height: 810px; background: #1c1c1e;
  border-radius: 38px; padding: 12px 10px 14px; box-shadow: 0 18px 42px rgba(20, 40, 30, .28);
  transform-origin: top center; transition: width .15s ease, height .15s ease;
}
.phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 6px; border-radius: 999px; background: #3a3a3c; z-index: 2;
}
.phone-frame iframe {
  width: 100%; height: 100%; border: 0; border-radius: 26px; background: #fff; display: block;
}
@media (max-width: 700px) {
  .phone-stage { padding: 10px 6px; }
  .preview-modal { padding: 14px; }
}

/* ================= 场地设置（舞台方位 / 文字 / 尺寸） ================= */
.venue-modal { max-width: 680px; }
.dir-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 14px; }
.dir-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.1; cursor: pointer; width: auto;
}
.dir-btn span { font-size: 12px; color: var(--muted); font-weight: 500; }
.dir-btn.on { border-color: var(--accent); background: var(--accent-soft, #eef7f1); color: var(--accent); }
.dir-btn.on span { color: var(--accent); }

.venue-rows { display: grid; gap: 8px; }
/* 每行自动换行：窄弹窗里不会把输入框挤成一条缝 */
.venue-row {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg);
  align-items: center;
}
.vr-head { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.venue-name { font-size: 13px; font-weight: 700; color: var(--text); min-width: 38px; }
.venue-row .chk { font-size: 12px; white-space: nowrap; }
.venue-row input[type="text"], .venue-row input[type="number"] {
  padding: 8px 10px; font-size: 13px; border-radius: 9px; min-width: 0;
}
.venue-row .v-label, .venue-row .v-sub { flex: 1 1 128px; min-width: 96px; }
.venue-row select.v-shape {
  flex: 0 0 76px; padding: 8px 4px; font-size: 12.5px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; font-family: var(--font); color: var(--text); min-width: 0;
}
.venue-dims { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.venue-dims input { width: 68px; padding: 7px 2px; text-align: center; }
.venue-tip { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 8px 0 0; }

/* ================= AI 导入：桌数同步相关 ================= */
.ai-sync { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 2px 0 8px; }
.ai-sync input { width: auto; margin-top: 2px; }
.ai-sync i { font-style: normal; color: var(--accent); }
.ai-note { font-size: 12.5px; color: var(--accent); background: var(--accent-soft, #eef7f1); border-radius: 8px; padding: 7px 10px; margin: 6px 0 0; line-height: 1.55; }
.ai-row.is-new { background: rgba(46, 158, 107, .07); border-radius: 8px; }
.new-tag { font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: #2e9e6b; border-radius: 4px; padding: 1px 4px; margin-left: 2px; vertical-align: 1px; }

/* ================= 被隐藏的桌（导入收敛后可一键恢复） ================= */
.hidden-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding: 9px 12px; border: 1px dashed var(--line);
  border-radius: 10px; background: var(--bg); font-size: 12.5px; color: var(--muted);
  flex-wrap: wrap;
}
.hidden-bar.hidden { display: none; }
.hb-txt { flex: 1 1 200px; line-height: 1.5; }
.hb-txt b { color: var(--text); font-weight: 600; }

/* ================= 主标题：轻量条状（不再是一整块又宽又高的大白卡） ================= */
.hero-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 12px 16px;
}
.hero-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.hero-name { font-size: 17px; margin: 0; line-height: 1.3; letter-spacing: .2px; }
.hero-meta { margin: 0; font-size: 12.5px; line-height: 1.4; }
#hero.hero-bar .sub { margin: 0; }
@media (max-width: 520px) {
  .hero-main { flex-direction: column; align-items: flex-start; gap: 1px; }
}

/* ================= 桌位地图：实时预览（宾客端同款渲染） ================= */
.live-pv {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #fafcfd, #f2f6f9);
}
.lp-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.lp-title { font-size: 13px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.lp-hint { font-weight: 500; color: var(--muted); font-size: 12px; }
.lp-hint.dirty { color: #c2410c; }
.lp-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lp-dev { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lp-dev .dev-btn {
  width: auto; background: var(--panel); color: var(--muted); border: 0; border-radius: 0;
  padding: 5px 12px; font-size: 12.5px; font-weight: 600;
}
.lp-dev .dev-btn.active { background: var(--accent); color: #fff; }
.lp-body { padding: 10px 12px 12px; display: flex; justify-content: center; }
.live-pv.collapsed .lp-body { display: none; }
.lp-frame {
  width: 100%; max-width: 720px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 8px; transition: max-width .18s ease;
}
.lp-body.is-phone .lp-frame {
  max-width: 390px; border-radius: 22px; padding: 10px 8px 12px;
  box-shadow: 0 12px 28px rgba(20, 40, 30, .16);
}
.lp-frame svg.seatmap { width: 100%; height: auto; display: block; }
.lp-frame .seatmap-controls { display: none; }

/* 预览与画布的分隔标题 */
.canvas-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 2px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.canvas-title { font-size: 14px; font-weight: 800; }
.canvas-tip { font-size: 12px; color: var(--muted); }

/* ================= 桌位分区（男方桌 / 女方桌 / 特别桌） ================= */
.zone-board {
  margin-top: 12px; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; background: var(--bg);
}
.zone-board.hidden { display: none; }
.zb-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.zb-title { font-size: 13px; font-weight: 800; }
.zb-legend { display: inline-flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.zb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.zb-dot.left { background: #2f6fed; }
.zb-dot.right { background: #e07b2a; }
.zb-muted { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.zb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.zb-chip {
  width: auto; display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 5px 9px; font-size: 12.5px; font-weight: 700;
}
.zb-chip.main { border-color: #e0899a; color: #c0392b; }
.zb-chip.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.zb-chip .zb-tag { font-style: normal; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 999px; background: #eef2f7; color: #2f6fed; }
.zb-chip .zb-tag.right { background: #fdf1e6; color: #c8761e; }
.zb-chip.sel .zb-tag { background: rgba(255, 255, 255, .28); color: #fff; }
.zb-ops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }

/* 场地设置里的分区配置 */
.zone-cfg { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.zone-on { font-weight: 700; color: var(--text); font-size: 13px; }
.zone-rows { display: grid; gap: 6px; margin-top: 8px; }
.zone-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px auto; gap: 6px; align-items: center; }
.zone-row input, .zone-row select {
  padding: 8px 10px; font-size: 13px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-family: var(--font); min-width: 0;
}
.zone-ops { margin-top: 8px; gap: 8px; }

/* 场地设置底部按钮：主按钮自适应，取消按钮不换行 */
.venue-actions { display: flex; gap: 10px; margin-top: 12px; align-items: stretch; }
.venue-actions #venueApply {
  flex: 1 1 0; min-width: 0; width: auto; white-space: nowrap; margin-top: 0;
}
.venue-actions #venueCancel {
  flex: 0 0 auto; min-width: 110px; width: auto; white-space: nowrap;
  padding: 14px 18px; margin-top: 0;
}

/* ================= 后台：两栏工作台 + 窄屏 tab ================= */
.wb-tabs { display: flex; gap: 8px; margin-top: 14px; }
.wb-tab {
  flex: 1; width: auto; padding: 11px 12px; font-size: 14px; font-weight: 700;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 12px;
}
.wb-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.workbench { display: grid; gap: 14px; margin-top: 14px; grid-template-columns: 1fr; align-items: stretch; }
.wb-panel { min-width: 0; }
.wb-panel.section { margin-top: 0; }
/* 两栏顶边 + 底边对齐：卡片撑满所在栏，内容各自滚动 */
.wb-panel { display: flex; flex-direction: column; }
.wb-card { margin-top: 0; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.wb-card > .list-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; max-height: none; }
@media (min-width: 1100px) {
  .wb-tabs { display: none; }
  .workbench { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}
@media (max-width: 1099px) {
  .wb-panel { display: none; }
  .wb-panel.active { display: block; }
}
/* 右栏名单单独滚动，不把整页拉长 */
.wb-right .list-scroll, #secGuests .list-scroll { max-height: calc(100vh - 220px); }
@media (max-width: 1099px) {
  .wb-card > .list-scroll { max-height: calc(100vh - 260px); }
}

/* 地图四周留白 */
.editor-map {
  margin-top: 4px;
  padding: 16px 18px 18px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.editor-map .seatmap-wrap { padding: 4px; }
.editor-map svg.seatmap.editor { background: transparent; }

/* 地图图例 */
.map-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.lg-dot.red { background: #d21f2b; }
.lg-dot.orange { background: #e07b2a; }
.lg-grid { width: 14px; height: 14px; border-radius: 3px; display: inline-block; margin-right: 5px;
  border: 1px solid rgba(120,100,70,.4); background: #fdfaf5; vertical-align: -2px; }
.lg-grid.off { background: rgba(120,100,70,.16); }
.lg-tip { color: #c2410c; }
.lg-tip.on { font-weight: 600; }

/* ================= 桌位样式 ================= */
.shape-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.shape-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--text); font-size: 13px; font-weight: 700; width: auto;
}
.shape-btn span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.shape-btn.on { border-color: var(--accent); background: var(--accent-soft, #eef3ff); color: var(--accent); }
.shape-btn.on span { color: var(--accent); }
.sh { display: block; width: 26px; height: 26px; background: #e07b2a; }
.sh-circle { border-radius: 50%; }
.sh-rect { border-radius: 4px; }
.sh-long { width: 44px; height: 18px; border-radius: 9px; }

.style-rows { display: grid; gap: 8px; }
.style-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font-size: 13px; color: var(--text);
}
.sr-name { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; min-width: 96px; }
.sr-name input[type="checkbox"] { width: auto; }
.sr-tip { font-size: 11.5px; color: var(--muted); }
.sr-num { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sr-num input { width: 62px; padding: 6px 8px; font-size: 13px; }
.style-row input[type="color"] {
  width: 40px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.style-row input[type="range"] { flex: 1 1 140px; accent-color: var(--accent); }
.style-preview {
  margin-top: 12px; border: 1px dashed var(--line); border-radius: 12px;
  background: #fbf7f1; padding: 6px;
}

/* 背景图 */
.bg-preview { margin-top: 10px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.bg-preview img { max-width: 220px; max-height: 150px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; display: block; }
.bg-preview p { margin: 0; }

@media (max-width: 760px) {
  .venue-row .v-label, .venue-row .v-sub { flex: 1 1 100%; }
  .venue-dims { flex: 1 1 100%; justify-content: flex-start; }
}

/* ================= 工具栏：宽屏全展示，窄屏折叠进「更多」 ================= */
.more-tools { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#moreBtn { display: none; }
@media (max-width: 980px) {
  #moreBtn { display: inline-flex; }
  .only-wide { display: none !important; }
  /* 窄屏默认收起，点「更多」才展开 */
  .more-tools { display: none; }
  #mapTools:not(.more-off) #moreTools { display: inline-flex; }
  #mapTools { justify-content: flex-start; }
}

/* ================= 联系人二维码（全局设置 + 宾客端） ================= */
.c-qr { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.contact-row .qr-thumb {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; overflow: hidden;
  border: 1px dashed var(--line); background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; color: var(--muted);
}
.contact-row .qr-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* 宾客端：联系方式旁边多一个「二维码」按钮 */
.c-wrap { display: inline-flex; align-items: stretch; gap: 6px; }
.c-wrap.has-qr .contact-item { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.c-wrap.has-qr .c-qr-btn { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.c-qr-btn {
  width: auto; padding: 8px 12px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--accent); cursor: pointer; font-family: var(--font);
}
.c-qr-btn:active { background: var(--bg); }

.gqr-layer {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(24,20,16,.62); backdrop-filter: blur(2px);
  align-items: center; justify-content: center; padding: 20px;
}
.gqr-layer.show { display: flex; }
.gqr-card {
  background: #fff; border-radius: 18px; padding: 18px 18px 14px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.28); max-width: 320px; width: 100%;
}
.gqr-title { font-size: 15px; font-weight: 800; color: #2b3a32; margin-bottom: 10px; }
.gqr-card img { width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: #fff; }
.gqr-tip { font-size: 12px; color: #8a8078; margin: 8px 0 12px; }
.gqr-x {
  width: 100%; padding: 11px; border-radius: 12px; border: 0; cursor: pointer;
  background: #2f6b4f; color: #fff; font-size: 14px; font-weight: 700; font-family: var(--font);
}

/* 弹窗底部按钮：窄屏不要被挤成竖排 */
.venue-actions button { white-space: nowrap; }
@media (max-width: 620px) {
  .venue-actions { flex-wrap: wrap; }
  .venue-actions .primary-cta { flex: 1 1 100%; }
  .venue-actions .ghost { flex: 1 1 auto; }
}

/* 只在窄屏出现的按钮（宽屏已有独立入口，避免重复） */
.only-narrow { display: none !important; }
@media (max-width: 980px) { .only-narrow { display: inline-flex !important; } }
