/* 星星瓶工作台 v2 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #FBF7EF; --card: #FFFFFF; --line: #E8DFCB; --line2: #D8C9A0;
  --text: #3B2F1A; --sub: #8A7A5C; --hint: #B3A582;
  --primary: #E0702A; --primary-d: #C25A1C; --danger: #E24B4A; --ok: #22C55E;
  --red-bg: #FCEBEB; --red-line: #E24B4A; --yellow: #FACC15; --blue: #3B82F6;
}
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }

/* 按钮（药丸） */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 16px; border-radius: 999px; font-size: 14px; transition: opacity .15s; white-space: nowrap; }
.btn:active { opacity: .75; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #F3EDDF; color: var(--text); border: 1px solid var(--line2); }
.btn-danger { background: #FCEBEB; color: #C0392B; border: 1px solid #F0B4B0; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.grow { flex: 1; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #FDF3E3, #F7E8D2); }
.login-card { background: #fff; padding: 36px 40px; border-radius: 20px; box-shadow: 0 8px 30px rgba(180, 140, 80, .15); text-align: center; width: 320px; }
.login-logo { margin-bottom: 8px; display: flex; justify-content: center; }
.login-logo-img { width: 84px; height: 84px; object-fit: cover; border-radius: 24px; box-shadow: 0 4px 14px rgba(180, 140, 80, .25); background: #FBF7EF; }
.login-card h1 { font-size: 18px; margin-bottom: 4px; }
.login-sub { color: var(--sub); font-size: 13px; margin-bottom: 18px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 10px; margin-bottom: 12px; outline: none; }
.login-card input:focus { border-color: var(--primary); }
.login-msg { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: 8px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 180px; background: #FDF6E9; border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; }
.logo-sm { font-size: 22px; }
.logo-sm-img { width: 30px; height: 30px; object-fit: cover; border-radius: 9px; }
.app-title { font-weight: 600; font-size: 15px; }
.side-tabs { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tab { text-align: left; padding: 10px 14px; border-radius: 10px; font-size: 14px; color: var(--sub); }
.tab:hover { background: #F3EDDF; color: var(--text); }
.tab.active { background: var(--primary); color: #fff; font-weight: 500; }
.tab-group { display: flex; flex-direction: column; gap: 2px; }
.tab-group-head { display: flex; align-items: center; gap: 4px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 10px; font-size: 14px; color: var(--text); background: transparent; border: none; cursor: pointer; font-weight: 500; }
.tab-group-head:hover { background: #F3EDDF; }
.tab-group-head .group-caret { margin-left: auto; font-size: 11px; color: var(--sub); transition: transform 0.2s ease; }
.tab-group-head[aria-expanded="false"] .group-caret { transform: rotate(-90deg); }
.tab-group-body { display: flex; flex-direction: column; gap: 2px; overflow: hidden; max-height: 300px; transition: max-height 0.25s ease, opacity 0.2s ease; opacity: 1; }
.tab-group-head[aria-expanded="false"] + .tab-group-body { max-height: 0; opacity: 0; }
.tab-sub { padding: 8px 14px 8px 30px; font-size: 13px; }
.tab-group-head.has-ico .group-caret { display: none; }
.side-foot { padding-top: 8px; }
.user-info { font-size: 12px; color: var(--sub); margin-bottom: 6px; padding: 6px 8px; background: #FBF7EF; border-radius: 8px; }
.user-info .badge { background: var(--primary); color: #fff; padding: 1px 7px; border-radius: 999px; font-size: 10px; }
.content { flex: 1 1 auto; padding: 16px 24px 60px; min-width: 0; max-width: calc(100vw - 220px); }
@media (max-width: 720px) { .content { max-width: 100%; } }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.topbar-left { display: flex; align-items: center; gap: 8px; }
.page-title { font-size: 20px; font-weight: 600; }
.badge { background: #F3EDDF; color: var(--sub); font-size: 12px; padding: 4px 10px; border-radius: 999px; margin-left: 8px; }

/* 工具栏 */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-label { font-weight: 600; min-width: 150px; text-align: center; }
.toolbar-summary { color: var(--sub); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line2); display: inline-block; }
.star-num { color: var(--primary); font-size: 16px; }

/* 卡片 */
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.step-head { font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.step-no { background: var(--primary); color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-tip { color: var(--sub); font-size: 12px; margin-bottom: 10px; }

/* 孩子卡片 */
.child-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.child-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.child-card.red { background: var(--red-bg); border-color: var(--red-line); }
.child-card .avatar { width: 40px; height: 40px; border-radius: 50%; background: transparent; display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; flex-shrink: 0; }
.child-card .avatar img { width: 100%; height: 100%; object-fit: contain; }
.child-info { flex: 1; min-width: 0; }
.child-name { font-weight: 600; }
.child-code { color: var(--sub); font-size: 12px; }
.child-side { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.chip { background: #F3EDDF; color: var(--sub); font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.chip.red-chip { background: var(--red-bg); color: #C0392B; border: 1px solid #F0B4B0; }
.chip.done { background: #EAF3DE; color: #4A7C10; }
.chip.away { background: #F1EFE8; color: #999; }
.redeem-btn { background: var(--primary); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 12px; }
.redeem-btn.done { background: #F1EFE8; color: #999; cursor: default; }
.btn-mini { padding: 4px 10px; border-radius: 999px; font-size: 11px; background: #F3EDDF; color: var(--text); border: 1px solid var(--line2); }
.btn-mini.red-btn { background: #F7C1C1; color: #7A1F1F; border-color: #E8A0A0; }
.btn-mini.ok-btn { background: #EAF3DE; color: #3B6D11; border-color: #C0DD97; }

/* 识别状态 / 预览 */
.rec-status { margin-top: 10px; font-size: 13px; color: var(--sub); min-height: 20px; }
.rec-status .model-tag { color: var(--primary); }
.photo-preview-wrap { margin-top: 10px; position: relative; display: inline-block; }
.photo-preview-wrap img { max-width: 100%; max-height: 200px; border-radius: 10px; border: 1px solid var(--line2); }
.photo-preview-wrap .btn { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; }

/* 频次分段 */
.freq-seg { display: inline-flex; background: #F3EDDF; border-radius: 999px; padding: 3px; margin-bottom: 14px; gap: 2px; }
.freq-seg .seg-btn { padding: 6px 16px; border-radius: 999px; font-size: 13px; color: var(--sub); }
.freq-seg .seg-btn.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 时段 chips */
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 6px 12px; border-radius: 999px; background: #F3EDDF; border: 1px solid var(--line2); font-size: 12px; }
.chip-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 数据区 */
.data-box { background: #FBF7EF; border-radius: 10px; padding: 12px; font-size: 13px; line-height: 1.8; color: var(--text); }
.data-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.data-row:last-child { border-bottom: none; }
.bar-track { height: 10px; background: #F1EFE8; border-radius: 5px; overflow: hidden; display: flex; }
.bar-seg { height: 100%; }
.empty-tip { text-align: center; color: var(--hint); padding: 30px 10px; font-size: 13px; }
.saved-tip { color: var(--ok); font-size: 12px; }
.talk-box { margin-top: 12px; background: #FFFDF7; border: 1px solid var(--line2); border-radius: 10px; padding: 12px; }
.talk-text { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 5px; }
.input, .select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 10px; outline: none; background: #fff; }
.input:focus, .select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; }
.row-between { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.checkbox { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* 图表 */
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.chart-title { font-weight: 600; }
.chart-canvas { overflow-x: auto; }
.chart-empty { color: var(--hint); text-align: center; padding: 30px; font-size: 13px; }
.chart-note { color: var(--sub); font-size: 12px; margin-top: 8px; line-height: 1.6; }
.chart-detail { margin-top: 10px; }
/* 饼图色块 */
.pie-legend { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.pie-legend-cell { display: flex; align-items: center; gap: 6px; background: #fff; border: 2px solid #ccc; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; transition: transform .12s ease; }
.pie-legend-cell:hover { transform: translateY(-1px); }
.pie-legend-cell.active { background: #FFF8E1; box-shadow: 0 2px 6px rgba(180,140,70,.2); }
.pie-color-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.pie-cnt { color: var(--sub); font-size: 11px; font-weight: 600; padding: 1px 6px; background: #F3EDDF; border-radius: 8px; }
.pie-slice { transition: filter .12s ease; }
.pie-slice.active { filter: brightness(1.08) saturate(1.15); }
/* 饼图色块下孩子列表 */
.pie-kids { margin-top: 8px; }
.pie-kids-title { font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 8px; }
.pie-kids-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.pie-kid-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #FBF7EF; border-radius: 8px; border: 1px solid var(--line); }
.pie-kid-info { font-size: 12.5px; color: var(--text); }

/* 弹层 */
.modal { position: fixed; inset: 0; background: rgba(60, 45, 20, .4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-card { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; }
.modal-title { font-weight: 600; font-size: 15px; }
.modal-close { font-size: 20px; color: var(--sub); padding: 0 4px; }
.modal-body { padding: 14px 18px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 0 18px 16px; }
.photo-pick { display: flex; align-items: center; gap: 8px; }
.photo-preview { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line2); }

/* toast */
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: rgba(40, 30, 15, .88); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 13px; z-index: 99; }

/* 移动端 */
/* 移动端顶栏出门按钮在 PC 端隐藏，手机端显示 */
#logoutBtnMobile { display: none; }
#navToggleBtn { display: none; }
.nav-mask { display: none; }

@media (max-width: 720px) {
  /* sidebar 改为左侧抽屉，点 navToggleBtn 滑入，点 tab 自动收起 */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 220px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 60;
    box-shadow: 2px 0 12px rgba(0,0,0,.08);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-mask {
    display: block;
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.25);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .nav-mask.show { opacity: 1; pointer-events: auto; }
  #navToggleBtn { display: inline-flex; align-items: center; justify-content: center; padding: 6px 8px; border-radius: 8px; background: #FBF7EF; border: 1px solid var(--line); }
  /* 手机端首页总览字号缩小，跟汉堡按钮贴紧 */
  .topbar-left { gap: 6px; }
  .page-title { font-size: 16px; }
  .content { padding: 12px 14px 24px; max-width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  #logoutBtnMobile { display: inline-flex; }
}

/* ===== v2.1 新增样式 ===== */
.overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.ov-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.ov-card.red-tint { background: var(--red-bg); border-color: var(--red-line); }
.ov-num { font-size: 26px; font-weight: 600; color: var(--text); }
.red-tint .ov-num { color: #C0392B; }
.ov-label { font-size: 12px; color: var(--sub); margin-top: 2px; }
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; }

.entry-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.entry-tab { padding: 8px 18px; border-radius: 999px; background: #F3EDDF; color: var(--sub); font-size: 13px; }
.entry-tab.active { background: var(--primary); color: #fff; font-weight: 500; }
.entry-panel { }

.date-picker-btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line2); font-size: 14px; font-weight: 600; }
.date-picker-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .cal-week { font-size: 11px; color: var(--hint); text-align: center; padding: 4px 0; }
.cal-grid .cal-day { text-align: center; padding: 8px 0; border-radius: 8px; font-size: 13px; cursor: pointer; }
.cal-grid .cal-day:hover { background: #F3EDDF; }
.cal-grid .cal-day.selected { background: var(--primary); color: #fff; font-weight: 600; }
.cal-grid .cal-day.today { border: 1px solid var(--primary); }
.cal-grid .cal-day.empty { cursor: default; }
.cal-grid .cal-day.empty:hover { background: none; }

.rec-edit-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rec-edit-row { display: flex; align-items: center; gap: 8px; background: #FBF7EF; border-radius: 10px; padding: 8px 10px; }
.rec-edit-row .child-label { min-width: 70px; font-weight: 500; }
.rec-edit-row input { width: 56px; text-align: center; padding: 5px; border: 1px solid var(--line2); border-radius: 8px; }
.rec-edit-row .conf-badge { font-size: 11px; color: var(--ok); margin-left: auto; }
.manual-stars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.reward-shelf { display: flex; flex-wrap: wrap; gap: 8px; }
.reward-card { border: 1px solid var(--line2); background: #fff; border-radius: 12px; padding: 12px 14px; min-width: 100px; text-align: center; cursor: pointer; }
.reward-card:hover { border-color: var(--primary); }
.reward-card.active { border-color: var(--primary); background: #FFF3E8; }
.reward-card .rw-emoji { font-size: 26px; }
.reward-card .rw-name { font-size: 12px; margin-top: 4px; }
.reward-edit-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.reward-edit-row:last-child { border-bottom: none; }

.voucher { margin-top: 14px; text-align: center; }
.voucher-card { border: 2px dashed var(--primary); border-radius: 14px; padding: 18px; background: #FFFDF7; margin-bottom: 10px; }
.voucher-card .voucher-name { font-size: 20px; font-weight: 600; margin: 6px 0; }
.voucher-card .voucher-reward { color: var(--primary); font-size: 15px; font-weight: 500; }
.voucher-card .voucher-date { color: var(--hint); font-size: 12px; margin-top: 4px; }

#tab-settings .step-tip { line-height: 1.7; }
@media (max-width: 720px) { .overview-grid { grid-template-columns: repeat(2, 1fr); } .manual-stars { grid-template-columns: 1fr; } }

/* ===== 家园沟通弹层修复 ===== */
.freq-seg .seg-btn:focus { outline: none; }
.freq-seg .seg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 1px 4px rgba(224, 112, 42, .25); }
.entry-tab:focus { outline: none; }
.talk-history { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.talk-history .th-title { font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.talk-row { background: #FBF7EF; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px; }
.talk-row .meta { color: var(--hint); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.talk-row .meta .badge { background: var(--primary); color: #fff; padding: 1px 6px; border-radius: 999px; font-size: 10px; }
.talk-row .body { color: var(--text); white-space: pre-wrap; line-height: 1.6; max-height: 80px; overflow-y: auto; }
.talk-row .ops { display: flex; gap: 6px; margin-top: 4px; }
textarea.talk-edit { min-height: 110px; resize: vertical; line-height: 1.7; font-size: 14px; }

/* ===== 家园沟通 v2 样式 ===== */
.struct-box { background: #FFF8EC; border: 1px solid #F0DFC0; border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 2; }
.struct-box .struct-item b { color: var(--primary); }
.listen-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.listen-pick { background: #FBF7EF; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: 12px; }
.listen-pick:hover { border-color: var(--primary); }
.listen-pick.selected { border-color: var(--primary); background: #FFF3E8; }
.listen-pick .lp-meta { color: var(--hint); display: flex; gap: 6px; align-items: center; margin-bottom: 3px; }
.listen-pick .lp-body { line-height: 1.6; white-space: pre-wrap; }
.listen-pick .lp-support { color: var(--ok); }
.talk-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.talk-summary-row:last-child { border-bottom: none; }

/* ===== 沟通记录可展开卡片 ===== */
.talk-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; transition: border-color .15s; }
.talk-card.open { background: #FFFDF7; border-color: var(--primary); }
.talk-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.talk-card-head .badge { background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.talk-card-head .meta-date { color: var(--sub); font-size: 12px; }
.talk-card-head .meta-model { color: var(--hint); font-size: 11px; }
.talk-card-body { font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.talk-card:not(.open) .talk-card-body { max-height: 60px; overflow: hidden; position: relative; }
.talk-card:not(.open) .talk-card-body::after { content: '...'; position: absolute; right: 0; bottom: 0; background: linear-gradient(to right, transparent, #fff 30%); padding-left: 18px; color: var(--hint); }
.talk-card-ops { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ===== 扭蛋神秘箱 ===== */
.mystery-box { text-align: center; padding: 18px; background: linear-gradient(135deg, #FFF3E8, #FDEDF3); border-radius: 14px; border: 1px dashed var(--primary); }
.mystery-box .rw-emoji { font-size: 40px; }
.mystery-box .rw-tip { font-size: 15px; font-weight: 600; color: var(--primary); margin-top: 6px; }
.mystery-box .rw-sub { font-size: 12px; color: var(--sub); margin-top: 4px; }

/* ===== 底板网格 ===== */
.board-grid { display: grid; gap: 8px; padding: 8px; background: #FBF7EF; border-radius: 10px; }
.board-cell { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; min-height: 94px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.board-cell.empty { background: #F1EFE8; border-style: dashed; color: var(--hint); justify-content: center; }
.board-cell .cell-pos { font-size: 10px; color: var(--hint); font-weight: 600; display: flex; flex-direction: column; line-height: 1.35; }
.board-cell .cell-pos .cell-pos-line { display: block; }
.board-cell .cell-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: transparent; display: flex; align-items: center; justify-content: center; }
.board-cell .cell-avatar img { width: 100%; height: 100%; object-fit: contain; }
.board-cell .cell-nick { font-size: 11px; font-weight: 500; }
.board-cell .cell-empty-tag { font-size: 10px; }

/* ===== 学期日历标记 ===== */
.cal-day { position: relative; }
.cal-tag { position: absolute; top: 1px; right: 2px; font-size: 9px; line-height: 1; background: var(--primary); color: #fff; border-radius: 3px; padding: 1px 3px; font-weight: 600; }
.cal-day.holiday { background: #FDECEA; color: #C0392B; }
.cal-day.holiday .cal-tag { background: #C0392B; }
.cal-day.weekend { background: #F4F1EA; color: var(--hint); }
.cal-day.special .cal-tag { background: #2E86C1; }
.cal-day.workday { background: #FFF8E1; color: #B8860B; font-weight: 500; }
.cal-day.workday .cal-tag { background: #B8860B; }
.cal-day.selected .cal-tag { background: #fff; color: var(--primary); }
.cal-sem { margin-top: 10px; font-size: 12px; color: var(--sub); background: #FFF8EC; border: 1px solid #F0DFC0; border-radius: 8px; padding: 8px 10px; line-height: 1.6; }
.cal-sem b { color: var(--primary); }
.cal-legend { margin-top: 8px; display: flex; gap: 14px; font-size: 11px; color: var(--sub); }
.cal-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.cal-legend .dot.holiday { background: #FDECEA; border: 1px solid #C0392B; }
.cal-legend .dot.weekend { background: #F4F1EA; border: 1px solid #c9c3b5; }
.cal-legend .dot.special { background: #2E86C1; }
.cal-legend .dot.workday { background: #FFF8E1; border: 1px solid #B8860B; }

/* ===== 贴纸选择/删除 ===== */
.sticker-ops { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sticker-ops label.btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sticker-ops label.btn:hover { border-color: var(--primary); color: var(--primary); }
.photo-preview { display: block; margin-top: 8px; width: 90px; height: 90px; object-fit: contain; border-radius: 50%; border: 1px solid var(--line2); background: transparent; }
.photo-preview.hidden { display: none; }

/* ===== 云端图标 + 抽屉 ===== */
.cloud-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); background: #fff; color: var(--primary); cursor: pointer; }
.cloud-btn:hover { background: #FFF8EC; border-color: var(--primary); }
.sync-dot { position: absolute; bottom: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; }
.sync-dot.online { background: #4A7C10; }
.sync-dot.syncing { background: #F0A020; }
.sync-dot.offline { background: #999; }

.drawer { position: fixed; inset: 0; z-index: 80; display: flex; }
.drawer.hidden { display: none; }
.drawer-mask { position: absolute; inset: 0; background: rgba(60, 45, 20, .35); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 460px; max-width: 92vw; background: #FFFDF7; box-shadow: -6px 0 30px rgba(120, 90, 40, .18); display: flex; flex-direction: column; animation: slideIn .22s ease-out; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; border-bottom: 1px solid var(--line2); }
.drawer-title { font-size: 16px; font-weight: 600; color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px; }
.drawer-foot { padding: 10px 14px 14px; border-top: 1px solid var(--line2); display: flex; justify-content: flex-end; }
.drawer-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.drawer-card.sync-card { background: #F1F8E9; border-color: #C5E1A5; }
.drawer-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; }
.drawer-card-body { font-size: 13px; color: var(--text); line-height: 1.6; }
.drawer-card-body .empty-tip { color: var(--hint); font-size: 12px; text-align: center; padding: 6px 0; }
.sync-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; }
.sync-label { color: var(--sub); }
.sync-time { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.sync-desc { color: var(--sub); font-size: 11.5px; margin-top: 6px; line-height: 1.5; }
.model-group-title { font-size: 12px; color: var(--sub); margin-bottom: 5px; }
.models-list .model-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; border-bottom: 1px dashed var(--line); }
.models-list .model-row:last-child { border-bottom: none; }
.model-rank { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #F3EDDF; color: var(--sub); font-size: 11px; font-weight: 600; flex-shrink: 0; }
.model-rank.primary { background: var(--primary); color: #fff; }
.model-name { flex: 1; font-family: -apple-system, monospace; color: var(--text); word-break: break-all; }
.model-note { color: var(--hint); font-size: 11px; flex-shrink: 0; }
.login-device-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px dashed var(--line); }
.login-device-row:last-child { border-bottom: none; }
.login-device-row.current { background: #E3F2FD; border-radius: 8px; border-bottom-color: transparent; }
.login-device-icon { width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.login-device-info { flex: 1; min-width: 0; }
.login-device-name { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.login-device-meta { font-size: 11px; color: var(--hint); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cur-badge { background: #1976D2; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
.login-user { background: #F0EBDD; color: var(--sub); font-size: 10px; padding: 1px 6px; border-radius: 8px; }
.link-del { color: #C0392B; background: none; border: none; padding: 0 2px; font-size: 11px; cursor: pointer; text-decoration: underline; }
.link-del:hover { opacity: .75; }
/* 改色弹窗的色卡 */
.color-cards { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.color-card { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; transition: border-color .12s ease, background .12s ease; }
.color-card:hover { border-color: #C9B68A; }
.color-card.active { border-color: #B8860B; background: #FFF8E1; box-shadow: 0 2px 6px rgba(180,140,70,.18); }
.color-card .color-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.color-card .color-name { font-weight: 600; color: var(--text); flex-shrink: 0; min-width: 96px; }
.color-card .color-desc { font-size: 12px; color: var(--hint); margin-left: auto; }

/* 云端同步状态指示 dot 过渡 */
.sync-dot { transition: background .25s ease; }
.badge { transition: background .25s ease, color .25s ease; }

/* 云端数据统计 #25 */
.db-stats-grid { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.db-stat-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: #FBF7EF; border-radius: 6px; font-size: 13px; }
.db-stat-name { color: var(--text); font-weight: 500; }
.db-stat-count { color: #B8860B; font-weight: 600; min-width: 38px; text-align: right; }


/* 每周家长交流话术弹窗 */
.modal-card-lg { max-width: 640px; }
.weekly-emotion-box { background: #FBF7EF; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.weekly-emotion-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.weekly-emotion-stats .em-chip { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.weekly-listen-options { max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.weekly-listen-opt { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.weekly-listen-opt:hover { background: #FAF8F2; }
.weekly-listen-opt.selected { background: #FFF8E1; }
.weekly-listen-opt input { margin-top: 3px; flex-shrink: 0; }
.weekly-listen-opt .wl-date { color: var(--sub); font-weight: 500; min-width: 76px; flex-shrink: 0; }
.weekly-listen-opt .wl-text { color: var(--text); flex: 1; line-height: 1.5; }
.weekly-listen-picked { margin-top: 8px; }
.weekly-listen-chip { font-size: 12px; color: var(--sub); padding: 4px 8px; background: #FBF7EF; border-radius: 6px; margin-bottom: 4px; }
.talk-history-list { margin-top: 10px; }
.talk-history-row { padding: 8px 10px; background: #FAF8F2; border-radius: 8px; margin-bottom: 6px; font-size: 13px; color: var(--sub); }
.talk-history-summary { font-size: 12px; color: var(--text); margin-top: 4px; line-height: 1.5; }
.btn.disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }


.device-foot { margin-top: 6px; font-size: 11px; color: var(--hint); line-height: 1.5; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-cell { background: #FAF8F2; border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.action-cell:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(180,140,70,.14); }
.action-cell.action-warn { background: #FFEBEE; border-color: #FFCDD2; }
.action-main { font-size: 12.5px; color: var(--text); font-weight: 500; }
.action-sub { font-size: 10.5px; color: var(--hint); text-align: center; }
@media (max-width: 768px) { .drawer-panel { width: 92vw; } .action-grid { grid-template-columns: 1fr 1fr; } }
