/* ============================================================
   同行家 · 设计系统 V2
   原则：无硬边框卡片、统一的圆角与阴影节奏、克制的品牌渐变、
        大号数字用等宽数字字体特性、暖色中性底。
   所有类名与 V1 完全一致，仅重构视觉层。
============================================================ */
:root {
  --brand-primary: #F76B4E;
  --brand-warm: #FF8A4C;
  --brand-amber: #FFB347;
  --brand-child: #3EC6B8;
  --brand-ink: #2C3A47;
  --brand-ink-sub: #8A929C;
  --brand-bg: #FAF7F2;
  --brand-surface: #FFFFFF;
  --brand-danger: #E05B4E;
  --bg: var(--brand-bg);
  --card: var(--brand-surface);
  --ink: var(--brand-ink);
  --muted: #98A0A8;
  --line: #EFE9DF;
  --green: #2FA795;
  --green-soft: #E4F6F2;
  --blue: #E8723F;
  --blue-soft: #FFEEE3;
  --amber: #C07A1E;
  --amber-soft: #FFF3DF;
  --danger: var(--brand-danger);
  --danger-soft: #FBEAE7;
  --radius: 12px;
  --radius-sm: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(44,58,71,.04), 0 6px 20px rgba(44,58,71,.06);
  --shadow-lift: 0 2px 4px rgba(44,58,71,.05), 0 14px 34px rgba(44,58,71,.10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-size: 15px; line-height: 1.55;
  overflow-x: clip;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; background: none; transition: transform .12s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 5.6vw, 32px); line-height: 1.2; font-weight: 750; letter-spacing: .01em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 700; letter-spacing: .01em; }
h3 { font-size: 15.5px; font-weight: 700; }
.muted { color: var(--muted); }

/* ---------------- 登录页（左品牌 + 右登录卡） ---------------- */
.auth-screen {
  min-height: 100dvh; display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--bg);
}
/* 左栏：橙+青双色底 + 柔光流体背景图（logo/auth-bg.svg）+ 淡 logo 水印 */
.auth-visual {
  position: relative; overflow: hidden; display: grid; align-items: center;
  padding: 56px clamp(32px, 6vw, 76px); color: #fff;
  background:
    url("logo/auth-bg.svg") center / cover no-repeat,
    linear-gradient(150deg, #FF8A4C 0%, #F76B4E 54%, #E4573C 100%);
}
.auth-visual::after {
  content: ""; position: absolute; right: -9%; bottom: -15%; width: 64%; aspect-ratio: 1;
  background: url("logo/logo_512.png") center / contain no-repeat;
  opacity: .12; filter: saturate(0) brightness(3); pointer-events: none;
}
.auth-visual-inner { position: relative; z-index: 1; width: 100%; max-width: 470px; display: grid; gap: 22px; }

.auth-brand { display: grid; justify-items: start; gap: 14px; }
.auth-brand img { width: 84px; height: 84px; object-fit: contain; border-radius: 24px; box-shadow: 0 12px 28px rgba(96,32,10,.24); }
.auth-brand-text { display: grid; gap: 4px; }
.auth-brand-text strong {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", serif;
  font-size: 30px; font-weight: 650; letter-spacing: .14em; color: #fff;
}
.auth-brand-text span { color: rgba(255,255,255,.82); font-size: 12.5px; letter-spacing: .2em; }

.auth-intro .auth-title {
  margin: 0; color: #fff; font-size: clamp(19px, 2.4vw, 31px); line-height: 1.42;
  font-family: "Songti SC", "STSong", "Source Han Serif SC", serif;
  font-weight: 650; letter-spacing: .02em; text-shadow: 0 2px 12px rgba(120,40,10,.18);
}
.auth-intro .auth-accent { color: #FFE7C4; }
.auth-desc { margin-top: 12px; color: rgba(255,255,255,.9); font-size: 13.5px; letter-spacing: .2em; }

/* 右侧登录卡 */
.auth-card { display: grid; align-items: center; justify-items: start; padding: 30px 46px; }
#pwdChangeScreen { grid-template-columns: minmax(0, 1fr); justify-items: center; }
#pwdChangeScreen .auth-panel { max-width: 420px; width: 100%; }
#pwdChangeScreen .auth-panel .primary.tall { width: 100%; height: 44px; min-height: 44px; }
#pwdChangeScreen [data-pwd-logout] { margin-top: 12px; }
.auth-panel {
  width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lift); padding: 26px 28px;
}
.auth-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.auth-panel-head h3 { font-size: 20px; }
.auth-tag { font-size: 10.5px; color: var(--green); background: var(--green-soft); border: 1px solid #CDEEDD; padding: 3px 9px; border-radius: 999px; }
.auth-panel-sub { font-size: 12.5px; color: #6E655F; margin-bottom: 16px; }
.auth-panel .field { margin-bottom: 12px; }
.auth-panel .field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.auth-panel .field input { height: 42px; min-height: 42px; border: 1.5px solid var(--line); border-radius: 11px; padding: 0 13px; font-size: 14px; background: #FFFDFB; }
.auth-panel .field input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(247,107,78,.15); }
.auth-panel .err { color: #E2574C; font-size: 11.5px; margin-top: 5px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; margin: 2px 0 14px; }
.auth-card .auth-remember { display: flex; align-items: center; gap: 7px; color: #6E655F; cursor: pointer; font-weight: 500; }
.auth-remember input { width: 16px; height: 16px; min-height: 0; }
.auth-link { color: #5B8DEF; font-size: 12.5px; text-decoration: none; padding: 0; }
.auth-link:hover { text-decoration: underline; }
.auth-panel #loginForm .primary.tall { width: 100%; height: 44px; min-height: 44px; }
.auth-panel #loginError { margin-top: 10px; font-size: 12.5px; }
.auth-card .site-foot { margin-top: 14px; }

@media (max-height: 780px) {
  .auth-visual { padding: 30px 40px; }
  .auth-visual-inner { gap: 15px; }
  .auth-brand img { width: 64px; height: 64px; border-radius: 18px; }
  .auth-card { padding: 22px 40px; }
  .auth-panel { padding: 22px 24px; }
  .auth-desc { font-size: 13px; }
}

@media (max-width: 920px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr); }
  .auth-visual { padding: 44px 26px 34px; }
  .auth-visual-inner { max-width: 440px; gap: 16px; justify-items: center; text-align: center; margin: 0 auto; }
  .auth-brand { justify-items: center; }
  .auth-brand img { width: 64px; height: 64px; border-radius: 18px; }
  .auth-brand-text strong { font-size: 25px; }
  .auth-visual::after { width: 48%; right: -14%; bottom: -20%; }
  .auth-intro { text-align: center; }
  .auth-intro .auth-title { font-size: min(21px, 5.6vw); }
  .auth-desc { max-width: none; }
  .auth-card { justify-items: center; padding: 8px 22px 36px; }
}

.stack { display: grid; gap: 14px; }
.stack.compact { gap: 12px; }
label { display: grid; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
label span { color: var(--muted); font-weight: 500; }
#loginForm label { justify-items: stretch; text-align: left; }
#loginForm label > span { margin-bottom: -2px; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  background: #F6F3EC; color: var(--ink); transition: border-color .15s, background .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #B4AA9C; }
input:focus, select:focus, textarea:focus {
  outline: none; background: #fff; border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(247,107,78,.12);
}
.primary {
  min-height: 48px; padding: 12px 18px; border-radius: 14px; color: #fff; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-primary) 60%, #EF5A44);
  box-shadow: 0 6px 16px rgba(247,107,78,.28), inset 0 1px 0 rgba(255,255,255,.22);
}
.primary.tall { min-height: 52px; }
.primary:hover { box-shadow: 0 8px 22px rgba(247,107,78,.36), inset 0 1px 0 rgba(255,255,255,.22); }
.primary:active { transform: translateY(1px) scale(.995); box-shadow: 0 3px 10px rgba(247,107,78,.24); }
.ghost {
  min-height: 42px; padding: 9px 14px; border-radius: 12px;
  background: #fff; color: var(--brand-ink); font-weight: 600;
  border: 1.5px solid var(--line);
}
.ghost:hover { border-color: #E0D6C6; background: #FDFBF7; }
.error { color: var(--danger); font-size: 14px; }

/* ---------------- 站点页脚（备案与声明） ---------------- */
.site-foot {
  margin-top: 26px; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid; gap: 5px; justify-items: center; text-align: center;
  color: var(--muted); font-size: 12px; line-height: 1.7;
}
.site-foot p { margin: 0; }
.site-foot-icp a { color: var(--muted); text-decoration: none; }
.site-foot-icp a:hover { color: var(--brand-primary); text-decoration: underline; }

/* ---------------- 应用骨架 ---------------- */
.app-screen { min-height: 100dvh; }
.brand-line { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--brand-ink); letter-spacing: .04em; }
.brand-line img { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; }
.brand-divider { width: 1px; height: 16px; background: #E3DACB; margin: 0 2px; }
.brand-slogan { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: .16em; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 68px; overflow: hidden; flex-wrap: nowrap;
  padding: 10px 18px; background: #FFFFFF;
  border-bottom: 1px solid #E8E0D2; box-shadow: 0 2px 10px rgba(75,58,52,.05);
}
.topbar > div { min-width: 0; }
.topbar-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar-title { min-width: 0; border-left: 1px solid #E8E0D2; padding-left: 11px; }
.topbar-slogan { color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.topbar-title small { display: block; color: var(--muted); font-size: 11px; }
.topbar-title h1 { margin-top: 2px; font-size: 17px; line-height: 1.2; }
.top-note { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 8px 13px; border-radius: 999px;
  background: #fff; box-shadow: var(--shadow); font-size: 13.5px; font-weight: 600;
}
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-child); box-shadow: 0 0 0 3px rgba(62,198,184,.18); }
.logout-btn {
  margin-left: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line);
}
.logout-btn:hover { color: var(--danger); box-shadow: inset 0 0 0 1.5px rgba(224,91,78,.45); background: var(--danger-soft); }
.side-nav { display: none; }
.nav-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.nav-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: #FFFFFF; backdrop-filter: blur(18px);
  border-top: 1px solid rgba(234,226,214,.7);
  padding: 7px max(8px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(44,58,71,.05);
}
.bottom-nav button, .side-nav .nav-item { min-height: 48px; border-radius: 13px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.bottom-nav button.active, .side-nav .nav-item.active { color: var(--brand-primary); background: var(--blue-soft); font-weight: 700; }
.main-area { padding: 20px 16px 96px; max-width: 1180px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; max-width: 1120px; margin-inline: auto; width: 100%; animation: pageIn .24s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 首页 hero ---------------- */
.hero { display: grid; gap: 18px; margin-top: 4px; }
.hero-copy .eyebrow { color: var(--green); font-weight: 700; font-size: 12.5px; letter-spacing: .12em; margin-bottom: 8px; }
.hero-copy p { margin-top: 10px; max-width: 640px; font-size: 14.5px; }
.hero-panel {
  display: grid; gap: 9px; padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #FF9A5C, var(--brand-primary) 65%, #EF5A44);
  color: #fff; box-shadow: 0 10px 26px rgba(247,107,78,.30);
}
.hero-panel .panel-label { color: rgba(255,255,255,.85); font-size: 13px; letter-spacing: .06em; }
.hero-panel strong { font-size: 40px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.progress { width: 100%; height: 8px; background: rgba(255,255,255,.28); border-radius: 999px; overflow: hidden; }
.progress i { display: block; width: 0; height: 100%; background: #fff; border-radius: inherit; transition: width .5s cubic-bezier(.22,1,.36,1); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 13px; }
.section-head h2 { position: relative; padding-left: 15px; }
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 17px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand-warm), var(--brand-primary));
}
.section-head span { color: var(--muted); font-size: 13px; }
.page.active > .section-head:first-child { margin-top: 10px; }
.page.active > form, .page.active > .list, .page.active > .split, .page.active > .panel { margin-bottom: 10px; }

/* ---------------- 结构化工作台 ---------------- */
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.metric {
  min-width: 0; padding: 15px; border-radius: var(--radius); background: var(--card);
  border: 1px solid #EDE5D8; box-shadow: 0 1px 2px rgba(44,58,71,.03);
}
.metric > span { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.metric strong { display: block; margin-top: 6px; font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric small { display: block; margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.split-grid > .panel { min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head h3 { margin: 0; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.panel-head > span { color: var(--muted); font-size: 12px; text-align: right; }
.panel-head.compact { margin-top: 0; }
.panel, .metric, .dimension-card, .member-card, .goal, .closure-card,
.list-item, .approval, .risk-card, .journey-item, .score-item {
  border: 1px solid #EDE5D8;
  box-shadow: 0 1px 2px rgba(44,58,71,.03);
}

/* ---------------- 卡片体系（无边框 + 柔影） ---------------- */
.dimension-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.dimension-card { background: #fff; border-radius: var(--radius); padding: 17px 17px 15px; box-shadow: var(--shadow); }
.dimension-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dimension-card .top strong { font-size: 15.5px; letter-spacing: .02em; }
.dimension-card .status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .03em; }
.status.complete { background: var(--green-soft); color: var(--green); }
.status.partial { background: var(--amber-soft); color: var(--amber); }
.status.todo { background: #F1EDE5; color: var(--muted); }
.dimension-card .text { min-height: 34px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.agent-brief {
  display: grid; gap: 12px; padding: 18px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #E9FBF7, #F3FFF9 60%, #FDF6EE);
  box-shadow: var(--shadow);
}
.agent-brief p { font-size: 14.5px; line-height: 1.6; }
.agent-brief button { justify-self: start; background: #fff; }
.list { display: grid; gap: 10px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
}
.item-title { font-weight: 650; font-size: 14.5px; }
.item-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.pill { flex: 0 0 auto; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.approved { background: var(--green-soft); color: var(--green); }
.pill.rejected { background: var(--danger-soft); color: var(--danger); }
.pill.active { background: var(--blue-soft); color: var(--blue); }

/* ---------------- 学习闭环 ---------------- */
.closure-list { display: grid; gap: 10px; }
.closure-card { padding: 15px 14px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.closure-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.closure-top strong { font-size: 15px; letter-spacing: .02em; }
.closure-count {
  flex: 0 0 auto; min-width: 38px; padding: 4px 8px; border-radius: 999px;
  background: #F1EDE5; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.closure-count.complete { background: var(--green-soft); color: var(--green); }
.closure-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.step-button {
  display: grid; gap: 2px; justify-items: center; min-width: 0; min-height: 46px; padding: 7px 2px;
  border-radius: 11px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; font-weight: 600; line-height: 1.2;
}
.step-button:hover { filter: brightness(.97); }
.step-button i { font-style: normal; font-size: 10.5px; white-space: nowrap; opacity: .85; font-weight: 500; }
.step-button.doing { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1.5px rgba(192,122,30,.3); }
.step-button.done { background: var(--green-soft); color: var(--green); font-weight: 700; box-shadow: inset 0 0 0 1.5px rgba(47,167,149,.3); }

/* ---------------- 家庭看板 ---------------- */
.board-grid { display: grid; gap: 11px; }
.member-card { background: #fff; border-radius: var(--radius-lg); padding: 17px; box-shadow: var(--shadow); }
.member-card.current { box-shadow: 0 0 0 2px rgba(62,198,184,.5), var(--shadow-lift); }
.member-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.member-name { font-weight: 750; font-size: 16px; letter-spacing: .02em; }
.member-role { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.member-badge { margin-top: 7px; }
.member-badge .pill { display: inline-block; }
.member-ratio { font-weight: 800; color: var(--green); font-size: 19px; font-variant-numeric: tabular-nums; }
.mini-bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 9px; align-items: center; font-size: 12.5px; color: var(--muted); }
.bar { height: 7px; background: #F1EDE5; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #5AD6C4, var(--brand-child)); border-radius: inherit; transition: width .5s cubic-bezier(.22,1,.36,1); }
.goal-list { display: grid; gap: 11px; }
.goal { display: grid; gap: 11px; padding: 17px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.goal-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.goal-actions { display: flex; gap: 8px; }
.goal-actions button { min-width: 44px; min-height: 40px; border-radius: 11px; background: #F6F3EC; font-weight: 700; }
.goal-actions button:hover { background: var(--green-soft); color: var(--green); }

/* ---------------- 表单与列表 ---------------- */
.split { display: grid; gap: 14px; align-items: start; }
.risk-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.risk-card { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.risk-label { color: var(--muted); font-size: 12.5px; }
.risk-value { font-size: 21px; font-weight: 800; margin-top: 5px; font-variant-numeric: tabular-nums; }
.risk-note { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.score-list { display: grid; gap: 10px; }
.score-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; background: #fff; border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.score-actions { display: flex; gap: 7px; }
.score-actions button { min-height: 40px; min-width: 68px; border-radius: 11px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.score-actions button:disabled { background: #F1EDE5; color: var(--muted); font-weight: 500; }
.panel { background: #fff; border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow); }
.token-value { display: block; margin: 9px 0; padding: 13px; border-radius: 12px; background: #F6F3EC; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.health-steps { margin: 8px 0 0; padding-left: 20px; }
.health-steps li { margin-bottom: 6px; }
.panel code { background: #F6F3EC; padding: 1px 5px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.segmented { display: flex; gap: 7px; overflow-x: auto; margin: 15px 0; padding-bottom: 4px; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { flex: 0 0 auto; min-height: 42px; padding: 9px 15px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); color: var(--muted); font-weight: 600; }
.segmented button.active { background: var(--brand-ink); color: #fff; font-weight: 700; }
.subnav {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px;
  padding: 7px; border-radius: 18px; background: rgba(255,255,255,.78);
  box-shadow: var(--shadow); margin: 22px 0 15px;
}
.subnav button { min-height: 43px; border-radius: 13px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; }
.subnav button.active { background: #FFF3EC; color: var(--brand-primary); box-shadow: inset 0 0 0 1.5px rgba(247,107,78,.22); }
.agent-panel { display: none; }
.agent-panel.active { display: grid; gap: 16px; animation: pageIn .22s ease; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-head h2 { padding-left: 14px; position: relative; }
.panel-head h2::before { content:""; position:absolute; left:0; top:50%; transform:translateY(-50%); width:5px; height:16px; border-radius:3px; background:linear-gradient(180deg,var(--brand-warm),var(--brand-primary)); }
.panel-head span { color: var(--muted); font-size: 12.5px; text-align: right; }
.panel-head.compact { margin-top: 4px; }
.form-surface { padding: 18px; border-radius: var(--radius-lg); background: linear-gradient(180deg,#FFFDF9,#F8F4EC); box-shadow: var(--shadow); }
.collapsible {
  margin-top: 16px; border-radius: var(--radius-lg); background: #fff;
  box-shadow: var(--shadow); overflow: hidden;
}
.collapsible summary {
  min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 18px; font-weight: 700; cursor: pointer; list-style: none;
}
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible summary::after {
  content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin-left: 8px;
  border-right: 2px solid #B6AC9D; border-bottom: 2px solid #B6AC9D;
  transform: rotate(45deg); transition: transform .18s ease;
}
.collapsible[open] summary::after { transform: rotate(225deg); }
.collapsible summary span { flex: 1; font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: right; }
.collapsible-body { padding: 4px 18px 18px; }
.record-fields { display: grid; gap: 12px; }
.record-fields button { min-height: 56px; background: #fff; border-radius: 15px; text-align: left; padding: 11px 15px; box-shadow: var(--shadow); font-weight: 600; }
.record-fields button.selected { box-shadow: 0 0 0 2px var(--brand-primary), var(--shadow); color: var(--brand-primary); }
#saveRecord { width: 100%; margin: 17px 0 10px; }

/* ---------------- 小同对话 ---------------- */
.agent-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.status-pill { padding: 6px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; }
.status-pill.remote { background: var(--blue-soft); color: var(--blue); }
.agent-shell { display: grid; gap: 0; }
.agent-chat-panel {
  padding: 18px; border-radius: var(--radius-lg); background: linear-gradient(135deg,#E9FBF7,#F3FFF9 58%,#FDF6EE);
  box-shadow: var(--shadow);
}
.agent-chat-panel .panel-label { color: var(--green); font-weight: 700; font-size: 12.5px; letter-spacing: .08em; }
.chat-box { height: min(38dvh, 360px); overflow-y: auto; display: grid; gap: 12px; align-content: start; margin: 14px 0; padding: 4px 2px; }
.message { max-width: 84%; padding: 13px 15px; border-radius: 20px; white-space: pre-wrap; line-height: 1.6; font-size: 14.5px; }
.message.agent { background: #fff; box-shadow: var(--shadow); border-bottom-left-radius: 7px; }
.message.user {
  justify-self: end; color: #fff; border-bottom-right-radius: 7px;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-primary));
  box-shadow: 0 4px 12px rgba(247,107,78,.25);
}
.message-source { display: block; margin-top: 7px; font-size: 11px; color: var(--muted); }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-top: 13px; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); color: var(--muted); font-weight: 600; }
.chips button:hover { color: var(--brand-primary); }

/* ---- 小同人格细节 ---- */
.chat-id { display: flex; align-items: center; gap: 10px; }
.chat-id img { width: 38px; height: 38px; border-radius: 12px; object-fit: contain; background: #fff; box-shadow: var(--shadow); padding: 3px; }
.chat-id-text strong { display: block; font-size: 14.5px; color: #2E2622; }
.chat-id-text span { font-size: 11.5px; color: var(--muted); }
.agent-voice { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--green-soft, #E9FBF7); color: #1E7A63; font-size: 13px; line-height: 1.6; }
.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-row.user { justify-content: flex-end; }
.msg-row .chat-avatar { width: 30px; height: 30px; border-radius: 10px; object-fit: contain; background: #fff; box-shadow: var(--shadow); padding: 2px; flex: 0 0 auto; }
.msg-row .message.agent { flex: 0 1 auto; max-width: 78%; }
.msg-row.user .message { max-width: 84%; }

/* ---------------- 审批 / 治理 ---------------- */
.approval-list { display: grid; gap: 11px; }
.approval { padding: 17px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.approval-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.approval-top strong { font-size: 15px; }
.approval-desc { margin: 10px 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.approval-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.approval-actions .ok { background: linear-gradient(135deg, var(--brand-warm), var(--brand-primary)); color: #fff; min-height: 46px; border-radius: 13px; font-weight: 700; box-shadow: 0 5px 14px rgba(247,107,78,.26); }
.approval-actions .no { background: #fff; color: var(--danger); min-height: 46px; border-radius: 13px; font-weight: 700; box-shadow: inset 0 0 0 1.5px rgba(224,91,78,.4); }
.approval-actions .no:hover { background: var(--danger-soft); }
.decision { margin-top: 11px; padding: 10px 12px; border-radius: 11px; background: #F6F3EC; color: var(--muted); font-size: 12.5px; }
.journey { display: grid; gap: 10px; }
.journey-item { display: flex; justify-content: space-between; padding: 14px 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); color: var(--muted); font-size: 14px; }
.journey-item strong { color: var(--ink); font-weight: 650; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; }
.admin-grid .wide { grid-column: 1 / -1; }
.mini-list { display: grid; gap: 10px; }
.mini-item { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13.5px; }
.log-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.log-item { display: grid; gap: 3px; padding: 10px 12px; border-radius: 11px; background: #F6F3EC; color: var(--muted); font-size: 12.5px; }

/* ---------------- 反馈 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 98px; transform: translate(-50%, 18px); z-index: 100;
  max-width: min(90vw, 420px); padding: 13px 18px; border-radius: 14px;
  background: rgba(44,58,71,.94); backdrop-filter: blur(8px); color: #fff; font-size: 14px;
  box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none; transition: .24s cubic-bezier(.22,1,.36,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading-state { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.loading-state img, .empty-state img { width: 34px; height: 34px; object-fit: contain; }
.empty-state { display: grid; justify-items: center; gap: 9px; padding: 26px; border-radius: var(--radius); color: var(--muted); background: #FFFDF9; box-shadow: inset 0 0 0 1.5px #EFE9DF; font-size: 13.5px; }
.hidden { display: none !important; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 699.98px) {
  .brand-divider, .brand-slogan { display: none; }
  .section-head { margin: 30px 0 13px; }
  .topbar { min-height: 66px; }
  .topbar-title { display: none; }
  .bottom-nav button { display: grid; justify-items: center; gap: 3px; }
  .subnav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .panel-head span { text-align: left; }
  .form-surface { padding: 16px; }
}
@media (min-width: 700px) {
  .app-screen { display: grid; grid-template-columns: 238px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .topbar { grid-column: 2; padding: 12px 22px; }
  .side-nav { grid-column: 1; grid-row: 1 / 3; }
  .topbar-left { gap: 0; }
  .brand-line { display: none; }
  .side-nav {
    position: sticky; top: 0; display: flex; flex-direction: column; gap: 20px; height: 100vh;
    padding: 20px 12px 16px; background: #fff; border-right: 1px solid #E7DFD0; overflow-y: auto;
  }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; min-width: 0; }
  .side-brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; }
  .side-brand strong, .side-brand small { display: block; }
  .side-brand strong { font-size: 14px; }
  .side-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
  .side-links { display: flex; flex-direction: column; gap: 4px; }
  .side-nav .nav-item { display: flex; align-items: center; gap: 9px; min-height: 42px; width: 100%; padding: 9px 10px; text-align: left; font-size: 13px; }
  .side-foot { margin-top: auto; border-top: 1px solid #EFE8DB; padding: 13px 8px 0; color: var(--muted); font-size: 12px; display: grid; gap: 3px; }
.side-foot small { font-size: 11px; opacity: .8; }
  .bottom-nav { display: none; }
  .main-area { padding: 26px; grid-column: 2; }
  .hero { grid-template-columns: minmax(0, 1fr) 280px; align-items: center; }
  .agent-chat-panel { padding: 20px; }
  .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 380px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); }
  .agent-shell {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 15px; align-items: start;
  }
  .agent-chat-panel { position: sticky; top: 112px; max-height: calc(100vh - 128px); overflow-y: auto; }
  .admin-grid { grid-template-columns: 400px minmax(0, 1fr); }
  .section-head, .hero { margin-top: 0; }
}
@media (min-width: 980px) {
  .board-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main-area { max-width: 1120px; padding: 26px 30px; }
}
@media (max-width: 389.98px) {
  .auth-card { padding: 30px 20px 24px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .main-area { padding-left: 12px; padding-right: 12px; }
  .approval-actions { grid-template-columns: minmax(0, 1fr); }
  .chat-form { grid-template-columns: minmax(0, 1fr); }
  .chat-form .primary { width: 100%; }
}

/* ---------------- 补齐：codex 新组件样式 ---------------- */
.weekday-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px;
  border: 0; padding: 0; margin: 12px 0;
}
.weekday-grid legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 0 8px 2px; }
.weekday-grid label {
  display: grid; justify-items: center; gap: 5px; min-height: 60px; padding: 9px 2px;
  background: #F6F3EC; border-radius: 11px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.weekday-grid label:hover { background: #F0EBE1; }
.weekday-grid input { width: 15px; height: 15px; min-height: 0; padding: 0; accent-color: var(--brand-primary); }
.weekday-grid label:has(input:checked) {
  background: var(--blue-soft); color: var(--blue);
  box-shadow: inset 0 0 0 1.5px rgba(232,114,63,.35);
}
@media (max-width: 479.98px) {
  .weekday-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 登录表单：无标签极简（文字仅保留给屏幕阅读器） */
.visually-hidden { display: contents; }
.visually-hidden > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#loginForm .stack, #loginForm { gap: 12px; }

.water-progress { background: var(--brand-soft, #FFF1EC); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: #4B3A34; }
.water-progress strong { font-variant-numeric: tabular-nums; font-size: 16px; }

/* ---- 打卡卡片布局 ---- */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.action-card { background: #fff; border-radius: var(--radius, 16px); box-shadow: 0 4px 16px rgba(75, 58, 52, .07); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.action-card.wide { grid-column: 1 / -1; }
.action-card h4 { margin: 0; font-size: 15px; color: #2E2622; }
.action-card .item-sub { margin: 0; font-size: 12.5px; color: #8A7A72; }
.action-card.done { background: linear-gradient(160deg, #F0FBF7, #fff); }
.action-card.done .item-sub { color: #1E9E7E; font-weight: 600; }
.action-card .inline-row { display: flex; align-items: center; gap: 8px; }
.action-card .inline-row input[type="number"] { width: 90px; }
.action-card .unit { font-size: 13px; color: #8A7A72; }
.action-card textarea { width: 100%; }
.photo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; background: var(--brand-primary, #F76B4E); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.photo-btn:hover { filter: brightness(1.05); }
.photo-btn input[type="file"] { display: none; }
.action-card .ghost { background: #F3EEE8; color: #4B3A34; }

/* ---- 协同拆分页 ---- */
.page-agent .agent-chat-panel { position: static; max-width: 780px; max-height: none; overflow: visible; }
.page-agent .agent-shell { display: block; }
.bottom-nav { overflow-x: auto; scrollbar-width: none; }
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-nav button { min-width: 58px; }

/* 界面配置：hidden 属性优先 */
[hidden] { display: none !important; }

/* 管理员不使用家庭页面 */
body.role-admin .nav-item[data-page="dashboard"],
body.role-admin .nav-item[data-page="account"],
body.role-admin .bottom-nav button[data-page="account"],
body.role-admin .nav-item[data-page="board"],
body.role-admin .bottom-nav button[data-page="dashboard"],
body.role-admin .bottom-nav button[data-page="board"] { display: none !important; }

/* 通知弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(43, 32, 28, .45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal-card { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; max-height: 76vh; overflow-y: auto; padding: 20px; box-shadow: 0 18px 50px rgba(43, 32, 28, .25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head h3 { margin: 0; }
