/* =============================================================================
 * Steel Structures Manual — shared style (light theme, file:// safe)
 * ========================================================================== */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; font-family: "Segoe UI", "Helvetica Neue", Arial,
    "Microsoft YaHei", "Noto Sans CJK", sans-serif;
  color: #1f2733; background: #f4f6f9; font-size: 15px; line-height: 1.5;
}
a { color: #1a5fb4; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top header ---- */
.site-header { background: #16314f; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.hd-bar { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px; flex-wrap: wrap; gap: 8px; }
.hd-left { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.hd-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hd-home, .hd-mail, .hd-brand { color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.hd-home:hover, .hd-mail:hover, .hd-brand:hover { color: #cfe3ff; text-decoration: none; }
.hd-sep { color: #5b7da6; }
.hd-ico { font-size: 16px; }
.hd-lang, .hd-std-sel, .hd-unit { color: #cfe3ff; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
/* Header dropdown controls. Explicit sizing + flex:none guarantees they never
   collapse to a zero-width (invisible) box inside the flex header — a known
   cross-browser quirk for <select> used as flex items. */
.hd-right select { flex: none; height: 30px; padding: 3px 8px;
  border-radius: 4px; border: 1px solid #2e4f76; background: #fff; color: #16314f;
  font-size: 13px; line-height: 1; cursor: pointer; }
#stdSel  { width: 132px; }
#unitSel { width: 150px; }
#langSel { width: 116px; }
.hd-std { padding: 4px 18px 8px; font-size: 12.5px; color: #b9d2ef; }
.hd-std b { color: #fff; }

/* ---- header responsive: keep all three dropdowns reachable ----------------
 * The right-hand group (standard / units / language / email) totals ~735px.
 * Without these rules it stays on one non-wrapping row and the right-most
 * controls — the language box — overflow off-screen on narrower windows. */
@media (max-width: 1024px) {
  .hd-right { gap: 8px; }
  .hd-right select { height: 28px; font-size: 12.5px; padding: 2px 6px; }
  #stdSel  { width: 118px; }
  #unitSel { width: 132px; }
  #langSel { width: 104px; }
}
@media (max-width: 760px) {
  .hd-bar { padding: 8px 12px; }
  .hd-right { gap: 6px; }
  /* keep the dropdowns, drop their text captions to save width */
  .hd-right label > span { display: none; }
  #stdSel  { width: 110px; }
  #unitSel { width: 124px; }
  #langSel { width: 96px; }
}

/* ---- layout ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }
.page-head h1 { font-size: 24px; margin: 6px 0 4px; }
.page-head p { color: #5b6675; margin: 0 0 18px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 18px 18px 20px; box-shadow: 0 1px 3px rgba(20,40,70,.05); }
.card h2 { font-size: 17px; margin: 0 0 12px; color: #16314f;
  border-bottom: 2px solid #eef2f7; padding-bottom: 8px; }

/* ---- inputs ---- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; color: #46506180; color: #465061; font-weight: 600; }
.field .sym { color: #1a5fb4; font-style: italic; }
.field input, .field select {
  padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 14px; background: #fff; color: #1f2733; }
.field input:focus, .field select:focus { outline: none; border-color: #1a5fb4;
  box-shadow: 0 0 0 2px rgba(26,95,180,.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.unit { font-size: 12px; color: #8a96a5; }

/* ---- results ---- */
.result { margin-top: 6px; }
.res-line { display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed #eef2f7; font-size: 14px; }
.res-line:last-child { border-bottom: none; }
.res-line .k { color: #465061; }
.res-line .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; }
.badge.pass { background: #e3f6e8; color: #1b7a3d; }
.badge.fail { background: #fde4e4; color: #b42318; }
.badge.warn { background: #fff3d6; color: #92680a; }
.verdict { font-size: 16px; font-weight: 800; margin: 6px 0 10px; }

.note { font-size: 12.5px; color: #6b7785; margin-top: 10px; line-height: 1.45; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { border: 1px solid #e2e8f0; padding: 6px 8px; text-align: right; }
table.tbl th { background: #f1f5fa; color: #16314f; text-align: right; }
table.tbl td.l, table.tbl th.l { text-align: left; }
.tbl-scroll { overflow-x: auto; }

/* ---- home module cards ---- */
.home-hero { background: #16314f; color: #fff; border-radius: 12px; padding: 26px 24px; margin-bottom: 22px; }
.home-hero h1 { margin: 0 0 6px; font-size: 28px; }
.home-hero p { margin: 0; color: #b9d2ef; }
.home-note { font-size: 13px; color: #6b7785; margin: 12px 2px 18px; }
.mod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .mod-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .mod-grid { grid-template-columns: 1fr; } }
.mod-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px;
  box-shadow: 0 1px 3px rgba(20,40,70,.05); transition: transform .12s, box-shadow .12s; }
.mod-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20,40,70,.12); text-decoration: none; }
.mod-card .ic { font-size: 26px; }
.mod-card h3 { margin: 8px 0 4px; font-size: 16px; color: #16314f; }
.mod-card p { margin: 0; font-size: 13px; color: #5b6675; }
.mod-card .tags { margin-top: 8px; }
.mod-card .tag { display: inline-block; font-size: 11px; color: #1a5fb4;
  background: #eaf2fc; border-radius: 4px; padding: 1px 7px; margin-right: 5px; }

/* (header selects are styled by the .hd-right select rule above) */

/* ---- export buttons ---- */
.export-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: #1a5fb4; color: #fff; border: 1px solid #15457f; border-radius: 6px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 600; }
.btn:hover { background: #154a8f; text-decoration: none; }
.btn:active { transform: translateY(1px); }

/* ---- stability chart ---- */
.chart-card { margin-top: 22px; }
.chart { width: 100%; max-width: 640px; }
.chart svg { width: 100%; height: auto; display: block; border: 1px solid #eef2f7; border-radius: 8px; }

