    :root {
      --bg-color: #f5f5f5;
      --text-color: #333;
      --primary-color: #007bff;
      --sidebar-bg: #ffffff;
      --chat-bg: #ffffff;
      --msg-bg: #f0f0f0;
      --user-msg-bg: #e3f2fd;
      --bot-msg-bg: #f5f5f5;
      --input-bg: #ffffff;
      --border-color: #e0e0e0;
    }
    .dark-mode {
      --bg-color: #1e1e2f;
      --text-color: #ffffff;
      --primary-color: #007bff;
      --sidebar-bg: #2a2a40;
      --chat-bg: rgba(255, 255, 255, 0.1);
      --msg-bg: rgba(255, 255, 255, 0.1);
      --user-msg-bg: rgba(0, 123, 255, 0.1);
      --bot-msg-bg: rgba(255, 255, 255, 0.1);
      --input-bg: rgba(255, 255, 255, 0.05);
      --border-color: rgba(255, 255, 255, 0.1);
    }
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    body {
      background: var(--bg-color);
      color: var(--text-color);
      transition: background 0.3s, color 0.3s;
    }
    #main-container {
      display: flex;
      max-width: 1200px;
      margin: 0 auto;
      height: 100vh;
      overflow: hidden;
    }
    /* 左侧栏样式 */
    #sidebar {
      width: 280px;
      background: var(--sidebar-bg);
      border-right: 1px solid var(--border-color);
      padding: 20px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      position: relative;
      z-index: 100;
      transition: transform 0.3s ease;
    }
    #sidebar.collapsed {
      transform: translateX(-100%);
    }
    #sidebar-toggle {
      position: absolute;
      left: 20px;
      top: 20px;
      background: var(--primary-color);
      color: #fff;
      width: 32px;
      height: 32px;
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 101;
      border: none;
    }
    #sidebar-header {
      margin-bottom: 20px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border-color);
      padding-left: 40px;
    }
    #theme-toggle {
      background: none;
      border: none;
      color: var(--text-color);
      cursor: pointer;
      font-size: 20px;
      position: absolute;
      right: 20px;
      top: 20px;
    }
    #history-list {
      flex: 1;
      overflow-y: auto;
    }
    .history-section {
      margin-bottom: 15px;
    }
    .section-title {
      font-size: 0.9em;
      color: var(--text-color);
      opacity: 0.7;
      margin-bottom: 8px;
      padding-left: 5px;
    }
    .history-item {
      padding: 10px;
      border-radius: 8px;
      margin-bottom: 5px;
      background: var(--msg-bg);
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      position: relative;
      padding-right: 40px;
      transition: background 0.2s;
    }
    .history-item:hover {
      background: var(--primary-color);
      color: #fff;
    }
    .history-item.active {
      background: var(--primary-color);
      color: #fff;
    }
    .history-item-actions {
      position: absolute;
      right: 5px;
      top: 50%;
      transform: translateY(-50%);
      display: none;
    }
    .history-item:hover .history-item-actions {
      display: flex;
      gap: 5px;
    }
    .history-item-btn {
      background: none;
      border: none;
      color: inherit;
      cursor: pointer;
      font-size: 12px;
      opacity: 0.7;
    }
    .history-item-btn:hover {
      opacity: 1;
    }
    #new-chat-btn {
      margin-top: 15px;
      padding: 10px;
      width: 100%;
      background: var(--primary-color);
      color: #fff;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: opacity 0.2s;
    }
    #new-chat-btn:hover {
      opacity: 0.9;
    }
    /* 右侧主内容区样式 */
    #chat-container {
      flex: 1;
      margin: 0;
      padding: 20px;
      background: var(--chat-bg);
      display: flex;
      flex-direction: column;
      height: 100vh;
      position: relative;
    }
    #chat-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border-color);
    }
    #chat-title {
      cursor: pointer;
      font-size: 24px;
      font-weight: bold;
      color: var(--primary-color);
      max-width: 80%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    #model-controls {
      display: flex;
      gap: 10px;
      align-items: center;
    }
    #chat-history {
      flex: 1;
      overflow-y: auto;
      padding: 10px 0;
    }
    /* 滚动条样式 */
    #chat-history::-webkit-scrollbar,
    #history-list::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }
    #chat-history::-webkit-scrollbar-thumb,
    #history-list::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.2);
      border-radius: 3px;
    }
    .user-msg,
    .bot-msg {
      margin: 10px 0;
      padding: 12px 16px;
      border-radius: 12px;
      position: relative;
      max-width: 85%;
      word-wrap: break-word;
    }
    .user-msg {
      background: var(--user-msg-bg);
      color: var(--primary-color);
      margin-left: auto;
      text-align: right;
    }
    .bot-msg {
      background: var(--bot-msg-bg);
      margin-right: auto;
    }
    .copy-btn {
      position: absolute;
      right: 12px;
      bottom: 12px;
      background: rgba(0, 0, 0, 0.1);
      padding: 2px 8px;
      border-radius: 4px;
      border: none;
      color: inherit;
      cursor: pointer;
      font-size: 12px;
      opacity: 0;
      transition: opacity 0.2s;
    }
    .bot-msg:hover .copy-btn,
    .user-msg:hover .copy-btn {
      opacity: 1;
    }
    .copy-btn:hover {
      background: rgba(0, 0, 0, 0.2);
    }
    /* 输入区域样式 */
    #input-area {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: auto;
      padding-top: 15px;
      border-top: 1px solid var(--border-color);
    }
    #input-controls {
      display: flex;
      gap: 10px;
    }
    #file-btn {
      padding: 8px 12px;
      background: var(--msg-bg);
      border: none;
      border-radius: 8px;
      color: var(--text-color);
      cursor: pointer;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    #file-btn:hover {
      background: var(--primary-color);
      color: #fff;
    }
    #file-input {
      display: none;
    }
    #user-input {
      flex: 1;
      padding: 12px 16px;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      background: var(--input-bg);
      color: var(--text-color);
      font-size: 16px;
      resize: none;
      min-height: 50px;
      max-height: 150px;
    }
    #user-input:focus {
      outline: none;
      border-color: var(--primary-color);
    }
    #send-btn {
      padding: 0 20px;
      background: var(--primary-color);
      color: #fff;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-weight: bold;
      transition: opacity 0.2s;
      height: 50px;
    }
    #send-btn:hover {
      opacity: 0.9;
    }
    .loading {
      color: var(--text-color);
      opacity: 0.7;
      font-style: italic;
      padding: 10px;
    }
    .error {
      color: #ff4444;
      font-weight: bold;
      padding: 10px;
    }
    /* 模型切换按钮 */
    .model-toggle {
      display: flex;
      align-items: center;
      background: rgba(0, 123, 255, 0.1);
      border-radius: 8px;
      padding: 8px 12px;
      color: var(--primary-color);
      cursor: pointer;
      user-select: none;
      transition: background 0.2s;
      border: none;
    }
    .model-toggle:hover {
      background: rgba(0, 123, 255, 0.2);
    }
    .model-toggle.off {
      background: var(--msg-bg);
      color: var(--text-color);
      opacity: 0.7;
    }
    /* 拖放区域样式 */
    .drop-area {
      border: 2px dashed var(--primary-color);
      border-radius: 8px;
      padding: 20px;
      text-align: center;
      margin-bottom: 10px;
      cursor: pointer;
      transition: all 0.3s;
      display: none;
    }
    .drop-area.active {
      display: block;
    }
    .drop-area.highlight {
      border-color: var(--accent-color);
      background: rgba(255, 0, 110, 0.1);
    }
    /* 移动端适配 */
    @media (max-width: 768px) {
      #sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        width: 80%;
      }
      #sidebar-toggle {
        left: 10px;
        top: 10px;
      }
      .user-msg,
      .bot-msg {
        max-width: 90%;
      }
    }