:root{
  --ink:#101a44;
  --ink2:#1b2a6b;
  --blue:#4a6fe3;
  --sky:#a8d8ff;
  --cream:#fff8ea;
  --lime:#c9f24d;
  --line:rgba(168,216,255,.16);
  --txt:#eaf3ff;
  --muted:#9fb4e0;
  --bubble-in:#20326f;
  --bubble-out:#4a6fe3;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
[hidden]{display:none !important}
html,body{height:100%}
body{
  margin:0;
  overflow-x:hidden;
  font-family:"PingFang SC","Microsoft YaHei","Noto Sans SC",system-ui,-apple-system,sans-serif;
  background:
    radial-gradient(120% 80% at 50% -10%, #2b4bb5 0%, #17225c 45%, #0d1538 100%);
  color:var(--txt);
  overflow:hidden;
  overscroll-behavior:none;
}

/* 背景气泡 */
.bubbles{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:0}
.bubbles i{
  position:absolute;bottom:-80px;border-radius:50%;
  background:radial-gradient(circle at 30% 25%, rgba(255,255,255,.55), rgba(168,216,255,.18) 60%, rgba(168,216,255,0) 72%);
  border:1px solid rgba(200,230,255,.22);
  animation:rise linear infinite;
  opacity:.7;
}
.bubbles i:nth-child(1){left:6%;width:26px;height:26px;animation-duration:17s;animation-delay:-2s}
.bubbles i:nth-child(2){left:18%;width:14px;height:14px;animation-duration:13s;animation-delay:-6s}
.bubbles i:nth-child(3){left:33%;width:36px;height:36px;animation-duration:22s;animation-delay:-11s;opacity:.45}
.bubbles i:nth-child(4){left:52%;width:18px;height:18px;animation-duration:15s;animation-delay:-4s}
.bubbles i:nth-child(5){left:66%;width:10px;height:10px;animation-duration:11s;animation-delay:-8s}
.bubbles i:nth-child(6){left:78%;width:30px;height:30px;animation-duration:19s;animation-delay:-14s;opacity:.5}
.bubbles i:nth-child(7){left:88%;width:16px;height:16px;animation-duration:14s;animation-delay:-3s}
.bubbles i:nth-child(8){left:44%;width:8px;height:8px;animation-duration:10s;animation-delay:-7s}
@keyframes rise{
  0%{transform:translateY(0) translateX(0);opacity:0}
  12%{opacity:.75}
  100%{transform:translateY(-108vh) translateX(14px);opacity:0}
}

/* 顶栏 */
.topbar{
  position:fixed;top:0;left:0;right:0;z-index:20;
  display:flex;align-items:center;gap:10px;
  padding:calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background:linear-gradient(180deg, rgba(13,21,56,.96), rgba(13,21,56,.72) 70%, rgba(13,21,56,0));
  backdrop-filter:blur(10px);
}
.avatar{
  position:relative;flex:0 0 auto;width:42px;height:42px;padding:0;border:0;border-radius:50%;
  background:linear-gradient(160deg,#7fa6ff,#31509e);cursor:pointer;
  box-shadow:0 4px 14px rgba(60,110,255,.45), inset 0 0 0 2px rgba(255,255,255,.35);
  overflow:visible;
}
.avatar img{width:100%;height:100%;object-fit:cover;object-position:50% 26%;border-radius:50%;display:block}
.avatar .live{
  position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;
  background:var(--lime);border:2px solid #0d1538;box-shadow:0 0 8px var(--lime);
}
.who{flex:1;min-width:0}
.who h1{
  margin:0;font-size:17px;line-height:1.2;letter-spacing:.3px;font-weight:800;
  display:flex;align-items:baseline;gap:6px;
}
.who h1 em{
  font-style:normal;font-size:10px;font-weight:700;letter-spacing:1px;
  color:#9fc0ff;background:rgba(120,160,255,.15);border:1px solid rgba(140,180,255,.25);
  padding:1px 6px;border-radius:99px;
}
.who p{margin:2px 0 0;font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rice{
  flex:0 0 auto;display:flex;align-items:center;gap:2px;
  font-size:11px;color:#dbe8ff;background:rgba(255,255,255,.07);
  border:1px solid var(--line);border-radius:99px;padding:5px 9px 5px 7px;
}
.rice b{font-size:12.5px;color:var(--lime);font-variant-numeric:tabular-nums}
.rice small{color:var(--muted);font-size:10px}

/* 视图区 */
.view{
  position:fixed;inset:0;z-index:1;
  padding-top:calc(66px + env(safe-area-inset-top, 0px));
  padding-bottom:calc(112px + var(--safe-b));
  display:flex;
}
.pane{flex:1;min-height:0;display:flex;flex-direction:column}
#pane-tasks{overflow-y:auto;padding:6px 14px 24px}

/* 聊天记录 */
.log{
  min-width:0;
  flex:1;overflow-y:auto;padding:8px 14px 6px;
  display:flex;flex-direction:column;gap:12px;
  scroll-behavior:smooth;
}
.log::-webkit-scrollbar{width:0}
.row{display:flex;gap:8px;align-items:flex-end;max-width:86%}
.row.out{margin-left:auto;flex-direction:row-reverse}
.row .ava{width:28px;height:28px;border-radius:50%;flex:0 0 auto;box-shadow:0 2px 8px rgba(0,0,0,.35);object-fit:cover;object-position:50% 26%}
.bubble{
  padding:10px 13px;border-radius:16px;font-size:14.5px;line-height:1.55;
  white-space:pre-wrap;word-break:break-word;
  animation:pop .22s ease-out both;
}
@keyframes pop{from{transform:translateY(6px) scale(.98);opacity:0}to{transform:none;opacity:1}}
.row.in .bubble{
  background:linear-gradient(180deg,#243a80,#1d2f6b);
  border:1px solid rgba(140,180,255,.18);
  border-bottom-left-radius:6px;
  box-shadow:0 6px 18px rgba(6,14,40,.35);
}
.row.out .bubble{
  background:linear-gradient(180deg,#5b80f0,#4364d8);
  border-bottom-right-radius:6px;
  box-shadow:0 6px 18px rgba(40,80,220,.35);
}
.row .meta{font-size:10px;color:rgba(190,210,245,.5);margin:4px 2px 0;text-align:right}
.row.in .meta{text-align:left}

/* 空态 */
.hello{
  width:100%;max-width:100%;
  margin:auto;text-align:center;padding:12px 18px 30px;
  display:flex;flex-direction:column;align-items:center;gap:10px;
  animation:pop .35s ease-out both;
}
.hello img{width:132px;height:132px;object-fit:contain;filter:drop-shadow(0 12px 24px rgba(20,50,160,.55));animation:float 4.6s ease-in-out infinite}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
.hello h2{margin:2px 0 0;font-size:17px;font-weight:800;letter-spacing:.4px}
.hello p{margin:0;font-size:12.5px;color:var(--muted);line-height:1.7;max-width:280px}
.hello .chips{margin-top:4px}

/* 快捷短语 */
.chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;max-width:100%}
.chips button{
  max-width:100%;flex:0 1 auto;
  font:inherit;font-size:12.5px;color:#dfeaff;
  background:rgba(120,160,255,.12);border:1px solid rgba(140,180,255,.28);
  padding:8px 12px;border-radius:99px;cursor:pointer;transition:.15s;
}
.chips button:active{transform:scale(.96);background:rgba(120,160,255,.24)}

/* 输入中 */
.typing{display:flex;align-items:center;gap:8px;padding:0 18px 8px;font-size:11.5px;color:var(--muted)}
.typing img{width:22px;height:22px;border-radius:50%}
.dots{display:inline-flex;gap:3px}
.dots i{width:5px;height:5px;border-radius:50%;background:var(--sky);animation:blink 1.1s infinite}
.dots i:nth-child(2){animation-delay:.18s}
.dots i:nth-child(3){animation-delay:.36s}
@keyframes blink{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* 输入区 */
.composer{
  position:fixed;left:0;right:0;z-index:25;
  bottom:calc(58px + var(--safe-b));
  display:flex;align-items:flex-end;gap:8px;
  padding:8px 12px;
  background:linear-gradient(0deg, rgba(13,21,56,.98), rgba(13,21,56,.55));
  backdrop-filter:blur(12px);
}
.composer textarea,.composer input{
  min-width:0;
  flex:1;font:inherit;font-size:15px;color:var(--txt);
  background:rgba(255,255,255,.07);
  border:1px solid rgba(150,190,255,.22);
  border-radius:20px;padding:11px 14px;
  outline:none;resize:none;max-height:120px;line-height:1.4;
}
.composer textarea::placeholder,.composer input::placeholder{color:#8ea6d6}
.composer textarea:focus,.composer input:focus{border-color:rgba(140,190,255,.55);background:rgba(255,255,255,.1)}
.composer .ic{
  width:38px;height:38px;flex:0 0 auto;border-radius:50%;
  background:rgba(255,255,255,.07);border:1px solid rgba(150,190,255,.22);
  color:#b9d0ff;font-size:16px;cursor:pointer;
}
.send{
  width:42px;height:42px;flex:0 0 auto;border-radius:50%;border:0;cursor:pointer;
  background:linear-gradient(160deg,#8ef0c0,#48c9f0 45%,#5b80f0);
  box-shadow:0 6px 18px rgba(60,170,240,.4);
  display:grid;place-items:center;transition:.15s;
}
.send:active{transform:scale(.93)}
.send svg{width:20px;height:20px;fill:#0c1636}
.send:disabled{opacity:.55}

/* 底部导航 */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:30;
  height:calc(58px + var(--safe-b));padding-bottom:var(--safe-b);
  display:flex;background:rgba(10,16,42,.94);backdrop-filter:blur(14px);
  border-top:1px solid rgba(140,180,255,.14);
}
.tab{
  flex:1;border:0;background:transparent;color:#8ea6d6;font:inherit;font-size:11px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer;
  position:relative;
}
.tab svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tab.on{color:var(--lime)}
.tab .badge{
  position:absolute;top:8px;right:calc(50% - 22px);
  min-width:16px;height:16px;border-radius:99px;background:#ff6b8a;color:#fff;
  font-size:10px;line-height:16px;padding:0 4px;font-style:normal;
}

/* 任务板 */
.tasks-head{padding:6px 2px 12px}
.tasks-head h2{margin:0;font-size:16px}
.tasks-head p{margin:4px 0 0;font-size:12px;color:var(--muted)}
.tasks{display:flex;flex-direction:column;gap:10px}
.task{
  background:linear-gradient(180deg, rgba(38,60,130,.6), rgba(26,42,100,.55));
  border:1px solid rgba(150,190,255,.16);border-radius:16px;padding:12px 13px;
  display:flex;gap:10px;align-items:flex-start;animation:pop .2s ease-out both;
}
.task .txt{flex:1;min-width:0}
.task h3{margin:0;font-size:14px;font-weight:650;line-height:1.45;word-break:break-word}
.task p{margin:4px 0 0;font-size:11.5px;color:var(--muted)}
.task .pill{
  flex:0 0 auto;font-size:11px;padding:5px 10px;border-radius:99px;cursor:pointer;
  border:1px solid transparent;user-select:none;
}
.pill.todo{background:rgba(255,255,255,.08);color:#cfdcff;border-color:rgba(180,200,255,.22)}
.pill.doing{background:rgba(201,242,77,.14);color:var(--lime);border-color:rgba(201,242,77,.35)}
.pill.done{background:rgba(120,255,200,.1);color:#7fe0c0;border-color:rgba(120,255,200,.28);text-decoration:line-through}
.task.done h3{color:var(--muted);text-decoration:line-through}
.empty-tasks{text-align:center;color:var(--muted);font-size:12.5px;padding:40px 10px;line-height:1.8}
.empty-tasks img{width:88px;opacity:.85;display:block;margin:0 auto 10px}

/* 抽屉 */
.sheet{position:fixed;inset:0;z-index:40;background:rgba(6,10,28,.6);backdrop-filter:blur(4px);display:flex;align-items:flex-end}
.sheet[hidden]{display:none}
.sheet-card{
  width:100%;background:#141f4d;border-radius:22px 22px 0 0;padding:18px 16px calc(18px + var(--safe-b));
  border-top:1px solid rgba(150,190,255,.2);animation:up .22s ease-out both;
}
@keyframes up{from{transform:translateY(30px);opacity:.6}to{transform:none;opacity:1}}
.sheet-card h3{margin:0 0 12px;font-size:14px;color:#cfe0ff}
.sheet-card .chips{justify-content:flex-start}
.ghost{margin-top:14px;width:100%;background:transparent;color:#93a9d8;border:1px solid rgba(150,190,255,.2);border-radius:14px;padding:10px;font:inherit;font-size:13px}

/* rua 彩蛋 */
.rua{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:rgba(6,10,28,.72);backdrop-filter:blur(3px)}
.rua[hidden]{display:none}
.rua img{width:min(70vw,320px);border-radius:20px;box-shadow:0 20px 60px rgba(0,0,0,.5);animation:pop .25s ease-out both}

/* 暗号门 */
.gate{position:fixed;inset:0;z-index:60;display:grid;place-items:center;background:radial-gradient(circle at 50% 30%,#1d2c6b,#0b1230);padding:24px}
.gate[hidden]{display:none}
.gate-card{width:100%;max-width:320px;text-align:center}
.gate-card img{width:120px;height:120px;object-fit:contain;margin-bottom:6px;filter:drop-shadow(0 10px 22px rgba(30,60,180,.5))}
.gate-card h2{margin:0 0 6px;font-size:17px}
.gate-card p{margin:0 0 16px;font-size:12.5px;color:var(--muted)}
.gate-card input{
  width:100%;font:inherit;font-size:18px;text-align:center;letter-spacing:8px;
  background:rgba(255,255,255,.08);border:1px solid rgba(150,190,255,.25);color:var(--txt);
  border-radius:14px;padding:12px;outline:none;margin-bottom:10px;
}
.gate-card button{
  width:100%;font:inherit;font-size:15px;font-weight:700;color:#0c1636;border:0;border-radius:14px;padding:12px;
  background:linear-gradient(160deg,#c9f24d,#8ef0c0);cursor:pointer;
}
.gate-card em{display:block;margin-top:10px;font-style:normal;font-size:12px;color:#ff9db1;min-height:16px}

@media (min-width:640px){
  .view{padding-left:max(0px, calc(50vw - 320px));padding-right:max(0px, calc(50vw - 320px))}
  .composer,.tabbar{max-width:640px;margin-left:auto;margin-right:auto;left:0;right:0}
  .composer{border-radius:0}
}

/* 静态版补充 */
.gear{
  flex:0 0 auto;width:34px;height:34px;margin-left:2px;border-radius:50%;
  background:rgba(255,255,255,.06);border:1px solid var(--line);color:#b9d0ff;
  font-size:15px;line-height:1;cursor:pointer;
}
.gear:active{transform:scale(.94)}
.rice{border:1px solid var(--line);background:rgba(255,255,255,.07);cursor:pointer;font:inherit}
.gate-card input[type=password]{letter-spacing:0;font-size:14px;text-align:left;font-family:ui-monospace,Consolas,monospace}
.gate-card .ghost{display:block;margin-top:10px;width:100%}
.gate-card small{display:block;margin-top:10px;font-size:11px;color:var(--muted);line-height:1.6}
/* 电脑面板 */
.pill.err{background:rgba(255,110,140,.14);color:#ffa2b6;border-color:rgba(255,110,140,.35)}
.pill.running{}
.task-out{
  margin:6px 0 0;font-size:12px;line-height:1.6;color:#cfe0ff;
  background:rgba(0,0,0,.22);border:1px solid rgba(150,190,255,.14);
  border-radius:10px;padding:8px 10px;white-space:pre-wrap;word-break:break-word;
  max-height:220px;overflow:auto;font-family:ui-monospace,Consolas,"Microsoft YaHei",monospace;
}
.pc-hint{margin:18px 4px;font-size:12.5px;color:var(--muted);text-align:center;line-height:1.8}