/* 童迹 · 幼儿成长评价系统 —— 公共样式（移动端优先） */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f4f2ec;
  color: #33322e;
  font-size: 15px;
  line-height: 1.6;
}
a { color: #2e7d5b; text-decoration: none; }
.container { max-width: 980px; margin: 0 auto; padding: 12px; }

/* 顶栏 */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e7e3d8;
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 980px; margin: 0 auto; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.brand { font-weight: 800; font-size: 18px; color: #2e7d5b; letter-spacing: 1px; }
.brand small { font-weight: 400; font-size: 12px; color: #9a948a; margin-left: 6px; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: #6b675f; margin-right: 8px; white-space: nowrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; padding: 10px 16px;
  font-size: 15px; font-family: inherit; cursor: pointer;
  background: #3f9d6e; color: #fff; min-height: 44px; min-width: 44px;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: #3f9d6e; border: 1px solid #3f9d6e; }
.btn.danger { background: #fff; color: #c0563f; border: 1px solid #d99a8a; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* 卡片与分区 */
.card {
  background: #fff; border: 1px solid #e7e3d8; border-radius: 14px;
  padding: 14px; margin-bottom: 12px;
}
.card h3 { font-size: 15px; color: #2e7d5b; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.card h3 .badge { background: #eaf5ef; color: #2e7d5b; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.muted { color: #9a948a; font-size: 13px; }
.section-title { font-size: 16px; font-weight: 700; margin: 16px 0 10px; color: #4a463e; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row .grow { flex: 1; min-width: 160px; }

/* 表单 */
label { font-size: 13px; color: #6b675f; display: block; margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #d8d3c6; border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff; color: #33322e;
}
/* 日期输入框：统一高度与外观，避免不同手机浏览器渲染大小不一（有的全宽大控件、有的很小） */
input[type=date] {
  -webkit-appearance: none; appearance: none;
  min-width: 0; height: 42px; box-sizing: border-box;
  line-height: normal;
}
input[type=date]::-webkit-date-and-time-value { text-align: left; }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9ed4b8; border-color: #3f9d6e; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* 幼儿卡片网格 */
.grid-children { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.child-card {
  background: #fff; border: 1px solid #e7e3d8; border-radius: 14px; padding: 12px 8px;
  text-align: center; cursor: pointer; transition: border-color .15s;
}
.child-card:hover { border-color: #3f9d6e; }
.child-card.del { position: relative; }
.child-card.del .delchk { position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; margin: 0; cursor: pointer; z-index: 2; }
.child-card.sel { border-color: #3f9d6e; background: #eaf5ef; }
.child-avatar {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px;
  background: linear-gradient(135deg, #f3c98b, #e8913a);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.child-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.child-card .nm { font-size: 14px; font-weight: 600; }
/* ===== 问卷活动影像资料 ===== */
.qmedia-item { display:inline-block; vertical-align:top; margin:6px 8px 0 0; text-align:center; }
.qmedia-item img { width:130px; height:100px; object-fit:cover; border-radius:8px; border:1px solid #ece8dd; display:block; }
.qmedia-item video { width:180px; height:110px; object-fit:cover; border-radius:8px; border:1px solid #ece8dd; display:block; background:#f5f2ea; }
.qmedia-item .btn { margin-top:4px; }
.qmedia-photo { width:200px; height:150px; object-fit:cover; border-radius:8px; border:1px solid #ece8dd; margin:6px 8px 0 0; }
.qmedia-video-box { display:inline-block; vertical-align:top; text-align:center; margin:6px 8px 0 0; }
.q-media { margin-top:6px; display:flex; flex-wrap:wrap; gap:10px; align-items:flex-start; }
.q-photo { width:200px; height:150px; object-fit:cover; border-radius:8px; border:1px solid #ece8dd; }
.q-video { text-align:center; }
.q-video img { width:132px; height:132px; border:1px solid #ece8dd; border-radius:8px; display:block; }
.child-card .card-ops { margin-top: 8px; display: flex; gap: 6px; justify-content: center; }
.child-card .card-ops .btn { padding: 3px 10px; font-size: 12px; }
.child-card .meta { font-size: 11px; color: #9a948a; margin-top: 2px; }
.child-card .cnt { font-size: 11px; color: #2e7d5b; margin-top: 4px; }

/* 记录 */
.rec { border: 1px solid #ece8dd; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.rec .head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #eaf5ef; color: #2e7d5b; }
.tag.domain { background: #fdf1e0; color: #b06d1f; }
.rec .time { font-size: 12px; color: #9a948a; }
.rec .txt { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.imgs, .rec .imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.imgs img, .rec .imgs img { width: 100px; height: 100px; object-fit: cover; border-radius: 10px; border: 1px solid #ece8dd; cursor: zoom-in; }
.rec .ops { margin-top: 8px; text-align: right; }

/* 照片放大 */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 200; display: none; align-items: center; justify-content: center; padding: 12px; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 8px; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(40,38,32,.45); z-index: 100; display: none; align-items: flex-end; justify-content: center; }
.mask.show { display: flex; }
.sheet {
  background: #fff; width: 100%; max-width: 640px; max-height: 92vh;
  border-radius: 18px 18px 0 0; padding: 16px; overflow-y: auto;
}
@media (min-width: 700px) {
  .mask { align-items: center; }
  .sheet { border-radius: 18px; }
}
.sheet .head { display: flex; align-items: center; margin-bottom: 10px; }
.sheet .head h3 { flex: 1; font-size: 16px; color: #2e7d5b; }

/* 弹窗（居中） */
.pop { position: fixed; inset: 0; background: rgba(40,38,32,.45); z-index: 100; display: none; align-items: center; justify-content: center; padding: 14px; }
.pop.show { display: flex; }
.pop-box { background: #fff; border-radius: 16px; padding: 18px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.pop-box h3 { font-size: 16px; color: #2e7d5b; margin-bottom: 8px; }

/* Tab */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab {
  padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid #d8d3c6;
  font-size: 14px; cursor: pointer; color: #6b675f;
}
.tab.active { background: #3f9d6e; border-color: #3f9d6e; color: #fff; }

/* 表格（班级/用户/指标） */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #efece2; vertical-align: middle; }
th { color: #9a948a; font-weight: 500; font-size: 13px; }
td .btn { margin-right: 4px; }
.table-wrap { overflow-x: auto; }

/* 搜索框 */
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }

/* 报告页 */
.report-body { background: #fff; }
.report-head { text-align: center; border-bottom: 2px solid #3f9d6e; padding-bottom: 12px; margin-bottom: 16px; }
.report-head h1 { font-size: 20px; color: #2e7d5b; }
.report-head .meta { font-size: 13px; color: #9a948a; margin-top: 6px; }
.report-sec { margin-bottom: 18px; }
.report-sec h2 { font-size: 16px; color: #2e7d5b; border-left: 4px solid #3f9d6e; padding-left: 8px; margin-bottom: 10px; }
.photo-wall { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-wall img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; }
.radar-wrap { max-width: 340px; margin: 0 auto; }

/* 空状态 */
.empty { text-align: center; color: #b5afa3; padding: 30px 10px; font-size: 14px; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .report-body { padding: 0; }
}

/* COA 记录 */
.coa-child { padding:8px 12px; background:#f4f7f2; border-radius:8px; font-weight:600; color:#2f6b4f; }
.coa-picker { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-start; }
.coa-chips { display:flex; flex-wrap:wrap; gap:6px; }
.coa-chip { display:inline-flex; align-items:center; background:#e6f2ea; color:#2f6b4f; border:1px solid #bfdccb; border-radius:14px; padding:2px 10px; font-size:12px; cursor:pointer; }
.coa-chip-sm { font-size:12px; padding:1px 8px; }
.coa-sec { margin:12px 0 6px; padding:4px 10px; background:#f0f5f1; border-left:4px solid #3f9d6e; font-size:14px; }
.coa-opt { display:flex; align-items:center; gap:6px; padding:6px 8px; border-bottom:1px dashed #eee; font-size:13px; cursor:pointer; }
.coa-cnt { color:#999; font-style:normal; font-size:12px; }
.coa-stage-opt { display:block; padding:8px; border:1px solid #e6e6e6; border-radius:8px; margin:6px 0; cursor:pointer; }
.coa-stage-text { font-size:13px; line-height:1.5; }
.coa-sample-link { color:#1a73e8; cursor:pointer; font-size:12px; white-space:nowrap; }
.coa-seg textarea { width:100%; }
.coa-block { background:#f7f7f2; border-radius:8px; padding:10px 12px; font-size:13px; line-height:1.7; }
.coa-ref-item { padding:6px 8px; border-bottom:1px dashed #eee; cursor:pointer; font-size:13px; }
.coa-ref-item:hover { color:#3f9d6e; }
.coa-ref-stage { padding:8px; border-bottom:1px dashed #eee; font-size:13px; line-height:1.6; }

/* ===================== 移动端增强 ===================== */
@media (max-width: 700px) {
  .container { padding: 10px; }
  .topbar-inner { padding: 8px 10px; gap: 6px; }
  .brand { font-size: 16px; letter-spacing: .5px; }
  .topbar .who { font-size: 12px; margin-right: 2px; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn { padding: 9px 13px; font-size: 14px; }
  .btn.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }

  /* 顶部 tab 导航：单行横向滑动，不再换行堆叠 */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; padding: 8px 14px; font-size: 13px; }

  /* 幼儿卡片：窄屏更紧凑 */
  .grid-children { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .child-card { padding: 10px 6px; }
  .child-avatar { width: 50px; height: 50px; font-size: 19px; }

  /* 表格：窄屏紧凑 + 横向滚动兜底 */
  th, td { padding: 7px 6px; font-size: 13px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }

  /* 表单 */
  input[type=text], input[type=password], input[type=date], select, textarea { padding: 10px 11px; font-size: 15px; }
  input[type=date] { -webkit-appearance: none; appearance: none; height: 42px; padding-top: 0; padding-bottom: 0; }
  select { min-height: 40px; }

  /* 弹层 / 弹窗：手机更贴边 */
  .sheet { padding: 14px; }
  .pop { padding: 10px; }
  .pop-box { padding: 14px; }

  /* 报告页照片自适应宽度 */
  .q-photo, .qmedia-photo { width: 100%; max-width: 240px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
  .photo-wall img { width: 96px; height: 96px; }
  .imgs img, .rec .imgs img { width: 88px; height: 88px; }
  .radar-wrap { max-width: 300px; }
  .report-head h1 { font-size: 17px; }
  .report-head .meta { font-size: 12px; }
}

@media (max-width: 380px) {
  .brand { font-size: 15px; }
  .brand small { display: none; }
  .topbar .who { max-width: 60px; font-size: 11px; }
  .tab { padding: 7px 11px; font-size: 12px; }
  .btn { padding: 8px 11px; font-size: 13px; min-height: 40px; }
  .qmedia-item img { width: 108px; height: 82px; }
  .qmedia-item video { width: 148px; height: 94px; }
  .qmedia-item .btn { padding: 5px 8px; font-size: 12px; min-height: 30px; }
  .q-video img { width: 112px; height: 112px; }
}


/* 幼儿行为分析三级勾选样式：隐藏勾选框，点击变色模块（系统绿色主题） */
.pill { display: inline-flex; margin: 3px 8px 3px 0; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 5px 14px; border-radius: 18px; border: 1px solid #e3dccd;
  background: #faf7f0; font-size: 14px; line-height: 1.4; transition: all .15s; }
.pill span:hover { border-color: #9cc9af; }
.pill i { font-style: normal; font-size: 11px; color: #9a948a; margin-left: 3px; }
.pill input:checked + span { background: #3f9d6e; border-color: #3f9d6e; color: #fff; }
.pill input:checked + span i { color: #fff; opacity: .85; }
.opt { display: block; margin: 4px 0; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: block; padding: 6px 12px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; line-height: 1.5; transition: all .15s; }
.opt span:hover { background: #f4f7f2; }
.opt input:checked + span { background: #eaf5ef; color: #2e7d5b; border-color: #bfdccb; }
