:root{
  --bg:#0f172a;
  --panel:#111827;
  --card:#ffffff;
  --muted:#475569;
  --text:#0f172a;
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --soft:#e2e8f0;
  --accent:#0ea5e9;
  --ok:#0f766e;
  --warn:#b45309;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:#f8fafc;
  color:var(--text);
  line-height:1.6;
}
header{
  background:linear-gradient(135deg,var(--bg),#1e293b);
  color:white;
  padding:24px 0;
}
.container{
  width:min(1200px,92%);
  margin:0 auto;
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand{
  font-size:1.3rem;
  font-weight:700;
}
nav a{
  color:#dbeafe;
  text-decoration:none;
  margin-left:14px;
  font-weight:600;
}
nav a:hover{color:white;text-decoration:underline}
.hero h1{margin:0 0 10px;font-size:2rem}
.hero p{max-width:900px;color:#e2e8f0}
main{padding:28px 0 40px}
.card{
  background:var(--card);
  border:1px solid #dbe5ef;
  border-radius:16px;
  padding:22px;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
  margin-bottom:20px;
}
.grid-2{display:grid;grid-template-columns:1.1fr .9fr;gap:20px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.grid-5{display:grid;grid-template-columns:repeat(5,1fr);gap:18px}
@media (max-width:1000px){.grid-5,.grid-3,.grid-2{grid-template-columns:1fr}}
button,.btn{
  background:var(--primary);
  color:white;
  border:none;
  border-radius:10px;
  padding:12px 16px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
}
button:hover,.btn:hover{background:var(--primary2)}
select,input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #cbd5e1;
  background:white;
}
label{font-weight:700;display:block;margin:8px 0 6px}
.small{font-size:.93rem;color:#475569}
.notice{
  background:#eff6ff;
  border-left:4px solid var(--primary);
  padding:12px 14px;
  border-radius:10px;
}
.warn{
  background:#fff7ed;
  border-left:4px solid #ea580c;
}
.ok{
  background:#ecfdf5;
  border-left:4px solid #059669;
}
.method-links a{
  display:block;
  padding:18px;
  border-radius:14px;
  border:1px solid #dbeafe;
  background:#f8fbff;
  color:#0f172a;
  text-decoration:none;
  font-weight:700;
}
.method-links a span{display:block;font-weight:400;color:#475569;margin-top:8px}
.table-wrap{overflow:auto}
table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}
th,td{
  border:1px solid #dbe5ef;
  padding:10px 8px;
  text-align:center;
}
th{background:#eff6ff}
.code-box, .eq-box{
  background:#0b1220;
  color:#e5eefb;
  border-radius:14px;
  padding:16px;
  overflow:auto;
}
.eq-line{font-family:'Courier New', monospace; margin:6px 0}
.matrix-grid{
  display:grid;
  grid-template-columns:repeat(5, minmax(64px, 90px));
  gap:8px;
  align-items:center;
}
.matrix-grid .sep{font-weight:700;text-align:center}
.badge{display:inline-block;padding:4px 10px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:.9rem;font-weight:700}
.kpi{background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:14px}
.kpi strong{display:block;font-size:1.2rem}
.canvas-wrap{background:#fff;border:1px solid #dbe5ef;border-radius:14px;padding:10px}
canvas{width:100%;height:320px;display:block}
footer{padding:20px 0 40px;color:#64748b;font-size:.92rem}
.section-title{margin:0 0 8px}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.tab-btn{background:#e2e8f0;color:#0f172a}
.tab-btn.active{background:#2563eb;color:#fff}
.result-box{background:#f8fafc;border:1px solid #dbe5ef;border-radius:14px;padding:14px}
pre{white-space:pre-wrap}

.topic-context{border:1px solid #bfdbfe;background:linear-gradient(180deg,#eff6ff 0%,#ffffff 100%)}
.topic-context p{margin-bottom:12px}
