:root {
  --bg: #0b0f14;
  --bg-soft: #101720;
  --card: #151d27;
  --card-2: #1b2531;
  --border: #263343;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #4dd4ac;
  --accent-2: #3b9eff;
  --warn: #ff6b6b;
  --ok: #4dd4ac;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 15% -10%, #14283a 0%, transparent 55%),
              radial-gradient(900px 500px at 95% 0%, #12322c 0%, transparent 50%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  min-height: 100vh;
}
a { color: var(--accent-2); }
.app { max-width: 1500px; margin: 0 auto; padding: 0 24px 40px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 22px 0 18px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #1c6b5a, #2b8c72);
  display: grid; place-items: center; font-size: 26px; color: #d9fff0;
  box-shadow: 0 0 22px rgba(77,212,172,.25);
}
.brand h1 { font-size: 19px; margin: 0 0 4px; letter-spacing: .3px; }
.brand p { margin: 0; color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 5px; border-radius: 10px; border: 1px solid var(--border); }
.tab {
  background: transparent; color: var(--muted); border: 0; cursor: pointer;
  padding: 9px 16px; border-radius: 7px; font-size: 13px; transition: .18s;
}
.tab:hover { color: var(--text); background: var(--card-2); }
.tab.active { background: var(--accent); color: #06231c; font-weight: 700; }

/* ---------- 页面 ---------- */
.page { display: none; padding-top: 22px; }
.page.active { display: block; }
.panel-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.panel {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.panel h2 { font-size: 15px; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 3px; height: 15px; background: var(--accent); border-radius: 2px; }
.panel h3 { font-size: 13px; margin: 18px 0 10px; color: var(--muted); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.muted { color: var(--muted); font-size: 12px; }
.center { text-align: center; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
select, input[type="text"], textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; font-size: 13px; outline: none;
}
select:focus, input[type="text"]:focus { border-color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.hint { display: block; color: #6d7a88; font-size: 11px; margin-top: 5px; }
.badge { color: var(--accent); font-weight: 700; }
.inline-form { display: flex; gap: 7px; }

.dropzone {
  border: 1.5px dashed #34465a; border-radius: 10px; background: #0e151e;
  padding: 22px 12px; text-align: center; cursor: pointer; transition: .18s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #10221e; }
.dz-icon { font-size: 28px; color: var(--accent); line-height: 1; }
.dropzone p { margin: 8px 0 4px; font-size: 13px; }
.dropzone small, .file-info { color: var(--muted); font-size: 11px; }
.file-info { margin: 7px 0 0; word-break: break-all; }

.btn-row { display: flex; gap: 10px; margin-top: 6px; }
.btn-row.wrap { flex-wrap: wrap; }
.btn {
  background: var(--card-2); color: var(--text); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: .16s; font-weight: 600;
}
.btn:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #42c79f, #2f9e80); color: #06231c; border: 0; flex: 1; }
.btn.ghost { background: transparent; }
.btn.full { width: 100%; }
.btn.small { padding: 6px 10px; font-size: 12px; }

.progress-wrap { margin-top: 14px; }
.progress { height: 5px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.progress-wrap small { color: var(--muted); display: block; margin-top: 6px; }

/* ---------- 统计卡片 ---------- */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.stats-row.big { grid-template-columns: repeat(4, 1fr); }
.stat-card {
  background: var(--card-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 5px;
}
.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 22px; line-height: 1.1; }
.stat-card strong.ok { color: var(--ok); }
.stat-card strong.warn { color: var(--warn); }

/* ---------- 结果区 ---------- */
.tabs-mini { display: flex; gap: 4px; }
.mini { background: transparent; border: 1px solid var(--border); color: var(--muted);
        border-radius: 6px; padding: 5px 10px; font-size: 11px; cursor: pointer; }
.mini.active { background: var(--accent-2); color: #04182b; border-color: var(--accent-2); font-weight: 700; }
.canvas-wrap {
  position: relative; width: 100%; min-height: 340px; background: #080c11;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.canvas-wrap img { max-width: 100%; max-height: 620px; display: none; object-fit: contain; }
.canvas-wrap img.show { display: block; }
.placeholder { text-align: center; color: var(--muted); padding: 60px 20px; }
.placeholder p { margin-top: 12px; }
.ph-icon { font-size: 44px; opacity: .35; }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { text-align: left; color: var(--muted); font-weight: 600;
                 padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.04); }
.data-table tr:hover td { background: rgba(255,255,255,.025); }
.data-table .tag { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 11px; }
.tag.ok { background: rgba(77,212,172,.13); color: var(--ok); }
.tag.warn { background: rgba(255,107,107,.13); color: var(--warn); }
.tag.info { background: rgba(59,158,255,.13); color: var(--accent-2); }
.link-btn { background: none; border: 0; color: var(--accent-2); cursor: pointer; font-size: 12px; padding: 2px 5px; }
.link-btn.danger { color: var(--warn); }

/* ---------- 座位标注 ---------- */
.seat-editor-panel { min-height: 520px; }
.seat-canvas-wrap {
  position: relative; width: 100%; min-height: 480px; background: #080c11;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.seat-canvas-wrap img { max-width: 100%; max-height: 640px; display: block; }
#seat-canvas { position: absolute; cursor: crosshair; }
.seat-counter { color: var(--muted); font-size: 12px; margin: 14px 0; }
.seat-counter strong { color: var(--accent); font-size: 16px; }

/* ---------- 说明页 ---------- */
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.about-card { background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.about-card h3 { margin: 0 0 9px; color: var(--accent); font-size: 14px; }
.about-card p { margin: 0; color: #b7c2cd; font-size: 12.5px; line-height: 1.8; }
code { background: #0c1218; padding: 1px 5px; border-radius: 4px; color: var(--accent); }

/* ---------- 弹窗 / Toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 99;
         display: flex; align-items: center; justify-content: center; padding: 30px; }
.modal-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
             padding: 18px; max-width: 900px; width: 100%; max-height: 88vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; color: var(--text); }
.modal-head button { background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
.modal-box img { max-width: 100%; border-radius: 8px; margin-top: 12px; }
.modal-box pre { color: #a9b6c3; font-size: 11px; white-space: pre-wrap; word-break: break-all; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
         background: #1d2b26; border: 1px solid var(--accent); color: var(--text);
         padding: 11px 20px; border-radius: 8px; z-index: 100; box-shadow: var(--shadow); }

footer { display: flex; justify-content: space-between; color: #64717e;
         font-size: 11px; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 10px; }

canvas { max-width: 100%; background: #0d141c; border-radius: 8px; }

@media (max-width: 1100px) {
  .panel-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .app { padding: 0 12px 30px; }
  .stats-row, .stats-row.big { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .tabs { width: 100%; overflow-x: auto; }
}
