/* ============================================================
   会务排座后台 · 设计系统
   宣纸底 + 墨绿侧栏 + 朱红强调 + 衬线标题
   ============================================================ */

:root {
  --paper: #ededed;
  --paper-2: #e2e2e2;
  --card: #ffffff;
  --ink: #0b0f1a;
  --ink-soft: #3d4452;
  --ink-faint: #e4e6ea;
  --vermilion: #ef4d23;
  --vermilion-soft: #feeae3;
  --gold: #ef4d23;
  --text: #1b1f27;
  --text-2: #6b7280;
  --text-3: #9aa0ab;
  --line: rgba(11, 15, 26, 0.1);
  --line-strong: rgba(11, 15, 26, 0.22);
  --ok: #16a34a;
  --shadow: 0 1px 3px rgba(11, 15, 26, 0.07), 0 4px 14px rgba(11, 15, 26, 0.05);
  --shadow-lg: 0 16px 44px rgba(11, 15, 26, 0.12);
  --serif: "Instrument Serif", "Songti SC", Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* 弹窗开关动画：时长与缓动。
     收起用的是展开曲线的镜像 —— 展开 ease-out（起步快、末段收住），
     收起 ease-in（起步慢、末段加速离场），两条互为时间反演，观感才对称。
     改这一处，两套动画同步生效。 */
  --mask-dur: 240ms;
  --mask-ease-out: cubic-bezier(.16, 1, .3, 1);
  --mask-ease-in: cubic-bezier(.7, 0, .84, 0);
}

/* 尊重系统「减弱动态效果」：保留可用性，去掉位移观感 */
@media (prefers-reduced-motion: reduce) {
  :root { --mask-dur: 1ms; }
}

/* 弹窗打开期间禁止背景滚动（由 app.js 的 syncMaskScrollLock 加/去 ） */
html.is-mask-open, html.is-mask-open body { overflow: hidden; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--sans); margin: 0; font-weight: 700; }

button { font-family: inherit; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 基础控件 ---------- */
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.input:focus {
  border-color: var(--ink-soft);
  box-shadow: 0 0 0 3px rgba(11, 15, 26, .08);
}

textarea.input { resize: vertical; line-height: 1.7; }

.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field-hint { font-size: 12px; color: var(--text-3); margin: 6px 0 0; line-height: 1.6; }

.btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
  letter-spacing: .02em;
}
.btn-primary { background: var(--ink); color: #ffffff; }
.btn-primary:hover { background: #0b0f1a; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: rgba(11, 15, 26, .05); }
.btn-danger { background: var(--vermilion); color: #fff; }
.btn-danger:hover { background: #d63d1c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* 胶囊分段选择（Uiverse radio-inputs 风格）：灰底容器 + 选中项白色浮起 */
.chips, #rosterFilters {
  display: inline-flex; flex-wrap: wrap;
  border-radius: 0.5rem;
  background-color: #EEEEEE;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  padding: 0.25rem;
  gap: 2px;
  font-size: 14px;
}
.chip {
  flex: 0 0 auto;
  text-align: center;
  padding: .5rem 1.25rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: rgba(51, 65, 85, 1);
  font-size: 14px;
  font-family: var(--sans);
  cursor: pointer;
  transition: all .15s ease-in-out;
}
.chip:hover { color: var(--ink); }
.chip.is-on { background-color: #fff; font-weight: 600; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.stat-inline .si b { font-size: 19px; font-family: var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-inline .si.accent b { color: var(--ok); }
.stat-inline .si span { font-size: 12px; color: var(--text-3); }

/* 视图 */
/* 舞台：离场视图 position:absolute 的定位参照（QueueAnim .queue-anim-leaving 同款机制） */
.view-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.view { display: none; padding: 24px 28px 40px; overflow-y: auto; flex: 1; }
.view.is-on { display: block; }
/* minmax(0,1fr)：画布排座会给座位区写死像素宽，裸 1fr 的 min-content 下限
   会被它撑开，把右侧「待排座」挤出屏幕 —— 与 .cl-grid2 是同一个坑。 */
#view-seating.is-on { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
#view-seating > * { min-width: 0; }

/* ---------- 视图进场 / 出场动画（纯 CSS 复刻 QueueAnim） ---------- */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blockIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes viewOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

/* 进场：整块淡入上滑 */
.view.is-on { animation: viewIn .30s cubic-bezier(.22, .61, .36, 1) both; }

/* 队列感：只作用于视图的一级区块（toolbar / 卡片 / 表格容器），
   绝不逐项作用到人员卡片上，否则长列表切页会卡 */
.view.is-on > * { animation: blockIn .34s cubic-bezier(.22, .61, .36, 1) both; }
.view.is-on > *:nth-child(1) { animation-delay: .04s; }
.view.is-on > *:nth-child(2) { animation-delay: .08s; }
.view.is-on > *:nth-child(3) { animation-delay: .12s; }
.view.is-on > *:nth-child(4) { animation-delay: .16s; }
.view.is-on > *:nth-child(5) { animation-delay: .20s; }
.view.is-on > *:nth-child(n+6) { animation-delay: .22s; }

/* 出场：脱离文档流，让新视图从顶部开始进（不被老视图挤下去） */
.view.is-leaving {
  position: absolute;
  inset: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
  animation: viewOut .22s ease-in both;
}
.view.is-leaving.is-on { animation: viewOut .22s ease-in both; }
.view.is-leaving > * { animation: none; }

/* 列表局部刷新：淡入（日期切换 / 筛选 / 搜索触发）
   选择器写成 .view .is-refreshed：与 .view.is-on > * 同权重但位置在后，才能覆盖掉进场动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.view .is-refreshed { animation: fadeIn .26s cubic-bezier(.22, .61, .36, 1) both; }

/* 无障碍：系统开了减弱动效就全关 */
@media (prefers-reduced-motion: reduce) {
  .view.is-on,
  .view.is-on > *,
  .view.is-leaving,
  .view.is-leaving.is-on,
  .is-refreshed { animation: none !important; }
}

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .search { width: 260px; }
.toolbar-right { margin-left: auto; display: flex; gap: 10px; }
.section-title { font-size: 16px; color: var(--ink); }

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: calc(100vh - 210px);
  box-shadow: var(--shadow);
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  position: sticky; top: 0; z-index: 1;
  background: #f4f4f5;
  text-align: left;
  padding: 11px 14px;
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbf8f1; }
.table .t-name { font-weight: 600; color: var(--text); }
.table .t-sub { color: var(--text-2); font-size: 12px; }
.table .t-seat { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.table .t-seat.empty { color: var(--gold); font-weight: 500; }
.table .t-phone { font-variant-numeric: tabular-nums; color: var(--text-2); }
.table-foot { font-size: 12px; color: var(--text-3); margin: 10px 2px 0; }

.seat-input {
  width: 150px; padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px; background: #fff;
  font-size: 13px; font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}
.seat-input:focus { outline: none; border-color: var(--ink-soft); box-shadow: 0 0 0 2px rgba(44,97,87,.12); }

.tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 11px; line-height: 1.7; white-space: nowrap;
}
.tag-ok { background: #dff1e8; color: var(--ok); }
.tag-warn { background: var(--vermilion-soft); color: var(--vermilion); }
.tag-line { border: 1px solid var(--line-strong); color: var(--text-2); }
.tag-gold { background: #f5f5f4; color: #b73c15; }

/* ---------- 排座 ---------- */
.seating {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px 28px;
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: calc(100vh - 140px);
}
.seating-stage {
  height: 34px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--ink) 0%, #2d3340 100%);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 14px; letter-spacing: .6em;
  margin-bottom: 30px;
}

.seat-grid { display: flex; flex-direction: column; gap: 30px; }

/* ---------- 排座：画布布局（seatMap.layout === 'canvas'） ----------
   与小程序端 buildVenueCanvas 同一套几何口径：1 格 = 1 个座位宽。
   每块板按 zone 的 x/y 自由摆放；坐标只决定「画在哪」，不决定「几号」
   （编号仍由云端 zones 数组顺序固化，拖动不换号）。
   这里宽度/高度/内边距全部由 JS 按容器尺寸算好写进内联样式，
   所以 CSS 只负责「板长什么样」，不负责「在哪」。 */
.seat-grid.is-canvas {
  display: block;
  position: relative;
  margin: 0 auto;
  box-sizing: border-box;
}
.cv-zone {
  position: absolute;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}
.cv-zone-name {
  position: absolute;
  left: 0; bottom: 100%;
  margin-bottom: 5px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-2);
  white-space: nowrap;
}
.cv-zone-name small {
  margin-left: 4px;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
/* 座位本身复用 .seat 的配色/状态色，只有位置和尺寸由 JS 给 */
.cv-seat { position: absolute; }

.zone-block { }
.zone-title {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px;
}
.zone-title small { font-family: var(--sans); font-size: 11px; color: var(--text-3); letter-spacing: 0; }

.seat-row { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
/* 块内过道缺口：编号按「每 N 座一条过道」分块时渲染 */
.seat-aisle-gap { width: 14px; flex-shrink: 0; }
.row-no {
  width: 22px; text-align: right; font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums; flex-shrink: 0; margin-right: 4px;
}

.seat {
  width: 30px; height: 30px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 10px;
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .13s ease;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.seat:hover { transform: translateY(-2px); border-color: var(--ink-soft); box-shadow: 0 3px 8px rgba(27,35,32,.14); }
.seat.taken { background: var(--ink); border-color: var(--ink); color: #ffffff; font-weight: 600; }
.seat.reserved { background: repeating-linear-gradient(45deg, #f5f5f4, #f5f5f4 4px, #e8e8e8 4px, #e8e8e8 8px); border-color: #ddc98d; color: #b73c15; }
.seat.selected { background: var(--vermilion); border-color: var(--vermilion); color: #fff; transform: scale(1.08); }
.seat.hl { box-shadow: 0 0 0 2px var(--gold); }

.seating-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 140px);
  display: flex; flex-direction: column;
}
.side-head h3 { font-size: 15px; color: var(--ink); margin-bottom: 12px; }
.side-head .count {
  display: inline-block; background: var(--ink-faint); color: var(--ink);
  border-radius: 999px; padding: 0 9px; font-size: 12px; font-family: var(--sans);
  margin-left: 4px;
}
.side-head .input { margin-bottom: 12px; }

.pending-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.pending-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  border: 1px solid transparent; background: #fafafa;
  cursor: pointer; transition: all .14s ease;
}
.pending-item:hover { border-color: var(--line-strong); }
.pending-item.is-on { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.pending-item .pi-name { font-size: 13px; font-weight: 600; }
.pending-item .pi-sub { font-size: 11px; color: var(--text-3); }
.pending-item.is-on .pi-sub { color: rgba(255,253,247,.65); }
.side-tip {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong);
  font-size: 12px; color: var(--text-3); line-height: 1.7;
}

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ink);
}
.kpi.accent::before { background: var(--ok); }
.kpi.gold::before { background: var(--gold); }
.kpi .k-label { font-size: 12px; color: var(--text-3); letter-spacing: .04em; }
.kpi .k-value { font-family: var(--sans); font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi.accent .k-value { color: var(--ok); }
.kpi.gold .k-value { color: var(--gold); }

/* ---------- 数字滚轮（odometer）：0→N 的滚动过程 ---------- */
.num { display: inline-flex; align-items: flex-start; line-height: 1; }
.od { display: inline-block; height: 1em; overflow: hidden; }
.od-col { display: block; will-change: transform; backface-visibility: hidden; }
.od-col i { display: block; height: 1em; line-height: 1; font-style: normal; }
.k-unit { margin-left: 1px; font-size: .68em; font-weight: 600; }
.kpi .k-value { display: flex; align-items: baseline; }
.gauge-big .num { line-height: 1; }

/* ---------- 设置 ---------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1100px; }
.set-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; box-shadow: var(--shadow);
}
.set-card h3 { font-size: 16px; color: var(--ink); margin-bottom: 16px; }
/* 勾选项：与输入框同样的纵向节奏 */
.set-check {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none;
}
.set-check input { width: 15px; height: 15px; accent-color: var(--brand, #ef4d23); flex-shrink: 0; }
.qr-box { margin-top: 16px; text-align: center; }
.qr-box img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 10px; }

.set-card-wide { grid-column: 1 / -1; }

/* ---------- 座位表编辑器 ---------- */
.zone-editor { display: flex; flex-direction: column; gap: 8px; }

.ze-head, .ze-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 110px 110px 96px 108px;
  gap: 10px;
  align-items: center;
}

/* 逐排设置 */
.ze-ops { display: flex; align-items: center; gap: 6px; }
.ze-toggle {
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: all .14s ease;
  white-space: nowrap;
}
.ze-toggle:hover { border-color: var(--ink-soft); color: var(--ink); }
.ze-toggle.is-on { background: var(--brand-soft, rgba(201,242,77,.16)); border-color: rgba(201,242,77,.5); color: #6b7a1f; font-weight: 600; }

.ze-per-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 14px 6px;
  margin: 0 4px 8px;
  background: #fafafa;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
}

.zpr-item { display: flex; align-items: center; gap: 5px; }
.zpr-label {
  font-size: 12px;
  color: var(--text-2);
  min-width: 34px;
  font-variant-numeric: tabular-nums;
}
.ze-per-row .field-hint { flex-basis: 100%; margin: 4px 0 0; }

.ze-head {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .04em;
  padding: 0 4px 4px;
}

.ze-row {
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}

.ze-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  outline: none;
  font-family: inherit;
}
.ze-input:focus { border-color: var(--ink-soft); box-shadow: 0 0 0 3px rgba(44,97,87,.1); }
.ze-input.mono { font-family: var(--mono); text-align: center; }

.stepper { display: flex; align-items: center; gap: 6px; }
.step-btn {
  width: 26px; height: 26px; flex-shrink: 0;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 7px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: all .14s ease;
}
.step-btn:hover { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.step-num {
  width: 42px; text-align: center;
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.zone-count { font-size: 12px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.ze-del {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent; color: var(--text-3);
  cursor: pointer; font-size: 15px; line-height: 1;
}
.ze-del:hover { border-color: var(--vermilion); color: var(--vermilion); background: var(--vermilion-soft); }

.ze-add { align-self: flex-start; margin-top: 6px; }

.ze-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-strong);
}
.ze-summary { font-size: 13px; color: var(--text-2); }
.ze-summary b { font-family: var(--sans); font-size: 17px; color: var(--ink); }

/* 座位表预览：讲台在上，各组横向并排（组间即过道），与参会人看到的一致 */
.ze-preview {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fafafa;
  border-radius: 10px;
  max-height: 260px;
  overflow: auto;
}

.zp-stage {
  margin-bottom: 12px;
  padding: 5px 0;
  text-align: center;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(201, 242, 77, 0.32), rgba(201, 242, 77, 0.1));
  border: 1px solid rgba(150, 180, 40, 0.45);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 5px;
  color: #5a6b12;
}

.zp-body { overflow-x: auto; }

.zp-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.zp-rown {
  width: 32px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.zp-zone {
  display: flex;
  align-items: center;
  margin-right: 16px;
}

.ze-preview .zp-seat {
  width: 28px;
  height: 16px;
  margin-right: 3px;
  border-radius: 3px;
  background: #fff;
  border: 1px solid var(--line-strong);
  font-size: 8px;
  font-style: normal;
  line-height: 14px;
  text-align: center;
  color: #7a7362;
  font-variant-numeric: tabular-nums;
}

.ze-preview .zp-seat.reserved {
  background: #ffd400;
  border-color: #e0b800;
  color: #4a3c00;
  font-weight: 600;
}

/* 会场级设置（讲台名 / 编号方式） */
.zone-global {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.range { width: 100%; accent-color: var(--ink); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 30, 26, .5);
  display: flex; align-items: center; justify-content: center; z-index: 60;
  backdrop-filter: blur(2px);
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--card); border-radius: 14px; width: 560px;
  max-width: calc(100vw - 40px); max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-sm { width: 420px; }
.modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; color: var(--ink); }
.modal-close {
  background: none; border: none; font-size: 22px; color: var(--text-3);
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}
.import-modal { width: 620px; }

.import-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.itab {
  padding: 6px 16px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px;
}
.itab.is-on { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.itab-body { display: none; }
.itab-body.is-on { display: block; }
/* 字段格式说明表 */
.fmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 12px;
  table-layout: fixed;
}
.fmt-table th {
  text-align: left;
  padding: 7px 10px;
  background: #f4f4f5;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.fmt-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}
.fmt-table td:first-child { width: 76px; font-weight: 600; }
.fmt-table td:nth-child(2) { width: 76px; }
.fmt-table td.mono { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

.import-mode { display: flex; gap: 20px; margin-top: 16px; font-size: 13px; color: var(--text-2); }
.import-mode label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.import-preview {
  margin-top: 14px; font-size: 12px; color: var(--text-2);
  max-height: 150px; overflow-y: auto; background: #fafafa;
  border-radius: 8px; padding: 10px 12px; line-height: 1.8;
}
.import-preview:empty { display: none; }

/* 弹窗内信息 */
.info-list { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.info-list .il { display: flex; justify-content: space-between; gap: 16px; }
.info-list .il span { color: var(--text-3); }
.info-list .il b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.modal-seat-big {
  font-family: var(--sans); font-size: 40px; color: var(--vermilion);
  line-height: 1.2; margin: 6px 0 16px; letter-spacing: .02em;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #ffffff;
  padding: 11px 22px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .22s cubic-bezier(.22,1,.36,1);
  z-index: 200; box-shadow: var(--shadow-lg);
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--vermilion); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(20, 69, 60, .18); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(20, 69, 60, .32); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  #view-seating.is-on { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ── 签到看板 ─────────────────────────────── */
.group-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.gbar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.gbar .g-name { width: 76px; flex: none; color: var(--text-2); text-align: right; }
.gbar .g-track { flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.08); overflow: hidden; }
.gbar .g-fill { height: 100%; border-radius: 5px; background: var(--brand); transition: width 0.5s ease; }
.gbar.is-full .g-fill { background: #4ade80; }
.gbar .g-num { width: 56px; flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }

.tel-link { color: var(--brand); text-decoration: none; cursor: pointer; }
.tel-link:hover { text-decoration: underline; }
.auto-refresh { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; cursor: pointer; }
.empty-row { color: var(--text-3); text-align: center; padding: 18px 0; }

/* 签到数字变化反馈：新签时"已签"卡放大一拍并标增量 */
.kpi.bump .k-value { animation: kpiBump 0.5s ease; transform-origin: left center; }
.k-delta { display: inline-block; margin-left: 6px; font-size: 13px; color: var(--brand); opacity: 0; }
.k-delta.is-show { animation: kDelta 2.4s ease forwards; }
@keyframes kpiBump { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes kDelta { 0%,80% { opacity: 1; } 100% { opacity: 0; } }

/* ── 签到率仪表盘（Convix 风格白卡） ── */
.gauge-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.gauge-left { flex: 1; min-width: 0; }
.gauge-head { display: flex; align-items: baseline; gap: 8px; }
.gauge-name { font-size: 14px; font-weight: 600; color: var(--vermilion); }
.gauge-sub { font-size: 12px; color: var(--text-3); }
.gauge-big { margin-top: 4px; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.gauge-sep { margin: 0 6px; color: var(--text-3); font-weight: 400; }
.gauge-cap { margin-top: 4px; font-size: 11px; color: var(--text-3); }
.gauge-svg { flex: none; }
.gauge-legend { display: flex; justify-content: space-between; width: 200px; font-size: 11px; color: var(--text-3); }

/* ── 登录页 ASCII 渐变背景（GradientASCII） ── */
.ascii-bg { position: absolute; inset: 0; z-index: 0; }
.gradient-ascii-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.gradient-ascii-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }


/* ---------- 登录（modern-form 浅色卡：图标输入 + 密码可见切换 + 扫描光按钮） ---------- */

/* 登录遮罩：全屏 + flex 居中卡片 + 暗底衬托 ASCII 背景 */
.login-mask {
  position: fixed;
  inset: 0;
  background: #0b0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.login-mask[hidden] { display: none; }

.modern-form {
  --primary: #ef4d23;
  --primary-dark: #d63d1c;
  --primary-light: rgba(239, 77, 35, 0.12);
  --success: #10b981;
  --text-main: #1e293b;
  --text-secondary: #64748b;
  --bg-input: #f8fafc;

  position: relative;
  z-index: 2;
  width: 340px;
  padding: 26px 28px 22px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.05),
    inset 0 0 0 1px rgba(148, 163, 184, 0.1);
  font-family: var(--sans);
}

.form-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 20px;
  text-align: center;
  letter-spacing: 0.04em;
}

.input-group { margin-bottom: 14px; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-main);
  transition: all 0.2s ease;
  font-family: var(--sans);
}

.form-input::placeholder { color: var(--text-secondary); }

.input-icon {
  position: absolute;
  left: 13px;
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  pointer-events: none;
}

.password-toggle {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  padding: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.eye-icon { width: 16px; height: 16px; }

.password-toggle:hover { color: var(--primary); }

.submit-button {
  position: relative;
  width: 100%;
  height: 42px;
  margin-top: 6px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  font-family: var(--sans);
}

.button-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.submit-button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.submit-button:hover .button-glow { transform: translateX(100%); }
.submit-button:active { transform: translateY(0); }
.submit-button:disabled { opacity: 0.75; cursor: wait; }

.form-footer { margin-top: 16px; text-align: center; font-size: 12px; }
.login-link { color: var(--text-secondary); text-decoration: none; transition: color 0.2s ease; }
.login-link:hover { color: var(--primary); }

.input-wrapper:has(.password-toggle) .form-input { padding-right: 38px; }

.submit-button.is-loading { color: transparent; pointer-events: none; }
.submit-button.is-loading:after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* 登录失败抖动 */
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.modern-form.shake { animation: loginShake 0.3s ease-in-out; }

/* ── 登录页 ASCII 渐变背景（GradientASCII） ── */
.ascii-bg { position: absolute; inset: 0; z-index: 0; }
.gradient-ascii-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.gradient-ascii-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }


/* ── 侧边栏/导航/日期切换/布局骨架（重建时误删，自 d2da34b 恢复） ── */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
}
.app[hidden] { display: none; }
.day-switch {
  display: inline-flex; flex-wrap: wrap;
  border-radius: 0.5rem;
  background-color: #EEEEEE;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  padding: 0.25rem;
  gap: 2px;
}
.day-btn {
  flex: 0 0 auto; text-align: center;
  padding: .4rem 1.25rem; border-radius: 0.5rem; border: none;
  background: transparent; color: rgba(51, 65, 85, 1);
  font-size: 13px; cursor: pointer; transition: all .15s ease-in-out;
  display: flex; flex-direction: column; align-items: center; line-height: 1.3;
  font-family: var(--sans);
}
.day-btn small { font-size: 11px; color: var(--text-3); }
.day-btn:hover { color: var(--ink); }
.day-btn.is-on { background-color: #fff; font-weight: 600; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.day-btn.is-on small { color: var(--text-2); }
.main { display: flex; flex-direction: column; overflow: hidden; }
.nav-ico {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-ico svg { width: 20px; height: 20px; display: block; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-2); font-size: 14px; cursor: pointer;
  text-align: left; width: 100%;
  transition: all 0.5s ease;
}
.nav-item:hover { background: #f1f5f9; color: var(--text-main); }
.nav-item.is-on {
  background: rgba(239, 77, 35, 0.12);
  border-color: #ef4d23;
  color: var(--primary-dark, #d63d1c);
  font-weight: 600;
}
.nav-item.is-on .nav-ico { color: #ef4d23; }
.nav-item.is-on span:last-child { transform: translateX(2px); }
.nav-item span:last-child { display: inline-block; transition: transform 0.5s ease; }
.sb-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 0 22px 22px; border-bottom: 1px solid var(--line); }
.sb-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sb-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sb-brand-text { display: flex; flex-direction: column; min-width: 0; }

.sb-foot { padding: 16px 22px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.sb-logout { background: none; border: none; color: var(--text-3); font-size: 12px; cursor: pointer; padding: 0; transition: color 0.2s ease; }
.sb-logout { background: none; border: none; color: var(--text-3); font-size: 12px; cursor: pointer; padding: 0; transition: color 0.2s ease; }
.sb-mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: #ef4d23; border: 1px solid #ef4d23;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 20px; font-weight: 700; color: #ffffff;
  flex-shrink: 0;
}
.sb-mode { font-size: 11px; color: var(--text-3); letter-spacing: .05em; }

.sb-nav { padding: 18px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar {
  background: #ffffff;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  padding: 24px 0 20px;
  border-right: 1px solid var(--line);
  box-shadow: 2px 0 12px rgba(11, 15, 26, 0.04);
}

.stat-inline { display: flex; gap: 22px; align-items: baseline; }

.stat-inline { display: flex; gap: 22px; align-items: baseline; }

.topbar {
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,247,.7);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
  100% { transform: rotate(360deg); }

/* ── 人员卡片网格（签到名册） ── */
.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.pg-empty { padding: 40px; text-align: center; color: var(--text-3); }

.pcard {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.pcard.is-unchecked { border-left: 3px solid #ef4d23; }
.pcard.is-checked { border-left: 3px solid #10b981; }

.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-name { font-weight: 600; font-size: 14px; color: var(--text); }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.is-checked .pc-dot { background: #10b981; }
.is-unchecked .pc-dot { background: #ef4d23; }

.pc-co { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.pc-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; gap: 8px;
}
.pc-seat { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.pc-tel {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(239, 77, 35, 0.12); color: #ef4d23;
  flex-shrink: 0; text-decoration: none;
  transition: all 0.2s ease;
}
.pc-tel:hover { background: #ef4d23; color: #ffffff; }
/* ★ SVG 必须显式定尺寸，否则会撑满整个视口（真机事故） */
.pc-tel svg { width: 13px; height: 13px; }

/* ── 星链集团 LOGO（黑色版，浅底直接显示） ── */
/* 会议名文字按需求隐藏（hidden 属性会被 .sb-brand-text 的 display:flex 覆盖，需显式声明） */
.sb-brand-text[hidden] { display: none; }
.sb-logo {
  display: block;
  width: 118px;
  height: auto;
  margin-bottom: 0;
}
.form-logo {
  display: block;
  width: 138px;
  height: auto;
  margin: 0 auto 16px;
}
