/* ============================================================
 * style.css — 成长工作台 v3（可爱/二次元浅色主题）
 * ============================================================ */
:root{
  --bg:#fff5f7; --panel:#ffffff; --ink:#4a2c36; --sub:#8c6f78;
  --line:#ffdce5; --brand:#ff85a2; --brand2:#ff9eb5; --accent:#ffb86c;
  --shadow:0 2px 8px rgba(255,133,162,.12), 0 10px 30px rgba(74,44,54,.06);
  --radius:18px;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  background:linear-gradient(135deg,#fff5f7 0%,#fff9fb 50%,#fff0f5 100%);
  color:var(--ink); -webkit-font-smoothing:antialiased;
}
.app{display:flex; min-height:100vh}

/* ---------- 侧边栏 ---------- */
.sidebar{
  width:210px; flex:0 0 210px; background:linear-gradient(180deg,#4a2c36,#3a222b);
  color:#ffe4ec; padding:22px 14px; display:flex; flex-direction:column; gap:6px;
}
.logo{font-size:18px; font-weight:800; margin-bottom:18px; padding:0 6px; color:#fff}
.sidebar nav{display:flex; flex-direction:column; gap:5px}
.sidebar button{
  text-align:left; background:transparent; border:0; color:#ffdce5;
  padding:11px 12px; border-radius:12px; cursor:pointer; font-size:14px; transition:.15s;
}
.sidebar button:hover{background:rgba(255,255,255,.1); color:#fff}
.sidebar button.active{background:linear-gradient(90deg,var(--brand),var(--brand2)); color:#fff; font-weight:700}
.side-foot{margin-top:auto; font-size:14px; font-weight:700; color:#ffbad0; padding:10px; text-align:center; background:rgba(255,255,255,.08); border-radius:12px}

/* ---------- 主区 ---------- */
.main{flex:1; padding:24px 32px 60px; max-width:1100px; margin:0 auto; width:100%}
h1{font-size:24px; margin:0 0 6px; color:#4a2c36}
.sub{color:var(--sub); margin:0 0 18px; font-size:14px}
.empty{color:var(--sub); padding:10px; font-size:13px}
.view{animation:fade .3s ease}
@keyframes fade{from{opacity:0; transform:translateY(6px)}to{opacity:1; transform:translateY(0)}}

.row{display:flex; align-items:center; gap:12px; margin:12px 0; flex-wrap:wrap}
.hint{color:var(--sub); font-size:13px}
.primary{background:linear-gradient(90deg,var(--brand),var(--brand2)); color:#fff; border:0;
  padding:10px 18px; border-radius:999px; cursor:pointer; font-size:14px; font-weight:700; transition:.15s; box-shadow:0 4px 14px rgba(255,133,162,.35)}
.primary:hover{filter:brightness(1.05); transform:translateY(-1px)}
.primary:disabled{opacity:.6; cursor:default; transform:none}
.primary.big{padding:14px 26px; font-size:16px}
.secondary{background:#fff; border:1.5px solid var(--brand); color:var(--brand); padding:9px 16px; border-radius:999px; cursor:pointer; font-size:14px; font-weight:600}
.secondary:hover{background:#fff0f4}
.del{background:#fff0f0; color:#e11d48; border:1px solid #fecdd3; padding:6px 10px; border-radius:8px; cursor:pointer; font-size:13px}
.link{background:transparent; border:0; color:var(--brand); text-decoration:underline; cursor:pointer; font-size:13px}
.mini{padding:5px 12px; font-size:12px}
button{font-family:inherit}

input,select,textarea{
  font-family:inherit; font-size:14px; padding:11px 14px; border:1.5px solid var(--line);
  border-radius:12px; background:#fff; color:var(--ink); outline:none; transition:.15s;
}
input:focus,select:focus,textarea:focus{border-color:var(--brand); box-shadow:0 0 0 4px rgba(255,133,162,.12)}
textarea{min-height:90px; resize:vertical; line-height:1.6}
input[type="range"]{padding:0}
pre{white-space:pre-wrap; word-break:break-word; font-family:inherit; margin:0}

.panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow); margin-top:16px}
.panel h3{margin:0 0 12px; font-size:15px; color:#6b3f4d}
.panel.danger{border-color:#fecdd3}

/* ---------- 首页 ---------- */
.hero{display:flex; justify-content:space-between; align-items:center; background:linear-gradient(135deg,#fff0f5,#ffe4ed); border:1px solid #ffdce5; border-radius:var(--radius); padding:24px 28px; box-shadow:var(--shadow)}
.hero h1{margin:0}
.cat-hero{font-size:46px; filter:drop-shadow(0 4px 8px rgba(255,133,162,.25)); animation:sway 3s ease-in-out infinite}
@keyframes sway{0%,100%{transform:rotate(-6deg)}50%{transform:rotate(6deg)}}
.dash-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; margin-top:18px}
.card{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); cursor:pointer; transition:.15s}
.card:hover{transform:translateY(-3px)}
.card-title{font-size:13px; color:var(--sub); margin-bottom:6px}
.card .big{font-size:36px; font-weight:800; color:var(--brand); margin:4px 0}
.card-sub{font-size:13px; color:var(--sub); margin-bottom:12px}
.pomocard .big{color:#ff6b6b}
.drinkcard.active{background:linear-gradient(135deg,#fff7ed,#fff); border-color:#fed7aa}
.drinkcard .big{color:#f59e0b}
.taskcard .big{color:#6366f1}
.cat-svg{width:120px;height:120px;filter:drop-shadow(0 6px 12px rgba(255,133,162,.25))}
.cat-tail{transform-origin:28px 78px; animation:tail 2.4s ease-in-out infinite}
.cat-eye{animation:blink 4s infinite}
@keyframes tail{0%,100%{transform:rotate(-10deg)}50%{transform:rotate(14deg)}}
@keyframes blink{0%,92%,100%{opacity:1}95%{opacity:0}}
.quote{font-size:16px; color:#6b3f4d; font-weight:600}
.sug-list{display:flex; gap:12px; flex-wrap:wrap}
.sug{background:#fff8fb; border:1px solid var(--line); border-radius:999px; padding:8px 14px; display:flex; align-items:center; gap:8px; font-size:13px}
.sug-type{background:var(--brand); color:#fff; padding:2px 8px; border-radius:999px; font-size:11px}

/* ---------- 番茄钟 ---------- */
.pomo-ring{width:260px;height:260px;border-radius:50%;margin:24px auto;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fff;border:8px solid #ffe4ed;box-shadow:var(--shadow);transition:.3s}
.pomo-ring.work.running{border-color:#ff85a2; box-shadow:0 0 40px rgba(255,133,162,.25)}
.pomo-ring.break.running{border-color:#81e6d9; box-shadow:0 0 40px rgba(129,230,217,.25)}
.pomo-time{font-size:58px;font-weight:800;color:#4a2c36;letter-spacing:2px}
.pomo-label{color:var(--sub);font-size:15px;margin-top:4px}
.pomo-controls{display:flex;gap:14px;justify-content:center;margin-top:10px}

/* ---------- 工作清单 ---------- */
.task-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.banner{background:var(--bg,#fff5f7);border:2px dashed var(--c,#ddd);border-radius:var(--radius);padding:14px 16px;margin-bottom:14px;box-shadow:var(--shadow)}
.banner-head{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:var(--c);margin-bottom:10px}
.banner-head .add{background:#fff;border:1.5px solid var(--c);color:var(--c);width:28px;height:28px;border-radius:50%;cursor:pointer;font-weight:700}
.task-row{display:flex;gap:10px;flex-wrap:wrap}
.quad-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-bottom:14px}
.quad{border:2px solid;border-radius:var(--radius);padding:14px;min-height:160px;box-shadow:var(--shadow)}
.quad-head{display:flex;justify-content:space-between;align-items:center;font-weight:700;margin-bottom:10px}
.quad-head .add{background:#fff;border:1.5px solid currentColor;width:26px;height:26px;border-radius:50%;cursor:pointer;font-weight:700}
.quad-tasks{display:flex;flex-direction:column;gap:8px}
.tchip{background:#fff;border:1px solid #f3d4de;border-radius:12px;padding:10px 12px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.tchip.done{opacity:.6; text-decoration:line-through}
.tchip-title{font-weight:600;font-size:14px}
.tchip-meta{font-size:11px;color:var(--sub);margin:3px 0 6px}
.tchip-actions{display:flex;gap:6px;align-items:center}
.tchip-actions button{background:#fff5f7;border:1px solid #ffdce5;color:#8c6f78;border-radius:8px;cursor:pointer;font-size:12px;padding:4px 8px}
.tchip-actions select{font-size:12px;padding:4px 8px;border-radius:8px;border:1px solid #ffdce5;background:#fff}

/* ---------- 糖水铺子 ---------- */
.drink-shop{display:grid;grid-template-columns:1.2fr 1fr;gap:18px}
.drink-counter{display:flex;align-items:center;justify-content:center;min-height:260px}
.drink-card{background:#fff;border:2px solid #ffdce5;border-radius:var(--radius);padding:28px 32px;text-align:center;box-shadow:var(--shadow);max-width:320px;width:100%}
.drink-card.active{border-color:#ffb86c;background:linear-gradient(135deg,#fff7ed,#fff)}
.drink-emoji{font-size:64px;margin-bottom:10px}
.drink-name{font-size:22px;font-weight:800;color:#4a2c36;margin-bottom:6px}
.drink-flavor{color:var(--sub);font-size:14px;margin-bottom:10px}
.drink-buff{display:inline-block;background:linear-gradient(90deg,#ff85a2,#ffb86c);color:#fff;padding:5px 14px;border-radius:999px;font-weight:700;font-size:13px;margin-bottom:8px}
.drink-reason{font-size:12px;color:var(--sub)}
.history-list{display:flex;flex-direction:column;gap:8px}
.hitem{background:#fff8fb;border:1px solid var(--line);border-radius:10px;padding:8px 12px;font-size:13px}

/* ---------- line 聊天 ---------- */
.line-chat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);display:flex;flex-direction:column;height:460px}
.line-messages{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px}
.line-empty{color:var(--sub);text-align:center;margin-top:80px}
.line-bubble{max-width:75%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.5}
.line-bubble.user{align-self:flex-end;background:linear-gradient(90deg,#ff85a2,#ff9eb5);color:#fff;border-bottom-right-radius:4px}
.line-bubble.assistant{align-self:flex-start;background:#fff0f4;color:#4a2c36;border-bottom-left-radius:4px}
.line-input{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line)}
.line-input input{flex:1}

/* 话题栏 */
.topic-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 14px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:10px 14px;box-shadow:var(--shadow)}
.topic-label{font-size:13px;color:var(--sub);font-weight:600}
.topic-btn{background:#fff0f4;border:1.5px solid #ffd6e2;color:#d6336c;padding:7px 13px;border-radius:999px;cursor:pointer;font-size:13px;font-weight:600;transition:.15s}
.topic-btn:hover{background:#ffe0ea;transform:translateY(-1px)}
.topic-btn:disabled{opacity:.5;cursor:default;transform:none}
.line-bubble.typing{color:var(--sub);letter-spacing:2px;animation:dots 1.2s infinite}
@keyframes dots{0%,100%{opacity:.3}50%{opacity:1}}

/* 朋友档案 */
.topic-btn.memory{background:#eef2ff;border-color:#c7d2fe;color:#4f46e5}
.friend-memory{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow);margin:0 0 14px}
.friend-memory .fm-head{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#4f46e5;font-size:14px;margin-bottom:8px}
.friend-memory textarea{width:100%;min-height:80px;font-size:14px}
.friend-memory .hint{margin:6px 0 0}

/* ---------- 设置 ---------- */
.settings-grid{display:grid;grid-template-columns:160px 1fr;gap:12px 16px;align-items:center;max-width:640px}
.settings-grid label{color:var(--sub);font-size:14px}
.filebtn{display:inline-block;background:#fff0f4;color:var(--brand);padding:9px 16px;border-radius:999px;cursor:pointer;font-size:14px;font-weight:600}

/* ---------- 弹窗 ---------- */
.mask{position:fixed;inset:0;background:rgba(74,44,54,.45);display:flex;align-items:center;justify-content:center;z-index:50;padding:20px}
.maid-modal{background:#fff;border:3px solid #ff85a2;border-radius:24px;padding:34px 40px;text-align:center;max-width:340px;animation:pop .35s cubic-bezier(.2,1.4,.4,1)}
.maid-cat{font-size:64px;margin-bottom:10px;animation:sway 2s ease-in-out infinite}
.maid-msg{font-size:18px;font-weight:700;color:#4a2c36;margin-bottom:18px;line-height:1.6}
@keyframes pop{0%{transform:scale(.75);opacity:0}100%{transform:scale(1);opacity:1}}

.review-modal{background:#fff;border-radius:var(--radius);width:100%;max-width:520px;max-height:70vh;display:flex;flex-direction:column;box-shadow:var(--shadow)}
.review-modal h3{margin:0;padding:16px 18px;border-bottom:1px solid var(--line);color:#6b3f4d}
.review-messages{flex:1;overflow-y:auto;padding:16px 18px;display:flex;flex-direction:column;gap:10px}
.rev-bubble{max-width:82%;padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.6}
.rev-bubble.user{align-self:flex-end;background:#ffebf0}
.rev-bubble.assistant{align-self:flex-start;background:#fff5f7;border:1px solid var(--line)}
.review-input{display:flex;gap:8px;padding:12px 18px;border-top:1px solid var(--line)}
.review-input input{flex:1}

.task-modal{background:#fff;border-radius:var(--radius);width:100%;max-width:460px;padding:22px 24px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:10px}
.task-modal h3{margin:0 0 6px;color:#6b3f4d}
.ai-points{background:#fff8fb;border:1px solid var(--line);border-radius:12px;padding:12px}
.challenge{display:flex;gap:8px;margin-top:8px}
.challenge input{flex:1}

.gacha-modal{background:#fff;border-radius:var(--radius);width:100%;max-width:560px;padding:22px 24px;box-shadow:var(--shadow)}
.gacha-candidates{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-top:14px}
.gc-card{background:#fff8fb;border:2px solid var(--line);border-radius:14px;padding:14px;text-align:center}
.gc-title{font-weight:700;font-size:15px;margin-bottom:4px}
.gc-meta{font-size:12px;color:var(--sub);margin-bottom:10px}
.gc-loading{color:var(--sub);text-align:center;padding:20px}
.gc-result{text-align:center;margin-top:14px;font-weight:700;color:var(--brand)}

.confirm-box{background:#fff;border-radius:var(--radius);padding:22px 24px;max-width:340px;text-align:center;box-shadow:var(--shadow)}
.confirm-box p{margin:0 0 14px}

/* ---------- 首次引导 ---------- */
.onboard-modal{background:#fff;border:3px solid #ffd0de;border-radius:26px;padding:30px 34px;max-width:420px;text-align:center;box-shadow:var(--shadow);animation:pop .4s cubic-bezier(.2,1.4,.4,1)}
.onboard-cat{display:flex;justify-content:center;margin-bottom:6px}
.onboard-modal h2{margin:4px 0 6px;color:#4a2c36;font-size:22px}
.onboard-sub{color:var(--sub);font-size:14px;margin:0 0 16px}
.onboard-list{list-style:none;margin:0 0 16px;padding:0;text-align:left;display:flex;flex-direction:column;gap:9px}
.onboard-list li{background:#fff8fb;border:1px solid var(--line);border-radius:12px;padding:9px 14px;font-size:14px;line-height:1.5}
.onboard-list b{color:var(--brand)}
.onboard-tip{background:#fff7ed;border:1px solid #fed7aa;color:#b45309;border-radius:12px;padding:10px 14px;font-size:13px;margin:0 0 18px;line-height:1.5}

/* ---------- toast ---------- */
.toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);background:#4a2c36;color:#fff;padding:11px 22px;border-radius:999px;font-size:14px;box-shadow:var(--shadow);z-index:99;animation:pop .25s}

@media (max-width:860px){
  .sidebar{width:64px;flex:0 0 64px}.logo{font-size:0}    .sidebar button{font-size:0}.side-foot{font-size:0}
  .quad-grid{grid-template-columns:1fr}.drink-shop{grid-template-columns:1fr}.settings-grid{grid-template-columns:1fr}
}

/* ---------- 登录 / 注册 ---------- */
.auth-screen{
  min-height:100vh; width:100%; display:flex; align-items:center; justify-content:center;
  padding:20px; background:linear-gradient(135deg,#fff5f7 0%,#fff0f5 100%);
}
.auth-card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:34px; width:100%; max-width:400px;
}
.auth-card .logo{color:var(--brand); margin-bottom:8px}
.auth-card .form-row{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.auth-card label{font-size:13px;color:var(--sub);font-weight:600}
.auth-card input{
  padding:12px 14px; border:1px solid var(--line); border-radius:12px; font-size:15px;
  background:#fff8fb; color:var(--ink);
}
.auth-card input:focus{outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(255,133,162,.15)}
.auth-card button.primary{padding:12px; border-radius:12px; font-size:15px}
.auth-card .link{background:transparent; border:0; color:var(--brand); cursor:pointer; font-size:14px}
.auth-card .link:hover{text-decoration:underline}

/* ---------- 用户信息 ---------- */
.user-chip{
  display:flex; align-items:center; justify-content:space-between;
  background:rgba(255,255,255,.1); border-radius:12px; padding:9px 12px;
  margin:-8px 0 12px; font-size:13px; color:#ffdce5;
}
.user-chip button.link{color:#fff; font-size:12px; padding:0}

