:root{
  --bg:#0b1020;
  --card:#111a33;
  --card2:#0f1730;
  --text:#e8ecff;
  --muted:#b7c0ff;
  --line:rgba(255,255,255,.10);
  --accent:#6ea8fe;
  --accent2:#7cf3c6;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius:18px;
  --max: 980px;
}
html[data-theme="light"]{
  --bg:#f7f8ff;
  --card:#ffffff;
  --card2:#f3f5ff;
  --text:#0b1020;
  --muted:#3b4664;
  --line:rgba(11,16,32,.10);
  --accent:#2b6cff;
  --accent2:#0ea37f;
  --shadow: 0 12px 30px rgba(11,16,32,.12);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 20% -10%, rgba(110,168,254,.35), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(124,243,198,.20), transparent 55%),
              var(--bg);
  color:var(--text);
  line-height:1.5;
}

a{color:inherit; text-decoration:none}
a:hover{color:var(--accent)}

.container{max-width:var(--max); margin:0 auto; padding: 20px 16px 56px}

.header{
  position:sticky; top:0; backdrop-filter: blur(12px);
  background: rgba(11,16,32,.55);
  border-bottom:1px solid var(--line);
  z-index:10;
}
html[data-theme="light"] .header{background: rgba(247,248,255,.70)}

.header-inner{max-width:var(--max); margin:0 auto; display:flex; align-items:center; justify-content:space-between; padding:14px 16px; gap:12px}
.brand{display:flex; gap:10px; align-items:center}
.logo{
  width:34px; height:34px; border-radius:12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 10px 25px rgba(110,168,254,.25);
}
.brand h1{font-size:16px; margin:0; letter-spacing:.2px}
.nav{display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:flex-end}
.nav a{padding:8px 10px; border:1px solid transparent; border-radius:12px; color:var(--muted); font-size:13px}
.nav a:hover{border-color:var(--line); color:var(--text); background: rgba(255,255,255,.03)}

.theme-btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size:13px; cursor:pointer;
}
html[data-theme="light"] .theme-btn{border-color: rgba(11,16,32,.12); background: rgba(11,16,32,.03)}
.theme-btn:hover{border-color: rgba(110,168,254,.45); background: rgba(110,168,254,.08)}

.hero{padding:26px 0 18px}
.hero h2{font-size:34px; line-height:1.15; margin:0 0 10px}
.hero p{margin:0; color:var(--muted); max-width: 70ch}

.grid{display:grid; grid-template-columns: repeat(12, 1fr); gap:14px; margin-top:18px}
.card{
  grid-column: span 6;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card-inner{padding:16px}
.card h3{margin:0 0 6px; font-size:16px}
.card p{margin:0 0 12px; color:var(--muted); font-size:13px}

.badge{display:inline-flex; gap:8px; align-items:center; font-size:12px; color:rgba(232,236,255,.9);
  background: rgba(110,168,254,.10); border: 1px solid rgba(110,168,254,.25); padding:6px 10px; border-radius:999px}
html[data-theme="light"] .badge{color: rgba(11,16,32,.85)}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 12px; border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size: 13px; font-weight:600;
  cursor:pointer;
}
html[data-theme="light"] .btn{border-color: rgba(11,16,32,.12); background: rgba(11,16,32,.03)}
.btn:hover{border-color: rgba(110,168,254,.45); background: rgba(110,168,254,.08)}
.btn.primary{background: linear-gradient(135deg, rgba(110,168,254,.22), rgba(124,243,198,.14)); border-color: rgba(124,243,198,.35)}

.tool{
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.tool-head{padding:18px 16px; border-bottom:1px solid var(--line); background: rgba(255,255,255,.02)}
.tool-head h2{margin:0 0 6px; font-size:22px}
.tool-head p{margin:0; color:var(--muted)}
.tool-body{padding:16px}

.form{display:grid; grid-template-columns: repeat(12, 1fr); gap:12px; margin-top:8px}
.field{grid-column: span 6}
.field.full{grid-column: span 12}
label{display:block; font-size:12px; color:var(--muted); margin: 0 0 6px}
input, select, textarea{
  width:100%; padding:12px 12px; border-radius: 14px;
  background: rgba(15,23,48,.65);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  outline:none;
}
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea{
  background: rgba(255,255,255,.92);
}
input:focus, select:focus, textarea:focus{border-color: rgba(110,168,254,.55); box-shadow: 0 0 0 4px rgba(110,168,254,.12)}

.actions{display:flex; gap:10px; flex-wrap:wrap; margin-top: 8px}
.result{
  margin-top:14px;
  padding:14px;
  border-radius: 16px;
  border:1px solid rgba(124,243,198,.25);
  background: rgba(124,243,198,.06);
}
.result h3{margin:0 0 6px; font-size:15px}
.result p, .result ul{margin:0; color: rgba(232,236,255,.92)}
html[data-theme="light"] .result p, html[data-theme="light"] .result ul{color: rgba(11,16,32,.88)}
.result ul{padding-left:18px}
.mini{font-size:12px; color:var(--muted); margin-top:10px}

.searchbar{margin-top:14px; display:flex; gap:10px; align-items:center}

.recent{
  margin-top:16px;
  padding:14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.recent h3{margin:0 0 10px; font-size:14px}
.recent a{
  display:inline-flex; margin:6px 8px 0 0;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  color: var(--text);
  font-size:12px;
}
.recent a:hover{border-color: rgba(110,168,254,.45); background: rgba(110,168,254,.08)}

.footer{margin-top:26px; border-top:1px solid var(--line); padding-top:16px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; color: var(--muted); font-size:12px}

.toast{
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15,23,48,.85);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 50;
}
html[data-theme="light"] .toast{background: rgba(255,255,255,.92)}
.toast.show{opacity:1; transform: translateX(-50%) translateY(-6px)}

@media (max-width: 840px){
  .card{grid-column: span 12}
  .field{grid-column: span 12}
  .hero h2{font-size:28px}
}
