@charset "UTF-8";

/* 布局与背景 */
html, body {
  height: 100%;
}
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at bottom, #0d1b2a 0%, #000000 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  overflow: hidden;
}

/* 星空动画（轻量） */
.stars {
  width: 1px;
  height: 1px;
  position: fixed;
  top: 0; left: 0;
  background: transparent;
  box-shadow:
    1000px 200px #fff, 1200px 800px #fff, 500px 1000px #fff,
    300px 400px #fff, 800px 1200px #fff, 1600px 300px #fff,
    200px 600px #fff, 900px 1500px #fff, 1300px 700px #fff,
    700px 1700px #fff, 1500px 1100px #fff, 1700px 1300px #fff;
  animation: animStar 100s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes animStar {
  from { transform: translateY(0); }
  to   { transform: translateY(-2000px); }
}

/* 头部 */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0,0,0,.55);
  border-bottom: 1px solid rgba(255,255,255,.15);
  z-index: 2;
}
.chat-header .logo {
  width: 40px; height: 40px; border-radius: 50%;
}
.chat-header .title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .5px;
  background: linear-gradient(90deg, #00c6ff, #0072ff, #00c6ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShine 5s linear infinite;
}
@keyframes titleShine {
  to { background-position: 200% center; }
}

/* 聊天窗口 */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 120px; /* 给底部输入留空间 */
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1;
}

/* 消息气泡 */
.message {
  max-width: 72ch;
  padding: 12px 16px;
  border-radius: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  word-break: break-word;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0072ff, #00c6ff);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,114,255,.25);
}
.message.ai {
  align-self: flex-start;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
}

/* Markdown 容器内的代码/列表等 */
.message.ai pre, .message.ai code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
}
.message.ai pre {
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.1);
  padding: 10px 12px;
  border-radius: 10px;
  overflow: auto;
}
.message.ai a { color: #6bdcff; }

/* 底部输入区（固定） */
.chat-input-container {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.75) 30%, rgba(0,0,0,.85) 100%);
  border-top: 1px solid rgba(255,255,255,.1);
  z-index: 3;
}
.chat-input-container textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  background: rgba(255,255,255,.07);
  color: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.chat-input-container textarea:focus {
  border-color: rgba(0,198,255,.7);
  box-shadow: 0 0 0 3px rgba(0,198,255,.15);
}
.chat-input-container button {
  min-width: 96px;
  border: none;
  border-radius: 9999px;
  padding: 0 20px;
  font-weight: 700;
  letter-spacing: .5px;
  background: linear-gradient(90deg, #0072ff, #00c6ff);
  color: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.chat-input-container button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,198,255,.35);
}

/* 小屏优化 */
@media (max-width: 640px) {
  .message { max-width: 90%; }
}
