:root {
  --bg: #05070d;
  --bg2: #0a1223;
  --card: rgba(17, 21, 34, 0.92);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #eef3ff;
  --muted: #9aa7c5;
  --primary: #3b82f6;
  --primary-2: #245fe0;
  --accent: #10b981;
  --accent-2: #0d9b6d;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 22px;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top center, #0b1d44 0%, var(--bg) 44%, #03050a 100%);
}
.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(59,130,246,.26), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(16,185,129,.14), transparent 32%),
    radial-gradient(circle at 100% 50%, rgba(82, 52, 255, .15), transparent 30%);
}
.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 24px 28px;
  position: relative;
  z-index: 1;
}
.hero-card { margin-bottom: 18px; }
.hero-card h1 {
  margin: 0 0 10px;
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: -.03em;
}
.hero-card p {
  margin: 0;
  color: #dbe7ff;
  font-size: 18px;
  line-height: 1.7;
}
.hero-card .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.toolbar {
  padding: 18px;
  margin-bottom: 18px;
}
.toolbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar-meta .dot { opacity: .55; }
.btn {
  border: 0;
  border-radius: 15px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,.08);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); background: rgba(255,255,255,.12); }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn.primary { background: linear-gradient(180deg, var(--primary), var(--primary-2)); }
.btn.accent { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.btn.ghost { background: rgba(255,255,255,.05); }
.workspace {
  display: grid;
  grid-template-columns: 1.4fr .92fr;
  gap: 18px;
}
.left-pane, .right-pane { padding: 16px; }
.pane-title {
  font-size: 29px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -.02em;
}
.canvas-box {
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  overflow: hidden;
  position: relative;
}
.source-box {
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.source-box.dragover {
  border-color: rgba(59,130,246,.8);
  box-shadow: 0 0 0 4px rgba(59,130,246,.15) inset;
  background: linear-gradient(180deg, rgba(59,130,246,.12), rgba(255,255,255,.03));
}
#sourceCanvas {
  width: 100%;
  aspect-ratio: 900 / 650;
  height: auto;
  display: block;
  background: #0a0f1b;
}
.drop-hint {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #dbe7ff;
  background: rgba(11, 29, 68, .72);
  border: 1px solid rgba(255,255,255,.08);
  pointer-events: none;
}
.preview-box {
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(255,255,255,.12);
  width: min(100%, 520px);
  margin-inline: auto;
}
#previewCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
.status-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.status-item {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 14px;
}
.status-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.status-value {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-all;
}
.detail-text {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}
.file-list-wrap {
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  background: rgba(0, 0, 0, .16);
}
.file-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-weight: 700;
}
.file-list {
  max-height: 320px;
  overflow: auto;
}
.file-list.empty {
  padding: 18px 16px;
  color: var(--muted);
}
.file-item {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  display: grid;
  gap: 6px;
}
.file-item:last-child { border-bottom: 0; }
.file-item:hover { background: rgba(255,255,255,.04); }
.file-item.active { background: rgba(59,130,246,.16); }
.file-name {
  font-weight: 700;
  word-break: break-all;
}
.file-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.badge.pending { background: rgba(255,255,255,.08); color: #dbe7ff; }
.badge.success { background: rgba(16,185,129,.18); color: #6ee7b7; }
.badge.error { background: rgba(239,68,68,.18); color: #fda4af; }
.badge.processing { background: rgba(245,158,11,.16); color: #fcd34d; }
@media (max-width: 1060px) {
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .app-shell { padding: 20px 14px 18px; }
  .hero-card h1 { font-size: 34px; }
  .hero-card p { font-size: 16px; }
  .pane-title { font-size: 24px; }
  .toolbar { padding: 14px; }
  .btn { width: 100%; }
  .status-grid { grid-template-columns: 1fr; }
  .drop-hint { left: 12px; right: 12px; text-align: center; }
}
