/* ============================================================
 * style.css - 钢结构工程量计算 App 样式（自适应、简洁）
 * ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Hiragino Sans", "Malgun Gothic", Arial, sans-serif;
  color: #1f2933;
  background: #f4f6f8;
  line-height: 1.5;
}
a { color: #2257d6; text-decoration: none; }

/* 顶部栏 */
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #1b2a4a; color: #fff; padding: 10px 18px;
}
.topbar .brand { font-weight: 700; font-size: 16px; margin-right: auto; }
.topbar .brand small { font-weight: 400; opacity: 0.8; font-size: 12px; display: block; }
.topbar a.btn, .topbar button.btn {
  background: #2f6fed; color: #fff; border: none; padding: 7px 12px;
  border-radius: 6px; cursor: pointer; font-size: 13px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.topbar a.btn.alt { background: #3a4a6b; }
.topbar a.btn:hover, .topbar button.btn:hover { filter: brightness(1.1); }
.topbar select.lang {
  background: #fff; color: #1f2933; border: 1px solid #ccd2dc;
  border-radius: 6px; padding: 6px 8px; font-size: 13px; cursor: pointer;
}

/* 布局 */
main { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }
.page-title { font-size: 22px; font-weight: 700; margin: 4px 0 2px; }
.page-sub { color: #5b6675; margin: 0 0 18px; font-size: 14px; }

/* 类型卡片网格 */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.card {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 12px;
  padding: 16px; cursor: pointer; transition: .15s; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 4px; min-height: 92px; justify-content: center;
}
.card:hover { border-color: #2f6fed; box-shadow: 0 4px 16px rgba(47,111,237,.12); transform: translateY(-2px); }
.card .ico { font-size: 22px; }
.card .name { font-weight: 600; font-size: 15px; }
.card .desc { font-size: 12px; color: #6b7686; }

/* 表单 */
.calc-wrap { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 820px) { .calc-wrap { grid-template-columns: 1.1fr .9fr; } }
.panel { background: #fff; border: 1px solid #e3e8ef; border-radius: 12px; padding: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; color: #3e4a5a; font-weight: 500; }
.field input, .field select {
  padding: 9px 10px; border: 1px solid #ccd2dc; border-radius: 7px; font-size: 14px;
  background: #fff; color: #1f2933;
}
.field .unit { font-size: 12px; color: #8a94a3; margin-left: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn-primary {
  background: #2f6fed; color: #fff; border: none; padding: 11px 16px; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost {
  background: #fff; color: #2f6fed; border: 1px solid #2f6fed; padding: 10px 14px;
  border-radius: 8px; font-size: 14px; cursor: pointer; width: 100%; margin-top: 10px;
}
.btn-ghost:hover { background: #eef3ff; }
.btn-link { display:inline-block; margin-top: 14px; font-size: 14px; }

/* 结果 */
.result-box { background: #eef6ee; border: 1px solid #bfe3bf; border-radius: 10px; padding: 16px; }
.result-box.warn { background: #fff6ee; border-color: #f0d3a8; }
.result-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #d6e4d6; }
.result-row:last-child { border-bottom: none; }
.result-row .k { color: #4a5a4a; font-size: 14px; }
.result-row .v { font-weight: 700; font-size: 16px; }
.note { font-size: 12px; color: #6b7686; margin-top: 12px; }

/* 汇总表 */
table.summary { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: 13px; }
table.summary th, table.summary td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #eef1f5; }
table.summary th { background: #1b2a4a; color: #fff; font-weight: 600; }
table.summary tr:nth-child(even) td { background: #fafbfc; }
table.summary tr.total td { background: #fff4e0; font-weight: 700; }
table.summary tr.group-title td { background: #eef3ff; color: #1b2a4a; font-weight: 700; }
.empty { text-align: center; color: #8a94a3; padding: 40px 10px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.group-title { margin: 18px 0 6px; font-size: 14px; font-weight: 700; color: #2f6fed; }

/* 分组方式选择 */
.grp-label { font-size: 13px; color: #3e4a5a; font-weight: 500; }
.grp-sel {
  padding: 9px 10px; border: 1px solid #ccd2dc; border-radius: 7px; font-size: 14px;
  background: #fff; color: #1f2933; cursor: pointer;
}

/* 附属工程量三栏 */
.acc-wrap { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 980px) { .acc-wrap { grid-template-columns: repeat(3, 1fr); align-items: start; } }

/* 项目选择 & 造价 */
.topbar select.proj {
  background: #fff; color: #1f2933; border: 1px solid #ccd2dc;
  border-radius: 6px; padding: 6px 8px; font-size: 13px; cursor: pointer;
  max-width: 160px;
}
.cost-panel { margin-top: 18px; }
.cost-panel .cost-val { font-size: 16px; font-weight: 700; color: #993c1d; padding: 6px 0; }
.cost-panel .cost-val.big { font-size: 22px; color: #a32d2d; }

/* 价格库 */
.price-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #e3e8ef; }
.price-row.head { font-weight: 600; color: #1b2a4a; border-bottom: 1px solid #ccd2dc; }
.price-row .mat { flex: 1; font-size: 14px; }
.price-row .price-inp {
  width: 130px; padding: 7px 10px; border: 1px solid #ccd2dc; border-radius: 7px;
  font-size: 14px; text-align: right; background: #fff; color: #1f2933;
}
.price-row .cur { width: 20px; font-size: 14px; color: #5b6675; }
