/* 儿童身高体重标准表 — 页面私有样式（查询工具 + 标准表）
   注意：禁止覆盖全局 --primary（game-zone/tool-nav 共享依赖） */

.chw-tool {
  margin: 28px auto;
}

.chw-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.chw-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-100);
}

.chw-card-head h2 {
  font-size: 20px;
  color: var(--gray-900);
}

.chw-card-meta {
  font-size: 13px;
  color: var(--gray-400);
}

/* ---------- 查询表单 ---------- */
.chw-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.chw-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chw-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}

.chw-field select,
.chw-field input[type="number"] {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 15px;
  color: var(--gray-800);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.chw-field select:focus,
.chw-field input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.chw-gender-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 4px;
}

.chw-gender {
  height: 38px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 15px;
  color: var(--gray-600);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.chw-gender.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.chw-actions {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.chw-actions .btn {
  min-width: 120px;
  height: 44px;
  font-size: 15px;
}

.chw-error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 14px;
}

.chw-tip {
  margin-top: 16px;
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ---------- 评级结果 ---------- */
.chw-result {
  margin-top: 18px;
  border-top: 1px dashed var(--gray-200);
  padding-top: 18px;
}

.chw-result-summary {
  font-size: 15px;
  color: var(--gray-700);
  margin-bottom: 14px;
}

.chw-result-summary strong {
  color: var(--gray-900);
}

.chw-grades {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.chw-grade-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px;
  background: var(--gray-50);
}

.chw-grade-name {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.chw-grade-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.chw-grade-range {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--gray-500);
  line-height: 1.7;
}

.chw-grade-value {
  margin-top: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

/* 等级配色（页面私有变量，不动全局） */
.chw-badge-low { background: #dc2626; }        /* 矮小 / 偏瘦 */
.chw-badge-midlow { background: #d97706; }     /* 偏矮 / 超重 */
.chw-badge-good { background: var(--secondary); } /* 标准 */
.chw-badge-high { background: #2563eb; }       /* 超高 / 肥胖高值提示 */

/* ---------- 刻度条 ---------- */
.chw-scale {
  margin-top: 14px;
}

.chw-scale-track {
  position: relative;
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}

.chw-scale-seg-low { background: #fecaca; }
.chw-scale-seg-midlow { background: #fde68a; }
.chw-scale-seg-good { background: #a7f3d0; }
.chw-scale-seg-high { background: #bfdbfe; }

.chw-scale-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--gray-900);
  transform: translateX(-2px);
}

.chw-scale-labels {
  display: flex;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-500);
}

.chw-scale-labels span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chw-median-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-400);
}

/* ---------- 标准表 ---------- */
.chw-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.chw-tab {
  min-width: 96px;
  height: 40px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
}

.chw-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.chw-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.chw-table-wrap.hidden {
  display: none;
}

.chw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}

.chw-table caption {
  padding: 14px 12px 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.chw-table thead th {
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 600;
  padding: 9px 8px;
  border: 1px solid var(--gray-200);
  white-space: nowrap;
}

.chw-table tbody th,
.chw-table tbody td {
  padding: 9px 8px;
  border: 1px solid var(--gray-100);
  text-align: center;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}

.chw-table tbody th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-800);
}

.chw-table tbody tr:hover {
  background: #f5f6ff;
}

.chw-table tbody tr.chw-row-hl {
  background: #eef2ff;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* 标准列（第4、6列数据位）淡提示 */
.chw-table .chw-col-median {
  color: var(--gray-900);
  font-weight: 600;
}

.chw-table-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.9;
}

.chw-feature-icon {
  margin-right: 6px;
}

.chw-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .chw-card {
    padding: 16px;
  }

  .chw-form {
    grid-template-columns: 1fr;
  }

  .chw-grades {
    grid-template-columns: 1fr;
  }

  .chw-tab {
    flex: 1;
  }
}
