/*
  `style.css`
  ------------------------------------------------------------------------------
  這份 CSS 負責整體 UI 風格：
  - 深色主題
  - 置中聊天卡片
  - 訊息泡泡（使用者 / AI）
  - 輸入列與按鈕
*/

/* 全域：使用 box-sizing 讓寬高計算更直覺 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 讓整頁有一致的字型與背景 */
html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  color: #e9eef6;
  background: radial-gradient(1200px 800px at 20% 10%, #1b2b4a 0%, #0b1020 45%, #070a12 100%);
}

/* 置中容器 */
.page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

/* 聊天卡片（主容器） */
.chat-card {
  width: min(920px, 100%);
  height: min(78vh, 720px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(15, 20, 36, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

/* 頂部標題列 */
.chat-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.06), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #6ee7ff 0%, #7c3aed 55%, #0ea5e9 100%);
  box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.16);
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(233, 238, 246, 0.72);
}

/* 訊息區 */
.messages {
  padding: 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 單一訊息泡泡：共用樣式 */
.msg {
  max-width: 78%;
  padding: 12px 12px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 使用者訊息：靠右、偏紫藍 */
.msg.user {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.92), rgba(14, 165, 233, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* AI 訊息：靠左、偏灰黑 */
.msg.bot {
  margin-right: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

/* 輸入列容器 */
.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 18, 0.45);
}

.message-input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e9eef6;
  outline: none;
}

.message-input:focus {
  border-color: rgba(110, 231, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(110, 231, 255, 0.12);
}

.send-btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(124, 58, 237, 0.35);
  color: #e9eef6;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.send-btn:hover {
  transform: translateY(-1px);
  background: rgba(124, 58, 237, 0.48);
  border-color: rgba(110, 231, 255, 0.35);
}

.send-btn:active {
  transform: translateY(0px);
}

.send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

