:root {
  --ink: #1a1a1a;
  --bg: #f5f5f5;
  --white: #ffffff;
  --line-green: #06c755;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.chat-app {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: var(--white);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 24px rgba(0,0,0,0.08);
}

.chat-header {
  background: var(--ink);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-name {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.brand-sub {
  display: block;
  font-size: 12px;
  color: #cfcfcf;
  margin-top: 2px;
}

.line-btn {
  background: var(--line-green);
  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.line-btn:hover { opacity: 0.85; }

.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg.bot { justify-content: flex-start; }

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg.bot .bubble {
  background: var(--bg);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.msg.user .bubble {
  background: var(--ink);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.msg.bot .bubble.loading {
  color: #888;
  font-style: italic;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid #eaeaea;
  background: var(--white);
}

.chat-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #dbdbdb;
  border-radius: 999px;
  font-size: 14px;
  outline: none;
}

.chat-input input:focus {
  border-color: var(--ink);
}

.chat-input button {
  background: var(--ink);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
