@charset "UTF-8";
*::-webkit-scrollbar {
  width: 8px;
}

*::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

input,
select {
  outline: none;
  min-height: 32px;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 0;
  background: #fff;
  font-size: 12px;
  font-family: monospace;
  color: #666;
}
input:focus,
select:focus {
  border-color: #007bff;
  box-shadow: none;
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
}
.btn.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border-color: var(--btn-primary-border);
}
.btn.btn-primary:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-hover-color);
  border-color: var(--btn-primary-hover-border);
}
.btn.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border-color: var(--btn-secondary-border);
}
.btn.btn-secondary:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}
.btn.btn-danger {
  background: var(--btn-danger-bg);
  color: var(--btn-danger-color);
  border-color: var(--btn-danger-border);
}
.btn.btn-danger:hover {
  background: var(--btn-danger-hover-bg);
  color: var(--btn-danger-hover-color);
  border-color: var(--btn-danger-hover-border);
}
.btn.btn-outline {
  background: transparent;
  border: 1px solid var(--btn-secondary-border);
  color: var(--btn-secondary-color);
}
.btn.btn-outline:hover {
  background: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
  color: var(--btn-secondary-hover-color);
}
.btn.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border-color: var(--btn-secondary-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.btn.btn-sm:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}
.btn.btn-icon {
  min-width: 32px;
  height: 32px;
  padding: 0;
  font-size: 14px;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border-color: var(--btn-secondary-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.btn.btn-icon:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.selector-container {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}

.select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  font-size: 14px;
  background: var(--bg-primary);
  outline: none;
  min-width: 120px;
  height: 100%;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.select-button:hover {
  border-color: var(--btn-primary-border);
}

.select-button.open {
  border-color: var(--btn-primary-border);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.25);
}

.select-text {
  flex: 1;
  text-align: left;
  text-wrap: nowrap;
}

.select-arrow {
  margin-left: 8px;
  font-size: 12px;
  color: #666;
  transition: transform 0.2s ease;
}

.select-dropdown {
  position: absolute;
  bottom: 100%;
  width: 320px;
  right: 0;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-bottom: 2px;
}

.select-options {
  max-height: 200px;
  overflow-y: auto;
}

.select-option {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f1f1;
  transition: background-color 0.2s ease;
  text-align: right;
}

.select-option:hover {
  background-color: #f8f9fa;
}

.select-option.selected {
  background-color: #e3f2fd;
  color: #1976d2;
}

.select-option.disabled {
  color: #999;
  cursor: not-allowed;
  background-color: #f5f5f5;
}

.select-option:last-child {
  border-bottom: none;
}

/* ====================================
   CSS VARIABLES & THEME SYSTEM
   ==================================== */
:root {
  /* Brand Colors */
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --danger-color: #dc3545;
  --danger-hover: #c82333;
  --success-color: #28a745;
  --warning-color: #ffc107;
  /* Text Colors */
  --text-primary: #333333;
  --text-primary1: #505050;
  --text-secondary: #666666;
  --text-muted: #999999;
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f5f5f5;
  /* Border Colors */
  --border-color: #e9ecef;
  --border-light: #f0f0f0;
  --border-dark: #ced4da;
  /* Button Theme Variables */
  --btn-primary-bg: #e3f2fd;
  --btn-primary-color: #1976d2;
  --btn-primary-border: #bbdefb;
  --btn-primary-hover-bg: #bbdefb;
  --btn-primary-hover-color: #1565c0;
  --btn-primary-hover-border: #90caf9;
  --btn-secondary-bg: #f5f5f5;
  --btn-secondary-color: #666666;
  --btn-secondary-border: #e0e0e0;
  --btn-secondary-hover-bg: #eeeeee;
  --btn-secondary-hover-color: #333333;
  --btn-secondary-hover-border: #d0d0d0;
  --btn-success-bg: #e8f5e8;
  --btn-success-color: #2e7d32;
  --btn-success-border: #c8e6c9;
  --btn-success-hover-bg: #c8e6c9;
  --btn-success-hover-color: #1b5e20;
  --btn-success-hover-border: #a5d6a7;
  --btn-danger-bg: #ffebee;
  --btn-danger-color: #c62828;
  --btn-danger-border: #ffcdd2;
  --btn-danger-hover-bg: #ffcdd2;
  --btn-danger-hover-color: #b71c1c;
  --btn-danger-hover-border: #ef9a9a;
  --background-tertiary: #f3f3f3;
  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  /* Sizes */
  --border-radius: 4px;
  --border-radius-lg: 8px;
}

/* ====================================
   KEYFRAMES & ANIMATIONS
   ==================================== */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes slideInFromTop {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes slideOutToTop {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0;
  }
}
@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}
@keyframes streaming-glow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
/* ====================================
   GLOBAL BASE STYLES
   ==================================== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft Yahei", Arial, "Hiragino Sans GB", sans-serif;
  color: var(--text-primary);
  overflow: hidden;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.if-editor {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
}

textarea {
  outline: none;
}
textarea:focus {
  border-color: var(--primary-color);
}

/* ====================================
   LAYOUT CONTAINERS
   ==================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  margin-left: 520px;
  transition: margin-left var(--transition-normal);
}

.chat-title-bar {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  min-height: 48px;
  flex-shrink: 0;
}

.chat-title-display {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--border-radius);
  transition: background-color var(--transition-fast);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-title-display:hover {
  background: var(--bg-tertiary);
}

.chat-title-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-primary);
  outline: none;
  font-family: inherit;
}
.chat-title-input:focus {
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.left-toolbar.collapsed ~ .chat-container {
  margin-left: 0;
}

.message-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 16px 24px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.message-area:empty::before {
  content: "";
  flex: 1;
}

/* ====================================
   LOADING & UTILITY COMPONENTS
   ==================================== */
.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 10px;
  flex: 1;
  min-height: 200px;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.title-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translateY(-50%);
}

.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ====================================
   MESSAGE COMPONENTS
   ==================================== */
.message-item {
  margin-bottom: 24px;
  border-radius: var(--border-radius-lg);
  max-width: 80%;
  word-wrap: break-word;
  -webkit-user-select: text;
     -moz-user-select: text;
          user-select: text;
  background: var(--bg-primary);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
}
.message-item[data-type=user] {
  color: var(--text-primary);
  margin-left: auto;
  margin-right: 0;
  text-align: right;
  display: inline-block;
  min-width: 160px;
}
.message-item[data-type=user] .message-header,
.message-item[data-type=user] .message-content {
  justify-content: flex-end;
  text-align: right;
}
.message-item[data-type=assistant] {
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  margin-left: 0;
  margin-right: auto;
}
.message-item.system-message {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
  margin-left: 0;
  margin-right: auto;
}
.message-item.system-message .message-content {
  background: #fff3cd;
  font-style: italic;
  color: #856404;
}
.message-item.system-message .message-role {
  color: #856404;
  font-weight: 500;
}
.message-item.streaming {
  position: relative;
}

.message-header {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  opacity: 0.8;
  padding: 12px;
  min-width: 280px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}
.message-header .message-toggle-btn {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: var(--btn-primary-bg);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 50%;
  opacity: 0;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.message-header .message-toggle-btn:hover {
  background: var(--primary-color);
  color: white;
  opacity: 1;
}
.message-header .message-regenerate-btn {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: var(--btn-primary-bg);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 50%;
  opacity: 0;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.message-header .message-regenerate-btn:hover {
  background: var(--warning-color);
  color: white;
  opacity: 1;
}
.message-header .message-delete-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: var(--btn-primary-bg);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 50%;
  opacity: 0;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.message-header .message-delete-btn:hover {
  background: var(--danger-color);
  color: white;
  opacity: 1;
}
.message-header:hover .message-toggle-btn, .message-header:hover .message-regenerate-btn, .message-header:hover .message-delete-btn {
  opacity: 1;
}

.message-role {
  font-weight: 600;
  padding-right: 16px;
  flex-grow: 1;
}

.message-timer {
  background: var(--primary-color);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  margin-left: 8px;
}

.message-content {
  white-space: normal;
  font-size: 14px;
  line-height: 1.5;
  padding: 16px;
  transition: all var(--transition-fast);
}
.message-content.typing::after {
  content: "";
  display: block;
  width: 12px;
  height: 1.2em;
  background: #475f79;
  animation: blink 0.36s infinite;
  margin-left: 2px;
  opacity: 0.8;
}

.message-item.content-hidden .message-content,
.message-item.content-hidden .message-stats {
  display: none;
}

/* ====================================
   INPUT COMPONENTS
   ==================================== */
.input-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  position: relative;
  min-height: 48px;
}

.input-top {
  width: 100%;
}

.input-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  height: 40px;
}

.input-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  height: 100%;
}
.input-toolbar button,
.input-toolbar [class*=btn],
.input-toolbar .btn,
.input-toolbar .menu-btn,
.input-toolbar .close-btn,
.input-toolbar .btn-close,
.input-toolbar .btn-sm,
.input-toolbar .btn-icon,
.input-toolbar .remove-btn,
.input-toolbar .save-btn,
.input-toolbar .eye-btn,
.input-toolbar .toolbar-btn,
.input-toolbar .toolbar-toggle {
  max-height: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  flex-shrink: 0;
  white-space: nowrap;
}

.input-toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  flex-shrink: 0;
}

.input-toolbar-center {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.input-toolbar-center .select-button {
  overflow: hidden;
}
.input-toolbar-center button,
.input-toolbar-center [class*=btn],
.input-toolbar-center .btn,
.input-toolbar-center .menu-btn,
.input-toolbar-center .close-btn,
.input-toolbar-center .btn-close,
.input-toolbar-center .btn-sm,
.input-toolbar-center .btn-icon,
.input-toolbar-center .remove-btn,
.input-toolbar-center .save-btn,
.input-toolbar-center .eye-btn,
.input-toolbar-center .toolbar-btn,
.input-toolbar-center .toolbar-toggle,
.input-toolbar-center .select-button {
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
}

.input-toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.toolbar-right {
  height: 100%;
}

.message-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  font-size: 14px;
  background: var(--bg-primary);
  outline: none;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 32px;
  border-radius: var(--border-radius);
  transition: border-color var(--transition-fast);
}
.message-input:focus {
  border-color: var(--primary-color);
}

.floating-textarea-container {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  margin-bottom: 8px;
  padding: 16px;
  height: 320px;
  display: flex;
  flex-direction: column;
}

.floating-textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius);
  font-size: 14px;
  background: var(--bg-primary);
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  margin-bottom: 12px;
  transition: border-color var(--transition-fast);
}
.floating-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.floating-send-btn {
  align-self: flex-end;
  margin-bottom: 8px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border: 1px solid var(--btn-primary-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.floating-send-btn:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-hover-color);
  border-color: var(--btn-primary-hover-border);
}

/* ====================================
   BUTTON COMPONENTS
   ==================================== */
.floating-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--btn-secondary-color);
  transition: all var(--transition-fast);
}
.floating-close-btn:hover {
  background: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
  color: var(--btn-secondary-hover-color);
}

.menu-btn {
  min-width: 40px;
  height: 40px;
  font-size: 18px;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.menu-btn:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.close-btn {
  min-width: 32px;
  height: 32px;
  font-size: 20px;
  font-weight: bold;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.close-btn:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.btn-close {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--border-radius);
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
  color: var(--btn-secondary-color);
  transition: all var(--transition-fast);
}
.btn-close:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.btn-sm {
  padding: 12px;
  font-size: 12px;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.btn-sm:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.btn-icon {
  min-width: 32px;
  height: 32px;
  font-size: 14px;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.remove-btn {
  background: var(--btn-danger-bg);
  color: var(--btn-danger-color);
  border: 1px solid var(--btn-danger-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.remove-btn:hover {
  background: var(--btn-danger-hover-bg);
  color: var(--btn-danger-hover-color);
  border-color: var(--btn-danger-hover-border);
}

.save-btn {
  min-width: 80px;
  height: 36px;
  background: var(--btn-success-bg);
  color: var(--btn-success-color);
  border: 1px solid var(--btn-success-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.save-btn:hover {
  background: var(--btn-success-hover-bg);
  color: var(--btn-success-hover-color);
  border-color: var(--btn-success-hover-border);
}

.eye-btn {
  min-width: 40px;
  height: 100%;
  min-height: 36px;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 0;
  transition: all var(--transition-fast);
}
.eye-btn:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.providers-list {
  margin-top: 30px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.list-header h4 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.list-actions {
  display: flex;
  gap: 10px;
}

.provider-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid #e9ecef;
  border-radius: 0;
  margin-bottom: 8px;
  background: #fff;
}

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

.provider-section {
  margin-bottom: 30px;
}

.provider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.provider-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.provider-url {
  font-size: 12px;
  color: #666;
  font-family: monospace;
  word-break: break-all;
}
.provider-url .url-input {
  width: 100%;
  height: 36px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 0;
  background: #fff;
  font-size: 12px;
  font-family: monospace;
  color: #666;
}
.provider-url .url-input:focus {
  outline: none;
  border-color: #007bff;
  background: #fff;
}

.provider-models {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 0;
}
.provider-models .models-label {
  font-size: 12px;
  color: #999;
}
.provider-models .models-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.provider-models .models-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.provider-models .models-toggle-btn {
  padding: 4px 8px;
  background: #6c757d;
  color: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  transition: background-color 0.2s ease;
}
.provider-models .models-toggle-btn:hover {
  background: #5a6268;
}
.provider-models .model-item {
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.provider-models .model-item.enabled {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}
.provider-models .model-item.disabled {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
}
.provider-models .model-name {
  flex: 1;
  cursor: pointer;
}
.provider-models .model-remove-btn {
  margin-left: 8px;
  padding: 2px 6px;
  background: #dc3545;
  color: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: background-color 0.2s ease;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.provider-models .model-remove-btn:hover {
  background: #c82333;
}
.provider-models .models-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 100%;
}

.provider-name {
  font-size: 14px;
  color: #333;
}

.name-span {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}
.name-span:hover {
  background-color: #f8f9fa;
}

.toolbar-btn {
  width: 100%;
  margin-bottom: 8px;
  height: 36px;
  justify-content: flex-start;
  padding-left: 12px;
  text-align: left;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}
.toolbar-btn:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.toolbar-toggle {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border: 1px solid var(--btn-primary-border);
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition-fast);
  z-index: 101;
  min-width: 32px;
  height: 100%;
  flex-shrink: 0;
  margin-right: 8px;
}
.toolbar-toggle:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-hover-color);
  border-color: var(--btn-primary-hover-border);
}

/* ====================================
   STATUS & MESSAGE INDICATORS
   ==================================== */
.assistant-name {
  font-size: 13px;
  font-weight: 500;
}

.loading-message {
  padding: 12px 16px;
  background: #e3f2fd;
  color: #1976d2;
  font-style: italic;
  text-align: center;
}

.error-message {
  padding: 12px 16px;
  background: #ffebee;
  color: #c62828;
  border-left: 4px solid #f44336;
}

.api-key-status {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 14px;
  display: none;
}

.status-success {
  background: #e8f5e8;
  color: #2e7d32;
  border-left: 4px solid #4caf50;
}

.status-error {
  background: #ffebee;
  color: #c62828;
  border-left: 4px solid #f44336;
}

.status-info {
  background: #e3f2fd;
  color: #1976d2;
  border-left: 4px solid #2196f3;
}

/* ====================================
   DROPDOWN & MENU COMPONENTS
   ==================================== */
.dropdown-menu {
  position: absolute;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  min-width: 160px;
  z-index: 1000;
  border-radius: 0;
}

.menu-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-fast);
}
.menu-item:hover {
  background-color: var(--bg-secondary);
}
.menu-item:last-child {
  border-bottom: none;
}

.dropdown-item {
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dropdown-item:hover {
  background: var(--bg-secondary);
}
.dropdown-item:not(:last-child) {
  border-bottom: 1px solid var(--border-light);
}

.item-icon {
  font-size: 14px;
  color: var(--text-secondary);
  min-width: 16px;
}

/* ====================================
   SETTINGS PANEL COMPONENTS
   ==================================== */
.setting-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.02);
  z-index: 1999;
}

.setting-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  width: 90%;
  height: 60%;
  max-width: 1000px;
  max-height: 1000px;
  z-index: 2000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.setting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.setting-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.setting-main {
  display: flex;
  height: calc(100% - 60px);
}

.setting-sidebar {
  width: 200px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
}

.sidebar-title {
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-item {
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}
.sidebar-item:hover {
  background: var(--border-color);
  color: var(--text-primary);
}
.sidebar-item.active {
  background: #adc4dd;
  color: #fff;
}

.setting-content-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.setting-section {
  display: block;
}

.setting-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  text-align: right;
}

/* ====================================
   FORM & INPUT COMPONENTS
   ==================================== */
.setting-group {
  margin-bottom: 20px;
}

.setting-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 14px;
}

.setting-input-group {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 36px;
}

.setting-input,
.setting-select,
.setting-control {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 0;
  background: var(--bg-primary);
  font-size: 14px;
}
.setting-input:focus,
.setting-select:focus,
.setting-control:focus {
  outline: none;
  border-color: var(--primary-color);
}

.setting-row {
  display: flex;
  gap: 20px;
}

.setting-item {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 6px;
  border-bottom: 1px solid var(--border-light);
}
.setting-item:hover {
  background-color: var(--bg-secondary);
}
.setting-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.setting-item label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.setting-left {
  flex: 0 0 40%;
  padding-right: 16px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.setting-right {
  flex-grow: 1;
  display: flex;
  align-items: center;
}

.range-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-container input[type=range] {
  flex: 1;
}

.range-value {
  min-width: 60px;
  text-align: center;
  font-weight: 500;
  color: var(--primary-color);
  padding: 4px 8px;
  border: 1px solid var(--border-dark);
  border-radius: 0;
  background: var(--bg-primary);
  font-size: 14px;
}

.setting-checkbox {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.checkbox-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.help-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
}
.help-link:hover {
  text-decoration: underline;
}

/* ====================================
   LEFT TOOLBAR & HISTORY
   ==================================== */
.left-toolbar {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 520px;
  height: 100vh;
  padding: 5px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  z-index: 100;
}
.left-toolbar.collapsed {
  transform: translateX(-100%);
}

.toolbar-collapse-btn {
  position: absolute;
  right: -26px;
  bottom: 180px;
  width: 30px;
  height: 60px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  z-index: 101;
  box-shadow: var(--shadow-sm);
}
.toolbar-collapse-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.toolbar-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.toolbar-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toolbar-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.toolbar-items-collapse-btn {
  width: 24px;
  height: 24px;
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition-fast);
}
.toolbar-items-collapse-btn:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover-border);
}

.toolbar-items {
  transition: all var(--transition-normal);
}
.toolbar-items.collapsed {
  display: none;
}

.toolbar-section h5 {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.history-panel {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.history-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
}
.history-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.history-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.no-history,
.history-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-style: italic;
  font-size: 13px;
}

.conversation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 8px;
  background: var(--bg-primary);
  transition: background-color var(--transition-fast);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.conversation-item:hover {
  background: var(--bg-tertiary);
}
.conversation-item:hover .conversation-delete-btn,
.conversation-item:hover .conversation-sync-btn {
  opacity: 1;
}

.conversation-preview {
  flex: 1;
}

.conversation-title {
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding-right: 5px;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.conversation-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.conversation-time {
  font-size: 12px;
  color: var(--text-muted);
}

.conversation-actions {
  margin-left: 12px;
}

.conversation-delete-btn,
.conversation-sync-btn {
  opacity: 0;
  transition: opacity var(--transition-fast);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conversation-delete-btn {
  right: 16px;
  background: #ff4757;
  color: white;
}
.conversation-delete-btn:hover {
  background: #ff3742;
}

.conversation-sync-btn {
  right: 48px;
  background: #2ed573;
  color: white;
}
.conversation-sync-btn:hover {
  background: #26d065;
}

.history-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-secondary);
}

.toolbar-history {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-color);
  flex-grow: 1;
}

.toolbar-history-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: block;
  flex-direction: column;
  justify-content: flex-end;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.detail-header h4 {
  margin: 0;
  flex: 1;
}

.detail-messages {
  flex: 1;
  overflow-y: auto;
}

.detail-message {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}
.detail-message.user {
  background: #e3f0ff;
  margin-left: 20%;
}
.detail-message.ai {
  background: var(--bg-secondary);
  margin-right: 20%;
}
.detail-message .message-role {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.detail-message .message-content {
  margin-bottom: 8px;
  white-space: pre-wrap;
  line-height: 1.4;
}
.detail-message .message-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ====================================
   ASSISTANT COMPONENTS
   ==================================== */
.assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.assistants-list {
  display: flex;
  flex-direction: column;
}

.assistant-item {
  border: 1px solid var(--border-color);
  padding: 16px;
  background: var(--bg-primary);
}
.assistant-item .assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.assistant-prompt-container {
  display: flex;
  flex-direction: column;
}
.assistant-prompt-container label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.assistant-prompt {
  width: 100%;
  min-height: 260px;
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  color: var(--text-secondary);
}

.assistants-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.assistant-content-area {
  display: flex;
  gap: 20px;
  height: 500px;
}

.assistant-left-column {
  flex: 0 0 200px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  overflow-y: auto;
}

.assistant-right-column {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--bg-primary);
  overflow-y: auto;
}

.assistant-list-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.assistant-list-item:hover {
  background: var(--bg-secondary);
}
.assistant-list-item.selected {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
}
.assistant-list-item:last-child {
  border-bottom: none;
}

.assistant-list-name {
  font-size: 14px;
  font-weight: 500;
}

.assistant-details {
  padding: 20px;
}

.assistant-details-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.assistant-details-item .assistant-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ====================================
   MESSAGE STATS
   ==================================== */
.message-stats {
  margin-top: 8px;
  padding: 8px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}

.stats-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.stats-content.main {
  font-weight: 500;
  margin-bottom: 4px;
}

.message-item[data-type=assistant] .message-stats {
  background: #f1f3f4;
  border-top-color: #dee2e6;
}

/* ====================================
   MARKDOWN & CONTENT STYLING
   ==================================== */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 1.5em 0 0.8em 0;
  line-height: 1.4;
  color: var(--text-primary);
  font-weight: 600;
}
.message-content h1 {
  font-size: 1.8em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border-light);
}
.message-content h2 {
  font-size: 1.5em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border-light);
}
.message-content h3 {
  font-size: 1.3em;
}
.message-content h4 {
  font-size: 1.15em;
}
.message-content h5 {
  font-size: 1em;
}
.message-content h6 {
  font-size: 0.9em;
  color: var(--text-primary1);
}
.message-content pre {
  padding: 12px;
  overflow-x: auto;
}
.message-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--text-primary1);
}
.message-content strong {
  font-weight: 600;
  color: var(--text-primary);
}
.message-content em {
  font-style: italic;
  color: var(--text-primary);
}
.message-content a {
  color: var(--primary-color);
  text-decoration: underline;
}
.message-content a:hover {
  color: var(--primary-hover);
}
.message-content .markdown-link {
  color: var(--text-primary);
  text-decoration: underline;
  transition: color var(--transition-fast);
}
.message-content .markdown-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}
.message-content .think-block {
  margin: 8px 0 32px 0;
  border: 1px solid #e3f2fd;
  border-radius: var(--border-radius-lg);
  background: var(--bg-secondary);
  overflow: hidden;
  white-space: normal;
}
.message-content .think-block.streaming .think-header {
  background: #e1f1ff;
}
.message-content .think-block.streaming .think-content {
  background: #f0f8ff;
  border-top-color: #b3d9ff;
}
.message-content .think-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-weight: 500;
  cursor: pointer;
}
.message-content .think-icon {
  margin-right: 8px;
  font-size: 16px;
}
.message-content .think-title {
  flex: 1;
  font-weight: 600;
  color: #1976d2;
  font-size: 14px;
}
.message-content .think-collapse-btn {
  margin-left: 8px;
}
.message-content .think-content {
  padding: 12px;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
  font-size: 13px;
  line-height: 1.6;
  color: #555;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  overflow: hidden;
  overflow-y: auto;
}
.message-content .think-content strong {
  font-weight: 600;
  color: #333;
  font-size: inherit;
}
.message-content .think-content em {
  font-style: italic;
  color: #333;
  font-size: inherit;
}
.message-content .think-content .markdown-link {
  color: #777;
}
.message-content .think-content .markdown-link:hover {
  color: #555;
}
.message-content .think-content .markdown-inline-code {
  background-color: #f5f5f5;
  color: #d32f2f;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 12px;
  border: 1px solid #e0e0e0;
}
.message-content .think-content .markdown-strikethrough {
  text-decoration: line-through;
  color: #777;
  opacity: 0.8;
  font-size: inherit;
}
.message-content .think-content del {
  text-decoration: line-through;
  color: #777;
  opacity: 0.8;
  font-size: inherit;
}
.message-content .think-content .think-h1,
.message-content .think-content .think-h2,
.message-content .think-content .think-h3,
.message-content .think-content .think-h4,
.message-content .think-content .think-h5,
.message-content .think-content .think-h6 {
  font-weight: 700;
  color: #333;
  font-size: inherit;
  margin: 0;
  display: inline;
}
.message-content .markdown-table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.message-content .markdown-table th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}
.message-content .markdown-table td {
  padding: 6px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  white-space: normal;
  line-height: 1.4;
}
.message-content .markdown-table tr:last-child td {
  border-bottom: none;
}
.message-content .markdown-table tr:nth-child(even) {
  background-color: var(--bg-tertiary);
}
.message-content .markdown-table tr:hover {
  background-color: var(--bg-secondary);
}
.message-content .markdown-ul {
  margin: 12px 0;
  padding-left: 28px;
  list-style-type: disc;
}
.message-content .markdown-ul li {
  margin: 6px 0;
  line-height: 1.6;
  color: var(--text-primary);
}
.message-content .markdown-ol {
  margin: 12px 0;
  padding-left: 28px;
  list-style-type: decimal;
}
.message-content .markdown-ol li {
  margin: 6px 0;
  line-height: 1.6;
  color: var(--text-primary);
}
.message-content .markdown-blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent-color);
  background-color: var(--background-secondary);
  border-radius: 0 8px 8px 0;
}
.message-content .markdown-blockquote p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-secondary);
}
.message-content .markdown-inline-code {
  background-color: var(--background-tertiary);
  color: var(--accent-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
  border: 1px solid var(--border-color);
}
.message-content .markdown-strikethrough {
  text-decoration: line-through;
  color: var(--text-secondary);
  opacity: 0.7;
}
.message-content .markdown-task-list {
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
}
.message-content .markdown-task-list .markdown-task-item {
  display: flex;
  align-items: flex-start;
  margin: 8px 0;
  line-height: 1.6;
}
.message-content .markdown-task-list .markdown-task-item input[type=checkbox] {
  margin-right: 8px;
  margin-top: 2px;
  accent-color: var(--accent-color);
}
.message-content .markdown-task-list .markdown-task-item .task-text {
  flex: 1;
  color: var(--text-primary);
}
.message-content .markdown-task-list .markdown-task-item .task-text.completed {
  text-decoration: line-through;
  color: var(--text-secondary);
  opacity: 0.7;
}
.message-content .markdown-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: block;
}

/* ====================================
   LOGIN PAGE STYLES
   ==================================== */
.login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-form {
  background: white;
  padding: 40px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-title {
  text-align: center;
  margin: 0 0 30px 0;
  font-size: 24px;
  color: #333;
}

.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.login-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  font-size: 14px;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: #007acc;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: #007acc;
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.login-btn:hover {
  background: #005a9e;
}

.login-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.spinner-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn.loading .spinner-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.if-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.if-modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 90%;
  min-height: 380px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.if-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.if-modal-close {
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.if-modal-close:hover {
  color: #333;
}

.if-modal-body {
  padding: 0;
  max-height: 600px;
  overflow-y: auto;
}

.if-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.model-modal-item,
.assistant-modal-item {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.model-modal-item:hover,
.assistant-modal-item:hover {
  background: #f8f9fa;
}

.model-modal-item.selected,
.assistant-modal-item.selected {
  background: #e3f2fd;
  color: #1976d2;
}

.model-modal-item.disabled,
.assistant-modal-item.disabled {
  color: #999;
  cursor: not-allowed;
}

.model-selected,
.assistant-selected {
  color: #4caf50;
  font-weight: bold;
}

.gitview .breadcrumb-item {
  align-items: center;
}
.gitview td,
.gitview th {
  padding: 5px;
}

/* ====================================
   IF LOADING TIP STYLES
   ==================================== */
.if-loading-tip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(0, 123, 255, 0.95);
  color: white;
  padding: 12px 20px;
  text-align: center;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.if-loading-tip.if-loading-show {
  transform: translateY(0);
  opacity: 1;
  animation: slideInFromTop 0.3s ease;
}
.if-loading-tip .if-loading-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
}
.if-loading-tip .if-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.if-loading-tip .if-loading-text {
  font-weight: 500;
}

/* ====================================
   IF SAVE TIP STYLES
   ==================================== */
.if-save-tip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(0, 123, 255, 0.95);
  color: white;
  padding: 12px 20px;
  text-align: center;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.if-save-tip.if-save-show {
  transform: translateY(0);
  opacity: 1;
  animation: slideInFromTop 0.3s ease;
}
.if-save-tip.if-save-success {
  background: rgba(40, 167, 69, 0.95);
}
.if-save-tip.if-save-error {
  background: rgba(220, 53, 69, 0.95);
}
.if-save-tip .if-save-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
}
.if-save-tip .if-save-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.if-save-tip .if-save-text {
  font-weight: 500;
}

.code-block {
  margin: 12px 0;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
  font-family: "Courier New", Consolas, Monaco, monospace;
  white-space: normal;
}

.code-block.streaming {
  border-color: #007bff;
  background: #f0f8ff;
}

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

.code-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-block.streaming .code-block-header {
  background: #cce7ff;
}

.code-language {
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.code-copy-btn {
  display: flex;
  align-items: center;
  padding: 2px 6px;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.code-copy-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.code-copy-btn.copy-success {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.code-copy-btn.copy-error {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.streaming-indicator {
  font-size: 11px;
  color: #007bff;
}

.code-content {
  padding: 0;
  background: #fafafa;
  overflow-x: auto;
  font-family: "Courier New", Courier, monospace;
}

.code-content pre {
  margin: 0;
  padding: 12px;
  background: transparent;
  border: none;
  font-size: 13px;
  line-height: 1.5;
  color: #383a42;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.code-content code {
  background: transparent;
  padding: 0;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.code-content .keyword,
.keyword {
  color: #a64ec2 !important;
  font-weight: 600;
}

.code-content .string,
.string {
  color: #50a14f !important;
}

.code-content .comment,
.comment {
  color: #a0a1a7 !important;
}

.code-content .number,
.number {
  color: #986801 !important;
}

.code-content .type,
.type {
  color: #a64ec2 !important;
}

.code-content .tag,
.tag {
  color: #e45649 !important;
}

.code-content .attr,
.attr {
  color: #a64ec2 !important;
}

.code-content .selector,
.selector {
  color: #a64ec2 !important;
}

.code-content .property,
.property {
  color: #986801 !important;
}

.code-content .key,
.key {
  color: #50a14f !important;
}

.code-content .variable,
.variable {
  color: #e45649 !important;
}

.code-content .operator,
.operator {
  color: #383a42 !important;
}

/* ====================================
   MOBILE RESPONSIVE DESIGN
   ==================================== */
/* ====================================
   MOBILE VARIABLES & OVERRIDES
   ==================================== */
:root {
  /* Mobile-specific sizes */
  --mobile-toolbar-width: 100%;
  --mobile-toolbar-height: 56px;
  --mobile-header-height: 48px;
  --mobile-input-height: 56px;
  --mobile-button-height: 26px;
  --mobile-touch-target: 26px;
  /* Mobile spacing */
  --mobile-padding-xs: 8px;
  --mobile-padding-sm: 12px;
  --mobile-padding-md: 16px;
  --mobile-padding-lg: 20px;
  /* Mobile font sizes */
  --mobile-font-xs: 12px;
  --mobile-font-sm: 14px;
  --mobile-font-md: 16px;
  --mobile-font-lg: 18px;
  --mobile-font-xl: 20px;
}

/* ====================================
   MOBILE VIEWPORT & SCALING OPTIMIZATION
   ==================================== */
html {
  /* Prevent zoom on input focus */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
       text-size-adjust: 100%;
  /* Prevent horizontal scroll */
  overflow-x: hidden;
}

body {
  /* Prevent zoom on input focus */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
       text-size-adjust: 100%;
  /* Prevent horizontal scroll */
  overflow-x: hidden;
  /* Smooth scrolling */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Prevent zoom on input focus for iOS */
input[type=text],
input[type=email],
input[type=password],
input[type=search],
input[type=tel],
input[type=url],
input[type=number],
textarea,
select {
  font-size: 16px !important;
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
}

/* Ensure proper scaling on high DPI displays */
@media (min-resolution: 192dpi) {
  html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
         text-size-adjust: 100%;
  }
}
/* ====================================
   SMALL TABLETS (768px and below)
   ==================================== */
@media (max-width: 768px) {
  body {
    font-size: var(--mobile-font-sm);
  }
  .select-dropdown {
    max-width: 180px;
  }
  .left-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 80%;
    height: 100vh;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  .left-toolbar.collapsed {
    transform: translateX(-100%);
  }
  .left-toolbar:not(.collapsed) {
    transform: translateX(0);
  }
  .left-toolbar:not(.collapsed) ~ .chat-container {
    margin-left: 0;
  }
  /* Mobile touch optimizations */
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  input,
  textarea,
  [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
  }
  button,
  .btn,
  .clickable,
  [role=button] {
    min-height: var(--mobile-touch-target);
    min-width: var(--mobile-touch-target);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    transition: background-color 0.15s ease, transform 0.1s ease;
    cursor: pointer;
  }
  button:active,
  .btn:active,
  .clickable:active,
  [role=button]:active {
    transform: scale(0.98);
    background-color: rgba(0, 0, 0, 0.05);
  }
  .chat-input,
  .message-input {
    touch-action: manipulation;
    -webkit-appearance: none;
    -moz-appearance: none;
         appearance: none;
    border-radius: 8px;
  }
  .conversation-item,
  .assistant-item,
  .model-item {
    min-height: var(--mobile-touch-target);
    padding: var(--mobile-padding-sm);
    touch-action: manipulation;
    transition: background-color 0.15s ease;
  }
  .conversation-item:active,
  .assistant-item:active,
  .model-item:active {
    background-color: rgba(0, 0, 0, 0.05);
  }
  .toolbar-button,
  .header-button {
    min-height: var(--mobile-touch-target);
    min-width: var(--mobile-touch-target);
    padding: var(--mobile-padding-sm);
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
  }
  .toolbar-button:active,
  .header-button:active {
    transform: scale(0.95);
    background-color: rgba(0, 0, 0, 0.1);
  }
  .setting-panel,
  .modal,
  .dropdown {
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
  }
  .scrollable {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  /* Input toolbar mobile optimizations */
  .input-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
  }
  .input-toolbar-center {
    flex: 1;
    min-width: 0;
    justify-content: center;
    gap: 6px;
    /* 确保子元素能够自适应缩放 */
  }
  .input-toolbar-center > * {
    flex-shrink: 1;
    min-width: 0;
  }
  .input-toolbar-left,
  .input-toolbar-right {
    flex-shrink: 0;
    gap: 6px;
  }
  /* Message item mobile optimizations */
  .message-item {
    margin-bottom: 16px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
  }
  .message-item .message-header {
    width: 100%;
  }
  .message-item .message-toggle-btn,
  .message-item .message-regenerate-btn,
  .message-item .message-delete-btn {
    position: relative;
    right: 0;
    opacity: 1;
    display: flex;
    transform: none;
    margin-left: 10px;
  }
  .code-block-header {
    padding: 4px 8px;
  }
}/*# sourceMappingURL=main.css.map */