:root{
  --bg:#fff7ee;
  --card:#fffdf8;
  --ink:#3f2b22;
  --sub:#8b6e62;
  --line:#ead9ce;
  --pink:#ff8aa0;
  --orange:#ffb35c;
  --shadow:0 18px 45px rgba(88,49,28,.16);
}
*{box-sizing:border-box}
body{
  margin:0;
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  background:
    radial-gradient(circle at 10% 5%,rgba(255,138,160,.26),transparent 28%),
    radial-gradient(circle at 90% 15%,rgba(255,179,92,.30),transparent 32%),
    linear-gradient(145deg,#fff7ee,#ffe8ef);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--ink);
  padding:18px;
}
button,input,select,textarea{font:inherit}
button,.item{
  transition:transform .14s ease, box-shadow .14s ease, background .14s ease;
}
button:active,.item:active{
  transform:scale(.985);
}
button:hover,.item:hover{
  box-shadow:0 10px 22px rgba(88,49,28,.09);
}
.hidden{display:none!important}
.app{
  width:min(430px,100%);
  background:rgba(255,253,248,.92);
  border:1px solid rgba(234,217,206,.9);
  border-radius:30px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.gate{
  padding:24px 20px 22px;
  text-align:center;
}
header{
  padding:22px 20px 16px;
  border-bottom:1px solid var(--line);
}
.label{
  display:inline-block;
  font-size:12px;
  color:var(--sub);
  background:#fff3e7;
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:10px;
}
h1{margin:0;font-size:27px;letter-spacing:-.03em}
.desc{margin:8px 0 0;color:var(--sub);font-size:14px;line-height:1.65}
.gate-row,.ai-home,.tiny-row{
  display:flex;
  gap:8px;
  margin-top:14px;
}
.gate-row input,.ai-home input,.tiny-row input{flex:1}
button{
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  cursor:pointer;
}
.gate-row button,.ai-home button{
  background:#fff1f2;
  border-radius:16px;
  padding:0 14px;
  font-weight:800;
}
.tabs{
  display:flex;
  gap:8px;
  overflow:auto;
  padding:14px 14px 0;
}
.tab{
  flex:0 0 auto;
  border-radius:16px;
  padding:11px 12px;
  font-size:13px;
  font-weight:650;
}
.tab.active{
  background:linear-gradient(135deg,#fff0f3,#fff5df);
  border-color:#ffc3b2;
}
main{padding:16px 18px 20px}
.panel{display:none}
.panel.active{display:block}
.bear{
  text-align:center;
  margin:6px 0 10px;
  animation:float 2.2s ease-in-out infinite;
}
.bear img{
  width:86px;
  height:86px;
  object-fit:contain;
  filter:drop-shadow(0 8px 14px rgba(88,49,28,.14));
}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
.bubble{
  background:#fff9f3;
  border:1px solid var(--line);
  border-radius:22px;
  padding:16px;
  line-height:1.75;
  min-height:96px;
  font-size:15px;
  white-space:pre-wrap;
}
.today-board,.food-doc,.feed-box,.wish-box{
  margin-top:14px;
  border:1px dashed #d8b9a7;
  background:#fffdf8;
  border-radius:22px;
  padding:14px;
}
.board-title{
  font-weight:800;
  margin-bottom:8px;
}
.mini{
  color:var(--sub);
  font-size:12px;
  line-height:1.55;
  margin:0 0 10px;
}
.board-grid,.dish,.templates{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.easter{
  display:grid;
  gap:10px;
}
.board-grid button,.dish button,.templates button,.easter button{
  border-radius:18px;
  background:#fff;
  padding:12px 10px;
  font-size:14px;
  box-shadow:0 8px 18px rgba(88,49,28,.06);
}
.dish,.templates{margin-top:14px}
.food-result,.ai-reply{
  margin-top:10px;
  background:#fff9f3;
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  color:var(--sub);
  font-size:14px;
  line-height:1.6;
}
.check{
  display:flex;
  align-items:center;
  gap:5px;
  white-space:nowrap;
  color:var(--sub);
  font-size:12px;
}
.check input{
  width:auto;
}
.menu{
  display:grid;
  gap:10px;
  margin-top:14px;
}
.item{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  border:1px solid var(--line);
  background:#fff;
  border-radius:18px;
  padding:13px 14px;
  box-shadow:0 8px 20px rgba(88,49,28,.06);
  cursor:pointer;
}
.left{display:flex;gap:12px;align-items:center}
.icon{
  width:34px;height:34px;border-radius:12px;
  display:grid;place-items:center;background:#fff1e7;font-size:18px;
}
.name{font-weight:700;font-size:14px}
.note{font-size:12px;color:var(--sub);margin-top:3px}
.arrow{color:#b59586}
.form{
  display:grid;
  gap:10px;
  margin-top:14px;
}
label{
  display:grid;
  gap:6px;
  color:var(--sub);
  font-size:12px;
}
input,select,textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  padding:12px;
  color:var(--ink);
  font-size:14px;
}
textarea{resize:vertical;line-height:1.65}
.send{
  border-radius:18px;
  background:#fff1f2;
  padding:13px 14px;
  color:var(--ink);
  font-size:14px;
  box-shadow:0 8px 20px rgba(88,49,28,.06);
  text-align:center;
  font-weight:800;
}
.soft-btn{
  background:#fff8e8;
}
.two-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.status{margin:8px 0 0;color:var(--sub);font-size:12px;line-height:1.6}
.log{display:grid;gap:8px;margin-top:10px}
.log .note-box,.message{
  background:#fff;
  border:1px solid var(--line);
  border-radius:15px;
  padding:11px 12px;
  line-height:1.55;
  font-size:13px;
}
.admin-list{display:grid;gap:10px;margin-top:12px}
.message-head{color:var(--sub);font-size:12px;margin-bottom:6px}
.message-content{white-space:pre-wrap}
.delete-btn{
  margin-top:8px;
  border-radius:14px;
  background:#fff0f0;
  padding:8px 10px;
  color:var(--ink);
  font-size:12px;
}
.admin-section{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  background:#fffdf8;
}
.admin-section h2{
  margin:0 0 8px;
  font-size:17px;
}
footer{padding:12px 18px 18px;color:var(--sub);font-size:12px;text-align:center}
footer a{color:var(--ink);text-decoration:none}
@media(max-width:390px){
  body{padding:10px}
  .app{border-radius:24px}
  .board-grid,.dish,.templates,.two-actions{grid-template-columns:1fr}
  .gate-row,.ai-home,.tiny-row{flex-direction:column}
  .gate-row button,.ai-home button{padding:12px 14px}
}

.sparkle-card{
  position:relative;
  overflow:hidden;
}
.sparkle-card:after{
  content:"";
  position:absolute;
  right:-30px;
  bottom:-46px;
  width:110px;
  height:110px;
  border-radius:999px;
  background:rgba(255,179,92,.18);
}
.today-board,.food-doc,.feed-box,.wish-box{
  box-shadow:0 10px 24px rgba(88,49,28,.055);
}
.board-grid button:nth-child(1){background:#fff7d9}
.board-grid button:nth-child(2){background:#fff1f2}
.board-grid button:nth-child(3){background:#fff6fb}
.board-grid button:nth-child(4){background:#fff4ee}
.board-grid button:nth-child(5){background:#f7fff4}
.board-grid button:nth-child(6){background:#f8f2ff}


.message.unread{
  border-color:#ffb3c1;
  background:linear-gradient(135deg,#fff,#fff4f7);
}
.message.read{
  opacity:.72;
}
.read-btn{
  margin-top:8px;
  margin-right:6px;
  border-radius:14px;
  background:#f3fff1;
  padding:8px 10px;
  color:var(--ink);
  font-size:12px;
}
.label:after{
  content:"";
}

.icon{
  font-size:13px;
  font-weight:800;
  color:#7a4e36;
}
.label{
  font-weight:600;
}
.desc br + *{
  margin-top:4px;
}

.icon{
  font-size:18px;
  font-weight:700;
}

.tool-bubble{
  min-height:104px;
}
.tool-bubble.pop{
  animation:pop .28s ease;
}
@keyframes pop{
  0%{transform:scale(.985)}
  60%{transform:scale(1.018)}
  100%{transform:scale(1)}
}
.anger-box{
  margin-top:14px;
  border:1px solid var(--line);
  background:linear-gradient(135deg,#fffdf8,#fff2f5);
  border-radius:22px;
  padding:14px;
  box-shadow:0 10px 24px rgba(88,49,28,.055);
}
.anger-line{
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:var(--ink);
  font-size:14px;
}
.anger-line b{
  color:#7a4e36;
}
.anger-meter{
  margin-top:10px;
  height:12px;
  border-radius:999px;
  background:#f3dfd2;
  border:1px solid #ead3c4;
  overflow:hidden;
}
.anger-fill{
  width:18%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#ff8aa0,#ffb35c);
  transition:width .28s ease;
}
.anger-note{
  margin-top:9px;
  color:var(--sub);
  font-size:12px;
  line-height:1.55;
}
.tool-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:14px;
}
.tool-grid button{
  border-radius:20px;
  background:#fff;
  padding:14px 12px;
  text-align:left;
  box-shadow:0 8px 18px rgba(88,49,28,.06);
}
.tool-grid button b{
  display:block;
  margin-top:8px;
  font-size:14px;
}
.tool-grid button small{
  display:block;
  margin-top:4px;
  color:var(--sub);
  font-size:12px;
  line-height:1.35;
}
.tool-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:#fff1e7;
  font-size:18px;
}
@media(max-width:390px){
  .tool-grid{grid-template-columns:1fr}
}

.tool-ai-btn{
  width:100%;
  margin-top:12px;
  border-radius:16px;
  background:#fff8e8;
  padding:11px 12px;
  color:var(--ink);
  font-weight:800;
  box-shadow:0 8px 18px rgba(88,49,28,.05);
}

.desc{
  line-height:1.7;
}

.welcome-gate{
  min-height:560px;
  display:grid;
  place-items:center;
  padding:28px 22px;
  border-bottom:0;
}
.welcome-card{
  width:100%;
  text-align:center;
  display:grid;
  justify-items:center;
  gap:10px;
}
.avatar{
  width:132px;
  height:132px;
  border-radius:38px;
  object-fit:cover;
  border:6px solid rgba(255,255,255,.88);
  box-shadow:0 18px 38px rgba(88,49,28,.18);
  animation:avatarFloat 2.8s ease-in-out infinite;
}
.welcome-pill{
  display:inline-block;
  font-size:12px;
  color:var(--sub, #8b6e62);
  background:#fff3e7;
  border:1px solid var(--line, #ead9ce);
  padding:6px 10px;
  border-radius:999px;
  margin-top:4px;
}
.welcome-btn{
  margin-top:8px;
  width:min(260px,100%);
  border-radius:999px;
  padding:14px 18px;
  font-weight:900;
  background:linear-gradient(135deg,#fff1f2,#fff8e8);
  box-shadow:0 12px 26px rgba(88,49,28,.10);
}
.welcome-card.opening .avatar{
  animation:avatarOpen .68s ease forwards;
}
.welcome-card.opening h1,
.welcome-card.opening .desc,
.welcome-card.opening .welcome-pill,
.welcome-card.opening .welcome-btn{
  animation:softUp .58s ease forwards;
}
.fade-out{
  animation:gateFade .5s ease forwards;
}
.station-enter{
  animation:stationIn .42s ease both;
}
@keyframes avatarFloat{
  0%,100%{transform:translateY(0) rotate(-1deg)}
  50%{transform:translateY(-7px) rotate(1deg)}
}
@keyframes avatarOpen{
  0%{transform:scale(1) rotate(0)}
  55%{transform:scale(1.08) rotate(-2deg)}
  100%{transform:scale(.96) rotate(0); opacity:.72}
}
@keyframes softUp{
  0%{transform:translateY(0); opacity:1}
  100%{transform:translateY(-12px); opacity:.25}
}
@keyframes gateFade{
  from{opacity:1; filter:blur(0)}
  to{opacity:0; filter:blur(8px)}
}
@keyframes stationIn{
  from{opacity:0; transform:translateY(14px) scale(.985)}
  to{opacity:1; transform:translateY(0) scale(1)}
}
@media(max-width:390px){
  .welcome-gate{min-height:520px}
  .avatar{width:118px;height:118px;border-radius:34px}
}

.treasure-title{
  min-height:auto;
}
.treasure-chat{
  margin-top:14px;
  height:360px;
  overflow:auto;
  border:1px solid var(--line, #ead9ce);
  border-radius:22px;
  background:linear-gradient(135deg,#fffdf8,#fff7fb);
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow:0 10px 24px rgba(88,49,28,.055);
}
.treasure-empty{
  color:var(--sub, #8b6e62);
  font-size:13px;
  line-height:1.6;
  text-align:center;
  margin:auto;
}
.chat-row{
  display:flex;
  flex-direction:column;
  max-width:86%;
}
.chat-row.user{
  align-self:flex-end;
  align-items:flex-end;
}
.chat-row.assistant{
  align-self:flex-start;
  align-items:flex-start;
}
.chat-name{
  font-size:11px;
  color:var(--sub, #8b6e62);
  margin:0 8px 4px;
}
.chat-bubble{
  border:1px solid var(--line, #ead9ce);
  border-radius:18px;
  padding:10px 12px;
  line-height:1.65;
  font-size:14px;
  white-space:pre-wrap;
  background:#fff;
}
.chat-row.user .chat-bubble{
  background:#fff1f2;
  border-color:#ffc3b2;
}
.chat-row.assistant .chat-bubble{
  background:#fff8e8;
}
.treasure-form{
  margin-top:12px;
  display:grid;
  gap:10px;
}
.treasure-form textarea{
  min-height:86px;
}
@media(max-width:390px){
  .treasure-chat{height:320px}
  .chat-row{max-width:92%}
}

.admin-app{
  min-height:560px;
}
.admin-tabs{
  display:flex;
  gap:8px;
  overflow:auto;
  padding:14px 14px 0;
  border-top:1px solid var(--line, #ead9ce);
}
.admin-tab{
  flex:0 0 auto;
  border-radius:16px;
  padding:11px 14px;
  font-size:13px;
  font-weight:800;
  border:1px solid var(--line, #ead9ce);
  background:#fff;
  color:var(--ink, #3f2b22);
}
.admin-tab.active{
  background:linear-gradient(135deg,#fff0f3,#fff5df);
  border-color:#ffc3b2;
}
.admin-panel{
  display:none;
}
.admin-panel.active{
  display:block;
}
.section-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}
.section-row h2{
  margin:0;
}
.danger-btn{
  border-radius:14px;
  background:#fff0f0;
  border:1px solid #ffd0d0;
  color:#7a2f2f;
  padding:8px 10px;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.chat-admin-list{
  max-height:520px;
  overflow:auto;
  padding-right:2px;
}
.treasure-record.user-record{
  background:#fff1f2;
  border-color:#ffc3b2;
}
.treasure-record.assistant-record{
  background:#fff8e8;
}
@media(max-width:390px){
  .section-row{
    align-items:flex-start;
    flex-direction:column;
  }
}
