* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f1220;
  color: #e6e9f2;
  height: 100vh;
  overflow: hidden;
}

/* ---------- 登录 ---------- */
.login-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #1b2140, #0f1220 70%);
  z-index: 10;
}
.login-card {
  width: 320px; padding: 32px;
  background: #1a1f38; border: 1px solid #2a3258; border-radius: 14px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.login-card h2 { font-size: 18px; }
.login-card .sub { color: #8b93b8; font-size: 13px; margin-bottom: 6px; }
.login-card input {
  padding: 11px 12px; border-radius: 9px; border: 1px solid #2a3258;
  background: #11152a; color: #e6e9f2; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: #5b7cfa; }
.login-card button {
  padding: 11px; border: none; border-radius: 9px; cursor: pointer;
  background: #5b7cfa; color: #fff; font-size: 15px; font-weight: 600;
}
.login-card button:hover { background: #6f8cff; }
.error { color: #ff6b6b; font-size: 13px; min-height: 16px; }

/* ---------- 主应用 ---------- */
.app { display: none; flex-direction: column; height: 100vh; }
.app > header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px; background: #161b30; border-bottom: 1px solid #232a48;
}
.app .title { font-weight: 700; }
.app .who { margin-left: auto; color: #9aa3c7; font-size: 14px; }
.app .who b { color: #e6e9f2; }
.ghost {
  background: transparent; color: #9aa3c7; border: 1px solid #2a3258;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
}
.ghost:hover { color: #fff; border-color: #5b7cfa; }

main { flex: 1; display: flex; min-height: 0; }
.chat-panel { flex: 1; display: flex; flex-direction: column; background: #0f1220; min-height: 0; }

/* 对话气泡 */
.chat-log { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 72%; padding: 11px 14px; border-radius: 14px; line-height: 1.6; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.bubble.user { align-self: flex-end; background: #5b7cfa; color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: #1c2240; border: 1px solid #2a3258; border-bottom-left-radius: 4px; }
.bubble-att { margin-top: 8px; font-size: 12px; color: #cdd3ee; background: rgba(255,255,255,.08); border-radius: 8px; padding: 5px 9px; display: inline-block; }

/* 输入区 */
.composer { border-top: 1px solid #232a48; background: #161b30; padding: 12px 16px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.attachments:empty { margin-bottom: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #1c2240; border: 1px solid #2a3258; border-radius: 999px;
  padding: 5px 12px; font-size: 13px;
}
.chip-x { cursor: pointer; color: #8b93b8; font-weight: 700; font-size: 15px; line-height: 1; }
.chip-x:hover { color: #ff6b6b; }

.composer-row { display: flex; gap: 10px; align-items: center; }
.attach-btn {
  flex: none; width: 44px; height: 44px; border-radius: 11px;
  background: transparent; border: 1px solid #2a3258; color: #9aa3c7;
  font-size: 20px; cursor: pointer;
}
.attach-btn:hover { color: #fff; border-color: #5b7cfa; }
#chat-input {
  flex: 1; padding: 12px 14px; border-radius: 11px;
  border: 1px solid #2a3258; background: #11152a; color: #e6e9f2; outline: none; font-size: 14px;
}
#chat-input:focus { border-color: #5b7cfa; }
.send-btn {
  flex: none; height: 44px; padding: 0 24px; border: none; border-radius: 11px;
  background: #5b7cfa; color: #fff; cursor: pointer; font-weight: 600; font-size: 14px;
}
.send-btn:hover { background: #6f8cff; }
.send-btn:disabled { opacity: .55; cursor: default; }
