/* Global Styles - React Compatible */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  background: #000000;
  color: #ffffff;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #000000;
}

/* Logo and Avatar Styles */
.logo-svg {
  width: 32px;
  height: 32px;
  margin-right: 12px;
}

.claude-avatar-svg {
  width: 28px;
  height: 28px;
}

.sidebar-brand-logo {
  width: 20px;
  height: 20px;
}

/* Language Toggle */
.language-toggle {
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 1000;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 4px;
  padding: 2px;
  display: flex;
  gap: 2px;
  align-items: center;
  height: 28px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: #71717a;
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  height: 24px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-btn.active {
  background: #ffffff;
  color: #000000;
}

.lang-btn:hover:not(.active) {
  color: #a1a1aa;
}

/* Header Styles */
.header {
  text-align: center;
  padding: 60px 20px 60px 20px;
  background: #000000;
  z-index: 10;
  position: relative;
  overflow: hidden;
}

.header.collapsed {
  display: none;
}

.header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.025em;
}

.header p {
  color: #a1a1aa;
  font-size: 14px;
  margin-bottom: 24px;
}

.header-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid #27272a;
  border-radius: 6px;
  transition: all 0.2s;
}

.github-link:hover {
  color: #ffffff;
  border-color: #52525b;
}

.github-icon {
  width: 14px;
  height: 14px;
}

.settings-btn {
  background: none;
  border: 1px solid #27272a;
  color: #a1a1aa;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  height: 32px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  color: #ffffff;
  border-color: #52525b;
}

.privacy-notice {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 20px auto;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notice-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.notice-text {
  font-size: 12px;
  color: #d4d4d8;
}

.instructions {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 20px;
  margin: 20px auto;
  max-width: 500px;
  text-align: left;
}

.instructions h3 {
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.instructions ol {
  margin: 0 0 12px 0;
  padding-left: 16px;
}

.instructions li {
  margin-bottom: 6px;
  color: #a1a1aa;
  line-height: 1.5;
  font-size: 12px;
}

.instructions code {
  background: #27272a;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 11px;
  color: #d4d4d8;
}

/* Homepage Actions Container */
.homepage-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-top: 32px;
}

.access-btn {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  color: #000000;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
  min-width: 200px;
  justify-content: center;
}

.access-btn.secondary {
  background: linear-gradient(135deg, #18181b, #27272a);
  color: #ffffff;
  border: 1px solid #3f3f46;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.access-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.access-btn.secondary::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.access-btn:hover::before {
  left: 100%;
}

.access-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.access-btn.secondary:hover {
  background: linear-gradient(135deg, #27272a, #3f3f46);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.access-btn:active {
  transform: translateY(0px);
  transition: all 0.1s ease;
}

/* Main Layout Styles */
.main-layout {
  display: flex;
  height: 100vh;
  background: #000000;
}

.sidebar {
  width: 280px;
  background: #0a0a0a;
  border-right: 1px solid #262626;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed {
  margin-left: -280px;
}

.sidebar-header {
  padding: 16px 16px 12px 16px;
  border-bottom: 1px solid #262626;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.sidebar-brand-text {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.sidebar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-github {
  background: none;
  border: none;
  color: #71717a;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-github:hover {
  background: #262626;
  color: #ffffff;
}

.sidebar-github svg {
  width: 16px;
  height: 16px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #71717a;
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: #262626;
  color: #ffffff;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.session-search {
  margin-bottom: 12px;
}

.search-input {
  width: 100%;
  background: #18181b;
  border: 1px solid #27272a;
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #52525b;
}

.search-input::placeholder {
  color: #71717a;
}

.session-stats {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 11px;
  color: #a1a1aa;
  text-align: center;
}

.session-group {
  margin-bottom: 16px;
}

.session-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin-bottom: 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.session-group-header:hover {
  background: #18181b;
}

.session-group-title {
  color: #d4d4d8;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-group-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-vscode-btn {
  background: none;
  border: none;
  color: #71717a;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-vscode-btn:hover {
  background: #007ACC;
  color: #ffffff;
}

.session-group-count {
  color: #71717a;
  font-size: 10px;
  background: #27272a;
  padding: 1px 4px;
  border-radius: 3px;
}

.session-group-toggle {
  color: #71717a;
  font-size: 10px;
  transition: transform 0.2s;
}

.session-group.collapsed .session-group-toggle {
  transform: rotate(-90deg);
}

.session-list {
  display: block;
}

.session-group.collapsed .session-list {
  display: none;
}

.session-item-sidebar {
  background: transparent;
  border: none;
  color: #d4d4d8;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
  font-size: 12px;
  line-height: 1.3;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid transparent;
  font-family: inherit;
}

.session-item-sidebar:hover {
  background: #18181b;
  border-color: #27272a;
}

.session-item-sidebar.active {
  background: #18181b;
  border-color: #52525b;
  color: #ffffff;
}

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

.session-title {
  font-weight: 500;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  max-width: 180px;
  line-height: 1.2;
  max-height: 1.2em;
  display: block;
}

.session-meta {
  font-size: 10px;
  color: #71717a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-time {
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000000;
  position: relative;
}

.main-header {
  padding: 12px 16px;
  border-bottom: 1px solid #262626;
  background: #000000;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  color: #71717a;
  transition: all 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover {
  background: #262626;
  color: #ffffff;
}

.main-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.025em;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
  cursor: pointer;
}

.session-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 28px;
}

.action-btn {
  background: #18181b;
  border: 1px solid #27272a;
  color: #a1a1aa;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  height: 28px;
  min-width: 60px;
  justify-content: center;
}

.action-btn:hover {
  background: #262626;
  color: #ffffff;
  border-color: #52525b;
}

.shared-indicator {
  background: #18181b;
  border: 1px solid #27272a;
  color: #a1a1aa;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.twitter-share {
  background: #1d9bf0 !important;
  border-color: #1d9bf0 !important;
  color: #ffffff !important;
}

.twitter-share:hover {
  background: #1a8cd8 !important;
  border-color: #1a8cd8 !important;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #000000;
}

.empty-state {
  text-align: center;
  color: #71717a;
  margin-top: 80px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #a1a1aa;
}

.empty-state p {
  font-size: 12px;
}

.message {
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.message.user .message-avatar {
  background: #ffffff;
  color: #000000;
}

.message.assistant .message-avatar {
  background: transparent;
  padding: 0;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-text {
  color: #ffffff;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 13px;
}

.tool-call {
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
}

.tool-call-header {
  background: #111111;
  padding: 10px 12px;
  border-bottom: 1px solid #262626;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #d4d4d8;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tool-call-header:hover {
  background: #1a1a1a;
}

.tool-toggle {
  margin-left: auto;
  color: #71717a;
  font-size: 12px;
  transition: transform 0.2s;
  user-select: none;
}

.tool-call-icon {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  font-size: 10px;
  font-weight: 600;
}

.tool-call-content {
  padding: 0;
  max-height: 0;
  transition: max-height 0.3s ease, padding 0.3s ease;
  overflow: hidden;
}

.tool-call-content:not(.collapsed) {
  padding: 12px;
  max-height: 500px;
}

.tool-call-input {
  background: #000000;
  color: #d4d4d8;
  padding: 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  overflow-x: auto;
  border: 1px solid #262626;
  white-space: pre-wrap;
  line-height: 1.4;
}

.error {
  color: #ef4444;
  background: #1a0a0a;
  border: 1px solid #3f1a1a;
  border-radius: 6px;
  padding: 12px;
  margin: 12px 0;
  font-size: 12px;
}

.loading {
  text-align: center;
  padding: 32px;
  color: #71717a;
  font-size: 12px;
}

.hidden {
  display: none;
}

/* FAB (Floating Action Button) Container */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: all 0.3s ease;
}

.fab-container.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.fab-btn {
  position: relative;
  min-width: 56px;
  height: 56px;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 0 16px;
  gap: 8px;
  font-family: inherit;
  font-weight: 500;
  overflow: hidden;
}

.fab-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.fab-btn:active {
  transform: scale(0.98) translateY(0px);
  transition: all 0.1s ease;
}

.fab-continue {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.fab-continue:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.4);
}

.fab-share {
  background: linear-gradient(135deg, #667eea, #5a67d8);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.fab-share:hover {
  background: linear-gradient(135deg, #5a67d8, #4c51bf);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Share Modal */
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.share-modal-content {
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.share-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #262626;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.share-modal-header h3 {
  color: #ffffff;
  font-size: 16px;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: #71717a;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #262626;
  color: #ffffff;
}

.share-modal-body {
  padding: 20px;
}

.share-option {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.share-option:hover {
  border-color: #52525b;
}

.share-option h4 {
  color: #ffffff;
  font-size: 14px;
  margin: 0 0 8px 0;
}

.share-option p {
  color: #a1a1aa;
  font-size: 12px;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: absolute;
    z-index: 100;
    height: 100%;
  }
  
  .sidebar.collapsed {
    margin-left: -100%;
  }
  
  .main-content {
    width: 100%;
  }
  
  .message {
    max-width: 100%;
    padding: 0 10px;
  }
}

/* Markdown and Code Block Styles */
.markdown-content {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  color: #e6edf3;
  font-size: 13px;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3, 
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
  color: #f0f6fc;
  margin: 12px 0 8px 0;
  font-weight: 600;
}

.markdown-content p {
  margin: 8px 0;
  line-height: 1.5;
}

.markdown-content ul, .markdown-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.markdown-content li {
  margin: 4px 0;
}

.markdown-content blockquote {
  border-left: 2px solid #30363d;
  margin: 8px 0;
  padding: 4px 12px;
  color: #7d8590;
  background-color: rgba(13, 17, 23, 0.3);
}

.markdown-content strong {
  font-weight: 600;
  color: #f0f6fc;
}

.markdown-content em {
  font-style: italic;
  color: #a5a5a5;
}

.markdown-content a {
  color: #58a6ff;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

.markdown-content hr {
  border: none;
  height: 1px;
  background-color: #21262d;
  margin: 16px 0;
}

/* Code Blocks */
.code-block-wrapper {
  background-color: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  margin: 12px 0;
  overflow: hidden;
}

.code-block-header {
  background: #161b22;
  border-bottom: 1px solid #21262d;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.code-language {
  color: #7d8590;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.code-copy-btn {
  background: #21262d;
  border: 1px solid #30363d;
  color: #7d8590;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.code-copy-btn:hover {
  background: #30363d;
  color: #e6edf3;
}

.markdown-content pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  background-color: transparent !important;
  font-family: 'SFMono-Regular', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  line-height: 1.35;
}

.markdown-content code {
  font-family: 'SFMono-Regular', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

.markdown-content :not(pre) > code,
.markdown-content .inline-code {
  background-color: #21262d;
  color: #f85149;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 11px;
  border: 1px solid #30363d;
  display: inline-block;
  white-space: nowrap;
}

/* 修复代码块间距问题 */
.markdown-content .code-block-wrapper {
  margin: 8px 0;
}

.markdown-content .code-block-wrapper:first-child {
  margin-top: 0;
}

.markdown-content .code-block-wrapper:last-child {
  margin-bottom: 0;
}
.chat-messages::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar,
.share-modal-content::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track,
.share-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb,
.share-modal-content::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 3px;
  border: 1px solid #18181b;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover,
.share-modal-content::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Firefox scrollbar styles */
.chat-messages,
.sidebar-content,
.share-modal-content {
  scrollbar-width: thin;
  scrollbar-color: #27272a transparent;
}