/* ============================================================
 * 儿童习惯打卡表
 * ============================================================ */
.hb-config { background:#fff; border:1px solid #e8eaf2; border-radius:12px; padding:16px 18px; margin-bottom:14px; }
.hb-row1 { display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
.hb-field { display:flex; align-items:center; gap:6px; font-size:13px; color:#5a6573; }
.hb-field input, .hb-field select {
  padding:7px 10px; border:1px solid #d8dde6; border-radius:5px;
  font-size:13px; background:#fff; min-width:120px;
}

/* —— 总分卡 —— */
.hb-score-card {
  background:linear-gradient(135deg,#ffd180,#ffab40);
  color:#fff;border-radius:12px;padding:18px 22px;margin-bottom:14px;
  display:flex;align-items:center;gap:18px;flex-wrap:wrap;
}
.hb-score-num {
  width:88px;height:88px;border-radius:50%;background:#fff;color:#cc7c00;
  display:flex;align-items:center;justify-content:center;
  font-size:32px;font-weight:800;flex-shrink:0;box-shadow:0 4px 12px rgba(204,124,0,.25);
}
.hb-score-info { flex:1;min-width:200px; }
.hb-score-info h3 { margin:0 0 4px;font-size:16px;color:#fff; }
.hb-score-info p { margin:0;font-size:14px;opacity:.95; }
.hb-score-bar {
  background:rgba(255,255,255,.4);border-radius:6px;height:10px;
  margin-top:8px;overflow:hidden;
}
.hb-score-bar > div {
  background:#fff;height:100%;width:0;transition:width .3s;
}

/* —— 打卡网格 —— */
#habitsGrid {
  background:#fff;border:1px solid #ecedf3;border-radius:10px;
  margin-bottom:14px;overflow:hidden;
}
.hb-head, .hb-row {
  display:grid;
  grid-template-columns: minmax(160px, 1.5fr) repeat(var(--days, 7), 1fr) 80px;
  border-bottom:1px solid #ecedf3;
  align-items:stretch;
}
.hb-head {
  background:#f7f8fb;font-size:12px;font-weight:600;color:#5a6573;
}
.hb-h-cell {
  padding:10px 6px;text-align:center;border-right:1px solid #ecedf3;
}
.hb-h-cell:last-child { border-right:none; }
.hb-h-name { text-align:left;padding-left:14px; }

.hb-row { transition:background .15s; }
.hb-row:hover { background:#fafbfd; }
.hb-row:last-child { border-bottom:none; }

.hb-name {
  padding:10px 14px;font-size:14px;color:#2c3e50;font-weight:500;
  border-right:1px solid #ecedf3;
  display:flex;align-items:center;
}
.hb-cell {
  text-align:center;font-size:18px;cursor:pointer;
  border-right:1px solid #ecedf3;
  display:flex;align-items:center;justify-content:center;
  min-height:44px;
  transition:background .12s;
}
.hb-cell:hover { background:#fff8e1; }
.hb-cell.hb-on { background:#fff8e1;color:#cc7c00; }

.hb-score {
  text-align:center;color:#27ae60;font-weight:600;
  display:flex;align-items:center;justify-content:center;
  font-size:14px;
}

/* —— 奖励列表 —— */
.hb-rewards {
  background:#fff;border:1px solid #ecedf3;border-radius:10px;
  padding:14px 18px;margin-bottom:14px;
}
.hb-rewards h3 { margin:0 0 10px;font-size:15px;color:#2c3e50; }
.hb-reward {
  display:flex;align-items:center;padding:10px 14px;
  background:#fafbfd;border:1px solid #e6e9ef;border-radius:6px;
  margin-bottom:6px;font-size:14px;
}
.hb-reward.hb-got {
  background:#e8f7ee;border-color:#a8dab9;
}

/* —— 添加习惯 —— */
.hb-add-row {
  display:flex;gap:8px;flex-wrap:wrap;align-items:center;
  background:#fff;border:1px solid #ecedf3;border-radius:8px;
  padding:10px 14px;margin-bottom:12px;
}
.hb-add-row input {
  padding:7px 10px;border:1px solid #d8dde6;border-radius:5px;
  font-size:13px;
}
.hb-add-row button {
  padding:7px 14px;border:none;background:#4f8cff;color:#fff;
  border-radius:5px;cursor:pointer;font-size:13px;font-weight:500;
}

/* —— 操作按钮 —— */
.hb-actions {
  display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px;
}
.hb-actions button {
  padding:9px 18px;border:1px solid #d8dde6;background:#fff;
  border-radius:6px;font-size:14px;cursor:pointer;font-weight:500;
}
.hb-btn-primary {
  background:linear-gradient(135deg,#27ae60,#2ecc71)!important;
  color:#fff!important;border:none!important;
}
.hb-btn-print {
  background:#fff8eb!important;color:#cc7c00!important;
  border-color:#ffd591!important;
}

/* —— 移动端 —— */
@media (max-width: 768px) {
  .hb-head, .hb-row {
    grid-template-columns: minmax(110px, 1.5fr) repeat(var(--days, 7), 1fr) 50px;
    font-size:12px;
  }
  .hb-name { padding:8px 10px;font-size:13px; }
  .hb-cell { min-height:38px;font-size:16px; }
  .hb-h-cell { padding:8px 4px;font-size:11px; }
  .hb-score { font-size:12px; }
}

/* —— 打印 —— */
@media print {
  body { background:#fff; }
  .navbar, .breadcrumb, .hb-config, .hb-actions,
  #floatingContactCta, #mobileTabBar, .m-tabbar, nav.m-tabbar,
  #toolFavBtn, .copyright-area, footer, .py-tip, .hb-tip,
  .hb-add-row, .hb-rewards-edit,
  .container > div:not(#habitsGrid):not(.hb-score-card):not(.hb-rewards):not(.hb-print-header) {
    display:none !important;
  }
  @page { size: A4; margin: 12mm 15mm; }
}
