  :root{
    --bg:#f4f6f8; --card:#ffffff; --ink:#1f2933; --muted:#6b7280;
    --line:#e3e8ee; --brand:#0b6bcb; --brand-d:#084e96;
    --ok:#2e7d32; --ok-bg:#e8f5e9; --ng:#c62828; --ng-bg:#fdecea;
    --warn:#b26a00; --warn-bg:#fff4e0;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{font-family:"Segoe UI",Roboto,Helvetica,Arial,"Noto Sans","Microsoft YaHei","Hiragino Sans",sans-serif;
    background:var(--bg); color:var(--ink); line-height:1.5; font-size:15px;}
  .topbar{display:flex; align-items:center; justify-content:space-between; gap:12px;
    background:var(--card); border-bottom:1px solid var(--line); padding:10px 16px; position:sticky; top:0; z-index:20; flex-wrap:wrap;}
  .brand{display:flex; align-items:center; gap:10px; font-weight:700; font-size:16px; color:var(--brand-d);}
  .brand .dot{width:10px;height:10px;border-radius:50%;background:var(--brand);display:inline-block;}
  .top-actions{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
  .btn{display:inline-flex; align-items:center; gap:6px; cursor:pointer; border:1px solid var(--line);
    background:#fff; color:var(--ink); padding:7px 12px; border-radius:8px; font-size:14px; text-decoration:none; transition:.15s;}
  .btn:hover{border-color:var(--brand); color:var(--brand);}
  .btn.primary{background:var(--brand); color:#fff; border-color:var(--brand);}
  .btn.primary:hover{background:var(--brand-d); color:#fff;}
  select.lang,select.unit{border:1px solid var(--line); border-radius:8px; padding:7px 10px; font-size:14px; background:#fff; color:var(--ink);}
  .wrap{max-width:1100px; margin:0 auto; padding:18px 16px 60px;}
  .grid{display:grid; grid-template-columns:1fr 1fr; gap:16px;}
  @media(max-width:880px){ .grid{grid-template-columns:1fr;} }
  .card{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px 18px; box-shadow:0 1px 2px rgba(16,24,40,.04);}
  .card h2{margin:0 0 12px; font-size:16px; color:var(--brand-d); display:flex; align-items:center; gap:8px;}
  .card h2 .n{background:var(--brand); color:#fff; width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;}
  .field{display:flex; flex-direction:column; gap:4px; margin-bottom:12px;}
  .field label{font-size:13px; color:var(--muted);}
  .field .row{display:flex; gap:8px; align-items:center;}
  .field input, .field select{width:100%; border:1px solid var(--line); border-radius:8px; padding:9px 10px; font-size:14px; color:var(--ink); background:#fff;}
  .field .unit{color:var(--muted); font-size:13px; min-width:30px;}
  .hint{font-size:12px; color:var(--muted); margin-top:-6px; margin-bottom:8px;}
  .calc-bar{display:flex; gap:12px; margin:18px 0; flex-wrap:wrap; align-items:center;}
  .calc-bar .btn{padding:11px 22px; font-size:15px;}
  .diagram-box{display:flex; justify-content:center; align-items:center; background:#fbfcfe; border:1px solid var(--line); border-radius:10px; padding:10px;}
  svg.lug{width:100%; max-width:420px; height:auto;}
  .res-hidden{color:var(--muted); font-style:italic; padding:14px 0;}
  table.res{width:100%; border-collapse:collapse; font-size:14px;}
  table.res th, table.res td{border-bottom:1px solid var(--line); padding:9px 8px; text-align:left; vertical-align:middle;}
  table.res th{color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.03em;}
  .bar{height:8px; border-radius:5px; background:#eceff3; overflow:hidden; min-width:90px;}
  .bar > i{display:block; height:100%;}
  .badge{display:inline-block; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:700;}
  .badge.ok{background:var(--ok-bg); color:var(--ok);}
  .badge.ng{background:var(--ng-bg); color:var(--ng);}
  .verdict{display:flex; align-items:center; gap:14px; margin-top:14px; padding:14px 16px; border-radius:10px; font-size:16px; font-weight:700;}
  .verdict.ok{background:var(--ok-bg); color:var(--ok);}
  .verdict.ng{background:var(--ng-bg); color:var(--ng);}
  .warnings{margin-top:12px;}
  .warnings .w{background:var(--warn-bg); color:var(--warn); border-radius:8px; padding:8px 12px; font-size:13px; margin-bottom:6px;}
  .big-load{font-size:22px; font-weight:800; color:var(--brand-d);}
  .sub{font-size:13px; color:var(--muted);}
  .shackle{margin-top:12px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:#fbfcfe;}
  .shackle .row{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
  details.notes{margin-top:20px;}
  details.notes summary{cursor:pointer; font-weight:600; color:var(--brand-d); padding:8px 0;}
  details.notes .body{font-size:13px; color:var(--ink);}
  details.notes code{background:#eef2f7; padding:1px 5px; border-radius:4px; font-size:12px;}
  .disclaimer{margin-top:24px; font-size:12px; color:var(--muted); border-top:1px solid var(--line); padding-top:12px;}
  .err{background:var(--ng-bg); color:var(--ng); padding:10px 14px; border-radius:8px; margin-bottom:12px; font-size:14px;}
  .designbox{margin-top:12px; padding:10px 14px; border:1px dashed var(--brand); border-radius:10px; background:#f3f8fe;}

  /* print sheet: hidden on screen, sole content when printing */
  #printSheet{display:none;}
  @media print{
    @page{size:A4 portrait; margin:12mm;}
    body{background:#fff;}
    body > *:not(#printSheet){display:none !important;}
    #printSheet{display:block; color:#111; font-size:11px; line-height:1.45;}
    #printSheet h1{font-size:20px; margin:0 0 2px; color:#111;}
    #printSheet h2{font-size:13px; margin:12px 0 4px; border-bottom:1px solid #999; padding-bottom:2px;}
    #printSheet .sub{font-size:9px; color:#555;}
    .print-head{border-bottom:1px solid #999; padding-bottom:6px; margin-bottom:6px;}
    .print-params{display:grid; grid-template-columns:repeat(4,1fr); gap:1px 14px; font-size:10px;}
    .pf{display:flex; justify-content:space-between; border-bottom:1px dotted #ccc; padding:1px 0;}
    .pf .pk{color:#444;}
    .pf .pv{font-weight:600;}
    .print-fig svg{max-width:300px; height:auto; margin:4px 0;}
    #printSheet table.res{font-size:10px; margin:4px 0;}
    #printSheet table.res th, #printSheet table.res td{padding:3px 5px;}
    #printSheet .bar{display:none;}
    #printSheet .badge{background:none !important; border:1px solid currentColor; padding:1px 6px; font-size:9px;}
    #printSheet .big-load{font-size:16px;}
    #printSheet .verdict{background:none !important; border:1.5px solid currentColor; padding:6px 8px; font-size:13px;}
    #printSheet .shackle{background:none; border:1px solid #999;}
    #printSheet .designbox{background:none; border:1px dashed #333;}
    #printSheet .print-notes{font-size:10px;}
    #printSheet .print-foot{margin-top:12px; font-size:9px; color:#666; border-top:1px solid #999; padding-top:4px;}
  }