/* =========================================================
   自律小站 · App 样式（移动优先）
   ========================================================= */

:root{
  --bg:#f3f1ea;
  --card:#ffffff;
  --ink:#12120f;
  --muted:#8d8d84;
  --line:rgba(18,18,15,.08);
  --black:#141412;
  --lime:#d7f75a;
  --lime-deep:#b8e02f;
  --purple:#c9b8ff;
  --orange:#ff8a4c;
  --blue:#6bb8ff;
  --green:#3ddc97;
  --radius:26px;
  --tabbar-h:74px;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}

html,body{height:100%}
body{
  margin:0;
  font-family:"Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  overscroll-behavior-y:none;
}
h1,h2,h3,p,ul{margin:0;padding:0}
ul{list-style:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
a{color:inherit;text-decoration:none}
b{font-weight:800}

#app{
  position:relative;
  width:100%;max-width:480px;margin:0 auto;min-height:100vh;
  padding:0 20px calc(var(--tabbar-h) + 24px);
}

/* ---------- 顶部 ---------- */
.app-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:22px 0 10px;
}
.hello{font-size:1.28rem;font-weight:800;letter-spacing:-.01em}
.sub{font-size:.8rem;color:var(--muted);margin-top:2px}
.avatar{
  width:42px;height:42px;border-radius:50%;
  display:grid;place-items:center;font-weight:800;font-size:.95rem;
  background:var(--black);color:var(--lime);
}

/* ---------- 屏幕切换 ---------- */
.screens{position:relative}
.screen{display:none;flex-direction:column;gap:18px;padding-bottom:8px}
.screen.is-active{display:flex;animation:screenIn .32s cubic-bezier(.22,.8,.3,1) both}
@keyframes screenIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ---------- 今日：进度环 ---------- */
.ring-card{
  position:relative;
  background:var(--card);border-radius:var(--radius);
  padding:22px 20px 18px;
  display:flex;flex-direction:column;align-items:center;
  box-shadow:0 18px 40px -30px rgba(0,0,0,.5);
  overflow:hidden;
  transition:background .5s ease;
}
.ring-card.all-done{background:var(--lime)}

.ring{width:150px;height:150px;transform:rotate(-90deg)}
.ring-bg{fill:none;stroke:rgba(18,18,15,.08);stroke-width:9}
.ring-fg{
  fill:none;stroke:var(--ink);stroke-width:9;stroke-linecap:round;
  stroke-dasharray:389.5;stroke-dashoffset:389.5;
  transition:stroke-dashoffset .7s cubic-bezier(.22,.8,.3,1), stroke .3s;
}
.ring-card.all-done .ring-fg{stroke:var(--ink)}

.ring-center{
  position:absolute;top:22px;left:0;right:0;height:150px;
  display:flex;align-items:center;justify-content:center;gap:5px;
}
.big-num{
  font-size:2.9rem;font-weight:900;line-height:1;letter-spacing:-.04em;
  transition:transform .25s cubic-bezier(.3,1.4,.6,1);
  display:inline-block;
}
.big-num.pop{transform:scale(1.18)}
.of{font-size:.95rem;color:var(--muted);font-weight:700}
.ring-label{margin-top:10px;font-size:.78rem;color:var(--muted);letter-spacing:.02em}
.ring-card.all-done .ring-label,
.ring-card.all-done .of{color:rgba(18,18,15,.6)}

.ring-dots{display:flex;gap:6px;margin-top:12px}
.ring-dots i{
  width:7px;height:7px;border-radius:50%;background:rgba(18,18,15,.14);
  transition:background .3s,transform .3s;
}
.ring-dots i.on{background:var(--ink);transform:scale(1.15)}

/* ---------- 区块 ---------- */
.block{
  background:var(--card);border-radius:var(--radius);
  padding:16px 16px 10px;
  box-shadow:0 14px 34px -30px rgba(0,0,0,.45);
}
.block-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.block-head h3{font-size:.95rem;letter-spacing:.01em}
.mini-btn{
  width:30px;height:30px;border-radius:50%;
  background:rgba(18,18,15,.06);font-size:1rem;line-height:1;
  display:grid;place-items:center;transition:.2s;
}
.mini-btn.wide{
  width:auto;min-width:30px;padding:0 11px;height:28px;border-radius:999px;
  font-size:.72rem;white-space:nowrap;
}
.mini-btn:active{transform:scale(.9)}

/* ---------- 习惯行 ---------- */
.habit-list li{
  display:flex;align-items:center;gap:12px;
  padding:11px 4px;border-bottom:1px solid var(--line);
}
.habit-list li:last-child{border-bottom:0}
.habit-emoji{font-size:1.05rem;width:22px;text-align:center}
.habit-name{flex:1;font-size:.95rem}
.habit-streak{font-size:.72rem;color:var(--muted)}
.habit-skeleton{
  height:46px;border-radius:12px;margin:6px 0;
  background:linear-gradient(90deg,#eeece6,#f7f5ef,#eeece6);
  background-size:200% 100%;animation:shimmer 1.2s linear infinite;
}
@keyframes shimmer{from{background-position:120% 0}to{background-position:-120% 0}}

/* 完成反馈按钮 */
.check{
  position:relative;width:34px;height:34px;flex:0 0 34px;
  border-radius:50%;border:2px solid rgba(18,18,15,.22);
  display:grid;place-items:center;transition:.22s;
  background:transparent;
}
.check svg{width:17px;height:17px;stroke:var(--ink);stroke-width:3;fill:none;
  stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:22;stroke-dashoffset:22;transition:stroke-dashoffset .3s .06s}
.check.checked{background:var(--lime);border-color:var(--lime)}
.check.checked svg{stroke-dashoffset:0}
.check:active{transform:scale(.9)}
.check.burst{animation:checkPop .45s cubic-bezier(.3,1.5,.6,1)}
@keyframes checkPop{0%{transform:scale(1)}35%{transform:scale(1.22)}100%{transform:scale(1)}}

.particle{
  position:absolute;left:50%;top:50%;width:5px;height:5px;border-radius:50%;
  background:var(--ink);pointer-events:none;
}

/* ---------- 待办 ---------- */
.todo-list li{
  display:flex;align-items:center;gap:10px;padding:10px 4px;
  border-bottom:1px solid var(--line);
}
.todo-list li:last-child{border-bottom:0}
.todo-check{
  width:20px;height:20px;border-radius:50%;flex:0 0 20px;
  border:2px solid rgba(18,18,15,.2);display:grid;place-items:center;transition:.2s;
}
.todo-check.on{background:var(--ink);border-color:var(--ink)}
.todo-check.on::after{
  content:"";width:8px;height:4px;border-left:2px solid #fff;border-bottom:2px solid #fff;
  transform:rotate(-45deg) translateY(-1px);
}
.todo-text{flex:1;font-size:.92rem;transition:.2s}
.todo-list li.done .todo-text{color:var(--muted);text-decoration:line-through}
.todo-del{font-size:.8rem;color:var(--muted);padding:4px 6px}
.empty{padding:16px 4px;font-size:.82rem;color:var(--muted);text-align:center}

/* ---------- 专注 ---------- */
.focus-card{
  position:relative;background:var(--black);color:#fff;
  border-radius:32px;padding:20px 20px 26px;
  display:flex;flex-direction:column;align-items:center;
  overflow:hidden;
}
.focus-top{width:100%;display:flex;justify-content:space-between;align-items:center}
.focus-tag{font-size:.68rem;letter-spacing:.22em;color:rgba(255,255,255,.45)}
.focus-count{font-size:.72rem;color:rgba(255,255,255,.45)}
.timer{
  font-size:4.4rem;font-weight:900;letter-spacing:-.05em;line-height:1.1;
  margin:26px 0 4px;font-variant-numeric:tabular-nums;
}
.focus-hint{font-size:.76rem;color:rgba(255,255,255,.45);margin-bottom:20px}
.focus-btn{
  width:62px;height:62px;border-radius:50%;background:var(--lime);
  display:grid;place-items:center;transition:.2s;
  box-shadow:0 12px 30px -14px rgba(215,247,90,.8);
}
.focus-btn:active{transform:scale(.93)}
.focus-btn svg{width:26px;height:26px;fill:var(--ink)}
.focus-btn .icon-pause{display:none}
.focus-card.running .icon-play{display:none}
.focus-card.running .icon-pause{display:block}
.focus-dots{
  position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .4s;
}
.focus-card.running .focus-dots{opacity:1}

/* ---------- 清单叠卡 ---------- */
.screen-title{padding:6px 2px 0}
.screen-title h2{font-size:2rem;font-weight:900;letter-spacing:-.03em}
.list-stack{position:relative;height:330px;margin-top:6px}
.list-card{
  position:absolute;left:0;right:0;top:0;height:112px;
  border-radius:24px;padding:16px 18px;
  display:flex;align-items:center;gap:12px;
  background:var(--card);color:var(--ink);
  box-shadow:0 18px 40px -32px rgba(0,0,0,.6);
  transition:transform .55s cubic-bezier(.22,.9,.3,1), height .4s, background .3s;
  will-change:transform;
}
.list-card .dot{width:12px;height:12px;border-radius:50%;flex:0 0 12px}
.list-card .name{font-size:1.1rem;font-weight:800;flex:1}
.list-card .count{font-size:.8rem;color:var(--muted)}
.list-card .arrow{font-size:.9rem;color:var(--muted);transition:transform .3s}

.list-stack.open .list-card{height:96px}
.list-stack.open .list-card .arrow{transform:rotate(90deg)}

/* ---------- 我的 ---------- */
.me-card{
  background:var(--card);border-radius:var(--radius);padding:24px 20px;
  display:flex;flex-direction:column;align-items:center;gap:6px;
  box-shadow:0 18px 40px -32px rgba(0,0,0,.5);
}
.me-avatar{
  width:60px;height:60px;border-radius:50%;background:var(--black);color:var(--lime);
  display:grid;place-items:center;font-weight:900;font-size:1.2rem;margin-bottom:4px;
}
.me-card h3{font-size:1.05rem}
.stat-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.stat{
  background:var(--card);border-radius:18px;padding:14px 10px;text-align:center;
  display:flex;flex-direction:column;gap:2px;
}
.stat b{font-size:1.3rem;letter-spacing:-.02em}
.stat span{font-size:.7rem;color:var(--muted)}

.msg{font-size:.8rem;color:var(--muted);margin-bottom:8px}
.pw-form{display:flex;flex-direction:column;gap:8px;padding-bottom:8px}
.pw-form input{
  padding:12px 14px;border-radius:14px;border:1px solid var(--line);
  background:#faf9f5;font:inherit;font-size:.9rem;outline:none;
}
.pw-form input:focus{border-color:var(--ink)}
.btn-ghost{
  padding:12px;border-radius:14px;background:rgba(18,18,15,.06);
  font-weight:700;font-size:.88rem;
}
.logout{
  display:block;text-align:center;padding:12px;margin-top:6px;
  font-size:.85rem;color:var(--muted);
}

/* ---------- 底部导航 ---------- */
.tabbar{
  position:fixed;left:50%;bottom:0;transform:translateX(-50%);
  width:100%;max-width:480px;height:var(--tabbar-h);
  display:grid;grid-template-columns:repeat(4,1fr);
  background:rgba(243,241,234,.92);
  backdrop-filter:blur(14px);
  border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);
  z-index:50;
}
.tab{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  font-size:.66rem;color:var(--muted);transition:.2s;
}
.tab svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;transition:transform .25s}
.tab.is-active{color:var(--ink)}
.tab.is-active svg{transform:translateY(-1px) scale(1.06)}

/* ---------- 登录 ---------- */
.auth-body{
  display:grid;place-items:center;min-height:100vh;padding:24px;
  background:radial-gradient(70% 50% at 50% 0%, #e8f4cf 0%, var(--bg) 60%);
}
.auth-card{
  width:min(380px,100%);background:var(--card);border-radius:28px;
  padding:34px 26px;text-align:center;
  box-shadow:0 30px 70px -40px rgba(0,0,0,.35);
}
.auth-logo{font-size:2rem;margin-bottom:10px}
.auth-card h1{font-size:1.2rem;margin-bottom:6px}
.auth-sub{font-size:.84rem;color:var(--muted)}
.auth-err{color:#e0554a;font-size:.8rem;margin-top:10px}
.auth-form{display:flex;flex-direction:column;gap:10px;margin-top:16px}
.auth-form input{
  padding:13px 15px;border-radius:14px;border:1px solid var(--line);
  background:#faf9f5;font:inherit;font-size:.92rem;outline:none;
}
.auth-form input:focus{border-color:var(--ink)}
.btn-primary{
  padding:13px;border-radius:14px;background:var(--ink);color:var(--lime);
  font-weight:800;font-size:.92rem;
}

/* ---------- 圆形扩散转场 ---------- */
::view-transition-old(root),
::view-transition-new(root){animation:none;mix-blend-mode:normal}
::view-transition-old(root){z-index:1}
::view-transition-new(root){z-index:2}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms!important;transition-duration:.001ms!important}
}

/* =========================================================
   Today 层
   ========================================================= */

#app{padding-bottom:calc(var(--tabbar-h) + 84px)}

/* ---------- 简报卡 ---------- */
.brief-card{
  position:relative;overflow:hidden;
  background:linear-gradient(178deg,#fffefb 0%,#fdf8ec 100%);
  border:1px solid rgba(18,18,15,.06);
  border-radius:30px;padding:18px 20px 12px;
  box-shadow:0 26px 50px -42px rgba(0,0,0,.6);
}
.brief-card::after{
  content:"";position:absolute;right:-46px;top:-52px;width:150px;height:150px;border-radius:50%;
  background:radial-gradient(circle,rgba(215,247,90,.55),rgba(215,247,90,0) 68%);
  pointer-events:none;
}
.brief-meta{display:flex;align-items:center;gap:8px;font-size:.72rem;color:var(--muted);position:relative;z-index:1}
.brief-pulse{
  width:7px;height:7px;border-radius:50%;background:var(--lime-deep);
  animation:briefPulse 2.6s infinite;
}
@keyframes briefPulse{
  0%{box-shadow:0 0 0 0 rgba(184,224,47,.55)}
  70%{box-shadow:0 0 0 9px rgba(184,224,47,0)}
  100%{box-shadow:0 0 0 0 rgba(184,224,47,0)}
}
.brief-time{flex:1;letter-spacing:.02em}
.brief-refresh{
  width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  font-size:.82rem;color:var(--ink);opacity:.42;
  background:rgba(255,255,255,.72);
  border:1px solid rgba(18,18,15,.07);
  transition:.2s;
}
.brief-refresh:active{transform:rotate(90deg)}
.brief-title{
  position:relative;z-index:1;
  font-size:1.46rem;font-weight:900;letter-spacing:-.035em;line-height:1.28;
  margin:11px 0 10px;
}
.brief-lines{position:relative;z-index:1;display:flex;flex-direction:column;gap:9px}
.brief-lines li{
  position:relative;padding-left:17px;
  font-size:.9rem;line-height:1.6;color:#3b3b33;
}
.brief-lines li::before{
  content:"";position:absolute;left:2px;top:.66em;width:5px;height:5px;border-radius:50%;
  background:var(--ink);opacity:.75;
}
.brief-lines li.sk{
  height:14px;border-radius:7px;padding:0;
  background:linear-gradient(90deg,#eeece4,#f8f6ef,#eeece4);
  background-size:200% 100%;animation:shimmer 1.2s linear infinite;
}
.brief-lines li.sk::before{display:none}
.brief-ask{
  position:relative;z-index:1;
  display:flex;align-items:center;gap:6px;width:100%;
  margin-top:12px;padding:10px 0 6px;
  font-size:.82rem;font-weight:700;color:var(--ink);
  border-top:1px solid var(--line);
}
.brief-ask span{margin-left:auto;color:var(--muted);font-weight:400}
.brief-ask:active{opacity:.6}

/* ---------- 建议卡（确认式执行） ---------- */
.suggest-card{
  background:var(--black);color:#fff;border-radius:28px;padding:18px 18px 14px;
  box-shadow:0 26px 50px -34px rgba(0,0,0,.75);
  animation:screenIn .3s cubic-bezier(.22,.8,.3,1) both;
}
.suggest-tag{
  display:inline-flex;align-items:center;gap:6px;
  font-size:.64rem;letter-spacing:.16em;color:var(--lime);
}
.suggest-tag::before{content:"";width:5px;height:5px;border-radius:50%;background:var(--lime)}
.suggest-reason{font-size:1rem;font-weight:700;line-height:1.5;margin:10px 0 4px}
.suggest-act{font-size:.76rem;color:rgba(255,255,255,.5);line-height:1.5}
.suggest-btns{display:flex;gap:8px;margin-top:14px}
.suggest-yes{
  flex:1;padding:12px;border-radius:15px;background:var(--lime);color:#172000;
  font-weight:800;font-size:.85rem;
}
.suggest-no{
  padding:12px 16px;border-radius:15px;background:rgba(255,255,255,.1);
  color:rgba(255,255,255,.75);font-size:.85rem;
}
.suggest-yes:active,.suggest-no:active{transform:scale(.97)}

/* ---------- 对话入口 ---------- */
.chat-fab{
  position:fixed;left:50%;transform:translateX(-50%);
  bottom:calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
  z-index:45;display:flex;align-items:center;gap:8px;
  background:var(--black);color:#fff;
  padding:12px 20px;border-radius:999px;
  font-size:.84rem;font-weight:700;
  box-shadow:0 20px 40px -16px rgba(0,0,0,.55);
  transition:opacity .25s,transform .25s;
}
.chat-fab .fab-dot{width:7px;height:7px;border-radius:50%;background:var(--lime)}
.chat-fab.hide{opacity:0;transform:translate(-50%,14px);pointer-events:none}
.chat-fab:active{transform:translate(-50%,0) scale(.97)}

/* ---------- 子页面（对话 / 记忆 / 大脑） ---------- */
.screen-sub{padding-bottom:18px}
body.sub .tabbar,body.sub .chat-fab{display:none}
body.sub .app-head{display:none}
body.sub #app{padding-bottom:28px}
.screen[data-screen="chat"]{min-height:calc(100vh - 36px)}
.screen[data-screen="chat"] .chat-body{flex:1}

.chat-top{display:flex;align-items:center;gap:10px;padding:4px 0 10px}
.chat-back{
  width:36px;height:36px;flex:0 0 36px;border-radius:50%;
  background:rgba(18,18,15,.06);font-size:1.15rem;line-height:1;
  display:grid;place-items:center;
}
.chat-who{flex:1;display:flex;flex-direction:column;line-height:1.3;min-width:0}
.chat-who b{font-size:.96rem;letter-spacing:-.01em}
.chat-who span{
  font-size:.68rem;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.chat-dot{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#cfcfc6}
.chat-dot.on{background:var(--lime-deep);box-shadow:0 0 0 3px rgba(184,224,47,.22)}

.chat-body{
  display:flex;flex-direction:column;gap:12px;
  padding:8px 0 14px;min-height:38vh;
}
.chat-day{align-self:center;font-size:.66rem;color:var(--muted);padding:4px 0}
.bubble{
  max-width:85%;padding:12px 15px;border-radius:20px;
  font-size:.9rem;line-height:1.62;white-space:pre-wrap;word-break:break-word;
  animation:bubbleIn .28s cubic-bezier(.22,.8,.3,1) both;
}
@keyframes bubbleIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.bubble.them{background:var(--card);border-bottom-left-radius:7px;align-self:flex-start;
  box-shadow:0 12px 26px -24px rgba(0,0,0,.6)}
.bubble.me{background:var(--black);color:#fff;border-bottom-right-radius:7px;align-self:flex-end}
.bubble.typing{color:var(--muted);letter-spacing:.15em}

.chat-quick{
  display:flex;gap:8px;overflow-x:auto;padding:6px 0 10px;
  -ms-overflow-style:none;scrollbar-width:none;
}
.chat-quick::-webkit-scrollbar{display:none}
.chat-quick button{
  flex:0 0 auto;padding:9px 14px;border-radius:999px;
  background:rgba(18,18,15,.055);font-size:.77rem;color:#4d4d44;
}
.chat-quick button:active{background:rgba(18,18,15,.11)}

.chat-form{
  position:sticky;bottom:0;display:flex;gap:0;align-items:center;
  padding:10px 0 calc(6px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg,rgba(243,241,234,0),var(--bg) 32%);
}
.chat-field{
  flex:1;display:flex;align-items:center;gap:6px;
  background:#fff;border:1px solid var(--line);
  border-radius:24px;padding:5px 8px 5px 5px;
}
.chat-field:focus-within{border-color:rgba(18,18,15,.28)}
.chat-field input{
  flex:1;min-width:0;padding:11px 4px;border:0;background:transparent;
  font:inherit;font-size:.92rem;outline:none;
}
.chat-field button:disabled{opacity:.45}

/* ---------- 记忆 ---------- */
.mem-form{display:flex;gap:8px;padding:2px 0 14px}
.mem-form select{
  flex:0 0 88px;padding:12px 10px;border-radius:14px;border:1px solid var(--line);
  background:#fff;font:inherit;font-size:.8rem;outline:none;color:var(--ink);
}
.mem-form input{
  flex:1;min-width:0;padding:12px 14px;border-radius:14px;border:1px solid var(--line);
  background:#fff;font:inherit;font-size:.86rem;outline:none;
}
.mem-form button{
  flex:0 0 52px;border-radius:14px;background:var(--ink);color:var(--lime);
  font-weight:800;font-size:.84rem;
}
.mem-list{display:flex;flex-direction:column;gap:10px}
.mem-item{
  display:flex;gap:10px;align-items:flex-start;
  background:var(--card);border-radius:20px;padding:14px 15px;
  box-shadow:0 14px 30px -30px rgba(0,0,0,.5);
}
.mem-kind{
  flex:0 0 auto;font-size:.64rem;padding:3px 8px;border-radius:999px;
  background:rgba(18,18,15,.06);color:#5d5d53;white-space:nowrap;margin-top:1px;
}
.mem-text{flex:1;font-size:.88rem;line-height:1.55}
.mem-text[contenteditable="true"]{outline:1px dashed rgba(18,18,15,.25);border-radius:6px;padding:2px 4px}
.mem-del{color:var(--muted);font-size:.72rem;padding:2px 2px;flex:0 0 auto}
.mem-empty{
  padding:26px 10px;text-align:center;font-size:.8rem;color:var(--muted);line-height:1.7;
}

/* ---------- 大脑设置 ---------- */
.brain-card{
  background:var(--card);border-radius:26px;padding:18px;
  box-shadow:0 18px 40px -32px rgba(0,0,0,.5);
}
.brain-state{
  font-size:.76rem;color:var(--muted);
  padding:10px 12px;border-radius:14px;background:rgba(18,18,15,.04);
  margin-bottom:14px;
}
.brain-state.on{background:rgba(61,220,151,.14);color:#1d7a4d}
.brain-form{display:flex;flex-direction:column}
.brain-form label{font-size:.7rem;color:var(--muted);margin:8px 0 4px}
.brain-form input{
  padding:12px 14px;border-radius:14px;border:1px solid var(--line);
  background:#faf9f5;font:inherit;font-size:.85rem;outline:none;
}
.brain-form input:focus{border-color:rgba(18,18,15,.3)}
.brain-actions{display:flex;gap:8px;margin-top:16px}
.btn-dark{
  flex:1;padding:12px;border-radius:14px;background:var(--ink);color:var(--lime);
  font-weight:800;font-size:.88rem;
}
.brain-hint{font-size:.71rem;color:var(--muted);line-height:1.7;margin-top:14px}

/* ---------- 我的：入口行 ---------- */
.link-block{padding:4px 6px}
.link-row{
  display:flex;align-items:center;gap:12px;width:100%;
  padding:14px 10px;border-bottom:1px solid var(--line);text-align:left;
}
.link-row:last-child{border-bottom:0}
.link-row:active{opacity:.6}
.link-ico{width:26px;text-align:center;font-size:.95rem}
.link-name{flex:1;font-size:.93rem;font-weight:600}
.link-val{font-size:.76rem;color:var(--muted)}
.link-arrow{color:var(--muted);font-size:.9rem}

/* =========================================================
   五个 Tab：聊天 / Today / 任务 / 记忆 / 我
   ========================================================= */

.tabbar{grid-template-columns:repeat(5,1fr)}
.tab span{font-size:.63rem}

body.chat-mode .app-head{display:none}

/* 聊天页：整屏固定，只滚对话区 */
body.chat-mode{overflow:hidden}
body.chat-mode #app{
  height:100dvh;min-height:0;
  padding:calc(14px + env(safe-area-inset-top)) 20px 0;
  display:flex;flex-direction:column;
}
body.chat-mode .screens{flex:1;min-height:0;display:flex;flex-direction:column}
body.chat-mode .screen-chat{
  flex:1;min-height:0;display:flex;flex-direction:column;gap:0;
  padding-bottom:calc(var(--tabbar-h) + 4px);
}
body.chat-mode .chat-body{
  flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  padding:8px 0 12px;
}
body.chat-mode .chat-top{flex:0 0 auto}
body.chat-mode .chat-quick{flex:0 0 auto;padding:6px 0 8px}
body.chat-mode .chat-form{flex:0 0 auto;position:static;padding:6px 0 4px}

.chat-top{padding-top:6px}
.chat-gear{
  width:36px;height:36px;flex:0 0 36px;border-radius:50%;
  background:rgba(18,18,15,.05);font-size:1rem;color:var(--muted);
  display:grid;place-items:center;
}

/* ---------- 专注入口 ---------- */
.ring-focus{
  margin-top:12px;font-size:.78rem;color:var(--muted);
  padding:6px 12px;border-radius:999px;background:rgba(18,18,15,.05);
}
.ring-focus:active{background:rgba(18,18,15,.1)}

/* ---------- 身体信号 ---------- */
.signal-row{display:flex;align-items:center;gap:8px;padding:4px 0 6px}
.signal-row label{font-size:.76rem;color:var(--muted);display:flex;align-items:center;gap:4px}
.signal-row input{
  width:58px;padding:8px 8px;border-radius:12px;border:1px solid var(--line);
  background:#faf9f5;font:inherit;font-size:.84rem;outline:none;text-align:center;
}
.signal-row input:focus{border-color:rgba(18,18,15,.3)}
.signal-row button{
  margin-left:auto;padding:8px 16px;border-radius:12px;
  background:rgba(18,18,15,.06);font-size:.8rem;font-weight:700;
}

/* ---------- 任务：模板库 ---------- */
.head-actions{display:flex;align-items:center;gap:6px}
.head-actions .mini-btn{width:auto;padding:0 10px;height:30px;font-size:.74rem;border-radius:999px}

.tpl-head{margin-top:6px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.tpl-head h3{font-size:.95rem}
.tpl-cats{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:2px 0}
.tpl-cats::-webkit-scrollbar{display:none}
.tpl-cats button{
  flex:0 0 auto;padding:6px 11px;border-radius:999px;
  font-size:.72rem;color:var(--muted);background:rgba(18,18,15,.05);
}
.tpl-cats button.on{background:var(--black);color:#fff}

.tpl-grid{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.tpl-card{
  position:relative;display:grid;grid-template-columns:40px 1fr 32px;grid-template-rows:auto auto;
  gap:2px 10px;align-items:center;text-align:left;
  background:var(--card);border-radius:22px;padding:14px 16px;
  box-shadow:0 14px 30px -28px rgba(0,0,0,.5);
}
.tpl-card:active{transform:scale(.99)}
.tpl-emoji{grid-column:1;grid-row:1 / span 2;font-size:1.35rem;text-align:center}
.tpl-title{grid-column:2;grid-row:1;font-size:.9rem;font-weight:700}
.tpl-desc{grid-column:2;grid-row:2;font-size:.72rem;color:var(--muted);line-height:1.5}
.tpl-plus{
  grid-column:3;grid-row:1 / span 2;width:28px;height:28px;border-radius:50%;
  background:rgba(18,18,15,.06);display:grid;place-items:center;font-size:.9rem;
}

/* ---------- 记忆：档案 + 日记 ---------- */
.profile-hero{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:14px 0 6px;text-align:center;
}
.hero-avatar{
  width:74px;height:74px;border-radius:50%;
  background:var(--black);color:var(--lime);
  display:grid;place-items:center;font-size:1.6rem;font-weight:900;
  box-shadow:0 18px 40px -22px rgba(0,0,0,.6);
}
.profile-hero h2{font-size:1.25rem;letter-spacing:-.02em}
.hero-sub{font-size:.74rem;color:var(--muted)}

.section-head{display:flex;align-items:center;justify-content:space-between;padding:10px 2px 2px}
.section-head h3{font-size:.92rem}
.section-head .sub{font-size:.72rem;color:var(--muted)}

.diary-list{display:flex;flex-direction:column;gap:10px}
.diary-card{
  display:flex;gap:12px;background:var(--card);border-radius:22px;padding:14px 16px;
  box-shadow:0 14px 30px -30px rgba(0,0,0,.5);
}
.diary-card.sk{height:86px;background:linear-gradient(90deg,#eeece4,#f8f6ef,#eeece4);background-size:200% 100%;animation:shimmer 1.2s linear infinite}
.diary-date{
  flex:0 0 42px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  padding-top:2px;color:var(--muted);
}
.diary-date b{font-size:1.05rem;color:var(--ink);line-height:1}
.diary-date span{font-size:.62rem;margin-top:2px}
.diary-body h4{font-size:.92rem;margin-bottom:4px}
.diary-body p{font-size:.8rem;line-height:1.7;color:#4a4a42;white-space:pre-wrap}
.diary-empty{
  padding:22px 12px;text-align:center;font-size:.78rem;color:var(--muted);line-height:1.7;
  background:var(--card);border-radius:20px;
}

/* ---------- 第一次见面 ---------- */
.onboard{
  position:fixed;inset:0;z-index:200;background:var(--bg);
  display:flex;flex-direction:column;justify-content:center;
  padding:32px 26px calc(32px + env(safe-area-inset-bottom));
}
.onboard[hidden]{display:none}
.onb-step{display:none;flex-direction:column;gap:14px;max-width:480px;width:100%;margin:0 auto}
.onb-step.is-active{display:flex;animation:screenIn .4s cubic-bezier(.22,.8,.3,1) both}
.onb-kicker{font-size:.72rem;letter-spacing:.18em;color:var(--muted)}
.onb-step h1{font-size:1.72rem;line-height:1.35;letter-spacing:-.03em;margin-bottom:6px}
.onb-input{
  width:100%;padding:16px 18px;border-radius:18px;border:1px solid rgba(18,18,15,.12);
  background:#fff;font:inherit;font-size:1rem;outline:none;resize:none;
}
.onb-input:focus{border-color:var(--ink)}
.onb-chips{display:flex;gap:8px;flex-wrap:wrap}
.onb-chips button{
  padding:8px 14px;border-radius:999px;background:rgba(18,18,15,.06);font-size:.82rem;
}
.onb-chips button.on{background:var(--black);color:var(--lime)}
.onb-tones{display:flex;flex-direction:column;gap:10px}
.onb-tones button{
  display:flex;flex-direction:column;gap:3px;text-align:left;
  padding:14px 16px;border-radius:18px;border:1px solid rgba(18,18,15,.08);
  background:#fff;transition:.2s;
}
.onb-tones button b{font-size:.95rem}
.onb-tones button span{font-size:.76rem;color:var(--muted)}
.onb-tones button.is-picked{border-color:var(--ink);box-shadow:0 0 0 2px rgba(18,18,15,.06) inset}
.onb-next{
  margin-top:8px;padding:15px;border-radius:16px;background:var(--ink);color:var(--lime);
  font-weight:800;font-size:.95rem;
}
.onb-skip{font-size:.8rem;color:var(--muted);padding:8px}

/* ---------- 清单子页 ---------- */
.screen[data-screen="lists"] .list-stack{margin-top:10px}

/* ---------- 日历 ---------- */
.cal-list{display:flex;flex-direction:column;padding:2px 0 6px}
.cal-item{
  display:flex;align-items:center;gap:10px;
  padding:9px 4px;border-bottom:1px solid var(--line);font-size:.86rem;
}
.cal-item:last-child{border-bottom:0}
.cal-time{
  flex:0 0 46px;font-size:.76rem;color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.cal-item.allday .cal-time{color:var(--ink);font-weight:700;font-size:.72rem}
.cal-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cal-end{font-size:.7rem;color:var(--muted)}
.cal-empty{
  font-size:.78rem;color:var(--muted);padding:14px 6px;
  line-height:1.7;text-align:center;
}

/* ---------- 每日一问 ---------- */
.ask-card{
  background:linear-gradient(178deg,#fffefb,#f7f1e2);
  border:1px solid rgba(18,18,15,.06);
  border-radius:26px;padding:16px 18px 12px;
  box-shadow:0 22px 44px -40px rgba(0,0,0,.55);
}
.ask-kicker{font-size:.64rem;letter-spacing:.16em;color:#8c7a33}
.ask-q{font-size:.98rem;font-weight:700;line-height:1.6;margin:9px 0 12px}
.ask-row{display:flex;gap:8px}
.ask-row input{
  flex:1;min-width:0;padding:11px 14px;border-radius:14px;
  border:1px solid var(--line);background:#fff;font:inherit;font-size:.85rem;outline:none;
}
.ask-row input:focus{border-color:rgba(18,18,15,.28)}
.ask-row button{
  padding:0 18px;border-radius:14px;background:var(--ink);color:var(--lime);
  font-weight:800;font-size:.84rem;
}
.ask-skip{display:block;margin-top:10px;font-size:.72rem;color:var(--muted);padding:2px 0}
.ask-card[hidden]{display:none}

/* ---------- 撤销条 ---------- */
.undo-bar{
  position:fixed;left:50%;bottom:calc(var(--tabbar-h) + 16px);
  transform:translate(-50%,12px);z-index:200;
  display:flex;align-items:center;gap:14px;
  background:#141412;color:#fff;padding:11px 14px 11px 18px;border-radius:999px;
  font-size:.8rem;opacity:0;transition:.25s;
  box-shadow:0 18px 40px -18px rgba(0,0,0,.6);
}
.undo-bar.show{opacity:1;transform:translate(-50%,0)}
.undo-bar button{color:var(--lime);font-weight:800;font-size:.8rem}

/* ---------- 聊天：头像 + 背景 ---------- */
.screen-chat{position:relative;overflow:hidden}
.chat-bg{
  position:absolute;top:-14px;left:-20px;right:-20px;bottom:0;
  background-size:cover;background-position:center;
  opacity:0;transition:opacity .5s;pointer-events:none;z-index:0;
}
.chat-bg.on{opacity:.30}
.chat-bg.on::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(243,241,234,.72),rgba(243,241,234,.86));
}
.chat-top,.chat-body,.chat-quick,.chat-form{position:relative;z-index:1}

.msg{
  display:flex;align-items:flex-end;gap:8px;max-width:90%;
  animation:bubbleIn .28s cubic-bezier(.22,.8,.3,1) both;
}
.msg.them{align-self:flex-start}
.msg.me{align-self:flex-end;flex-direction:row-reverse}
.msg .ava{
  width:30px;height:30px;flex:0 0 30px;border-radius:50%;overflow:hidden;
  background:var(--black);color:var(--lime);
  display:grid;place-items:center;font-size:.72rem;font-weight:800;
}
.msg .ava img{width:100%;height:100%;object-fit:cover;display:block}
.msg .bubble{max-width:100%;animation:none}

/* ---------- 形象设置 ---------- */
.face-list{display:flex;flex-direction:column;gap:10px}
.face-row{
  display:flex;align-items:center;gap:12px;
  background:var(--card);border-radius:20px;padding:12px 14px;
}
.face-prev{
  width:46px;height:46px;flex:0 0 46px;border-radius:50%;
  background:var(--black);color:var(--lime);
  display:grid;place-items:center;font-weight:800;font-size:1rem;
  background-size:cover;background-position:center;
}
.face-prev.wide{
  width:78px;flex:0 0 78px;border-radius:12px;
  background:rgba(18,18,15,.06);color:var(--muted);
  font-size:.68rem;font-weight:600;
}
.face-prev.has{color:transparent}
.face-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.face-meta b{font-size:.88rem}
.face-meta span{font-size:.7rem;color:var(--muted)}
.face-btn{
  padding:8px 12px;border-radius:12px;background:rgba(18,18,15,.06);
  font-size:.76rem;font-weight:700;cursor:pointer;white-space:nowrap;
}
.face-btn:active{background:rgba(18,18,15,.12)}
.face-del{font-size:.72rem;color:var(--muted);padding:6px 2px;white-space:nowrap}

/* ---------- 头像出现在各个位置 ---------- */
.chat-ava{
  width:34px;height:34px;flex:0 0 34px;border-radius:50%;overflow:hidden;
  background:var(--black);color:var(--lime);background-size:cover;background-position:center;
  display:grid;place-items:center;font-size:.8rem;font-weight:800;
}
.chat-ava.has,.hero-avatar.has,.avatar.has,.me-avatar.has{color:transparent}

.ask-kicker{display:flex;align-items:center;gap:6px}
.ask-ava{
  width:20px;height:20px;flex:0 0 20px;border-radius:50%;
  background:rgba(18,18,15,.08);background-size:cover;background-position:center;
}

.hero-avatar{background-size:cover;background-position:center}
.avatar{background-size:cover;background-position:center}
.me-avatar{background-size:cover;background-position:center}

/* ---------- 聊天记录 ---------- */
.chat-gear svg{
  width:17px;height:17px;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}

.day-banner{
  position:relative;z-index:1;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  margin:4px 0 2px;padding:9px 14px;border-radius:14px;
  background:rgba(18,18,15,.055);
  font-size:.74rem;color:var(--muted);
}
.day-banner[hidden]{display:none}
.day-banner button{
  font-size:.74rem;font-weight:700;color:var(--ink);white-space:nowrap;
}

.day-list{display:flex;flex-direction:column;gap:8px;padding-top:6px}
.day-item{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  background:var(--card);border-radius:18px;padding:13px 15px;
  box-shadow:0 12px 26px -28px rgba(0,0,0,.5);
}
.day-item:active{transform:scale(.995)}
.day-item.today{box-shadow:0 0 0 1.5px rgba(18,18,15,.12) inset}
.day-date{flex:0 0 62px;display:flex;flex-direction:column;gap:1px}
.day-date b{font-size:.82rem}
.day-date span{font-size:.64rem;color:var(--muted)}
.day-preview{
  flex:1;min-width:0;font-size:.82rem;color:#4a4a42;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.day-count{flex:0 0 auto;font-size:.68rem;color:var(--muted)}
.day-empty{
  padding:30px 10px;text-align:center;font-size:.8rem;color:var(--muted);
}

/* ---------- 她的气质 ---------- */
.look-box{
  background:linear-gradient(178deg,#fffefb,#f8f2e4);
  border:1px solid rgba(18,18,15,.06);
  border-radius:20px;padding:13px 15px;
}
.look-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.look-head b{font-size:.86rem}
.look-head button{font-size:.72rem;color:var(--muted);font-weight:600}
.look-box p{
  margin-top:6px;font-size:.78rem;line-height:1.7;color:#4a4a42;
}

/* ---------- 调情档位 ---------- */
.flirt-row{display:flex;gap:6px;margin-top:10px}
.flirt-row button{
  flex:1;height:34px;border-radius:10px;
  background:rgba(18,18,15,.055);font-size:.82rem;font-weight:700;
  color:#6a6a60;transition:.15s;
}
.flirt-row button.on{background:var(--black);color:var(--lime)}
.flirt-row button:active{transform:scale(.96)}

/* ---------- 聊天模式 ---------- */
.mode-row{display:flex;gap:6px;margin-top:10px}
.mode-row button{
  flex:1;height:34px;border-radius:10px;
  background:rgba(18,18,15,.055);font-size:.8rem;font-weight:700;
  color:#6a6a60;transition:.15s;
}
.mode-row button.on{background:var(--black);color:var(--lime)}
.mode-row button:active{transform:scale(.96)}
/* ---------- 朗读按钮 ---------- */
.speak{
  flex:0 0 24px;width:24px;height:24px;border-radius:50%;
  display:grid;place-items:center;opacity:.32;transition:.2s;
  align-self:flex-end;margin-bottom:2px;color:var(--ink);
}
.speak:hover,.speak:active{opacity:.85}
.speak svg{
  width:14px;height:14px;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
/* ---------- 按住说话 ---------- */
.mic{
  flex:0 0 34px;width:34px;height:34px;border-radius:50%;
  display:grid;place-items:center;
  background:rgba(18,18,15,.06);color:var(--ink);
  transition:.18s;
}
.mic svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mic.rec{background:#e0554a;color:#fff;transform:scale(1.06)}
.mic.rec svg{stroke:#fff}
/* ---------- 通话界面 ---------- */
.call-screen{
  background:#12120f;color:#fff;
  margin:-14px -20px 0;padding:0;
  min-height:100dvh;
}
body.sub .call-screen{display:none}
body.sub .call-screen.is-active{display:flex}
.call-wrap{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:10px;padding:0 24px calc(32px + env(safe-area-inset-bottom));
}
.call-ava{
  width:104px;height:104px;border-radius:50%;
  background:#232320;color:var(--lime);
  display:grid;place-items:center;font-size:2rem;font-weight:800;
  background-size:cover;background-position:center;
  box-shadow:0 0 0 8px rgba(255,255,255,.04);
  animation:callPulse 2.4s ease-in-out infinite;
}
@keyframes callPulse{
  0%,100%{box-shadow:0 0 0 8px rgba(255,255,255,.04)}
  50%{box-shadow:0 0 0 16px rgba(255,255,255,.02)}
}
.call-wrap h2{font-size:1.1rem;font-weight:700;margin-top:8px}
.call-status{font-size:.8rem;color:rgba(255,255,255,.55)}
.call-dots{display:flex;gap:6px;margin:10px 0 28px}
.call-dots i{width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.35);animation:callDot 1.2s infinite}
.call-dots i:nth-child(2){animation-delay:.2s}
.call-dots i:nth-child(3){animation-delay:.4s}
@keyframes callDot{0%,100%{opacity:.25}50%{opacity:1}}
.call-end{
  width:64px;height:64px;border-radius:50%;background:#e0554a;
  display:grid;place-items:center;
}
.call-end svg{width:26px;height:26px;fill:#fff;stroke:none}
.call-end:active{transform:scale(.94)}
/* ---------- 订阅地址 ---------- */
.ics-box{
  margin-top:14px;padding:13px 15px;border-radius:18px;
  background:rgba(18,18,15,.04);
}
.ics-box p{
  margin-top:6px;font-size:.74rem;line-height:1.6;color:#4a4a42;
  word-break:break-all;
}
/* ---------- 她怎么叫你 ---------- */
.nick-row{display:flex;gap:8px;margin-top:10px}
.nick-row input{
  flex:1;min-width:0;padding:10px 12px;border-radius:10px;
  border:1px solid var(--line);background:#fff;
  font:inherit;font-size:.84rem;outline:none;
}
.nick-row input:focus{border-color:rgba(18,18,15,.28)}
.nick-row button{
  padding:0 16px;border-radius:10px;background:var(--black);color:var(--lime);
  font-weight:800;font-size:.8rem;
}
/* ---------- 聊天记录里的删除 ---------- */
.day-del{
  flex:0 0 auto;padding:6px 4px 6px 10px;
  font-size:.7rem;color:var(--muted);
}
.day-del:active{color:#e0554a}
/* ---------- 输入框右侧按钮 ---------- */
.field-btn{
  flex:0 0 30px;width:30px;height:30px;border-radius:50%;
  display:grid;place-items:center;color:var(--muted);
}
.field-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.field-btn:active{background:rgba(18,18,15,.06)}

/* ---------- 附件面板 ---------- */
.sheet{position:fixed;inset:0;z-index:300;display:flex;align-items:flex-end}
.sheet[hidden]{display:none}
.sheet-mask{position:absolute;inset:0;background:rgba(0,0,0,.28)}
.sheet-body{
  position:relative;width:100%;max-width:480px;margin:0 auto;
  background:var(--bg);border-radius:24px 24px 0 0;
  padding:14px 16px calc(20px + env(safe-area-inset-bottom));
  display:flex;flex-direction:column;gap:8px;
  animation:sheetUp .25s cubic-bezier(.22,.8,.3,1) both;
}
@keyframes sheetUp{from{transform:translateY(30px);opacity:.6}to{transform:none;opacity:1}}
.sheet-body button{
  display:flex;align-items:center;gap:12px;
  padding:14px 16px;border-radius:16px;background:#fff;
  font-size:.9rem;text-align:left;
}
.sheet-body button span{font-size:1.05rem}
.sheet-body button:active{background:#f2efe8}

/* 图片气泡 */
.bubble.img{padding:4px;background:transparent}
.bubble.img img{display:block;max-width:220px;max-height:280px;border-radius:16px}