:root {
  --primary: #8A9A6F;
  --primary-light: #D4DFC7;
  --accent-yellow: #F4C37B;
  --accent-orange: #F4A261;
  --soft-pink: #EAC4C4;
  --bg: #FDFBF7;
  --surface: #F7F3EB;
  --text: #4A443D;
  --text-quiet: #8C847B;
  --warning: #E08E79;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.station {
  padding: 18px 16px 10px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
}

.station .back {
  position: absolute;
  left: 16px;
  top: 20px;
  color: var(--text-quiet);
  font-size: 14px;
  text-decoration: none;
}

.station .session-toggle {
  position: absolute;
  right: 16px;
  top: 18px;
  padding: 4px 12px;
  border: 1px solid var(--primary-light);
  border-radius: 12px;
  background: transparent;
  color: var(--text-quiet);
  font-size: 13px;
  cursor: pointer;
}

.session-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 80vw;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 12px rgba(74, 68, 61, 0.1);
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.session-sidebar.open {
  transform: translateX(0);
}

.session-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 68, 61, 0.3);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.session-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid var(--surface);
}

.sidebar-header h2 {
  font-size: 16px;
  color: var(--text);
}

.new-session {
  padding: 6px 12px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.session-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 8px;
}

.session-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}

.session-list li:hover {
  background: var(--surface);
}

.session-list li.active {
  background: var(--primary-light);
}

.session-list .info {
  flex: 1;
  min-width: 0;
}

.session-list .title {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-list .time {
  font-size: 12px;
  color: var(--text-quiet);
  margin-top: 2px;
}

.session-list .delete {
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: var(--text-quiet);
  font-size: 12px;
  cursor: pointer;
}

.session-list .delete:hover {
  color: var(--warning);
}

.station h1 {
  font-size: 22px;
  color: var(--primary);
}

.station p {
  color: var(--text-quiet);
  font-size: 13px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
  min-height: 0;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  background: var(--surface);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 12px;
}

.bubble {
  display: flex;
  gap: 10px;
  max-width: 88%;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.7;
}

.bubble.user {
  flex-direction: row-reverse;
  margin-left: auto;
}

.bubble.ai {
  margin-right: auto;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  object-fit: cover;
}

.bubble.user .avatar {
  background: var(--primary);
  color: #fff;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble.user .content {
  align-items: flex-end;
}

.bubble p {
  padding: 12px 16px;
  border-radius: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 44px;
}

.bubble.ai p {
  background: #fff;
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(74, 68, 61, 0.06);
}

.bubble.user p {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.loading p {
  color: var(--text-quiet);
  background: #fff;
}

.bubble.error p {
  background: var(--soft-pink);
  color: #8a4b4b;
}

.loading-dots::after {
  content: '…';
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.prompt-chips button {
  padding: 8px 14px;
  border: 1px solid var(--primary-light);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.prompt-chips button:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.chat-input {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.chat-input textarea {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--primary-light);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 48px;
  border-radius: 10px;
}

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

.chat-input button {
  padding: 0 22px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 10px;
}

.chat-input button:disabled {
  background: var(--primary-light);
  color: var(--text-quiet);
  cursor: not-allowed;
}

.notice {
  text-align: center;
  font-size: 12px;
  color: var(--text-quiet);
  margin-top: 10px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .station h1 { font-size: 20px; }
  .bubble { max-width: 92%; font-size: 14px; }
}
