:root{
  --bg:#0b1220;
  --panel:#0f172a;
  --muted:#8b9bb5;
  --text:#e6f0ff;
  --accent:#27e0ff;
  --accent-2:#8b5cf6;
  --border:rgba(255,255,255,0.08);
  --shadow:0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
  --code-font: ui-monospace,SFMono-Regular,Menlo,Consolas,Monaco,"Liberation Mono","Courier New",monospace;
  --radius:14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(39,224,255,.12), transparent 60%),
    radial-gradient(1200px 600px at 100% 0%, rgba(139,92,246,.12), transparent 60%),
    linear-gradient(180deg, #070b14, #0b1220 60%);
  color:var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  line-height:1.6;
}

.app-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 24px;
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(6px);
  position: sticky; top:0; z-index:10;
}

.brand{ display:flex; gap:14px; align-items:center; }

.back-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.back-icon:hover {
  background: rgba(255,255,255,0.1);
  color: var(--accent);
  transform: translateY(-1px);
}
.logo{
  width:36px; height:36px; border-radius:10px;
  background: linear-gradient(135deg, rgba(39,224,255,.18), rgba(139,92,246,.18));
  display:grid; place-items:center;
  color:var(--accent);
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight:700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  background: linear-gradient(135deg, rgba(39,224,255,.25), rgba(139,92,246,.25));
}
.title h1{ margin:0; font-size:20px; letter-spacing:.5px; }
.subtitle{ margin:2px 0 0; font-size:12px; color:var(--muted); }

.actions{ display:flex; gap:10px; }
.btn{
  appearance:none; border:none; border-radius:10px; cursor:pointer;
  padding:10px 14px; color:var(--text); background:#1c2540;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .06s ease, background .2s ease, border .2s ease;
  font-family: var(--code-font);
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn.primary{ background: linear-gradient(135deg, #1a2a55, #1c2540);
  border-color: rgba(39,224,255,.35);
  box-shadow: 0 0 0 1px rgba(39,224,255,.18) inset, var(--shadow);
}
.btn.ghost{ background: transparent; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.app-main{ padding:22px; max-width:1200px; margin:0 auto; }

.uploader{
  display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:18px;
}
.dropzone{
  flex:1 1 520px; min-height:110px; border-radius:var(--radius);
  border:1px dashed rgba(39,224,255,.35);
  background: linear-gradient(180deg, rgba(28,37,64,.85), rgba(15,23,42,.85));
  display:flex; align-items:center; gap:18px; padding:18px 20px;
  cursor:pointer;
  box-shadow: var(--shadow);
}
.dropzone:hover{ border-color: rgba(139,92,246,.5); }
.dz-icon{
  font-size:28px; width:48px; height:48px; display:grid; place-items:center;
  border-radius:12px;
  background: linear-gradient(135deg, rgba(39,224,255,.12), rgba(139,92,246,.12));
  border:1px solid var(--border);
}
.dz-text strong{ color:var(--text); font-family:var(--code-font); }
.dz-text .link{ color:var(--accent); text-decoration: underline dotted; cursor:pointer; }
.hint{ color:var(--muted); font-size:12px; }

.rule-badge{
  padding:10px 12px; border-radius:10px;
  border:1px solid rgba(139,92,246,.35);
  background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(39,224,255,.08));
  font-family: var(--code-font); font-size:12px; color:#dcd2ff;
  white-space:nowrap;
}

.grid{
  display:grid; grid-template-columns: 1fr 1fr; gap:16px;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

.panel{
  border-radius:var(--radius);
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(28,37,64,.7), rgba(15,23,42,.9));
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel-head{
  display:flex; align-items:baseline; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid var(--border);
}
.panel h3{ margin:0; font-size:14px; letter-spacing:.3px; }
.meta{ font-size:12px; color:var(--muted); }

.preview{
  margin:0; padding:14px 16px 18px; min-height:340px; max-height:60vh; overflow:auto;
  font-family: var(--code-font); font-size:13px; color: #d9e8ff;
  line-height:1.7; white-space: pre-wrap; word-break: break-word;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

.app-footer{
  max-width:1200px; margin:12px auto 26px; padding:0 22px;
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
}
.stats{
  font-family: var(--code-font); font-size:12px; color:#cfe9ff;
  padding:8px 10px; border:1px solid rgba(39,224,255,.25);
  border-radius:10px;
  background: linear-gradient(135deg, rgba(39,224,255,.08), rgba(139,92,246,.06));
}
.note{ color:var(--muted); font-size:12px; }