* { box-sizing: border-box; }
:root {
  --ink: #172033;
  --muted: #5B667A;
  --line: #DDE3EA;
  --panel: #FFFFFF;
  --soft: #F6F8FB;
  --brand: #2563EB;
  --brand-dark: #1749B7;
  --warn: #B45309;
  --ok: #047857;
  --bad: #BE123C;
}
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #EEF2F7;
  color: var(--ink);
}
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(15,23,42,0.05);
  padding: 14px 20px;
}
.toolbar h1 { font-size: 18px; margin: 0 0 4px; color: #10233F; }
.toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
button {
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}
button:hover { background: var(--brand-dark); }
button.ghost { background: #E2E8F0; color: var(--ink); }
button.ghost:hover { background: #CBD5E1; }
button:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.shell { display: grid; grid-template-columns: 390px 1fr; min-height: calc(100vh - 77px); }
.side { border-right: 1px solid var(--line); background: #F8FAFC; padding: 16px; overflow: auto; }
.preview-wrap { padding: 20px; overflow: auto; }
.preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15,23,42,0.06);
  max-width: 1180px;
  margin: 10px auto 40px;
  min-height: 320px;
}
.card { background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.card h2 { font-size: 14px; margin: 0 0 10px; color: #10233F; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.mode-tab { background: #E2E8F0; color: var(--ink); padding: 8px 6px; }
.mode-tab.active { background: var(--ink); color: #fff; }
.input-panel { display: none; }
.input-panel.active { display: block; }
label { display: block; font-size: 12px; font-weight: 700; color: #334155; margin: 10px 0 6px; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
input[type="text"], input[type="number"], select { height: 36px; padding: 0 10px; }
textarea {
  min-height: 220px;
  resize: vertical;
  padding: 10px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
input[type="file"].native-file { display: none; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; line-height: 1.4; }
.check input { margin: 0; }
.picked-box {
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  background: #F8FAFC;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-word;
}
.pick-row, .convert-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 8px 0 0; }
.warning { color: var(--warn); }
.status { max-width: 1180px; margin: 0 auto; font-size: 13px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 8px; font-size: 12px; color: var(--muted); }
.log {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 8px;
  border-radius: 8px;
}
.image-list { font-size: 12px; display: grid; gap: 8px; }
.image-item { border: 1px solid #E2E8F0; border-radius: 8px; padding: 8px; background: #fff; word-break: break-word; }
.ok { color: var(--ok); font-weight: 700; }
.failed { color: var(--bad); font-weight: 700; }
.empty {
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  padding: 32px;
}
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
@media (max-width: 960px) {
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; }
  .shell { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
}
