* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #F5F5F5;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

.chat-container {
  width: 900px;
  max-width: 95vw;
  height: 90vh;
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.chat-header {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E5E5;
  padding: 16px 24px;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 18px;
  font-weight: 500;
  color: #1F1F1F;
}

.chat-messages {
  flex-grow: 1;
  padding: 24px;
  background: #FFFFFF;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #D0D0D0;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #B0B0B0;
}

.welcome-message {
  text-align: center;
  margin: 100px auto;
  max-width: 500px;
}

.welcome-message h2 {
  font-size: 28px;
  font-weight: 400;
  color: #1F1F1F;
  margin-bottom: 12px;
}

.welcome-message p {
  font-size: 16px;
  color: #666666;
  line-height: 1.5;
}

.message {
  display: flex;
  margin-bottom: 24px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user { 
  justify-content: flex-end; 
}

.assistant { 
  justify-content: flex-start; 
}

.bubble {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 75%;
  line-height: 1.6;
  font-size: 15px;
}

.user .bubble {
  background: #2F2F2F;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.assistant .bubble {
  background: #F5F5F5;
  color: #1F1F1F;
  border-bottom-left-radius: 4px;
}

.thinking {
  font-style: italic;
  color: #666666;
}

.chat-input-container {
  padding: 16px 24px 24px;
  background: #FFFFFF;
  border-top: 1px solid #E5E5E5;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F5F5F5;
  border: 1px solid #E5E5E5;
  border-radius: 24px;
  padding: 8px 8px 8px 16px;
  transition: all 0.2s ease;
}

.chat-input:focus-within {
  border-color: #CC9B7A;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(204, 155, 122, 0.1);
}

.chat-input input[type="text"] {
  flex-grow: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: #1F1F1F;
}

.chat-input input[type="text"]::placeholder {
  color: #999999;
}

.icon-btn {
  border: none;
  background: transparent;
  color: #666666;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #E5E5E5;
  color: #1F1F1F;
}

.send-btn {
  border: none;
  background: #CC9B7A;
  color: #FFFFFF;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
}

.send-btn:hover {
  background: #B88A6A;
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  background: #D0D0D0;
  cursor: not-allowed;
  transform: none;
}

.attachment-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #F0F0F0;
  border-radius: 12px;
  font-size: 14px;
  color: #1F1F1F;
  margin-top: 8px;
}

.error-message {
  background: #FEE !important;
  color: #C00 !important;
  border: 1px solid #FCC;
}

@media (max-width: 768px) {
  .chat-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .chat-messages {
    padding: 16px;
  }

  .welcome-message {
    margin: 50px auto;
  }

  .welcome-message h2 {
    font-size: 24px;
  }

  .bubble {
    max-width: 85%;
    font-size: 14px;
  }

  .chat-input-container {
    padding: 12px 16px 16px;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: #1F1F1F;
  }

  .chat-container {
    background: #2F2F2F;
  }

  .chat-header {
    background: #2F2F2F;
    border-bottom-color: #3F3F3F;
  }

  .header-title {
    color: #FFFFFF;
  }

  .chat-messages {
    background: #2F2F2F;
  }

  .welcome-message h2 {
    color: #FFFFFF;
  }

  .welcome-message p {
    color: #B0B0B0;
  }

  .assistant .bubble {
    background: #3F3F3F;
    color: #FFFFFF;
  }

  .chat-input-container {
    background: #2F2F2F;
    border-top-color: #3F3F3F;
  }

  .chat-input {
    background: #3F3F3F;
    border-color: #4F4F4F;
  }

  .chat-input:focus-within {
    background: #3F3F3F;
    border-color: #CC9B7A;
  }

  .chat-input input[type="text"] {
    color: #FFFFFF;
  }

  .chat-input input[type="text"]::placeholder {
    color: #808080;
  }

  .icon-btn {
    color: #B0B0B0;
  }

  .icon-btn:hover {
    background: #4F4F4F;
    color: #FFFFFF;
  }
}