/* ============================================================
   演出项目二级票务工作台 — 扁平矢量 · 欧美风 · 淡色系
   ============================================================ */
:root {
  --bg: #f6f7f3;
  --surface: #ffffff;
  --border: #e5e7e0;
  --border-strong: #d4d7cd;
  --ink: #2f342b;
  --ink-2: #6b7264;
  --ink-3: #9aa091;
  --coral: #e08d6d;
  --coral-soft: #f7e3da;
  --sage: #8ba884;
  --sage-soft: #e2ecdf;
  --blue: #7f9cba;
  --blue-soft: #e2eaf1;
  --amber: #d4a55e;
  --amber-soft: #f5ead6;
  --rose: #c98a94;
  --rose-soft: #f4e2e5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(47, 52, 43, 0.04);
  font-size: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 1180px; margin: 0 auto; padding: 36px 28px 80px; }

/* ---------- 通用 ---------- */
.micro {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink); border-radius: 10px;   padding: 8px 16px;
  font-size: 14.5px; font-weight: 500; cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--ink-3); background: #fbfbf9; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #444b3f; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: #eef0ea; color: var(--ink); }
.btn.danger-ghost { border-color: transparent; background: transparent; color: var(--rose); }
.btn.danger-ghost:hover { background: var(--rose-soft); }
.btn.sm { padding: 4px 10px; font-size: 13.5px; border-radius: 8px; }
.btn.sm2 { padding: 5px 12px; font-size: 13.5px; border-radius: 8px; }

/* ---------- 勾选连座工具栏 ---------- */
.selbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 14px; margin-bottom: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  position: sticky; top: 0; z-index: 5;
  box-shadow: 0 1px 4px rgba(60, 60, 50, .06);
}
.selbar .sel-info { font-size: 13.5px; color: var(--ink-2); }
.selbar .sel-info b { color: var(--coral); font-size: 15.5px; }
.selbar .sel-hint { font-size: 12.5px; color: var(--ink-3); margin-left: 4px; }
td.chk, th.chk { width: 34px; text-align: center; padding: 3px 2px; }
td.chk input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: #e08d6d; }
tr.picked td { background: rgba(224, 141, 109, .10) !important; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
input, select, textarea {
  font: inherit; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 8px 12px; background: #fff; outline: none; width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--sage); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--coral);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px;
}
.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: .01em; }
.brand .micro { margin-top: 1px; }

/* ---------- 项目列表 ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 30px 0 14px;
}
.section-head h2 { font-size: 17px; font-weight: 700; }
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px;
}
.project-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: border-color .15s; }
.project-card:hover { border-color: var(--border-strong); }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.pc-name { font-size: 17.5px; font-weight: 700; }
.pc-stats { display: flex; gap: 22px; }
.pc-stat .num { font-size: 22px; font-weight: 700; }
.pc-stat .num small { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.pc-actions { display: flex; gap: 8px; margin-top: 2px; }
.new-project-card {
  border: 1.5px dashed var(--border-strong); background: transparent;
  border-radius: var(--radius); min-height: 150px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-3); transition: all .15s; font: inherit;
}
.new-project-card:hover { border-color: var(--sage); color: var(--sage); background: #fafbf8; }
.new-project-card .plus { font-size: 26px; font-weight: 300; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active { background: var(--sage-soft); color: #5d7a56; }
.badge.archived { background: #ecedea; color: var(--ink-3); }

/* ---------- 工作区 ---------- */
.ws-top { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.ws-title { font-size: 21px; font-weight: 700; margin-right: auto; }
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0 24px;
}
.tab {
  border: none; background: none; font: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--ink-3); padding: 10px 16px; cursor: pointer; position: relative;
}
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--ink); }
.tab.on::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2.5px; border-radius: 2px; background: var(--coral);
}
.tab .soon { font-size: 11.5px; background: var(--blue-soft); color: var(--blue); padding: 1px 6px; border-radius: 999px; margin-left: 6px; font-weight: 600; }

/* ---------- 统计卡 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.stat-card .val { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.stat-card .val small { font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.stat-card.tint-coral { background: var(--coral-soft); border-color: transparent; }
.stat-card.tint-sage { background: var(--sage-soft); border-color: transparent; }
.stat-card.tint-blue { background: var(--blue-soft); border-color: transparent; }
.stat-card.tint-amber { background: var(--amber-soft); border-color: transparent; }

.panel { padding: 20px 22px; margin-bottom: 18px; overflow-x: auto; }
.panel table { min-width: 640px; }
.panel table.seat-table { min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { font-size: 16px; font-weight: 700; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; padding: 5px 8px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 3px 8px; border-bottom: 1px solid #f0f1ec; vertical-align: middle; height: 34px; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #fafbf7; }
td.num { font-variant-numeric: tabular-nums; }
.seat-table { width: auto; min-width: 0; }
.seat-cell { white-space: nowrap; }
.zonesection { margin-bottom: 8px; }
.zonesection > .zone-bar {
  display: flex; align-items: center; gap: 12px; padding: 6px 6px; margin-top: 8px;
}
.zone-bar .zname { font-size: 15px; font-weight: 700; }
.zone-bar .zmeta { font-size: 12.5px; color: var(--ink-3); }

/* 行内编辑单元格 */
.seat-table td { white-space: nowrap; }
.cell-in, .cell-sel {
  border: 1px solid transparent; background: transparent; border-radius: 6px;
  font: inherit; color: inherit; padding: 3px 6px; height: 29px; width: 100%;
  min-width: 0; box-sizing: border-box; outline: none;
}
.cell-in:hover { border-color: #e2e4dc; }
.cell-in:focus, .cell-sel:focus { border-color: var(--sage); background: #fff; }
.cell-in.num { text-align: right; }
.w64 { width: 64px; } .w80 { width: 80px; } .w88 { width: 90px; }
.w110 { width: 94px; } .w120 { width: 120px; } .w140 { width: 142px; }
.cell-sel { cursor: pointer; max-width: 96px; }
/* 座位表下拉：固定宽度贴文字（含下拉箭头约占 17px） */
.seat-table .cell-sel { width: 68px; min-width: 0; padding-left: 3px; padding-right: 3px; }
.seat-table select[data-f="attr"] { width: 52px; }
.seat-table select[data-f="rights"] { width: 82px; }

/* ---------- 状态徽章 ---------- */
.st { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st.empty { background: #eff0ec; color: var(--ink-3); }
.st.pending { background: var(--blue-soft); color: #5f7d99; }
.st.booked { background: var(--amber-soft); color: #a67c33; }
.st.sold { background: var(--sage-soft); color: #5d7a56; }
.st.done { background: var(--rose-soft); color: #a5636e; }

/* ---------- 连座标记 ---------- */
.linkchip {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px;
  margin-left: 6px; vertical-align: 1px;
}
.seat-table.rz-table td.linkcell { text-align: center; white-space: nowrap; }
.seat-table.rz-table td.linkcell .linkchip { display: inline-block; }

/* ---------- 筛选条 ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--border-strong); background: #fff; border-radius: 999px;
  padding: 5px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filterbar .spacer { flex: 1; }
.filterbar input { width: 210px; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 54px 20px; color: var(--ink-3);
}
.empty .big { font-size: 36px; margin-bottom: 10px; }
.empty p { font-size: 14.5px; margin-bottom: 18px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(47, 52, 43, .32);
  display: grid; place-items: center; z-index: 50; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  padding: 26px 28px; max-height: 86vh; overflow: auto;
}
.modal h3 { font-size: 17.5px; font-weight: 700; margin-bottom: 4px; }
.modal .sub { font-size: 13.5px; color: var(--ink-3); margin-bottom: 18px; }
.modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal .form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* 导入模式选择 */
.imp-modes { display: grid; gap: 8px; }
.imp-mode {
  display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; column-gap: 8px;
  border: 1.5px solid #e4e6df; border-radius: 10px; padding: 10px 14px; cursor: pointer;
  font-size: 13.5px; transition: border-color .15s, background .15s;
}
.imp-mode:has(input:checked) { border-color: var(--coral, #e0876a); background: #fdf6f2; }
.imp-mode input { accent-color: var(--coral, #e0876a); }
.imp-mode b { font-weight: 700; color: var(--ink); }
.imp-mode span { font-size: 12.5px; color: var(--ink-3); }
.imp-err {
  background: var(--rose-soft); color: #a5636e; border-radius: 8px;
  padding: 8px 12px; font-size: 13.5px; line-height: 1.6;
}

/* ---------- 座位图 ---------- */
.seatmap { overflow-x: auto; }
.sm-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.linklike {
  border: none; background: none; padding: 0; font: inherit; font-size: 12.5px;
  color: var(--coral); cursor: pointer; text-decoration: underline; margin-left: 6px;
}
.sm-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.sm-lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sm-lg i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid rgba(47, 52, 43, .10); }
.sm-lg i.noattr { background: transparent; border: 1px solid #c9ccc2; }
.sm-zones { display: flex; flex-wrap: nowrap; width: max-content; gap: 28px; align-items: flex-start; }
.sm-viewport {
  overflow: auto; max-height: 72vh;
  cursor: grab; user-select: none;
  padding: 6px 4px 10px; border-radius: 10px;
  scrollbar-width: thin;
}
.sm-viewport.dragging { cursor: grabbing; }
.sm-viewport:active { cursor: grabbing; }
.sm-viewport .sm-rowlabel { user-select: none; }
.sm-zone { flex: 0 0 auto; }
.sm-zone-title {
  display: inline-block; font-size: 13.5px; font-weight: 700; color: #fff;
  background: var(--blue); border-radius: 7px; padding: 3px 14px; margin-bottom: 10px;
}
.sm-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sm-rowlabel { width: 40px; flex: none; text-align: right; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.sm-rowlabel.right { text-align: left; }
.sm-colhead { margin-bottom: 2px; }
.sm-colhead .sm-rowlabel { visibility: hidden; }
.sm-seats .sm-col {
  width: 24px; height: 14px; flex: none;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 600; color: var(--ink-3);
  overflow: hidden; white-space: nowrap;
}
.sm-seats { display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-start; align-content: flex-start; }
.sm-seat {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 24px; align-self: flex-start;
  width: 24px; height: 24px; min-width: 24px; max-width: 24px;
  min-height: 24px; max-height: 24px;
  border: 1px solid #c9ccc2; border-radius: 5px; background: transparent;
  font-size: 11.5px; font-weight: 700; line-height: 1; color: #35392f;
  padding: 0; overflow: hidden; box-sizing: border-box; cursor: default;
}
.sm-seat.noattr { background: transparent; }
.sm-seat.gap { border-color: transparent; background: transparent; }
.sm-zone.sm-extra .sm-zone-title { background: #9aa08f; }
.sm-extratip { font-size: 11.5px; font-weight: 600; margin-left: 6px; opacity: .85; }

/* ---------- 属性设置 ---------- */
.attr-tag { padding-left: 8px; }
.attr-tag input[type="color"], .chips-edit form input[type="color"] {
  width: 24px; height: 24px; padding: 0; border: none; background: none;
  border-radius: 6px; cursor: pointer; flex: none;
}
.chips-edit form input.attr-name { width: 120px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; font-size: 14.5px; padding: 10px 18px;
  border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.14); animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 图表 ---------- */
.barchart { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 8px; }
.barchart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barchart .bar .col { width: 100%; max-width: 38px; background: var(--sage); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.barchart .bar .lbl { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.barchart .bar .v { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }

.chips-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-edit .tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: #f1f2ee; border-radius: 999px; padding: 5px 7px 5px 14px; font-size: 13.5px; font-weight: 500;
}
.chips-edit .tag button {
  border: none; background: #dddfd8; width: 18px; height: 18px; border-radius: 50%;
  cursor: pointer; font-size: 11px; line-height: 1; color: var(--ink-2); display: grid; place-items: center;
}
.chips-edit .tag button:hover { background: var(--rose); color: #fff; }
.chips-edit .tag.tag-total {
  background: var(--ink); color: #fff; padding-right: 14px;
}
.chips-edit .tag.tag-total b { color: #fff; }
/* 渠道视图：当前渠道高亮、其他渠道淡化（仅作对照，不可点） */
.chips-edit .tag.on { background: var(--sage); font-weight: 700; outline: 1px solid var(--sage); }
.chips-edit .tag.dim { opacity: .45; }
.chips-edit form { display: inline-flex; gap: 8px; }
.chips-edit form input { width: 150px; padding: 5px 12px; }
.hint { font-size: 13.5px; color: var(--ink-3); line-height: 1.7; }
.muted { color: var(--ink-3); }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px; }

/* ============ 演出日期：切换栏 + 卡片日期行 ============ */
.daybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.daybar-label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-right: 2px; }
.day-chip { font-size: 13.5px; padding: 5px 12px; }
.rz-batch-group { display: inline-flex; align-items: center; gap: 6px; }
.rz-batch-group .rz-batch-n { width: 58px; text-align: center; padding: 6px 6px; }
.rz-empty { text-align: center; padding: 30px 0 22px; }
.rz-empty .big { font-size: 36px; margin-bottom: 6px; }
.rz-empty p { margin: 4px 0 14px; color: var(--ink-2); font-size: 14.5px; }
.rz-empty p.muted { color: var(--ink-3); font-size: 13.5px; margin-bottom: 0; }
.rz-empty-act { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.daybar-hint { font-size: 13.5px; color: var(--ink-3); margin-bottom: 12px; }
.daybar-hint b { color: var(--ink); }
/* 设置页「库存日期」栏：分隔共享设置与按日库存 */
.stock-daybar { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.stock-daybar .hint { font-size: 12.5px; }
.pc-days { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
/* 项目卡上的演出时间段行 */
.pc-time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* 工作区顶栏的演出时间段标签 */
.ws-showtime {
  font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  padding: 3px 10px; border-radius: 999px;
  background: var(--blue-soft); border: 1px solid var(--border);
}

/* 随机票区：票区切换条 / 序号列 / 已录入行底色 */
.rzone-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; }
.rzone-bar .chip.ghost { border-style: dashed; border-color: var(--ink-3); color: var(--ink-2); padding-left: 12px; padding-right: 12px; }
.rzone-bar .chip.ghost:hover { border-color: var(--ink); color: var(--ink); }
/* 随机票区：录入渠道整体切换条 / 列表排序条 */
.rchan-bar, .rsort-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 12px; padding: 8px 12px;
  background: var(--sage-soft, #e2ecdf); border: 1px solid var(--sage); border-radius: 10px;
}
.rsort-bar { background: transparent; border: 1px dashed var(--border, #e3e1d8); border-radius: 8px; margin: 0 0 10px; }
.rchan-bar .sel-hint, .rsort-bar .sel-hint { margin-left: auto; }
.rchan-bar .sel-hint b { color: var(--ink); }
.rz-fillchan { display: inline-flex; align-items: center; gap: 6px; }
.rz-fillchan .cell-sel { max-height: 30px; }
.seat-table .seq { width: 46px; text-align: center; color: var(--ink-3); font-variant-numeric: tabular-nums; user-select: none; }
.seat-table.rz-table tbody tr.entered { background: var(--ebg, #eef5ee); }       /* 录入日期填入后行变色（不同日期不同色） */
.seat-table.rz-table tbody tr.entered td.seq { box-shadow: inset 3px 0 0 var(--ebar, var(--sage)); color: var(--ink); }
.empty-block { text-align: center; padding: 30px 16px; }
.empty-block .big { font-size: 42px; margin-bottom: 6px; }
.empty-block p { color: var(--ink-2); line-height: 1.7; }

/* ============ 邀请函模块 ============ */
.inv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; }
.inv-bar .spacer { flex: 1; }
.inv-bar .hint { font-size: 12.5px; }
td.qty-auto { background: #f4f5f0; border-radius: 6px; text-align: center; white-space: nowrap; }
td.qty-auto .muted { font-weight: 400; }
.inv-matrix th, .inv-matrix td { text-align: center; }
.inv-matrix th:first-child, .inv-matrix td:first-child { text-align: left; }
.inv-matrix td { font-variant-numeric: tabular-nums; }
tfoot tr.total-row td, tr.total-row td {
  font-weight: 700; background: #f4f5f0;
  border-top: 1.5px solid var(--border-strong); border-bottom: none;
}
/* 矩阵表前置行：渠道申领 / 渠道库存（申领−出单），位于日期明细行之上；
   淡鼠尾草绿底色，与白色日期行、灰绿汇总行明确区分 */
.inv-matrix tr.extra-row td {
  font-weight: 600; background: var(--sage-soft);
}
.inv-matrix tr.extra-row td:first-child { color: var(--ink-2); font-weight: 700; }
.inv-matrix tbody tr.extra-row + tr td { border-top: 1px dashed var(--border, #e3e1d8); }
.neg { color: #a5636e; }
.pos { color: #4c7a5b; }

/* 随机票区 · 智能识别内嵌面板（不弹窗，直接显示在页面） */
.sp-panel { border: 1px solid var(--sage); }
.sp-panel #sp-text { width: 100%; resize: vertical; font-size: 13.5px; line-height: 1.7; }
.sp-panel #sp-preview table { margin-top: 4px; }
.sp-head-right { display: flex; align-items: center; gap: 10px; }
.sp-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.sp-actions .spacer { flex: 1; }
.btn.sm2.on { background: var(--sage-soft); border-color: var(--sage); color: #4f6b48; }
.sp-nameless td { background: #fdf6ec; }
/* 预览表里的连坐标记 */
.sp-linkchip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--coral-soft, #f7e3da); color: #a5636e; border: 1px solid var(--coral, #cf9088);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
/* AI 大模型解析（可选通道）：按钮行 + 折叠配置 */
.sp-ai-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sp-ai-row .spacer { flex: 1; }
/* 全部票区视图：识别面板的「默认票区」选择行 */
.sp-defzone-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.sp-defzone-row label { color: var(--sage, #7a8b6f); }
/* 未配置票档报错条：出现清单之外的票档时显示并阻止确认新增 */
.sp-err {
  margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.6;
  background: #fbeaea; border: 1.5px solid #d98a8a; color: #9c3d3d;
}
.sp-ai-cfg { margin-top: 8px; border: 1px dashed var(--sage, #a8b394); border-radius: 8px; padding: 8px 12px; }
.sp-ai-cfg > summary { cursor: pointer; font-size: 12.5px; color: var(--sage, #7a8b6f); user-select: none; }
.sp-ai-cfg[open] > summary { margin-bottom: 8px; }
.sp-ai-grid { display: grid; grid-template-columns: 2fr 1.2fr 1.6fr auto; gap: 10px; align-items: start; }
@media (max-width: 900px) { .sp-ai-grid { grid-template-columns: 1fr 1fr; } }
.sp-ai-grid input { width: 100%; }

/* 累计调整：可展开的每次调整明细 */
.adj-detail { display: inline-block; margin-left: 6px; vertical-align: baseline; }
.adj-detail > summary {
  cursor: pointer; list-style: none; font-size: 11.5px; color: var(--sage, #7a8b6f);
  border-bottom: 1px dashed currentColor; user-select: none;
}
.adj-detail > summary::-webkit-details-marker { display: none; }
.adj-detail > summary::before { content: "▸ "; }
.adj-detail[open] > summary::before { content: "▾ "; }
.adj-list { margin-top: 4px; text-align: left; min-width: 190px; }
.adj-line { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 400; padding: 2px 0; border-top: 1px dashed var(--border, #e3e1d8); white-space: nowrap; }
.adj-line:first-child { border-top: none; }
.adj-time { color: var(--ink-2, #8a8a80); }
.adj-from { font-variant-numeric: tabular-nums; }
.adj-delta { font-variant-numeric: tabular-nums; }
.adj-note { margin-left: auto; color: var(--ink-2); font-weight: 400; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.adj-note::before { content: "📝 "; }

/* 库存调整模块（设置页） */
.inv-adjust-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inv-adjust-row select, .inv-adjust-row input[type="number"], .inv-adjust-row input[type="text"] {
  padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13.5px; background: #fff; color: inherit;
}
.inv-adjust-row #inv-adj-qty { width: 116px; }
.inv-adjust-row #inv-adj-note { width: 170px; }
.inv-adjust-init { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.inv-adjust-init input { accent-color: var(--sage); }

/* 当日未导入座位提示条（座位图下方） */
.dayempty { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); }

/* 座位图模块常驻：无模板无座位时的引导占位 */
.sm-placeholder { padding: 24px 16px; text-align: center; color: var(--ink-2); }
.sm-placeholder .big { font-size: 30px; margin-bottom: 6px; }
.sm-placeholder p { font-size: 13.5px; line-height: 1.7; margin: 0; }

/* ============ 属性/状态/权益 列筛选 ============ */
.filterbar .fsel { width: 102px; flex: none; padding-left: 6px; padding-right: 4px; }
.filterbar .fdate { width: 134px; flex: none; padding: 6px 6px; }
.filter-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink-2); background: var(--blue-soft); border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 12px; margin-bottom: 10px; }
.filter-result b { color: var(--ink); }

/* ============ 云端同步状态徽章 ============ */
.cloud-badge {
  position: fixed; right: 14px; bottom: 14px; z-index: 60;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: #fff; border: 1px solid var(--border, #d8ddd4); color: #6b7a63;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08); pointer-events: none;
}
.cloud-badge.cb-saved { background: var(--sage-soft); border-color: transparent; color: #5d7a56; }
.cloud-badge.cb-sync { background: #fff6e8; border-color: transparent; color: #a2763f; }
.cloud-badge.cb-offline { background: #f0f0f0; border-color: transparent; color: #777; }
.cloud-badge.cb-conflict, .cloud-badge.cb-locked { background: var(--coral-soft); border-color: transparent; color: #a5636e; }

/* ============ 登录页 ============ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f6f7f4; }
.login-card {
  width: 340px; background: #fff; border-radius: 18px; padding: 28px 26px 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .07); text-align: center;
}
.login-logo { font-size: 34px; margin-bottom: 6px; }
.login-card h2 { font-size: 18px; margin: 0 0 4px; color: #3f4a3a; }
.login-sub { margin: 0 0 18px; font-size: 13px; color: #8b9686; }
.login-card .field { text-align: left; margin-bottom: 12px; }
.login-btn { width: 100%; margin-top: 6px; }
.login-err { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--coral-soft, #f7e3da); color: #a5636e; font-size: 13px; text-align: left; }
.login-foot { margin-top: 16px; font-size: 11.5px; color: #a3ada0; }

/* ============ 数据备份与云端（设置页） ============ */
.cloud-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.snap-table { width: 100%; font-size: 13px; margin-top: 10px; border-collapse: collapse; }
.snap-table th, .snap-table td { padding: 6px 8px; border-bottom: 1px solid var(--border, #e6e9e2); text-align: left; }
.snap-table th { color: var(--ink-2, #7a8474); font-weight: 600; }
.snap-table .num { text-align: right; }
