/* 样式:从旧版 index.html 的 inline <style> 抽取,规则与外观保持一致 */
:root {
  --bg: #f5f6fa;
  --card: #fff;
  --primary: #1a5276;
  --accent: #2980b9;
  --green: #27ae60;
  --orange: #e67e22;
  --red: #c0392b;
  --yellow: #f39c12;
  --border: #e0e0e0;
  --text: #2c3e50;
  --sub: #7f8c8d;
  --highlight: #fff9c4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.topbar {
  background: linear-gradient(135deg, #1a3a4a, #1a5276);
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.topbar .ver { font-size: 12px; opacity: .6; }

.nav {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav button {
  padding: 12px 24px;
  border: none;
  background: none;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  color: var(--sub);
  transition: .2s;
}
.nav button.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 600; }

.main { max-width: 1200px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  padding: 20px;
  margin-bottom: 16px;
}
.card h3 {
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ecf0f1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

label { font-weight: 600; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 4px; }
select, input[type=text], input[type=number] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
  background: #fff;
}
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41, 128, 185, .1); }

.checkbox-card {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: .2s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  user-select: none;
}
.checkbox-card:hover { border-color: var(--accent); }
.checkbox-card.checked { border-color: var(--green); background: #eafaf1; }
.checkbox-card .dot {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.checkbox-card.checked .dot { background: var(--green); border-color: var(--green); }
.checkbox-card.checked .dot::after { content: "✓"; color: #fff; font-size: 12px; font-weight: bold; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: var(--primary); color: #fff; padding: 8px 10px; text-align: center; font-weight: 500; }
td { padding: 7px 10px; border: 1px solid var(--border); text-align: center; }
td.l { text-align: left; }
tr.subtotal td { background: #eaf7ea; font-weight: 600; }
tr.total td { background: var(--highlight); font-weight: 700; color: var(--red); font-size: 14px; }

.section-label { background: #d6e4f0; font-weight: 600; font-size: 14px; padding: 8px 12px; margin: 16px 0 8px; border-radius: 6px; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.summary-item { background: #fafafa; border-radius: 8px; padding: 12px; border: 1px solid var(--border); }
.summary-item .label { font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.summary-item .value { font-size: 20px; font-weight: 700; color: var(--primary); }
.summary-item.total { background: var(--highlight); border-color: var(--orange); }
.summary-item.total .value { color: var(--red); font-size: 24px; }

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2471a3; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #229954; }
.btn-export { background: var(--orange); color: #fff; font-size: 16px; padding: 12px 32px; }
.btn-export:hover { background: #d35400; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }

input.price-edit { background: var(--highlight); font-weight: 600; text-align: center; width: 90px; }
.price-table input { width: 90px; text-align: center; }

.note { font-size: 12px; color: var(--sub); margin-top: 4px; }
.empty-state { text-align: center; padding: 40px; color: var(--sub); }
.qual-count { font-size: 13px; color: var(--accent); margin-left: 8px; }

.qual-group-title {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

@media print {
  body { background: #fff; }
  .topbar, .nav, .no-print { display: none; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .main { padding: 0; }
}
