
:root{
  --bg:#edf2f7;
  --surface:#ffffff;
  --surface-2:#f8fbff;
  --ink:#17212f;
  --muted:#667085;
  --line:#d6dde8;
  --primary:#0f4ea8;
  --primary-2:#1f7fe0;
  --primary-soft:#eaf3ff;
  --accent:#ff8a00;
  --success:#0f8b55;
  --shadow:0 8px 24px rgba(15,23,42,.08);
  --radius:18px;
  --radius-sm:12px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:linear-gradient(180deg,#f3f6fa 0,#edf2f7 100%);
  color:var(--ink);
  line-height:1.55;
}
a{color:inherit}
.container{width:min(1180px, calc(100% - 26px)); margin:20px auto 46px}
.site-header{
  background:linear-gradient(135deg,var(--primary) 0%, #145dc2 55%, var(--primary-2) 100%);
  color:#fff;
  border-radius:24px;
  padding:20px 22px;
  box-shadow:var(--shadow);
}
.brand{
  display:flex;
  align-items:center;
  gap:18px;
}
.brand img{
  width:98px;
  height:98px;
  object-fit:contain;
  background:rgba(255,255,255,.08);
  border-radius:18px;
  padding:8px;
}
.brand-text h1{
  margin:0 0 6px;
  font-size:clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing:.02em;
}
.brand-text p{margin:0; max-width:800px; opacity:.95}
.chip{
  display:inline-block;
  padding:5px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  font-size:.78rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:8px;
}
.main-nav{
  margin-top:18px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.main-nav a, .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  text-decoration:none;
  background:#fff;
  color:var(--ink);
  font-weight:700;
  box-shadow:0 1px 0 rgba(0,0,0,.03);
}
.main-nav a.active{
  background:var(--primary-soft);
  color:var(--primary);
  border-color:#b9d4ff;
}
.btn.primary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}
.btn.secondary{
  background:var(--primary-soft);
  border-color:#b9d4ff;
  color:var(--primary);
}
.section, .hero-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  margin-top:18px;
  padding:20px;
}
.hero-card{
  background:linear-gradient(180deg,#ffffff 0,#fbfdff 100%);
}
.hero-card h2, .section h2{margin:0 0 12px; font-size:1.4rem}
.hero-card h3, .section h3{margin:14px 0 8px; font-size:1.04rem}
.section p, .hero-card p, li{font-size:1rem}
.grid2, .grid3, .grid4{
  display:grid;
  gap:14px;
}
.grid2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid4{grid-template-columns:repeat(4,minmax(0,1fr))}
.card{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:16px;
}
.course-link{
  display:flex;
  flex-direction:column;
  min-height:255px;
  text-decoration:none;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:18px;
  transition:transform .18s ease, border-color .18s ease;
}
.course-link:hover{transform:translateY(-2px); border-color:#8dc0ff}
.badge{
  display:inline-block;
  width:max-content;
  padding:5px 10px;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:.78rem;
  font-weight:800;
}
.course-link h3{margin:12px 0 8px; font-size:1.2rem}
.course-link p{margin:0; color:var(--muted)}
.course-link .go{margin-top:auto; padding-top:18px; color:var(--primary); font-weight:800}
.notice{
  border-left:4px solid var(--primary);
  background:var(--primary-soft);
  padding:12px 14px;
  border-radius:0 12px 12px 0;
}
.warning{
  border-left:4px solid var(--accent);
  background:#fff6ea;
  padding:12px 14px;
  border-radius:0 12px 12px 0;
}
.formula{
  margin:14px 0;
  padding:14px 16px;
  text-align:center;
  font-size:clamp(1.15rem, 3vw, 1.6rem);
  font-weight:800;
  color:var(--primary);
  background:var(--primary-soft);
  border-radius:14px;
}
.small{font-size:.88rem; color:var(--muted)}
.diagram{
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  padding:10px;
  overflow-x:auto;
}
.diagram svg{display:block; width:100%; min-width:540px; height:auto}
svg .wire{stroke:#18212f; stroke-width:4; fill:none; stroke-linecap:round; stroke-linejoin:round}
svg .rail{stroke:#18212f; stroke-width:5}
svg .comp{fill:#fff; stroke:#18212f; stroke-width:3}
svg .node{fill:#0f4ea8}
svg .board{fill:#f7fbff; stroke:#d6dde8; stroke-width:2}
svg .dtext{fill:#18212f; font-size:17px; font-family:Arial,Helvetica,sans-serif}
svg .dsmall{fill:#667085; font-size:14px; font-family:Arial,Helvetica,sans-serif}
svg .dbold{fill:#18212f; font-size:18px; font-weight:700; font-family:Arial,Helvetica,sans-serif}
svg .accent{stroke:#ff8a00; fill:none; stroke-width:5}
.table-wrap{overflow-x:auto}
table{width:100%; border-collapse:collapse}
th, td{border:1px solid var(--line); padding:10px; vertical-align:top}
th{background:#f3f7fb; text-align:left}
ol{padding-left:22px}
ul{padding-left:22px}
.calc-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.field{display:flex; flex-direction:column; gap:6px}
label{font-weight:700}
input, select{
  min-height:42px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  font:inherit;
  background:#fff;
}
.result{
  margin-top:12px;
  padding:12px 14px;
  border:1px solid #c9ebd7;
  background:#effbf3;
  color:#145c37;
  border-radius:12px;
  font-weight:800;
}
.exercise{
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
  background:#fff;
  margin-bottom:12px;
}
details{
  margin-top:10px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  background:#fbfdff;
}
summary{cursor:pointer; font-weight:800}
.split-title{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
}
.footer{
  margin-top:18px;
  padding:14px 4px 0;
  border-top:1px solid var(--line);
  color:var(--muted);
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  font-size:.88rem;
}
@media (max-width: 960px){
  .grid4, .grid3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 720px){
  .brand{flex-direction:column; align-items:flex-start}
  .brand img{width:82px; height:82px}
  .grid4, .grid3, .grid2, .calc-grid{grid-template-columns:1fr}
  .container{width:min(100% - 14px,1180px); margin-top:8px}
  .site-header, .section, .hero-card{padding:16px}
}
@media print{
  body{background:#fff}
  .container{width:100%; margin:0}
  .site-header{box-shadow:none; border-radius:0}
  .hero-card, .section, .course-link{box-shadow:none}
  .main-nav, .no-print{display:none !important}
  @page{size:A4; margin:10mm}
}
