/* ============================================================
   青飞幼儿园 · 家长端 H5
   米白 #FAF6EE / 墨黑 #2B2B2B / 朱砂红 #C0392B / 皮影金 #C9A24B
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #FAF6EE;
  --ink: #2B2B2B;
  --red: #C0392B;
  --red-dark: #A93226;
  --gold: #C9A24B;
  --card: #FFFFFF;
  --card-warm: #FFFCF5;
  --soft: #F3EBDC;
  --line: #ECE3D2;
  --muted: #8F8779;
  --green: #6FA86C;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(80, 60, 30, .07);
}
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
img { display: block; }
.page { padding: 12px 14px 96px; max-width: 640px; margin: 0 auto; }

/* ---------- 通用 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .bar { width: 4px; height: 16px; border-radius: 2px; background: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ai-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: #A79E8F; margin-top: 8px;
}
.ai-tag::before { content: "✦"; color: var(--gold); font-size: 10px; }
.btn {
  min-height: 48px; width: 100%;
  border-radius: 12px; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .15s, transform .05s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:active { background: var(--red-dark); }
.btn-ghost { background: var(--soft); color: var(--ink); }
.btn-line { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-danger-line { background: #fff; border: 1px solid #E3C2BC; color: var(--red); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.gold { color: var(--gold); }
.red { color: var(--red); }

/* 状态 */
.loading-box { text-align: center; padding: 48px 0; color: var(--muted); }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--red);
  animation: spin .8s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty {
  text-align: center; padding: 40px 16px; color: var(--muted);
}
.empty .emoji { font-size: 38px; display: block; margin-bottom: 8px; }
.error-box { text-align: center; padding: 36px 16px; color: var(--muted); }
.error-box .btn { max-width: 200px; margin: 14px auto 0; min-height: 42px; }

/* 徽标 */
.badge {
  position: absolute; top: -4px; right: -8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 8px;
  font-size: 10px; line-height: 16px; text-align: center;
}
.dot-badge {
  position: absolute; top: 2px; right: 0;
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
}
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 20px; background: var(--soft); color: #7A6C52;
}
.tag-gold { background: rgba(201,162,75,.14); color: #94762E; }
.tag-red { background: rgba(192,57,43,.1); color: var(--red); }
.tag-green { background: rgba(111,168,108,.14); color: #4E7E4C; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; padding: 56px 26px 32px;
  display: flex; flex-direction: column;
}
.login-logo {
  width: 76px; height: 76px; margin: 0 auto 14px;
  border-radius: 22px; background: var(--red);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 40px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(192,57,43,.28);
}
.login-title { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 34px; }
.login-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 22px 18px; }
.field { margin-bottom: 14px; }
.field label { font-size: 13px; color: #6E6557; display: block; margin-bottom: 6px; }
.input-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px; min-height: 50px;
}
.input-box:focus-within { border-color: var(--gold); }
.input-box input { border: none; background: none; outline: none; flex: 1; min-width: 0; }
.code-btn { color: var(--red); font-size: 13px; font-weight: 600; white-space: nowrap; padding-left: 10px; border-left: 1px solid var(--line); min-height: 30px; }
.code-btn:disabled { color: #B9B0A0; }
.login-err {
  background: #FBEEEC; color: var(--red); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px; display: none;
}
.login-err.show { display: block; }
.dev-hint {
  margin-top: 14px; font-size: 12px; color: #94762E;
  background: rgba(201,162,75,.1); border-radius: 10px; padding: 8px 12px;
  text-align: center;
}
.login-foot { margin-top: auto; padding-top: 30px; text-align: center; font-size: 11px; color: #B6AD9E; }

/* ---------- 顶部 / 孩子切换 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250,246,238,.94); backdrop-filter: blur(8px);
  padding: 12px 14px 8px; max-width: 640px; margin: 0 auto;
}
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.brand-mini { font-weight: 800; letter-spacing: 1px; font-size: 16px; }
.brand-mini span { color: var(--red); }
.child-switch { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.child-switch::-webkit-scrollbar { display: none; }
.child-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1.5px solid transparent;
  border-radius: 30px; padding: 4px 13px 4px 5px; box-shadow: var(--shadow);
  font-size: 13px; font-weight: 600;
}
.child-chip.active { border-color: var(--red); }
.avatar {
  border-radius: 50%; background: var(--soft); color: #8A6E3A;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: 0 0 auto; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-28 { width: 28px; height: 28px; font-size: 13px; }
.avatar-44 { width: 44px; height: 44px; font-size: 18px; }
.avatar-60 { width: 60px; height: 60px; font-size: 24px; }

/* ---------- 首页 ---------- */
.hello { font-size: 13px; color: var(--muted); }
.child-card { display: flex; align-items: center; gap: 14px; }
.child-card .name { font-size: 19px; font-weight: 800; }
.child-card .cls { font-size: 12px; color: var(--muted); margin-top: 2px; }
.child-card .date-txt { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); }
.today-note {
  background: linear-gradient(135deg, #FFF7EA, #FFFDF7);
  border: 1px solid #F1E4C8;
}
.note-quote { font-size: 15px; line-height: 1.75; margin-top: 10px; }
.suggestion-box {
  margin-top: 10px; background: var(--bg); border-radius: 12px;
  padding: 10px 12px; font-size: 13px; color: #6E6557;
}
.suggestion-box b { color: var(--ink); }
.report-entry {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #FDF1EF, #FFFDF9);
  border: 1px solid #F0D7D2;
}
.report-entry .arrow { color: var(--red); font-size: 20px; }
.report-entry .t1 { font-weight: 700; font-size: 15px; }
.report-entry .t2 { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 任务反馈 */
.fb-box { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.fb-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.fb-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); padding: 10px 12px; min-height: 70px; resize: none; outline: none;
}
.fb-textarea:focus { border-color: var(--gold); }
.fb-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; background: var(--soft);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  position: relative;
}
.icon-btn.recording { background: #F6DAD6; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.fb-submit { margin-left: auto; min-height: 42px; padding: 0 22px; width: auto; font-size: 14px; }
.fb-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.fb-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; position: relative; }
.fb-thumb-x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  background: rgba(0,0,0,.55); color: #fff; border-radius: 50%;
  font-size: 11px; line-height: 18px; text-align: center;
}
.fb-done {
  background: rgba(111,168,108,.1); border-radius: 12px; padding: 10px 12px;
  font-size: 13px; color: #4E7E4C; margin-top: 10px;
}
.fb-done .imgs { display: flex; gap: 6px; margin-top: 8px; }
.fb-done img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }

/* ---------- 成长页 ---------- */
.segments {
  display: flex; background: var(--soft); border-radius: 12px;
  padding: 3px; margin-bottom: 14px;
}
.segment {
  flex: 1; text-align: center; padding: 8px 0; font-size: 14px;
  border-radius: 10px; color: #7A6C52; font-weight: 600; position: relative;
}
.segment.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(80,60,30,.1); }
.report-item .rtype { font-size: 12px; }
.report-item .rtitle { font-weight: 700; margin: 4px 0; }
.report-item .rdate { font-size: 12px; color: var(--muted); }
.report-item .arrow { color: #C9BCA2; }

.report-detail-head { display: flex; align-items: center; margin-bottom: 12px; }
.back-btn { font-size: 14px; color: var(--red); display: flex; align-items: center; gap: 2px; }
.report-detail-title { font-size: 18px; font-weight: 800; text-align: center; flex: 1; padding-right: 48px; }
.radar-wrap { width: 100%; height: 300px; }
.report-section h3 { font-size: 15px; margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
.report-section p { font-size: 14px; color: #444; white-space: pre-wrap; }
.term-actions { display: flex; gap: 10px; }
.term-actions .btn { min-height: 44px; font-size: 14px; }

.works-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.work-cell {
  border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: var(--shadow);
}
.work-cell img { width: 100%; height: 150px; object-fit: cover; background: var(--soft); }
.work-cell .cap { padding: 8px 10px 10px; font-size: 12.5px; line-height: 1.5; }
.diary-item .diary-date { font-size: 12px; color: var(--muted); }
.diary-item .diary-text { margin-top: 6px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.diary-item img { width: 100%; border-radius: 12px; margin-top: 10px; max-height: 300px; object-fit: cover; }

/* ---------- 问问 ---------- */
.qa-page { display: flex; flex-direction: column; height: 100vh; }
.qa-list { flex: 1; overflow-y: auto; padding: 14px 14px 8px; max-width: 640px; width: 100%; margin: 0 auto; }
.bubble { max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.7; word-break: break-word; white-space: pre-wrap; }
.bubble.ai { background: #fff; border-top-left-radius: 4px; box-shadow: var(--shadow); }
.bubble.me { background: var(--red); color: #fff; border-top-right-radius: 4px; margin-left: auto; }
.qa-row { display: flex; margin-bottom: 14px; }
.qa-row.me { justify-content: flex-end; }
.qa-tag { font-size: 10.5px; color: #B0A797; margin-top: 5px; }
.escalated-note {
  max-width: 88%; margin: 0 auto 14px; text-align: center;
  background: rgba(201,162,75,.12); color: #8A6E3A;
  border-radius: 12px; padding: 9px 12px; font-size: 13px;
}
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #C9BCA2; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
.qa-quick { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 8px; scrollbar-width: none; max-width: 640px; margin: 0 auto; width: 100%; }
.qa-quick::-webkit-scrollbar { display: none; }
.quick-chip {
  flex: 0 0 auto; font-size: 12.5px; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 7px 14px; color: #6E6557;
}
.qa-input-bar {
  position: sticky; bottom: 0; background: rgba(250,246,238,.96); backdrop-filter: blur(8px);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.qa-input-inner { display: flex; gap: 8px; align-items: flex-end; max-width: 640px; margin: 0 auto; }
.qa-input {
  flex: 1; border: 1px solid var(--line); border-radius: 22px; background: #fff;
  padding: 10px 14px; min-height: 42px; max-height: 90px; outline: none; resize: none;
}
.qa-send {
  width: 42px; height: 42px; border-radius: 50%; background: var(--red); color: #fff;
  font-size: 18px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.qa-send:disabled { background: #D9C9C3; }
.qa-disclaimer { text-align: center; font-size: 10.5px; color: #B6AD9E; padding-bottom: 4px; }
.qa-tab-body { height: 100vh; }

/* ---------- 我的 ---------- */
.me-child { display: flex; align-items: center; gap: 12px; }
.usage-num { font-size: 30px; font-weight: 800; }
.usage-num small { font-size: 13px; font-weight: 500; color: var(--muted); }
.usage-bars { display: flex; align-items: flex-end; gap: 7px; height: 72px; margin-top: 14px; }
.usage-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.usage-bar { width: 100%; max-width: 22px; background: linear-gradient(180deg, #D88B80, var(--red)); border-radius: 5px 5px 0 0; min-height: 3px; }
.usage-bar-label { font-size: 10px; color: var(--muted); }
.usage-bar-val { font-size: 9px; color: #A79E8F; }
.ctrl-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--soft); }
.ctrl-row:last-child { border-bottom: none; }
.ctrl-main { flex: 1; }
.ctrl-main .t { font-size: 14.5px; font-weight: 600; }
.ctrl-main .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.switch { width: 46px; height: 27px; border-radius: 15px; background: #D8CFC0; position: relative; transition: background .2s; flex: 0 0 auto; }
.switch.on { background: var(--red); }
.switch i {
  position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  background: #fff; border-radius: 50%; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch.on i { left: 22px; }
.slider-row { padding: 10px 0 4px; }
.slider-val { color: var(--red); font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--red); }
.me-link {
  display: flex; align-items: center; padding: 15px 2px;
  border-bottom: 1px solid var(--soft); font-size: 14.5px;
}
.me-link:last-child { border-bottom: none; }
.me-link .arrow { margin-left: auto; color: #C9BCA2; }
.me-status { font-size: 12px; margin-left: auto; margin-right: 8px; }
.logout-btn { margin-top: 8px; }

/* ---------- 同意书门 ---------- */
.gate-mask {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  overflow-y: auto; padding: 26px 20px calc(40px + env(safe-area-inset-bottom));
}
.gate-inner { max-width: 640px; margin: 0 auto; }
.gate-logo {
  width: 58px; height: 58px; border-radius: 18px; background: var(--red);
  color: #fff; font-size: 30px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.gate-title { font-size: 19px; font-weight: 800; text-align: center; }
.gate-ver { text-align: center; font-size: 12px; color: var(--muted); margin: 4px 0 18px; }
.consent-body { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.consent-body h4 { font-size: 14.5px; margin: 14px 0 6px; }
.consent-body h4:first-child { margin-top: 0; }
.consent-body p { font-size: 13.5px; color: #4A453D; line-height: 1.8; }
.consent-check { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; font-size: 13.5px; }
.consent-check input { margin-top: 3px; accent-color: var(--red); width: 17px; height: 17px; }
.revoke-banner {
  background: rgba(201,162,75,.12); color: #8A6E3A; border-radius: 12px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 14px; text-align: center;
}

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(43,34,22,.45); z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #fff; width: 100%; max-width: 640px;
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 82vh; overflow-y: auto;
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.modal-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.modal h3 { font-size: 17px; text-align: center; margin-bottom: 6px; }
.modal .modal-sub { text-align: center; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.modal .btn { margin-top: 10px; }
.modal .consent-body { box-shadow: none; padding: 4px 2px; }
.preview-mask {
  position: fixed; inset: 0; z-index: 95; background: rgba(20,15,8,.88);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.preview-mask .pv-close { color: #fff; font-size: 26px; align-self: flex-end; }
.preview-mask img { max-width: 100%; max-height: 70vh; border-radius: 12px; object-fit: contain; margin: 0 auto; }
.preview-cap { color: #F0E9DC; font-size: 13px; margin-top: 12px; max-width: 640px; width: 100%; margin-left: auto; margin-right: auto; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: rgba(43,34,22,.9); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 22px; z-index: 200; max-width: 80vw;
  text-align: center; animation: up .2s ease;
}
/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { max-width: 640px; margin: 0 auto; display: flex; }
.tab {
  flex: 1; padding: 7px 0 5px; text-align: center; font-size: 11px; color: #A99F8F;
  display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--red); font-weight: 600; }
