:root {
  color-scheme: dark;
  --bg: #080a12;
  --panel: rgba(255,255,255,0.075);
  --panel-strong: rgba(255,255,255,0.12);
  --text: #f7f7fb;
  --muted: #aeb4c8;
  --line: rgba(255,255,255,0.13);
  --accent: #ff4b67;
  --accent-2: #8c6dff;
  --ok: #5df2b4;
  --warn: #ffd166;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255,75,103,0.25), transparent 36rem),
    radial-gradient(circle at bottom right, rgba(140,109,255,0.2), transparent 36rem),
    var(--bg);
  color: var(--text);
}
.app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 72px; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .04em; margin: 0 0 10px; }
h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.04; margin: 0; letter-spacing: -0.04em; }
.lead { max-width: 720px; color: var(--muted); font-size: 17px; line-height: 1.75; margin: 18px 0 0; }
.status-pill { white-space: nowrap; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 10px 14px; color: var(--muted); }
.panel, .progress-card, .results { border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.04)); border-radius: 28px; box-shadow: 0 24px 70px rgba(0,0,0,.35); backdrop-filter: blur(18px); }
.panel { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
label span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.28); color: var(--text); padding: 14px 14px; outline: none; font-size: 15px; }
input:focus, select:focus { border-color: rgba(255,75,103,.8); box-shadow: 0 0 0 4px rgba(255,75,103,.12); }
.actions { display: flex; gap: 12px; align-items: end; }
button { border: 0; border-radius: 16px; padding: 13px 18px; font-weight: 800; cursor: pointer; color: var(--text); transition: transform .15s ease, opacity .15s ease; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.ghost { background: var(--panel-strong); border: 1px solid var(--line); }
.note { color: var(--muted); line-height: 1.7; margin: 18px 0 0; }
.progress-card { margin-top: 18px; padding: 20px; }
.progress-top { display: flex; justify-content: space-between; gap: 18px; color: var(--muted); margin-bottom: 12px; }
.progress-top strong { color: var(--text); }
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
#barFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--ok)); transition: width .2s ease; }
.results { margin-top: 22px; padding: 24px; }
.result-header { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.result-header h2 { margin: 0; font-size: 26px; }
.result-actions { display: flex; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.metric-card { background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 24px; padding: 20px; }
.metric-card h3 { margin: 0 0 12px; }
.metric { display: flex; justify-content: space-between; padding: 9px 0; color: var(--muted); border-bottom: 1px solid rgba(255,255,255,.08); }
.metric:last-child { border-bottom: 0; }
.metric strong { color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.05); }
td { color: #e7e9f5; }
a { color: #9db7ff; }
.type-badge { display: inline-flex; border-radius: 999px; padding: 4px 9px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 800; }
@media (max-width: 860px) {
  .hero, .result-header { flex-direction: column; }
  .form-grid, .cards { grid-template-columns: 1fr; }
  .actions, .result-actions { flex-wrap: wrap; }
  .status-pill { white-space: normal; }
}
.main-panel { margin-top: 18px; }
.section-title { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.section-title h2 { margin: 0 0 8px; font-size: 24px; }
.section-title p { margin: 0; color: var(--muted); line-height: 1.7; }
code { color: #ffd5dc; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); padding: 2px 6px; border-radius: 8px; }
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; align-items: stretch; margin-bottom: 16px; }
textarea { width: 100%; min-height: 140px; resize: vertical; border: 1px solid var(--line); border-radius: 18px; background: rgba(0,0,0,.28); color: var(--text); padding: 14px; outline: none; font-size: 15px; line-height: 1.6; font-family: inherit; }
textarea:focus { border-color: rgba(255,75,103,.8); box-shadow: 0 0 0 4px rgba(255,75,103,.12); }
.import-actions { display: grid; gap: 12px; align-content: start; }
.small-table { margin-top: 10px; }
.small-table table { min-width: 720px; }
.row-actions { display: flex; gap: 8px; }
.mini { padding: 8px 10px; border-radius: 12px; background: var(--panel-strong); border: 1px solid var(--line); font-size: 12px; }
.danger { color: #ffd0d6; background: rgba(255,75,103,.16); }
.empty { color: var(--muted); text-align: center; padding: 22px; }
.subhead { color: var(--muted); margin: 8px 0 0; }
@media (max-width: 860px) {
  .import-grid { grid-template-columns: 1fr; }
  .import-actions { grid-template-columns: 1fr 1fr; }
}
.file-picker { display: block; margin-top: 12px; }
.file-picker input { margin-top: 8px; padding: 11px; }
.wide-actions { grid-column: 1 / -1; align-items: center; }
.log-panel { margin-top: 22px; }
.log-box { min-height: 180px; max-height: 360px; overflow: auto; margin: 16px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(0,0,0,.32); color: #dbe1ff; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
input[type="file"] { cursor: pointer; }
@media (max-width: 860px) {
  .wide-actions { grid-column: auto; }
}
