/* 专注陪伴型学习机器人 — 视觉规范
   底色：米白 #F7F5F0 / 卡片 #FFFFFF / 文字 #2E3A37 / 次要 #8A9691
   主色：淡青 #7FA6A0 / 浅青底 #E6EFEC / 暖砂强调 #D9BFA6
*/

:root{
  --bg:#F7F5F0;
  --card:#FFFFFF;
  --ink:#2E3A37;
  --ink-soft:#5C6B66;
  --muted:#93A09B;
  --line:#E8E4DC;
  --accent:#7FA6A0;
  --accent-deep:#5F8C85;
  --accent-soft:#E6EFEC;
  --sand:#D9BFA6;
  --danger:#C98A7D;
  --radius:18px;
  --shadow:0 1px 2px rgba(46,58,55,.04), 0 8px 24px rgba(46,58,55,.05);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:"PingFang SC","Microsoft YaHei","Hiragino Sans GB","Source Han Sans SC",system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:15px;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{margin:0;font-weight:600;letter-spacing:.01em}
button{font-family:inherit;cursor:pointer}
input{font-family:inherit}

.app{
  max-width:1120px;
  margin:0 auto;
  padding:28px 22px 40px;
}

/* 顶栏 */
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  gap:16px;margin-bottom:22px;
}
.brand{display:flex;align-items:center;gap:12px}
.logo{
  width:44px;height:44px;border-radius:14px;flex:0 0 auto;
  background:linear-gradient(140deg,#8FB3AC,#6E9A93);
  color:#fff;font-size:19px;font-weight:600;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 16px rgba(110,154,147,.28);
}
.brand-text h1{font-size:19px;line-height:1.3}
.brand-text .sub{margin:2px 0 0;font-size:12px;color:var(--muted);letter-spacing:.08em}
.today{font-size:12.5px;color:var(--muted);white-space:nowrap}

/* 栅格 */
.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:start;
  gap:16px;
}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
}
.card h2{font-size:15px;color:var(--ink)}

/* 表单 */
.field{display:block;margin-top:16px}
.label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:8px}
input[type=text],input[type=password]{
  width:100%;padding:12px 14px;border-radius:12px;
  border:1px solid var(--line);background:#FBFAF7;color:var(--ink);
  font-size:14.5px;outline:none;transition:.18s;
}
input[type=text]:focus,input[type=password]:focus{
  border-color:var(--accent);background:#fff;
  box-shadow:0 0 0 3px rgba(127,166,160,.16);
}
input::placeholder{color:#B4BFBB}

.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  padding:8px 14px;border-radius:999px;border:1px solid var(--line);
  background:#FBFAF7;color:var(--ink-soft);font-size:13.5px;transition:.18s;
}
.chip:hover{border-color:#D6E2DE}
.chip.is-active{
  background:var(--accent-soft);border-color:#B7D2CB;color:var(--accent-deep);
  font-weight:500;
}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:12px;border:1px solid transparent;
  padding:12px 20px;font-size:14.5px;transition:.18s;
}
.btn.primary{background:#58857E;color:#fff}
.btn.primary:hover{background:#47706A}
.btn.ghost{background:#FBFAF7;border-color:var(--line);color:var(--ink-soft)}
.btn.ghost:hover{background:#F3F1EB}
.btn.danger{background:#FBEFEC;border-color:#F0D8D2;color:#A9645A}
.btn.danger:hover{background:#F6E3DE}
.btn.sm{padding:9px 16px;font-size:13.5px;border-radius:10px}
.btn:disabled{opacity:.45;cursor:not-allowed}

#startBtn{width:100%;margin-top:22px;padding:13px;font-size:15px}
.hint{margin:12px 0 0;font-size:12.5px;color:var(--muted);line-height:1.65}

/* 计时 */
.timer{display:flex;flex-direction:column;align-items:center;justify-content:center}
.ring-wrap{position:relative;width:min(240px,64vw);aspect-ratio:1/1;margin:4px auto 6px}
.ring{width:100%;height:100%;transform:rotate(-90deg)}
.ring-bg,.ring-fg{fill:none;stroke-width:7;stroke-linecap:round}
.ring-bg{stroke:#EFEDE6}
.ring-fg{
  stroke:var(--accent);
  stroke-dasharray:326.7;      /* 2πr, r=52 */
  stroke-dashoffset:0;
  transition:stroke-dashoffset .5s linear, stroke .3s;
}
.ring-center{
  position:absolute;inset:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:2px;
}
.time{
  font-size:38px;font-weight:300;letter-spacing:.04em;
  font-variant-numeric:tabular-nums;color:var(--ink);
}
.state{font-size:12.5px;color:var(--muted);letter-spacing:.06em}
.task-now{
  margin:6px 0 16px;max-width:280px;text-align:center;
  font-size:13px;color:var(--ink-soft);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.timer-actions{display:flex;gap:10px;width:100%}
.timer-actions .btn{flex:1}

/* 对话 */
.chat{display:flex;flex-direction:column;min-height:380px}
.chat-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.bot-state{
  font-size:11.5px;color:var(--accent-deep);background:var(--accent-soft);
  padding:3px 10px;border-radius:999px;
}
.bot-state.live::before{
  content:"";display:inline-block;width:6px;height:6px;border-radius:50%;
  background:#7FB0A6;margin-right:6px;vertical-align:1px;
  animation:blink 1.6s infinite;
}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.25}}

.messages{
  flex:1;overflow-y:auto;max-height:300px;
  display:flex;flex-direction:column;gap:10px;
  padding:6px 2px 10px;
}
.msg{
  max-width:86%;padding:10px 14px;border-radius:14px;
  font-size:14px;line-height:1.65;white-space:pre-wrap;word-break:break-word;
  animation:rise .28s ease both;
}
@keyframes rise{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.msg.bot{align-self:flex-start;background:#F5F3ED;color:var(--ink);border-bottom-left-radius:5px}
.msg.user{align-self:flex-end;background:var(--accent-soft);color:#33544F;border-bottom-right-radius:5px}
.msg.review{
  align-self:stretch;max-width:100%;background:#FBF8F1;
  border:1px dashed #E4D8C6;border-radius:14px;
}
.msg.review b{font-weight:600}
.msg .tag{
  display:inline-block;font-size:11px;color:var(--accent-deep);
  background:#fff;border:1px solid #DCE8E4;border-radius:6px;
  padding:0 6px;margin-bottom:6px;
}
.msg .meta{display:block;margin-top:8px;font-size:11.5px;color:var(--muted)}

.quick{display:flex;flex-wrap:wrap;gap:8px;padding:8px 0 10px;border-top:1px solid #F1EEE7}
.quick button{
  padding:6px 12px;border-radius:999px;border:1px solid var(--line);
  background:#fff;color:var(--ink-soft);font-size:12.5px;
}
.quick button:hover{border-color:#CFDFDA;color:var(--accent-deep)}

.chat-input{display:flex;gap:8px}
.chat-input input{flex:1;padding:11px 14px}

/* 记录 */
.rec-head{display:flex;align-items:center;justify-content:space-between}
.link{
  background:none;border:none;color:var(--muted);font-size:12.5px;
  text-decoration:underline;text-underline-offset:3px;padding:0;
}
.link:hover{color:var(--accent-deep)}

.stats{display:flex;gap:10px;margin:16px 0 14px}
.stat{
  flex:1;background:#FBFAF7;border:1px solid #F1EEE7;border-radius:14px;
  padding:12px 8px;text-align:center;
}
.stat b{display:block;font-size:21px;font-weight:500;color:var(--accent-deep);font-variant-numeric:tabular-nums}
.stat span{font-size:11.5px;color:var(--muted)}

.week{
  display:flex;align-items:flex-end;gap:8px;height:78px;
  padding:6px 2px 0;margin-bottom:8px;
}
.week .bar{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;
  height:100%;justify-content:flex-end;
}
.week .bar i{
  display:block;width:100%;max-width:26px;border-radius:6px 6px 3px 3px;
  background:#E3EEEA;transition:.3s;
}
.week .bar.today i{background:var(--accent)}
.week .bar span{font-size:10.5px;color:var(--muted)}

.rec-list{list-style:none;margin:0;padding:0;max-height:190px;overflow-y:auto}
.rec-list li{
  display:flex;justify-content:space-between;gap:12px;
  padding:10px 0;border-bottom:1px dashed #F0EDE6;font-size:13.5px;
}
.rec-list li:last-child{border-bottom:none}
.rec-list .r-task{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink)}
.rec-list .r-meta{color:var(--muted);font-size:12.5px;white-space:nowrap}
.rec-list li.empty{justify-content:center;color:var(--muted);font-size:13px;border:none}

/* 页脚 */
.foot{
  display:flex;align-items:center;justify-content:space-between;
  margin-top:22px;font-size:12px;color:var(--muted);
}

/* 弹窗 */
.dialog-mask[hidden],.toast[hidden]{display:none}
.dialog-mask{
  position:fixed;inset:0;background:rgba(46,58,55,.28);
  display:flex;align-items:center;justify-content:center;padding:20px;z-index:50;
}
.dialog{
  width:100%;max-width:420px;background:#fff;border-radius:20px;
  padding:24px;box-shadow:0 20px 60px rgba(46,58,55,.18);
}
.dialog h3{font-size:16px}
.dialog-tip{font-size:12.5px;color:var(--muted);margin:8px 0 4px;line-height:1.65}
.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}

/* 提示 */
.toast{
  position:fixed;left:50%;bottom:36px;transform:translateX(-50%);
  background:rgba(46,58,55,.92);color:#fff;font-size:13.5px;
  padding:10px 18px;border-radius:999px;z-index:80;
  animation:rise .25s ease both;
}

/* 手机适配 */
@media (max-width:820px){
  .app{padding:20px 14px 32px}
  .grid{grid-template-columns:1fr;gap:12px}
  .card{padding:18px;border-radius:16px}
  .brand-text h1{font-size:17px}
  .logo{width:38px;height:38px;border-radius:12px;font-size:17px}
  .today{display:none}
  .time{font-size:34px}
  .timer{order:-1}
  .messages{max-height:260px}
  .rec-list{max-height:220px}
}

/* 记录区操作按钮 */
.rec-actions{display:flex;gap:14px;align-items:center}

/* 今日报告 */
.report-dialog{max-width:520px}
.report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 6px}
.report-kpi{background:var(--mint,#E6EFEC);border-radius:12px;padding:12px 14px}
.report-kpi b{display:block;font-size:17px;color:var(--ink);font-weight:600}
.report-kpi span{display:block;font-size:12px;color:var(--muted);margin-top:4px}
.report-sub{font-size:12.5px;color:var(--muted);margin:16px 0 8px}
.report-bars{display:flex;flex-direction:column;gap:8px}
.report-bar{display:flex;align-items:center;gap:10px;font-size:12.5px}
.report-bar-label{width:52px;color:var(--muted);flex:none}
.report-bar-track{flex:1;height:8px;background:#EFEDE7;border-radius:99px;overflow:hidden}
.report-bar-track u{display:block;height:100%;background:var(--brand,#58857E);border-radius:99px;text-decoration:none}
.report-bar-val{width:64px;text-align:right;color:var(--ink);flex:none}
.report-row{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-top:1px dashed #EAE4D8;font-size:13px;margin-top:6px}
.report-k{color:var(--muted)}
.report-v{color:var(--ink);font-weight:600}
.report-tip{margin-top:14px;background:#FBF8F1;border:1px dashed #E4D8C6;border-radius:12px;padding:12px 14px;font-size:13px;line-height:1.7;color:var(--ink)}
.report-empty{font-size:13px;color:var(--muted);line-height:1.7;margin:12px 0}
@media (max-width:820px){
  .report-grid{grid-template-columns:1fr}
}
