/* 爱宝喂养台 · 管理端 —— 设计令牌沿用 docs/03-界面设计 L9-L18 */
:root {
  --paper: #FBF9F4;
  --paper-deep: #F3EEE3;
  --card: #FFFFFF;
  --cocoa: #33261F;
  --cocoa-2: #6B5B4F;
  --line: #E7DFCE;
  --butter: #E8A23C;
  --honey: #A9721C;
  --pea: #7A9461;
  --pea-deep: #546B3E;
  --blue: #8FB4CE;
  --blue-deep: #4F7898;
  --clay: #C26D4D;
  --clay-deep: #9E4E30;
  --radius: 14px;
  --p-paper: #FFFDF9;
  --p-line: #EDE5D4;
  --p-ink: #3A2C24;
  --p-sub: #9C8D7E;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--paper);
  color: var(--cocoa);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.8;
}
a { text-decoration: none; color: inherit; }

/* 布局：左侧栏 + 主区 */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 200px;
  flex: none;
  background: var(--cocoa);
  color: #C9BBA9;
  padding: 18px 12px;
  font-size: 13px;
}
.side-title {
  color: #FBF7EE;
  font-weight: 800;
  font-size: 14.5px;
  padding: 0 10px 12px;
  border-bottom: 1px solid rgba(247, 241, 230, 0.15);
  margin-bottom: 10px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { padding: 9px 10px; border-radius: 8px; }
.nav-item:hover { color: #FBF7EE; }
.nav-on {
  background: rgba(232, 162, 60, 0.22);
  color: #FBF7EE;
  font-weight: 700;
  border-left: 3px solid var(--butter);
}
.main { flex: 1; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }

/* 顶行 */
.top-row { display: flex; align-items: center; justify-content: space-between; }
.page-title { font-size: 18px; font-weight: 800; }
.select-box {
  background: #FBF8F1;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--cocoa-2);
  padding: 6px 14px;
}

/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  background: var(--card);
  border: 1px solid var(--p-line);
  border-radius: 11px;
  padding: 14px 16px;
}
.kpi .kt { font-size: 12px; color: var(--p-sub); }
.kpi .kn { font-family: Georgia, serif; font-size: 26px; font-weight: 700; }
.kpi .kd { font-size: 11.5px; color: var(--pea-deep); font-weight: 700; }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--p-line);
  border-radius: 11px;
  padding: 14px 18px;
}
.card h5 { font-size: 13.5px; margin-bottom: 10px; color: var(--cocoa); }
.row-flex { display: flex; gap: 14px; align-items: stretch; }

/* 趋势柱 */
.trend-bars { display: flex; align-items: flex-end; gap: 14px; height: 120px; }
.trend-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.trend-bar { width: 100%; border-radius: 6px 6px 0 0; background: var(--butter); opacity: 0.9; }
.trend-bar.bar-today { background: var(--pea); opacity: 1; }
.trend-x { display: flex; gap: 14px; margin-top: 6px; }
.trend-x span { flex: 1; text-align: center; font-size: 11px; color: var(--p-sub); }

/* 待办 */
.todo-li {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--cocoa-2);
  padding: 7px 0;
  border-bottom: 1px dashed #F0E9D9;
}
.todo-li:last-child { border-bottom: none; }
.todo-time { margin-left: auto; color: #C9BFA9; }

/* 徽标 */
.mini-pill { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 700; flex: none; }
.mp-ok { background: #E9F0E3; color: var(--pea-deep); }
.mp-warn { background: #F4E8D2; color: var(--honey); }
.mp-risk { background: #F5E3DA; color: var(--clay-deep); }
.mp-info { background: #E4EDF3; color: var(--blue-deep); }

/* 工具行与表格 */
.tool-row { display: flex; gap: 10px; }
.search-input {
  flex: 1;
  background: #FBF8F1;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--p-sub);
  padding: 7px 14px;
}
.btn {
  background: var(--cocoa);
  color: #FBF7EE;
  border-radius: 8px;
  font-size: 12.5px;
  padding: 7px 16px;
  display: inline-block;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.btn.light { background: #fff; color: var(--cocoa); border: 1px solid var(--cocoa); }
.btn.mini { padding: 3px 12px; font-size: 11.5px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left;
  color: var(--p-sub);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--p-line);
  font-size: 12px;
  white-space: nowrap;
}
td { padding: 8px; border-bottom: 1px solid #F4EFE3; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.tbl-foot {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--p-sub);
}
.tbl-foot .note { margin-left: auto; }

/* 参数输入 */
.param-input {
  background: #FBF8F1;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--cocoa);
  padding: 4px 12px;
}
.template-box {
  background: #FBF8F1;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--cocoa-2);
  display: flex;
  align-items: center;
}

/* 合规工单 */
.case-li,
.announce-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--cocoa-2);
  padding: 8px 0;
  border-bottom: 1px dashed #F0E9D9;
}
.case-li:last-child,
.announce-row:last-child { border-bottom: none; }
.case-ops { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.case-wait { color: #C9BFA9; font-size: 12px; }

/* 占位页 */
.placeholder {
  margin: 60px auto;
  max-width: 420px;
  text-align: center;
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 32px;
}
.placeholder h3 { font-size: 18px; margin-bottom: 8px; }
.placeholder p { font-size: 13px; color: var(--cocoa-2); margin-bottom: 20px; }
.back-home {
  display: inline-block;
  background: var(--cocoa);
  color: #FBF7EE;
  border-radius: 999px;
  padding: 8px 26px;
  font-size: 13px;
  font-weight: 600;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding: 16px 0 22px;
  font-size: 12px;
  color: var(--cocoa-2);
  display: flex;
  gap: 14px;
}

/* ===== T-UI-CORE 公共层（Task 2+）===== */
/* 登录页 */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(160deg, #F3EEE3 0%, #FBF9F4 55%, #F6EFDD 100%);
}
.login-box { width: 392px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 34px 36px 28px; box-shadow: 0 18px 50px rgba(51,38,31,.12); }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-logo { width: 52px; height: 52px; border-radius: 16px; background: var(--butter); color: #3A2C24; font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.login-brand b { font-size: 17px; }
.login-brand p { font-size: 12px; color: var(--p-sub); margin-top: 2px; }
.login-fld { margin-bottom: 13px; }
.login-fld label { display: block; font-size: 12px; color: var(--cocoa-2); font-weight: 700; margin-bottom: 5px; }
.login-fld input { width: 100%; background: #FBF8F1; border: 1px solid var(--p-line); border-radius: 9px; font-size: 13.5px; padding: 9px 13px; font-family: inherit; color: var(--cocoa); outline: none; }
.login-fld input:focus { border-color: var(--butter); background: #fff; }
.login-btn { width: 100%; background: var(--cocoa); color: #FBF7EE; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; padding: 11px; cursor: pointer; font-family: inherit; margin-top: 6px; }
.login-btn:hover { background: #45362C; }
.login-btn:disabled { opacity: .6; cursor: wait; }
.login-err { display: none; background: #F5E3DA; color: var(--clay-deep); font-size: 12px; border-radius: 8px; padding: 7px 12px; margin-bottom: 12px; }
.login-err.show { display: block; }
.login-foot { text-align: center; font-size: 11px; color: var(--p-sub); margin-top: 14px; line-height: 1.7; }

/* toast / modal */
.wb-toast { position: fixed; top: 26px; left: 50%; transform: translateX(-50%) translateY(-8px); background: var(--cocoa); color: #FBF7EE; font-size: 13px; border-radius: 999px; padding: 9px 22px; opacity: 0; transition: all .25s; z-index: 60; pointer-events: none; box-shadow: 0 10px 30px rgba(42,35,32,.35); }
.wb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.wb-modal-mask { position: fixed; inset: 0; background: rgba(42,35,32,.44); display: none; align-items: center; justify-content: center; z-index: 50; }
.wb-modal-mask.show { display: flex; }
.wb-modal { width: 430px; max-height: 80vh; overflow: auto; background: #fff; border-radius: 16px; padding: 22px 24px; box-shadow: 0 24px 60px rgba(42,35,32,.3); }
.wb-modal h4 { font-size: 15px; margin-bottom: 8px; }
.wb-modal #wb-modal-text { font-size: 12.5px; color: var(--cocoa-2); line-height: 1.75; }
.wb-modal-ops { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

/* 侧栏分组/子项/用户框 */
.side-nav .nav-group { font-size: 10.5px; color: #8A7B69; padding: 9px 10px 3px; letter-spacing: 1px; }
.side-nav .nav-item.nav-sub { padding-left: 26px; font-size: 12.5px; position: relative; }
.side-nav .nav-item.nav-sub::before { content: '└'; position: absolute; left: 12px; color: #8A7B69; font-size: 12px; }
.side-user { border-top: 1px solid rgba(247,241,230,.15); margin-top: 10px; padding: 10px 8px 2px; display: flex; align-items: center; gap: 9px; }
.side-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--butter); color: #3A2C24; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.side-un { font-size: 12.5px; color: #FBF7EE; font-weight: 700; line-height: 1.3; }
.side-un small { display: block; font-size: 10px; color: #A99A85; font-weight: 400; }
.side-logout { margin-left: auto; font-size: 11px; color: #C9BBA9; border: 1px solid rgba(247,241,230,.25); border-radius: 7px; padding: 3px 9px; cursor: pointer; }
.side-logout:hover { color: #FBF7EE; border-color: #FBF7EE; }

/* 骨架屏 / 错误条 / 空态 */
.skl { position: relative; overflow: hidden; background: #F1ECE3; border-radius: 6px; color: transparent !important; user-select: none; min-height: 14px; }
.skl::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: wb-shimmer 1.4s infinite; }
@keyframes wb-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.wb-error { background: #F5E3DA; border: 1px solid #EBC9BC; color: var(--clay-deep); border-radius: 10px; padding: 12px 16px; font-size: 13px; display: flex; align-items: center; gap: 12px; }
.wb-empty { text-align: center; padding: 34px 0; color: var(--p-sub); font-size: 13px; }

/* KPI 环比色（Task 3） */
.kd-up { color: var(--pea-deep); }
.kd-down { color: var(--clay-deep); }
.kd-flat { color: var(--cocoa-2); }
.kd-mut { color: var(--p-sub); }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--pea-deep); font-weight: 700; background: #E9F0E3; border-radius: 999px; padding: 3px 11px; }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--pea); animation: wb-pulse 1.8s infinite; }
@keyframes wb-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.trend-mini { margin-left: auto; font-size: 11px; color: var(--p-sub); font-weight: 400; }

/* 多家庭 pill + 分页按钮（Task 4） */
.fam-pills { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.fam-pill { display: inline-flex; align-items: center; gap: 6px; background: #FBF8F1; border: 1px solid var(--p-line); border-radius: 999px; padding: 1px 10px 1px 8px; font-size: 11.5px; white-space: nowrap; }
.fam-pill .fr { font-size: 10px; color: var(--p-sub); }
.fam-pill.multi { border-color: var(--butter); background: #FDF6E9; }
.pager { margin-left: auto; display: flex; gap: 5px; align-items: center; }
.pager button { min-width: 27px; height: 27px; border-radius: 7px; border: 1px solid var(--p-line); background: #fff; color: var(--cocoa-2); font-size: 12px; cursor: pointer; font-family: inherit; }
.pager button.on { background: var(--cocoa); color: #FBF7EE; border-color: var(--cocoa); font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* kv 键值行 + mp-mut（Task 5） */
.kv { display: flex; gap: 10px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed #F0E9D9; align-items: baseline; }
.kv:last-child { border-bottom: none; }
.mp-mut { background: #F1ECE3; color: var(--cocoa-2); }

/* bar-row（Task 6 画像） */
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 5px 0; }
.bar-row .bl { width: 84px; color: var(--cocoa-2); flex: none; }
.bar-row .bt { flex: 1; height: 16px; background: var(--paper-deep); border-radius: 8px; overflow: hidden; }
.bar-row .bf { height: 100%; border-radius: 8px; }
.bar-row .bv { width: 88px; text-align: right; color: var(--cocoa); flex: none; font-weight: 700; }

/* 话术变量（Task 9） */
.say-text { white-space: normal; min-width: 260px; color: var(--cocoa); }
.var-chip { display: inline-block; background: #FDF6E9; border: 1px dashed var(--butter); color: var(--honey); border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 800; font-family: Consolas, monospace; margin: 0 1px; }
.var-btn { display: inline-flex; align-items: center; background: #FBF8F1; border: 1px solid var(--p-line); border-radius: 999px; padding: 2px 11px; font-size: 11.5px; font-weight: 700; color: var(--honey); cursor: pointer; margin: 0 6px 6px 0; font-family: Consolas, monospace; }
.var-btn:hover { border-color: var(--butter); background: #FDF6E9; }
.var-code { font-family: Consolas, monospace; background: #FDF6E9; border-radius: 5px; padding: 0 5px; color: var(--honey); font-weight: 700; font-size: 11.5px; }
.say-preview { background: var(--paper-deep); border: 1px dashed var(--p-line); border-radius: 9px; padding: 9px 13px; font-size: 12.5px; color: var(--cocoa); line-height: 1.8; margin-top: 8px; }
.say-preview .pv-label { font-size: 10.5px; color: var(--p-sub); font-weight: 800; display: block; margin-bottom: 2px; }
.tp-pill { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; font-weight: 700; white-space: nowrap; display: inline-block; }
.tp-all { background: #F1ECE3; color: var(--cocoa-2); }
.tp-day { background: #F4E8D2; color: var(--honey); }
.tp-night { background: #E4EDF3; color: var(--blue-deep); }

/* 数据查询 tabs（Task 10） */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--p-line); flex-wrap: wrap; }
.tab-btn { border: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--cocoa-2); padding: 9px 15px; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tab-btn.on { color: var(--cocoa); font-weight: 800; border-bottom-color: var(--butter); }
.dq-pane { display: none; }
.dq-pane.on { display: block; }
.kpi .kn small { font-size: 12px; font-family: inherit; color: var(--cocoa-2); font-weight: 400; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--cocoa-2); margin-top: 8px; flex-wrap: wrap; }

/* 前成员家庭 pill（用户列表：被移除/解散移出的历史归属，2026-10-10） */
.fam-pill.former { background: #F6F4EF; border-style: dashed; color: var(--p-sub); }
.fam-pill.former .fr { color: #B7A895; }

/* ===== 帮我写文案分区（心情文案 × 成长之路打卡，specs/2026-10-12，纯追加） ===== */
/* 双大 Tab */
.big-tabs { display: flex; gap: 10px; align-items: stretch; }
.big-tab { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; border: 1.5px solid var(--p-line); background: var(--card); cursor: pointer; transition: all .15s; }
.big-tab .bt-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; flex: none; }
.big-tab .bt-name { font-size: 15px; font-weight: 800; }
.big-tab .bt-desc { font-size: 11.5px; color: var(--p-sub); }
.big-tab .bt-count { margin-left: auto; font-size: 12px; color: var(--p-sub); font-weight: 700; white-space: nowrap; }
.big-tab.on { border-color: var(--butter); background: #FFFDF6; box-shadow: 0 2px 10px rgba(232, 162, 60, .12); }
.big-tab.on .bt-name { color: var(--honey); }
.bt-heart { background: #F5E3DA; color: var(--clay-deep); }
.bt-road { background: #F4E8D2; color: var(--honey); }

/* 段卡片（徽章之路七段：段色经行内 --sc/--sc-deep/--sc-tint 变量注入） */
.stage-card { background: var(--card); border: 1px solid var(--p-line); border-left: 4px solid var(--sc, var(--butter)); border-radius: 12px; overflow: hidden; }
.stage-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: linear-gradient(90deg, var(--sc-tint, #F4E8D2), #fff 70%); cursor: pointer; }
.stage-char { width: 38px; height: 38px; border-radius: 50%; background: var(--sc, var(--butter)); color: #FFFDF6; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; flex: none; box-shadow: inset 0 0 0 2.5px rgba(255, 253, 246, .4), 0 1px 4px rgba(51, 38, 31, .18); }
.stage-meta { min-width: 0; }
.stage-name { font-size: 15px; font-weight: 800; }
.stage-name .st-range { font-size: 11.5px; color: var(--p-sub); font-weight: 600; margin-left: 8px; }
.stage-theme { font-size: 12px; color: var(--cocoa-2); }
.stage-side { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--p-sub); white-space: nowrap; }
.stage-fold { font-size: 12px; color: var(--p-sub); transition: transform .15s; }
.stage-card.folded .stage-fold { transform: rotate(-90deg); }
.stage-body { padding: 6px 18px 14px; border-top: 1px dashed var(--p-line); }
.stage-card.folded .stage-body { display: none; }

/* 段内里程碑小节 */
.ms-block { padding: 8px 0 4px; border-bottom: 1px dashed #F0E9D9; }
.ms-block:last-child { border-bottom: none; }
.ms-block-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--sc-deep, var(--honey)); padding: 3px 0; }
.ms-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc, var(--butter)); flex: none; }
.ms-block-head .ms-sub { font-weight: 600; font-size: 11px; color: var(--p-sub); }

/* 文案行 */
.copy-row { display: flex; align-items: center; gap: 10px; padding: 5px 0 5px 16px; font-size: 12.5px; }
.copy-row .cr-text { flex: 1; white-space: normal; color: var(--cocoa); min-width: 0; }
.copy-row.pending .cr-text { color: var(--honey); }
.copy-row .cr-meta { font-size: 11px; color: var(--p-sub); white-space: nowrap; }
.copy-row .cr-ops { white-space: nowrap; display: flex; gap: 6px; }
.cr-reject { font-size: 11px; color: var(--clay-deep); background: #F5E3DA; border-radius: 6px; padding: 0 8px; white-space: nowrap; }

/* 封顶提示条（打卡池超过 1000 条时显式告知） */
.road-tip { background: #F4E8D2; border: 1px dashed var(--butter); color: var(--honey); border-radius: 9px; padding: 7px 14px; font-size: 12px; margin-bottom: 10px; }

/* ICP 备案页脚（工信部要求：网站底部展示备案号并链接管局网站；core.js 全页注入） */
.wb-beian { text-align: center; padding: 18px 0 22px; font-size: 12px; color: #9a8f83; }
.wb-beian a { color: inherit; text-decoration: none; }
.wb-beian a:hover { color: var(--honey); text-decoration: underline; }
