:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel2: #1e2230;
  --border: #2a2f3f;
  --text: #e6e8ef;
  --muted: #8b90a3;
  --primary: #5b8cff;
  --primary-hover: #4a7bf0;
  --accent: #22c58b;
  --danger: #ef5b6b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--panel2);
  color: var(--muted);
}
.badge.ok { background: #123326; color: var(--accent); }
.badge.no { background: #3a1d22; color: var(--danger); }

.layout { display: flex; flex: 1; overflow: hidden; }

.sidebar {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 12px;
  overflow-y: auto;
}
.sidebar-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; }
.project-list { list-style: none; }
.project-list li {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-all;
}
.project-list li:hover { background: var(--panel2); }
.project-list li.active { background: var(--primary); color: #fff; }

.main { flex: 1; overflow-y: auto; padding: 20px; }

.empty-state {
  text-align: center;
  margin-top: 120px;
  color: var(--muted);
}
.empty-state h2 { margin-bottom: 12px; color: var(--text); }
.empty-state p { margin-bottom: 20px; }

.editor { max-width: 1000px; margin: 0 auto; }

.steps { display: flex; gap: 8px; margin-bottom: 24px; }
.step {
  flex: 1;
  text-align: center;
  padding: 10px;
  background: var(--panel);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid var(--border);
}
.step span {
  display: inline-block;
  width: 22px; height: 22px;
  line-height: 22px;
  border-radius: 50%;
  background: var(--panel2);
  margin-right: 6px;
}
.step.active { border-color: var(--primary); color: var(--text); }
.step.active span { background: var(--primary); color: #fff; }
.step.done { color: var(--accent); }

.step-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }

h2 { font-size: 16px; margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
textarea, input[type="text"], input:not([type]) {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); }

.actions { display: flex; gap: 10px; margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row input { flex: 1; }

.btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }

.loading { margin-top: 12px; color: var(--accent); font-size: 13px; }

.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }

.shot-list { display: flex; flex-direction: column; gap: 12px; }
.shot-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.shot-card .shot-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.shot-card .shot-head b { font-size: 14px; }
.shot-card .shot-head button { background: none; border: none; color: var(--danger); cursor: pointer; }
.shot-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot-fields .full { grid-column: 1 / -1; }
.shot-fields label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.shot-fields textarea, .shot-fields input { width: 100%; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  padding: 6px 16px;
  border-radius: 16px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.asset-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; }
.asset-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.asset-card .asset-name { padding: 6px 8px; font-size: 12px; word-break: break-all; }
.asset-card .asset-kind { padding: 0 8px 6px; font-size: 10px; color: var(--muted); }
.asset-placeholder {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.asset-actions { display: flex; gap: 10px; }

.compact .shot-card { cursor: pointer; }
.prompt-detail { margin-top: 16px; }
.prompt-block { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.prompt-block h4 { font-size: 14px; margin-bottom: 8px; color: var(--accent); }
.prompt-block pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.6; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal[hidden] { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; width: 90%; max-width: 480px; }
.modal-box.wide { max-width: 720px; }
.modal-box h3 { margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.asset-detail { display: flex; gap: 16px; }
.asset-detail-left { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.asset-detail-left img { width: 240px; height: 240px; object-fit: contain; background: var(--panel2); border-radius: 8px; }
.asset-detail-left img[src=""] { display: none; }
.asset-img-actions { display: flex; gap: 8px; }
.asset-img-actions .btn { flex: 1; font-size: 13px; padding: 6px 10px; }
.asset-detail-right { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.asset-detail-right label { font-size: 12px; color: var(--muted); }

/* 登录页 */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.login-overlay[hidden] { display: none; }
.login-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  width: 90%;
  max-width: 360px;
  text-align: center;
}
.login-box h1 { font-size: 20px; margin-bottom: 8px; }
.login-box p { margin-bottom: 18px; }
.login-box input {
  width: 100%;
  margin-bottom: 14px;
  text-align: center;
  font-size: 15px;
}
.login-btn { width: 100%; padding: 10px; font-size: 15px; }
.login-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }


/* 导出页（步骤 4） */
.export-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.export-title-box { flex: 1; }
.export-proj-title { font-size: 18px; font-weight: bold; margin-bottom: 4px; }
.export-meta { font-size: 13px; color: var(--muted); }
.export-steps { display: flex; gap: 6px; font-size: 12px; color: var(--muted); }
.export-steps span { padding: 3px 8px; background: var(--panel2); border-radius: 6px; }
.export-steps span.on { background: var(--primary); color: #fff; }

.export-model-tabs { display: flex; gap: 8px; margin: 14px 0; }
.etab {
  padding: 8px 18px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.etab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.export-toolbar { display: flex; align-items: center; gap: 12px; margin: 14px 0; }

.export-units-list { display: flex; flex-direction: column; gap: 14px; }
.export-unit-card {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.eu-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
.eu-head b { font-size: 15px; }
.eu-secs { font-size: 12px; color: var(--muted); }
.eu-asset { font-size: 13px; margin: 4px 0; }
.eu-num { background: var(--panel); padding: 2px 8px; border-radius: 6px; margin-right: 6px; font-size: 12px; }
.eu-type { color: var(--accent); margin-right: 6px; }
.eu-name { font-weight: bold; }
.eu-shots { color: var(--muted); font-size: 12px; }
.eu-missing { color: var(--danger); cursor: pointer; }
.eu-missing:hover { text-decoration: underline; }
.eu-hint { color: var(--danger); font-size: 12px; }
.eu-missing-group { margin: 8px 0; padding: 8px; background: #2a1f22; border-radius: 8px; }
.eu-prompt {
  margin: 10px 0;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
}
.eu-actions { text-align: right; }
.export-actions { display: flex; gap: 10px; margin-top: 16px; }
