:root {
  --gray-50: 220 10% 94%;
  --gray-100: 220 10% 90%;
  --gray-200: 0 0% 71%;
  --gray-300: 220 2% 58%;
  --gray-400: 220 2% 48%;
  --gray-500: 220 2% 35%;
  --gray-600: 220 3% 25%;
  --gray-700: 220 4% 20%;
  --gray-800: 220 5% 15%;
  --gray-900: 220 6% 11%;
  --gray-950: 220 6% 9%;
  --gray-1000: 220 6% 7%;
  --orange-50: 14 100% 97%;
  --orange-100: 20 100% 94%;
  --orange-200: 22 89% 73%;
  --orange-300: 21 65% 60%;
  --orange-400: 23 76% 46%;
  --orange-500: 24 100% 31%;
  --orange-600: 24 100% 23%;
  --orange-700: 20 58% 22%;
  --orange-800: 20 49% 18%;
  --orange-900: 20 48% 14%;
  --orange-950: 22 27% 13%;
  --orange-1000: 20 17% 11%;
  --yellow-50: 42 96% 95%;
  --yellow-100: 43 100% 88%;
  --yellow-200: 42 69% 61%;
  --yellow-300: 41 58% 48%;
  --yellow-400: 42 80% 34%;
  --yellow-500: 42 95% 25%;
  --yellow-600: 42 92% 19%;
  --yellow-700: 42 95% 15%;
  --yellow-800: 40 64% 14%;
  --yellow-900: 40 58% 11%;
  --yellow-950: 40 25% 12%;
  --yellow-1000: 40 19% 10%;
  --lime-50: 75 53% 92%;
  --lime-100: 72 76% 85%;
  --lime-200: 69 57% 51%;
  --lime-300: 69 100% 34%;
  --lime-400: 77 63% 35%;
  --lime-500: 70 100% 21%;
  --lime-600: 70 100% 15%;
  --lime-700: 70 60% 15%;
  --lime-800: 70 49% 13%;
  --lime-900: 70 37% 11%;
  --lime-950: 70 21% 11%;
  --lime-1000: 70 17% 9%;
  --green-50: 129 54% 94%;
  --green-100: 126 82% 91%;
  --green-200: 133 58% 63%;
  --green-300: 133 34% 54%;
  --green-400: 137 42% 42%;
  --green-500: 138 76% 26%;
  --green-600: 139 65% 20%;
  --green-700: 138 41% 19%;
  --green-800: 136 29% 17%;
  --green-900: 136 32% 13%;
  --green-950: 135 17% 12%;
  --green-1000: 135 12% 10%;
  --teal-50: 178 71% 93%;
  --teal-100: 180 65% 89%;
  --teal-200: 180 53% 61%;
  --teal-300: 180 47% 48%;
  --teal-400: 180 51% 39%;
  --teal-500: 180 99% 22%;
  --teal-600: 180 75% 19%;
  --teal-700: 177 52% 17%;
  --teal-800: 181 93% 11%;
  --teal-900: 180 79% 9%;
  --teal-950: 180 29% 11%;
  --teal-1000: 180 18% 9%;
  --blue-50: 225 100% 98%;
  --blue-100: 225 100% 96%;
  --blue-200: 225 100% 82%;
  --blue-300: 223 89% 73%;
  --blue-400: 226 72% 63%;
  --blue-500: 226 48% 49%;
  --blue-600: 225 46% 35%;
  --blue-700: 225 35% 27%;
  --blue-800: 224 32% 21%;
  --blue-900: 225 33% 16%;
  --blue-950: 225 22% 14%;
  --blue-1000: 225 15% 12%;
  --purple-50: 248 100% 98%;
  --purple-100: 248 100% 96%;
  --purple-200: 249 75% 83%;
  --purple-300: 252 73% 74%;
  --purple-400: 253 58% 64%;
  --purple-500: 255 39% 50%;
  --purple-600: 255 35% 36%;
  --purple-700: 252 28% 28%;
  --purple-800: 252 25% 22%;
  --purple-900: 252 22% 17%;
  --purple-950: 248 17% 14%;
  --purple-1000: 240 12% 12%;
  --pink-50: 330 100% 98%;
  --pink-100: 325 100% 95%;
  --pink-200: 326 65% 78%;
  --pink-300: 321 64% 66%;
  --pink-400: 319 39% 55%;
  --pink-500: 319 48% 41%;
  --pink-600: 320 41% 30%;
  --pink-700: 320 33% 25%;
  --pink-800: 320 30% 19%;
  --pink-900: 320 28% 15%;
  --pink-950: 320 16% 13%;
  --pink-1000: 320 14% 11%;
  --red-50: 0 100% 98%;
  --red-100: 0 100% 95%;
  --red-200: 359 81% 80%;
  --red-300: 356 69% 69%;
  --red-400: 354 54% 58%;
  --red-500: 353 53% 43%;
  --red-600: 353 50% 32%;
  --red-700: 358 37% 26%;
  --red-800: 0 30% 20%;
  --red-900: 0 31% 16%;
  --red-950: 0 20% 13%;
  --red-1000: 0 15% 11%;
  --warm-gray-50: 30 12% 97%;
  --warm-gray-100: 40 8% 95%;
  --warm-gray-200: 33 1% 75%;
  --warm-gray-300: 30 1% 62%;
  --warm-gray-400: 30 1% 52%;
  --warm-gray-500: 30 1% 39%;
  --warm-gray-600: 30 2% 29%;
  --warm-gray-700: 30 3% 23%;
  --warm-gray-800: 30 2% 18%;
  --warm-gray-900: 30 3% 15%;
  --warm-gray-950: 30 4% 12%;
  --warm-gray-1000: 30 5% 11%;
  --black: 0 0% 2%;
  --white: 0 0% 99%;
  --color-jet: 0 0% 4%;
  --color-umbra: 221 12% 14%;
  --color-ink: 213 11% 16%;
  --color-ash: 216 5% 19;
  --color-iron: 216 4% 20%;
  --color-steel: 216 4% 22%;
  --color-tin: 216 4% 26%;
  --color-fog: 216 4% 35%;
  --color-silver: 213 6% 74%;
  --color-pewter: 213 0% 100%;
  --color-dove: 222 0% 86%;
  --color-nimbus: 228 21.74% 95.49%;
  --color-ivory: 40 18% 97%;
  --color-white: 0 0% 100%;
  --color-midnight: 214 58.3% 9.4%;
  --color-evenfall: 214 16.1% 28%;
  --color-breeze: 214 48.9% 73.9%;
  --color-cobalt: 214.6 60 45%;
  --color-gale: 214.6 79.1 62.5%;
  --color-dawn: 37 100% 76%;
  --color-sunset: 22 100% 51.6%;
  --color-rust: 22 93.8% 36.72%;
  --color-dusk: 263 70% 50.4%;
  --color-twilight: 255 92% 76%;
  --radius: 0.5rem;
  --font-default: var(--font-universal-sans), var(--font-ibm-plex-mono);
  --content-max-width: 48rem;
  --surface-inset: hsl(var(--gray-1000));
  --surface-base: hsl(var(--gray-950));
  --surface-l1: hsl(var(--gray-900));
  --surface-l2: hsl(var(--gray-800));
  --surface-l3: hsl(var(--gray-700));
  --surface-l4: hsl(var(--gray-600));
  --surface-l4-hover: hsl(var(--gray-500));
  --surface-invert: hsl(var(--white));
  --overlay: hsl(var(--black) / 50%);
  --button-filled: hsl(var(--white));
  --button-filled-hover: hsl(var(--gray-200));
  --button-filled-active: hsl(var(--gray-300));
  --button-ghost-hover: hsl(var(--white) / 8%);
  --button-ghost-active: hsl(var(--white) / 10%);
  --border-l1: hsl(var(--white) / 6%);
  --border-l2: hsl(var(--white) / 10%);
  --border-l3: hsl(var(--white) / 20%);
  --ring: hsl(var(--gray-500));
  --fg-primary: var(--white);
  --fg-secondary: var(--gray-200);
  --fg-tertiary: var(--gray-300);
  --fg-invert: var(--gray-1000);
  --fg-danger: var(--red-300);
  --fg-positive: var(--teal-300);
  --input-background: #313234;
  --input-background-hover: #36383a;
  --input-button-background: #313234;
  --input-button-background-hover: #424446;
  --input-button-background-selected: #626365;
  --input-button-border: #444446;
  --input-button-border-hover: #707172;
  --incognito-input-background: #222329;
  --incognito-input-background-hover: #26252e;
  --incognito-input-button-background: #222329;
  --incognito-input-button-background-hover: #33333b;
  --incognito-input-button-background-selected: #5a5a61;
  --incognito-input-button-border: #36373c;
  --incognito-input-button-border-hover: #66666a;
  --background: hsl(var(--gray-950));
  --background-secondary: hsl(220 6% 10%);
  --foreground: hsl(var(--color-dove) / 8%);
  --highlight: hsl(var(--color-pewter) / 30%);
  --gradient: hsl(var(--color-pewter) / 10%);
  --gradient-bg: hsla(217, 4%, 14%, 1);
  --important: hsl(var(--color-ash));
  --important-hover: hsl(var(--color-steel));
  --button-primary: hsl(var(--color-ivory) / 90%);
  --button-primary-hover: hsl(var(--color-ivory));
  --button-secondary: hsl(var(--color-dove) / 12%);
  --button-secondary-hover: hsl(var(--color-dove) / 20%);
  --button-secondary-selected: hsl(var(--color-dove) / 30%);
  --button-text-hover: hsl(var(--color-dove) / 8%);
  --button-outline-border: hsl(var(--color-dove) / 8%);
  --input: hsl(var(--color-iron) / 100%);
  --input-glow: hsl(var(--color-pewter) / 20%);
  --input-border: hsl(var(--color-dove) / 4%);
  --input-hover: hsl(var(--color-iron) / 100%);
  --input-border-focus: hsl(var(--color-white) / 16%);
  --input-foreground-hover: hsl(var(--color-tin) / 100%);
  --toggle-border: hsl(var(--color-white) / 9%);
  --toggle-hover: hsl(var(--color-white) / 6%);
  --toggle-selected: hsl(var(--color-white) / 24%);
  --toggle-disabled: hsl(var(--color-white) / 8%);
  --popover: hsl(var(--color-steel) / 100%);
  --popover-border: hsl(var(--color-dove) / 4%);
  --popover-hover: hsl(var(--color-dove) / 4%);
  --card: hsl(var(--color-dove) / 8%);
  --card-hover: hsl(var(--color-dove) / 6%);
  --card-focus: hsl(var(--color-dove) / 14%);
  --card-border: hsl(var(--color-dove) / 4%);
  --card-border-focus: hsl(var(--color-dove) / 4%);
  --chip: hsl(var(--color-dove) / 5%);
  --link: hsl(var(--color-gale));
  --link-hover: hsl(var(--color-cobalt));
  --primary: var(--color-ivory);
  --secondary: var(--color-silver);
  --incognito: hsl(var(--color-twilight));
  --input-incognito: hsl(var(--color-twilight) / 4%);
  --input-glow-incognito: hsl(var(--color-twilight) / 25%);
  --input-border-incognito: hsl(var(--color-twilight) / 35%);
  --input-hover-incognito: hsl(var(--color-twilight) / 7%);
  --input-border-focus-incognito: hsl(var(--color-twilight) / 55%);
  --border-incognito: hsl(var(--color-twilight));
  --ring-incognito: hsl(var(--color-twilight));
  --card-foreground: 0 0% 98%;
  --popover-foreground: 0 0% 98%;
  --primary-foreground: 0 0% 9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 0 0% 14.9%;
  --muted-foreground: 0 0% 63.9%;
  --accent: 240 4% 16%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 14.9%;
  --chart-1: 220 70% 50%;
  --chart-2: 160 60% 45%;
  --chart-3: 30 80% 55%;
  --chart-4: 280 65% 60%;
  --chart-5: 340 75% 55%;
  --sidebar-foreground: 240 4.8% 95.9%;
  --sidebar-primary: 224.3 76.3% 48%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 240 5% 26%;
  --sidebar-accent-foreground: 240 4.8% 95.9%;
  --sidebar-border: 240 3.7% 15.9%;
  --sidebar-ring: 217.2 91.2% 59.8%;
  --scrollbar-thumb-dimmed: rgba(255, 255, 255, 0.05);
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --scrollbar-track: transparent;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0a0a0a;
  color: #ffffff;
  height: 100vh;
  overflow: hidden;
}

/* App Layout */
.app {
  display: flex;
  height: 100vh;
  background-color: #0a0a0a;
  position: relative;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 256px;
  background-color: #0f0f0f;
  border-right: 1px solid #1f1f1f;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  overflow: hidden;
  overflow-x: hidden;
  touch-action: pan-y;
  position: relative;
  z-index: 10;
}

.sidebar.collapsed {
  width: 48px;
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 64px;
}

.sidebar.collapsed .sidebar-header {
  justify-content: flex-start;
  padding: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .logo {
  opacity: 1 !important;
  position: relative !important;
  pointer-events: auto !important;
  visibility: visible !important;
  left: 0 !important;
  justify-content: flex-start;
}

.logo-icon {
  color: #ffffff;
  flex-shrink: 0;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  position: relative;
  /* 自定义滚动条样式 */
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* 自定义滚动条样式 - Webkit 浏览器 */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.sidebar-content::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 3px;
  transition: background-color 0.2s;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-dimmed);
}

.sidebar-content::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb);
}

.sidebar.collapsed .sidebar-content {
  padding: 0 6px;
}

/* Search Section */
.search-section {
  margin-bottom: 16px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .search-section {
  opacity: 0;
  position: absolute;
  pointer-events: none;
  visibility: hidden;
  left: -9999px;
}

.search-input-wrapper {
  position: relative;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}

.search-icon {
  color: #9ca3af;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 14px;
}

.search-input::placeholder {
  color: #6b7280;
}

.search-shortcut {
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}

/* Menu Items */
.menu-items {
  margin-bottom: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: #9ca3af;
  position: relative;
}

.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 10px 6px;
  gap: 0;
}

.menu-item:hover {
  background-color: #1a1a1a;
  color: #ffffff;
}

.menu-item.active {
  background-color: #1f1f1f;
  color: #ffffff;
}

.menu-item svg {
  flex-shrink: 0;
  min-width: 16px;
  width: 16px;
  height: 16px;
}

.menu-text {
  font-size: 14px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .menu-text {
  opacity: 0;
  position: absolute;
  pointer-events: none;
  visibility: hidden;
  left: -9999px;
}

/* Submenu Section */
.submenu-section {
  margin-left: 28px;
  margin-bottom: 16px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .submenu-section {
  opacity: 0;
  position: absolute;
  pointer-events: none;
  visibility: hidden;
  left: -9999px;
}

.submenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 4px;
}

.submenu-item:hover {
  background-color: #1a1a1a;
  color: #ffffff;
}

.submenu-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.submenu-text {
  font-size: 14px;
}

.submenu-link {
  padding: 6px 12px;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}

.submenu-link:hover {
  color: #9ca3af;
}

/* History Section */
.history-section {
  flex: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding: 0 8px;
}

.sidebar.collapsed .history-section {
  opacity: 0;
  position: absolute;
  pointer-events: none;
  visibility: hidden;
  left: -9999px;
}

.history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

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

.history-label {
  padding: 4px 12px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 4px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 14px;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.history-item:hover {
  background-color: #1a1a1a;
  color: #ffffff;
}

.history-item.active {
  background-color: #2a2a2a;
  color: #ffffff;
}

.history-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.history-item:hover .history-item-actions {
  opacity: 1;
}

.history-item-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
}

.history-item-btn:hover {
  color: #ffffff;
  background-color: #3a3a3a;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  min-height: 64px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  position: relative;
  border-top: none;
}

.sidebar.collapsed .sidebar-footer {
  padding: 16px 6px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 80px;
}

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

.sidebar.collapsed .user-profile {
  justify-content: center;
  gap: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background-color: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.user-name {
  font-size: 14px;
  color: #ffffff;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .user-name {
  opacity: 0;
  position: absolute;
  pointer-events: none;
  visibility: hidden;
  left: -9999px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-toggle {
  display: none;
}

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

.expand-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.sidebar.collapsed .expand-btn {
  display: flex;
}

.expand-btn:hover {
  background-color: #1f1f1f;
  color: #ffffff;
}

.expand-btn svg {
  transform: none;
}

.sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #0a0a0a;
  position: relative;
}

/* Chat Area */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
}

/* Welcome Screen */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.welcome-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.brand-icon {
  color: #ffffff;
}

.brand-title {
  font-size: 48px;
  font-weight: bold;
  color: #ffffff;
}

/* Input Container */
.input-container {
  width: 100%;
  max-width: 640px;
}

.input-form {
  position: relative;
}

.input-wrapper {
  position: relative;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding-bottom: 48px;
  padding-left: 20px;
  padding-right: 20px;
}

.input-placeholder {
  position: absolute;
  left: 20px;
  top: 22px;
  color: #9ca3af;
  pointer-events: none;
  user-select: none;
  font-size: 16px;
  transition: opacity 0.2s;
}

.input-placeholder.hidden {
  opacity: 0;
}

.input-field {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 16px;
  resize: none;
  min-height: 56px;
  padding: 16px 12px 16px 0;
  line-height: 1.5;
  /* 自定义滚动条样式 */
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* 自定义滚动条样式 - Webkit 浏览器 */
.input-field::-webkit-scrollbar {
  width: 6px;
}

.input-field::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.input-field::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 3px;
  transition: background-color 0.2s;
}

.input-field::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-dimmed);
}

.input-field::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb);
}

.input-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-top: 2px solid transparent;
}

.control-btn {
  background: none;
  border: 1px solid #2a2a2a;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.control-btn:hover {
  background-color: #2a2a2a;
  color: #ffffff;
}

.control-group {
  display: flex;
  flex: 1;
  gap: 6px;
  max-width: 100%;
}

.deepsearch-toggle {
  display: flex;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  align-items: center;
  max-height: 40px;
  transition: all 0.1s;
  position: relative;
  overflow: hidden;
}

.deepsearch-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px 0 0 20px;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.deepsearch-btn:hover {
  background-color: #2a2a2a;
  color: #ffffff;
}

/* 选中状态，与 hover 效果一致 */
.deepsearch-btn.selected,
.deepsearch-btn.selected:hover {
  background-color: #6b7280; /* 暗灰高亮 */
  color: #ffffff;
}

.deepsearch-btn span {
  color: #d1d5db;
}

.divider {
  width: 1px;
  height: 16px;
  background-color: #2a2a2a;
}

.dropdown-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px 12px 8px 8px;
  border-radius: 0 20px 20px 0;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-btn:hover {
  background-color: #2a2a2a;
  color: #ffffff;
}

.think-btn {
  background: none;
  border: 1px solid #2a2a2a;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.think-btn:hover {
  background-color: #2a2a2a;
  color: #ffffff;
}

.think-btn span {
  color: #d1d5db;
}

.model-selector {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.model-btn {
  background: none;
  border: 1px solid #2a2a2a;
  color: #ffffff;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-btn:hover {
  background-color: #2a2a2a;
}

.model-btn.disabled,
.model-btn[disabled] {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.model-name {
  color: #ffffff; /* 白色字体更协调 */
  font-size: 14px;
}

.send-btn {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.send-btn.enabled {
  opacity: 1;
}

.send-btn-inner {
  width: 40px;
  height: 40px;
  background-color: #6b7280;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.1s;
}

.send-btn.enabled .send-btn-inner {
  background-color: #ffffff;
}

.send-btn.enabled .send-btn-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.1s;
}

.send-btn svg {
  color: #000000;
  position: relative;
  z-index: 1;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 3px;
  transition: background-color 0.2s;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-dimmed);
}

.chat-messages::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb);
}

.messages-container {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.message {
  display: flex;
  gap: 12px;
  width: 100%; /* 使气泡宽度以容器为基准，避免 shrink-to-fit */
}

.message.user {
  align-self: flex-end;
}

.message.ai {
  align-self: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #333333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background-color: #4a4a4a;
  order: 1;
}

.message.ai .message-avatar {
  background-color: #1d3e8a;
}

.message-content-wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%; /* 让内部气泡计算宽度时基于 messages-container */
}

.message.user .message-content-wrapper {
  align-items: flex-end;
  position: relative;
}

.message.ai .message-content-wrapper {
  align-items: flex-start;
}

.message-content {
  position: relative;
  max-width: 90%;
  /* 让普通文本和长单词都能在气泡内部自动换行，防止溢出 */
  white-space: pre-wrap;
  word-break: break-word; /* 对连续长单词进行折行 */
  overflow-wrap: break-word; /* 仅在需要时断词，避免中文被拆成单字符 */
}

.message-content p {
  line-height: 1.6;
}

.message.user .message-content {
  background-color: #2c2c2c;
  color: #ffffff;
  border-top-right-radius: 4px;
  border: 1px solid #2a2a2a;
  padding: 12px 16px;
  border-radius: 12px;
}

.message.ai .message-content {
  background-color: transparent;
  color: #e0e0e0;
  border: none;
  box-shadow: none;
  padding: 0;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  transition: all 0.2s;
}

.message-actions.floating {
  position: fixed;
  display: flex;
  flex-direction: column;
  z-index: 10;
  transform: translateY(0);
  transition: opacity 0.2s ease-in-out, left 0s, top 0s;
  opacity: 0;
  pointer-events: none;
}

.message-actions.floating.visible {
  opacity: 1;
  pointer-events: auto;
}

.message.user .message-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.message-buttons {
  display: flex;
  gap: 4px;
}

.message-actions.floating .message-buttons {
  flex-direction: column;
}

.message-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.message-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.message-time {
  font-size: 12px;
  color: #6b7280;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: #9ca3af;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Bottom Input */
.bottom-input {
  padding: 16px 24px;
  background-color: #0a0a0a;
}

.bottom-input .input-wrapper {
  max-width: 768px;
  margin: 0 auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -256px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar.collapsed {
    width: 256px;
    left: -256px;
  }

  .main-content {
    width: 100%;
  }

  .welcome-screen {
    justify-content: center;
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .welcome-logo {
    margin-bottom: 0;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
  }

  .brand-title {
    font-size: 40px;
  }

  .input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    margin: 0;
    padding: 16px;
    background-color: #0a0a0a;
    border-top: 1px solid #1f1f1f;
    z-index: 100;
  }

  .input-wrapper {
    border-radius: 20px;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 44px;
    margin: 0;
  }

  .input-field {
    min-height: 48px;
    font-size: 16px;
    padding: 16px 12px 16px 0;
  }

  .input-placeholder {
    font-size: 16px;
    top: 16px;
    left: 16px;
  }

  .input-controls {
    padding: 8px;
    gap: 6px;
  }

  .control-btn {
    width: 36px;
    height: 36px;
    padding: 8px;
  }

  .control-btn svg {
    width: 18px;
    height: 18px;
  }

  .deepsearch-toggle {
    max-height: 36px;
    display: none;
  }

  .think-btn {
    padding: 8px 12px;
    font-size: 13px;
    gap: 6px;
    height: 36px;
  }

  .think-btn span {
    display: block;
  }

  .think-btn svg {
    width: 16px;
    height: 16px;
  }

  .model-btn {
    padding: 8px 12px;
    font-size: 13px;
    gap: 6px;
    height: 36px;
  }

  .model-btn svg {
    width: 14px;
    height: 14px;
  }

  .send-btn-inner {
    width: 36px;
    height: 36px;
  }

  .send-btn svg {
    width: 18px;
    height: 18px;
  }

  .chat-messages {
    padding: 16px;
    padding-bottom: 120px;
  }

  .message {
    max-width: 90%;
  }

  .message-content {
    padding: 10px 12px;
    font-size: 14px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
  }

  .message-avatar svg {
    width: 14px;
    height: 14px;
  }

  .bottom-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    border-top: 1px solid #1f1f1f;
    background-color: #0a0a0a;
    z-index: 100;
  }

  .bottom-input .input-wrapper {
    border-radius: 20px;
    padding-bottom: 44px;
    max-width: none;
    margin: 0;
    padding-left: 16px;
    padding-right: 16px;
  }

  .bottom-input .input-field {
    min-height: 48px;
    padding: 16px 12px 16px 0;
  }

  .bottom-input .input-placeholder {
    top: 16px;
    left: 16px;
  }

  .bottom-input .input-controls {
    padding: 8px;
    gap: 6px;
  }

  .bottom-input .control-btn {
    width: 36px;
    height: 36px;
  }

  .bottom-input .deepsearch-toggle {
    display: none;
  }

  .bottom-input .think-btn {
    padding: 8px 12px;
    font-size: 13px;
    height: 36px;
  }

  .bottom-input .think-btn span {
    display: block;
  }

  .bottom-input .model-btn {
    padding: 8px 12px;
    font-size: 13px;
    height: 36px;
  }

  .bottom-input .send-btn-inner {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 475px) {
  .deepsearch-toggle {
    display: none !important;
  }

  .control-group {
    gap: 4px;
  }

  .think-btn {
    padding: 8px 10px;
    min-width: 36px;
  }

  .model-btn {
    padding: 8px 10px;
    min-width: 36px;
  }

  .model-name {
    display: none;
  }

  .input-controls {
    gap: 4px;
  }

  .welcome-screen {
    padding: 16px 12px;
    padding-top: 50px;
    padding-bottom: 100px;
  }

  .brand-title {
    font-size: 32px;
  }

  .input-container {
    padding: 12px;
  }

  .input-wrapper {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 40px;
  }

  .input-placeholder {
    left: 12px;
  }

  .input-controls {
    padding: 6px;
  }

  .bottom-input {
    padding: 12px;
  }

  .bottom-input .input-wrapper {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 40px;
  }

  .bottom-input .input-placeholder {
    left: 12px;
  }

  .bottom-input .input-controls {
    padding: 6px;
  }
}

@media (max-width: 640px) {
  .message.user .message-content {
    max-width: 100%;
  }
}

.message-actions.hidden {
  display: none !important;
}

/* Global Loader */
.global-loader {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 10, 10, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #ffffff;
}

.loader-content p {
  font-size: 16px;
  font-weight: 500;
}

/* Model Selector Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 10, 10, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  pointer-events: none;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.2s ease-in-out;
}

.modal-overlay.visible .modal-content {
  transform: scale(1);
}

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

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-icon {
  width: 24px;
  height: 24px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.modal-close-btn:hover {
  background-color: #2a2a2a;
}

.modal-body {
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.modal-body::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 3px;
  transition: background-color 0.2s;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-dimmed);
}

.model-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  overflow: hidden;
  margin-bottom: 8px;
  background-color: #444444;
  position: relative;
}

.model-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.model-item.selected {
  transform: translateY(0);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.model-item.selected .model-item-name {
  color: #ffffff;
}

.model-item.selected .model-item-capabilities {
  color: rgba(255, 255, 255, 0.9);
}

.model-item-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--radio-color, #6b7280);
  margin-right: 16px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  background-color: transparent;
}

.model-item.selected .model-item-radio {
  border-color: var(--radio-color, #6b7280);
  background-color: var(--radio-color, #6b7280);
}

.model-item-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: transparent;
  transform: scale(0);
  transition: all 0.2s;
}

.model-item.selected .model-item-radio::after {
  background-color: #ffffff;
  transform: scale(1);
}

.model-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-item-name {
  font-size: 14.4px;
  font-weight: 700;
  color: #ffffff;
  transition: color 0.2s;
}

.model-item-capabilities {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #d1d5db;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.model-item.selected .model-item-capabilities {
  max-height: 200px;
  opacity: 1;
  color: #000000;
}

.model-item.selected .model-item-name {
  color: #000000;
}

.capability-tag {
  display: flex;
  align-items: center;
  gap: 6px;
}

.capability-tag svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.capability-tag span {
  line-height: 1.4;
}

.model-item-remark {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.8;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #2a2a2a;
}

.modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.modal-btn.cancel {
  background-color: #3a3a3a;
  color: #ffffff;
}

.modal-btn.cancel:hover {
  background-color: #4a4a4a;
}

.modal-btn.confirm {
  background-color: #3b82f6;
  color: #ffffff;
}

.modal-btn.confirm:hover {
  background-color: #2563eb;
}

.modal-btn.confirm:active {
  transform: scale(0.98);
}

.blinking-cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background-color: #ffffff;
  animation: blink 1s step-end infinite;
  vertical-align: bottom;
}

@keyframes blink {
  from,
  to {
    background-color: transparent;
  }
  50% {
    background-color: #ffffff;
  }
}

/* Editing Highlight */
.message.editing .message-content {
  outline: 2px solid #facc15;
  outline-offset: -1px;
}

.message-btn[title="保存"] {
  color: #22c55e;
}

.message-btn[title="取消"] {
  color: #ef4444;
}

/* --- Attachment Previews --- */
.attachment-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  max-height: 120px;
  overflow-y: auto;
}

.attachment-previews img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
}

/* --- Disabled attach button --- */
.attach-btn:disabled {
  background-color: #303030; /* 深灰底色，区别启用状态 */
  border-color: #555555;
  color: #555555;
  opacity: 1; /* 保持不透明，避免整体暗淡过度 */
  cursor: not-allowed;
  filter: grayscale(100%) brightness(0.8);
}

.attach-btn:disabled svg {
  stroke: #555555;
}

/* --- Attachment Item & Remove Button --- */
.attachment-item {
  position: relative;
}

.attachment-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 2px #1e1e1e;
  transition: background-color 0.15s;
}

.attachment-remove-btn:hover {
  background-color: #dc2626;
}

/* --- Message Attachments in chat --- */
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.message-attachments img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
}

/* --- Inline Editing --- */
.message.editing .editing-textarea {
  width: 100%;
  background: #1f1f1f;
  border: 1px solid #555;
  border-radius: 6px;
  color: #fff;
  padding: 8px;
  font-size: 14px;
  resize: vertical;
  margin-top: 8px;
}

.message.editing .editing-controls {
  display: flex;
  margin-top: 6px;
  gap: 6px;
}

.message.editing .editing-previews {
  margin-bottom: 6px;
}

.model-btn.disabled svg:last-child,
.model-btn[disabled] svg:last-child {
  display: none;
}

/* --- Message Sources --- */
.message-sources {
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}

.message-sources a {
  color: #60a5fa;
  text-decoration: underline;
  cursor: pointer;
}

.message-sources ul {
  margin: 0;
  padding-left: 18px;
}

.message-sources li {
  margin-bottom: 2px;
}

/* --- Clear All Conversations Button --- */
.clear-all-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: #9ca3af;
  background: none;
  border: none;
  width: 100%;
  margin: 6px 0 10px 0;
}

.clear-all-btn:hover {
  background-color: #1a1a1a;
  color: #ffffff;
}

.clear-all-btn svg {
  flex-shrink: 0;
  min-width: 16px;
  width: 16px;
  height: 16px;
}

/* --- Adding Attachments Indicator --- */
.adding-attachments-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #9ca3af;
}

.loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #3b82f6;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Search Modal */
.search-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.search-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-content {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.search-modal-content input {
  width: 100%;
  background: #0f0f0f;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 16px;
  outline: none;
}

.search-results {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.search-result-item:hover {
  background-color: #2a2a2a;
}

.search-result-snippet {
  font-size: 14px;
  color: #d1d5db;
}

.search-result-item mark {
  background-color: #fbbf24;
  color: #1a1a1a;
}

.search-highlight {
  animation: searchFlash 2s ease-in-out;
}

@keyframes searchFlash {
  0% {
    background-color: rgba(251, 191, 36, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

/* Code Block Styling */
pre {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  position: relative;
  font-size: 14px;
  line-height: 1;
  color: #e5e7eb;
  counter-reset: linenumber;
}

.code-wrapper {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: 1px solid #3f3f46;
  color: #9ca3af;
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-copy-btn:hover {
  background-color: #2a2a2a;
  color: #ffffff;
}

.code-copy-btn svg {
  width: 14px;
  height: 14px;
}

.code-copy-btn.copied {
  color: #10b981; /* Emerald */
  border-color: #10b981;
}

/* Code Block Line Numbers */
.code-line {
  display: block;
  padding-left: 2.8em; /* space for numbers */
  position: relative;
  white-space: pre;
}

.code-line::before {
  counter-increment: linenumber;
  content: counter(linenumber);
  position: absolute;
  left: 0;
  width: 2.2em;
  text-align: right;
  color: #6b7280;
  user-select: none;
  pointer-events: none;
}

/* Contact Email */
.contact-email {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  color: #9ca3af;
  font-size: 14px;
  white-space: nowrap;
}

.sidebar.collapsed .contact-email {
  display: none;
}

.contact-footer {
  position: fixed;
  bottom: 8px;
  left: 0;
  right: 0;
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
}

.contact-footer.show {
  display: flex;
}

.contact-footer svg {
  flex-shrink: 0;
}

/* Mobile menu button */
.mobile-menu-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #ffffff;
  display: none;
  z-index: 1100;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

/* Show button only on small screens */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 900; /* 小于 sidebar(1000) 但高于内容 */
}

.sidebar-overlay.visible {
  display: block;
}
