
:root{--blue:#1a73e8;--light:#f5f9ff;--muted:#667085;--bg:#fafafa;--red:#ff4d4f}
*{box-sizing:border-box}html,body{height:100%;margin:0;background:var(--bg);
font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans','PingFang SC','Microsoft Yahei',sans-serif}
.topbar{position:sticky;top:0;background:#fff;border-bottom:1px solid #eee;padding:10px 14px;z-index:10;display:flex;flex-direction:column;gap:8px}
.brand{display:flex;justify-content:space-between;align-items:center}.topbar h1{font-size:18px;margin:0}
.container{display:grid;grid-template-columns:1fr;gap:12px;padding:12px}
.panel.hidden{display:none}.auth-section{display:flex;justify-content:center;align-items:flex-start}
.auth-card{width:min(520px,100%);background:#fff;border:1px solid #eee;border-radius:16px;padding:16px;box-shadow:0 10px 30px rgba(0,0,0,.06)}
.muted{color:var(--muted);font-size:13px}.phone-row{display:flex;align-items:center;gap:6px;margin-top:6px}
.phone-row .prefix{padding:8px 10px;background:#f2f4f7;border:1px solid #e5e7eb;border-radius:10px}
input,select,textarea{width:100%;padding:10px;border:1px solid #e5e7eb;border-radius:10px;font-size:16px;background:#fff}
button{padding:10px 14px;border-radius:10px;border:1px solid #e5e7eb;background:#fff;cursor:pointer}
button.primary{background:var(--blue);color:#fff;border-color:var(--blue)}button.ghost{background:#fff;border-color:#e5e7eb}
button.small{padding:6px 10px;font-size:12px}button.danger{background:#ff4d4f;color:#fff;border-color:#ff4d4f}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}.tab{padding:8px 12px;border-radius:10px;border:1px solid #e5e7eb;background:#fff;cursor:pointer}
.tab.active{background:var(--light);border-color:#dbe9ff}.tabpage{display:none;border:1px solid #eee;border-radius:16px;padding:12px;background:#fff}
.tabpage.show{display:block}.row{display:flex;gap:10px;align-items:flex-start;margin:8px 0;flex-wrap:wrap}
.list{list-style:none;padding:0;margin:0;width:100%}
.list li{display:flex;justify-content:space-between;align-items:center;border:1px solid #eee;border-radius:10px;padding:8px;background:#fff;margin:6px 0}
.list .tag{font-size:12px;padding:2px 6px;border-radius:999px;background:#f2f4f7;margin-left:6px}
.chat{display:flex;flex-direction:column;border:1px solid #eee;border-radius:16px;padding:12px;background:#fff}
.chatlog{flex:1;overflow:auto;border:1px solid #eee;border-radius:12px;padding:12px;min-height:40vh;background:#fbfbfb}
.msg{display:flex;gap:10px;margin:10px 0}.msg .meta{flex:0 0 90px;font-weight:700;font-size:13px;color:#666}
.msg .bubble{flex:1;background:#fff;border:1px solid #eee;border-radius:16px;padding:12px;white-space:pre-wrap;word-break:break-word}
.msg.assistant .bubble{background:var(--light);border-color:#dbe9ff}.msg.user .bubble{background:#fff7f2;border-color:#ffd8bf}
.input-bar{display:flex;gap:8px;margin-top:10px}.input-bar textarea{flex:1;padding:12px;border-radius:12px;border:1px solid #ddd;font-size:16px}
.input-bar .primary{flex:0 0 102px}.footer{border-top:1px solid #eee;padding:10px 14px;font-size:12px;color:#666;text-align:center}
.msgline{margin-top:6px;color:#666}

/* 发送中动画 + 正在思考 */
button.loading{
  background: linear-gradient(90deg, #e6f0ff, #cfe2ff, #e6f0ff);
  background-size: 200% 100%;
  animation: btn-pulse 1.2s linear infinite;
  color: #174ea6;
  border-color: #cfe2ff;
  pointer-events: none;
  opacity: .9;
}
@keyframes btn-pulse{0%{background-position:0% 0}100%{background-position:200% 0}}
.msg.assistant.typing .bubble .dots i{
  display:inline-block;width:.4em;text-align:center;opacity:.2;animation:blink 1.2s infinite;
}
.msg.assistant.typing .bubble .dots i:nth-child(2){animation-delay:.2s}
.msg.assistant.typing .bubble .dots i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,20%{opacity:.2}50%{opacity:1}100%{opacity:.2}}
