    :root {
      --bg-main: #fbfbfa;
      --bg-sidebar: #f7f7f5;
      --border-color: #e5e5e0;
      --text-main: #191919;
      --text-muted: #6b6b66;
      --primary: #d97706; /* Warm orange amber for Claude theme */
      --primary-hover: #b45309;
      --accent: #8b5cf6;
      --input-bg: #ffffff;
      --card-selected: #ebebe5;
    }

    /* Dark Mode (Class based) */
    body.dark-theme {
      --bg-main: #191919;
      --bg-sidebar: #121212;
      --border-color: #2a2a2a;
      --text-main: #ececec;
      --text-muted: #9b9b9b;
      --primary: #f59e0b;
      --input-bg: #222222;
      --card-selected: #2d2d2d;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, 'Noto Sans SC', sans-serif;
      background-color: var(--bg-main);
      color: var(--text-main);
      height: 100vh;
      display: flex;
      overflow: hidden;
      transition: background-color 0.3s, color 0.3s;
    }

    /* Left Sidebar */
    .sidebar {
      width: 338px;
      background-color: var(--bg-sidebar);
      border-right: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      height: 100%;
      flex-shrink: 0;
      animation: slideInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sidebar-header {
      padding: 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .logo-container {
      display: flex;
      align-items: center;
      gap: 10px;
      font-family: 'Outfit', sans-serif;
      font-weight: 700;
      font-size: 1.6rem;
      letter-spacing: -0.02em;
    }

    .logo-icon {
      color: var(--primary);
      font-size: 1.95rem;
    }

    .btn-create-skill {
      margin: 10px 20px 0 20px;
      padding: 10px 16px;
      border: 1.5px dashed var(--primary);
      background: transparent;
      border-radius: 8px;
      color: var(--text-main);
      font-weight: 600;
      font-size: 1.1rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .btn-create-skill:hover {
      background: rgba(217, 119, 6, 0.08);
      border-style: solid;
      box-shadow: 0 0 10px rgba(217, 119, 6, 0.15);
      transform: translateY(-1px);
    }

    .btn-new-chat {
      margin: 10px 20px;
      padding: 10px 16px;
      border: 1px solid var(--border-color);
      background: var(--input-bg);
      border-radius: 8px;
      color: var(--text-main);
      font-weight: 500;
      font-size: 1.15rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: background 0.2s;
    }

    .btn-new-chat:hover {
      background: var(--card-selected);
    }

    .sidebar-menu {
      flex: 1;
      overflow-y: auto;
      padding: 10px 20px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .menu-section-title {
      font-size: 1.0rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      margin-top: 15px;
      margin-bottom: 6px;
      letter-spacing: 0.05em;
    }

    .menu-item {
      padding: 8px 12px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 1.15rem;
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--text-main);
      transition: background 0.2s;
    }

    .menu-item:hover {
      background: var(--card-selected);
    }

    .menu-item.active {
      background: var(--card-selected);
      font-weight: 500;
    }

    .sidebar-footer {
      padding: 20px;
      border-top: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .user-profile {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 0.85rem;
      font-weight: 500;
    }

    .avatar {
      width: 32px;
      height: 32px;
      background: #e2e8f0;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      color: #475569;
    }

    /* Main Content Area */
    .main-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      height: 100%;
      position: relative;
      background-color: var(--bg-main);
    }

    /* Top Navigation */
    .top-nav {
      height: 56px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 24px;
    }

    .theme-toggle {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 6px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s;
    }

    .theme-toggle:hover {
      background: var(--card-selected);
      color: var(--text-main);
    }

    /* Chat Area */
    .chat-container {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 20px 40px 30px 40px;
      max-width: 720px;
      width: 100%;
      margin: 0 auto;
      position: relative;
      height: 100vh;
      overflow: hidden;
    }

    .greeting {
      font-family: 'Playfair Display', serif;
      font-size: 2.2rem;
      font-weight: 600;
      margin-bottom: 30px;
      display: flex;
      align-items: center;
      gap: 12px;
      color: var(--text-main);
      text-align: center;
    }

    .greeting-flower {
      width: 36px;
      height: 36px;
      fill: var(--primary);
    }

    /* Big Input Card */
    .input-card {
      width: 100%;
      background: var(--input-bg);
      border: 1.5px solid var(--border-color);
      border-radius: 16px;
      padding: 16px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
      transition: border-color 0.2s, box-shadow 0.2s;
      display: flex;
      flex-direction: column;
      gap: 12px;
      flex-shrink: 0;
    }

    .input-card:focus-within {
      border-color: #d97706bb;
      box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
    }

    textarea {
      width: 100%;
      height: 90px;
      border: none;
      background: transparent;
      resize: none;
      outline: none;
      font-family: inherit;
      font-size: 1rem;
      color: var(--text-main);
      line-height: 1.5;
    }

    textarea::placeholder {
      color: var(--text-muted);
    }

    .input-bottom {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-top: 1px solid var(--border-color);
      padding-top: 12px;
    }

    .bottom-left-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .btn-attach {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 8px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s, color 0.2s;
    }

    .btn-attach:hover {
      background: var(--card-selected);
      color: var(--text-main);
    }

    .model-selector {
      background: var(--bg-main);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      color: var(--text-muted);
      padding: 6px 12px;
      font-size: 0.85rem;
      font-weight: 500;
      outline: none;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.2s, color 0.2s;
    }

    .model-selector:hover {
      background: var(--card-selected);
      color: var(--text-main);
    }

    .btn-submit {
      background: var(--primary);
      border: none;
      color: #ffffff;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s, transform 0.1s;
    }

    .btn-submit:hover:not(:disabled) {
      background: var(--primary-hover);
      transform: scale(1.05);
    }

    .btn-submit:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* File upload pill preview inside input card */
    .file-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--card-selected);
      border: 1px solid var(--border-color);
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 500;
      max-width: fit-content;
    }

    .file-pill-remove {
      cursor: pointer;
      color: var(--text-muted);
      border: none;
      background: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .file-pill-remove:hover {
      color: #ef4444;
    }

    /* Configuration Panel (Modal) */
    .config-trigger {
      display: flex;
      align-items: center;
      gap: 10px;
      background: none;
      border: 1px solid var(--border-color);
      color: var(--text-muted);
      padding: 8px 16px;
      border-radius: 20px;
      cursor: pointer;
      font-size: 0.85rem;
      font-weight: 500;
      margin-top: 15px;
      margin-bottom: 5px;
      transition: background 0.2s;
      flex-shrink: 0;
    }

    .config-trigger:hover {
      background: var(--card-selected);
      color: var(--text-main);
    }

    .modal-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.4);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(8px) saturate(180%);
      -webkit-backdrop-filter: blur(8px) saturate(180%);
    }

    .modal {
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(20px) saturate(180%);
      -webkit-backdrop-filter: blur(20px) saturate(180%);
      border: 1px solid rgba(255, 255, 255, 0.5);
      width: 450px;
      border-radius: 20px;
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    }

    body.dark-theme .modal {
      background: rgba(30, 30, 30, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }

    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 600;
      font-size: 1.1rem;
    }

    .modal-close {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1.2rem;
    }

    /* Config Item Layout */
    .config-row-item {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 4px;
    }

    .config-row-item label {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-main);
    }

    .config-input-group {
      display: flex;
      gap: 8px;
      align-items: center;
      width: 100%;
    }

    .config-input-group input {
      flex: 1;
      padding: 10px 14px;
      border-radius: 12px;
      border: 1px solid var(--border-color);
      background: var(--input-bg);
      color: var(--text-main);
      font-size: 0.85rem;
      outline: none;
      transition: all 0.2s;
    }
    
    .config-input-group input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
    }

    .btn-config-save {
      background: linear-gradient(135deg, #06b6d4, #8b5cf6);
      color: white;
      border: none;
      padding: 10px 18px;
      border-radius: 12px;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.25s ease;
      box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    }

    .btn-config-save:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
    }

    .btn-config-save:active {
      transform: translateY(0);
    }

    .btn-config-delete {
      background: var(--bg-sidebar);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      padding: 10px 14px;
      border-radius: 12px;
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
    }

    .btn-config-delete:hover {
      background: var(--card-selected);
      border-color: #ef4444;
      color: #ef4444;
    }

    /* Footer Profile Card CSS */
    .user-profile-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.4);
      border: 1px solid rgba(255, 255, 255, 0.5);
      cursor: pointer;
      transition: all 0.25s ease;
      box-shadow: 0 4px 12px rgba(0,0,0,0.02);
      width: 100%;
    }
    
    body.dark-theme .user-profile-card {
      background: rgba(255, 255, 255, 0.03);
      border-color: rgba(255, 255, 255, 0.06);
    }
    
    .user-profile-card:hover {
      background: rgba(255, 255, 255, 0.75);
      border-color: rgba(255, 255, 255, 0.8);
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    }

    body.dark-theme .user-profile-card:hover {
      background: rgba(255, 255, 255, 0.06);
      border-color: rgba(255, 255, 255, 0.1);
    }

    .user-profile-avatar {
      width: 48px;
      height: 48px;
      background: linear-gradient(135deg, #06b6d4, #8b5cf6);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 1.15rem;
      color: white;
      box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
    }

    .user-profile-info {
      display: flex;
      flex-direction: column;
      flex: 1;
      overflow: hidden;
      text-align: left;
    }

    .user-profile-name {
      font-weight: 600;
      font-size: 1.1rem;
      color: var(--text-main);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .user-profile-role {
      font-size: 0.9rem;
      color: var(--text-muted);
      font-weight: 500;
    }

    .user-profile-chevron {
      color: var(--text-muted);
      transition: transform 0.25s ease;
    }

    .user-profile-card.active .user-profile-chevron {
      transform: rotate(180deg);
    }

    .user-popover-menu {
      display: none;
      position: absolute;
      bottom: 74px;
      left: 20px;
      right: 20px;
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(16px);
      border: 1px solid rgba(255, 255, 255, 0.5);
      border-radius: 16px;
      box-shadow: 0 10px 25px rgba(0,0,0,0.1);
      padding: 6px;
      flex-direction: column;
      gap: 2px;
      z-index: 999;
      animation: popoverIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    body.dark-theme .user-popover-menu {
      background: rgba(30, 30, 30, 0.85);
      border-color: rgba(255, 255, 255, 0.08);
      box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    }

    @keyframes popoverIn {
      from { transform: translateY(10px); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
    }

    .user-popover-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: 10px;
      cursor: pointer;
      font-size: 0.82rem;
      font-weight: 500;
      color: var(--text-main);
      transition: all 0.2s;
    }

    .user-popover-item:hover {
      background: var(--card-selected);
    }

    .user-popover-item.logout:hover {
      background: rgba(239, 68, 68, 0.08);
      color: #ef4444;
    }

    /* Split Screen Artifact Drawer */
    .app-layout {
      display: flex;
      width: 100%;
      height: 100%;
    }

    .artifacts-drawer {
      display: none;
      position: relative;
      width: 0;
      max-width: 50%;
      height: 100%;
      background: #ffffff;
      border-left: 1px solid var(--border-color);
      flex-direction: column;
      transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      overflow: hidden;
      z-index: 10;
    }
    .artifacts-drawer.open {
      width: 40%;
      min-width: 360px;
    }

    body.dark-theme .artifacts-drawer {
      background: #1e1e1e;
    }

    .drawer-header {
      height: 56px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 20px;
    }

    .drawer-title {
      font-weight: 600;
      font-size: 0.95rem;
    }

    .drawer-actions {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .drawer-body {
      flex: 1;
      overflow: auto;
      padding: 20px;
    }

    /* Loading state */
    .loading-overlay {
      display: none !important;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(255,255,255,0.7);
      z-index: 10;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 16px;
    }

    body.dark-theme .loading-overlay {
      background: rgba(25,25,25,0.7);
    }

    /* 灵动小药丸 (Non-blocking Notch Loading Indicator) */
    .notched-loading {
      display: none;
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translateX(-50%) translateY(-30px);
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid rgba(0, 0, 0, 0.06);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
      border-radius: 40px;
      padding: 10px 24px;
      align-items: center;
      gap: 12px;
      z-index: 9999;
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--text-main);
      opacity: 0;
      transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      pointer-events: none;
    }
    body.dark-theme .notched-loading {
      background: rgba(30, 30, 30, 0.85);
      border-color: rgba(255, 255, 255, 0.06);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(255, 255, 255, 0.02);
    }
    .notched-loading.show {
      display: flex;
      transform: translateX(-50%) translateY(0);
      opacity: 1;
    }

    .spinner-mini {
      border: 2px solid rgba(0,0,0,0.06);
      width: 14px;
      height: 14px;
      border-radius: 50%;
      border-left-color: var(--primary);
      animation: spin 0.8s linear infinite;
    }
    body.dark-theme .spinner-mini {
      border-color: rgba(255,255,255,0.06);
      border-left-color: var(--primary);
    }

    .spinner {
      border: 3px solid rgba(0,0,0,0.1);
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border-left-color: var(--primary);
      animation: spin 1s linear infinite;
    }

    body.dark-theme .spinner {
      border-color: rgba(255,255,255,0.1);
      border-left-color: var(--primary);
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    @keyframes slideInLeft {
      from { transform: translateX(-100%); }
      to { transform: translateX(0); }
    }

    @keyframes slideInRight {
      from { transform: translateX(100%); }
      to { transform: translateX(0); }
    }

    /* Skill Manager Button */
    .btn-skill-manager {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 9px 12px;
      margin-top: 8px;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.8rem;
      cursor: pointer;
      transition: all 0.2s;
    }
    .btn-skill-manager:hover {
      background: var(--card-selected);
      color: var(--text-main);
    }

    /* Skill Manager Full Panel */
    .skill-manager-panel {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: var(--bg-main);
      z-index: 100;
      flex-direction: column;
      animation: fadeInScale 0.25s ease;
    }
    .skill-manager-panel.open {
      display: flex;
    }
    
    /* MCP Manager Styling */
    .mcp-item-card {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .mcp-item-card:hover {
      background: rgba(255, 255, 255, 0.04);
      border-color: rgba(255, 255, 255, 0.12);
      transform: translateY(-1px);
    }
    .mcp-item-info {
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1;
      min-width: 0;
      padding-right: 16px;
    }
    .mcp-item-name-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .mcp-item-name {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-main);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .mcp-item-badge {
      font-size: 0.65rem;
      padding: 1px 6px;
      border-radius: 4px;
      font-weight: 500;
    }
    .mcp-item-badge.builtin {
      color: #3b82f6;
      background: rgba(59, 130, 246, 0.15);
    }
    .mcp-item-badge.custom {
      color: #10b981;
      background: rgba(16, 185, 129, 0.15);
    }
    .mcp-item-url {
      font-size: 0.75rem;
      color: var(--text-muted);
      word-break: break-all;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .mcp-item-controls {
      display: flex;
      align-items: center;
      gap: 16px;
    }
    .mcp-switch {
      position: relative;
      display: inline-block;
      width: 42px;
      height: 22px;
    }
    .mcp-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    .mcp-slider {
      position: absolute;
      cursor: pointer;
      top: 0; left: 0; right: 0; bottom: 0;
      background-color: rgba(255, 255, 255, 0.08);
      transition: .25s;
      border-radius: 22px;
      border: 1px solid var(--border-color);
    }
    .mcp-slider:before {
      position: absolute;
      content: "";
      height: 14px;
      width: 14px;
      left: 3px;
      bottom: 3px;
      background-color: var(--text-muted);
      transition: .25s;
      border-radius: 50%;
    }
    input:checked + .mcp-slider {
      background-color: var(--primary);
      border-color: var(--primary);
    }
    input:checked + .mcp-slider:before {
      transform: translateX(20px);
      background-color: white;
    }
    .mcp-btn-delete {
      background: none;
      border: none;
      color: #ef4444;
      cursor: pointer;
      font-size: 0.75rem;
      padding: 6px;
      border-radius: 6px;
      transition: background 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .mcp-btn-delete:hover {
      background: rgba(239, 68, 68, 0.1);
    }
    
    @keyframes fadeInScale {
      from { opacity: 0; transform: scale(0.97); }
      to { opacity: 1; transform: scale(1); }
    }
    .sm-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 32px;
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-sidebar);
    }
    .sm-title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 1.2rem;
      font-weight: 600;
      font-family: 'Outfit', sans-serif;
    }
    .sm-close {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-muted);
      padding: 6px;
      border-radius: 6px;
      transition: background 0.2s;
    }
    .sm-close:hover { background: var(--card-selected); }
    .sm-body {
      flex: 1;
      overflow-y: auto;
      padding: 32px;
    }
    .sm-loading {
      text-align: center;
      color: var(--text-muted);
      padding: 40px;
    }
    .sm-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      gap: 20px;
    }
    .sm-card {
      background: var(--bg-sidebar);
      border: 1px solid var(--border-color);
      border-radius: 14px;
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      transition: box-shadow 0.2s;
    }
    .sm-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
    .sm-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .sm-card-name {
      font-weight: 600;
      font-size: 0.95rem;
      font-family: 'Outfit', sans-serif;
    }
    .sm-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 10px;
      border-radius: 20px;
      font-size: 0.72rem;
      font-weight: 600;
    }
    .sm-badge.ready {
      background: #d1fae5;
      color: #065f46;
    }
    .sm-badge.missing {
      background: #fef3c7;
      color: #92400e;
    }
    body.dark-theme .sm-badge.ready { background: #064e3b; color: #6ee7b7; }
    body.dark-theme .sm-badge.missing { background: #451a03; color: #fbbf24; }
    .sm-card-desc {
      font-size: 0.82rem;
      color: var(--text-muted);
      line-height: 1.5;
    }
    .sm-template-list {
      font-size: 0.78rem;
      color: var(--text-muted);
    }
    .sm-template-item {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 4px 0;
    }
    .sm-template-item .dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .dot-ok { background: #10b981; }
    .dot-missing { background: #f59e0b; }
    .sm-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .sm-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 14px;
      border-radius: 8px;
      font-size: 0.78rem;
      font-weight: 500;
      cursor: pointer;
      border: 1px solid var(--border-color);
      background: var(--bg-main);
      color: var(--text-main);
      transition: all 0.2s;
      text-decoration: none;
    }
    .sm-btn:hover { background: var(--card-selected); }
    .sm-btn.primary {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }
    .sm-btn.primary:hover { background: var(--primary-hover); }
    .sm-upload-hidden { display: none; }

    /* \u5c0f\u773c\u775b\u70b9 \u2014 \u5206\u8fa8\u56fe\u50cf\u6a21\u578b\u6807\u5fd7 */
    select option { font-size: 0.85rem; }

    /* Skill badge \u52a8\u753b */
    #skill-badge {
      animation: badgeIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    @keyframes badgeIn {
      from { transform: scale(0.7); opacity: 0; }
      to   { transform: scale(1);   opacity: 1; }
    }

    /* Dropdown hover */
    #skill-dropdown-list > div:hover {
      background: var(--card-selected) !important;
    }

    /* Session list item */
    #session-list .menu-item {
      overflow: hidden;
    }

    /* Skills quick-select bar — 收藏展示，每行2个，左对齐 */
    .skills-quick-select {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      justify-content: start;
      align-items: start;
      margin-top: 12px;
      width: 100%;
    }
    .skill-quick-btn {
      background: var(--bg-sidebar);
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      color: var(--text-main);
      padding: 8px 10px;
      font-size: 0.72rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.18s;
      text-align: left;
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-height: 48px;
      overflow: hidden;
    }
    .skill-quick-btn .sq-name {
      font-weight: 700;
      color: var(--primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 0.72rem;
    }
    .skill-quick-btn .sq-desc {
      font-weight: 400;
      color: var(--text-muted);
      font-size: 0.65rem;
      line-height: 1.3;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .skill-quick-btn:hover {
      background: var(--card-selected);
      border-color: var(--primary);
      transform: translateY(-1px);
      box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    }
    .skill-quick-btn.active {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }
    .skill-quick-btn.active .sq-name,
    .skill-quick-btn.active .sq-desc {
      color: rgba(255,255,255,0.9);
    }
    .skills-quick-label {
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-top: 16px;
      margin-bottom: 4px;
    }

    /* AI 预处理协商面板 */
    .preprocess-panel {
      display: none;
      width: 100%;
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(16px);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 20px;
      margin-bottom: 20px;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
      flex-direction: column;
      gap: 16px;
      max-height: 420px;
      overflow-y: auto;
      animation: slideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      flex-shrink: 0;
    }
    body.dark-theme .preprocess-panel {
      background: rgba(30, 30, 30, 0.85);
    }
    @keyframes slideInDown {
      from { transform: translateY(-20px); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
    }
    .preprocess-title {
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 8px;
      padding-bottom: 4px;
    }
    .preprocess-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.82rem;
    }
    .preprocess-table th {
      text-align: left;
      padding: 8px 10px;
      color: var(--text-muted);
      font-weight: 600;
      border-bottom: 1px solid var(--border-color);
    }
    .preprocess-table td {
      padding: 8px 10px;
      border-bottom: 1px solid var(--border-color);
      vertical-align: middle;
    }
    .preprocess-input {
      width: 100%;
      padding: 6px 10px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--input-bg);
      color: var(--text-main);
      outline: none;
      font-family: inherit;
      font-size: 0.8rem;
      transition: border-color 0.2s;
    }
    .preprocess-input:focus {
      border-color: var(--primary);
    }
    .preprocess-select {
      width: 100%;
      padding: 6px 10px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--input-bg);
      color: var(--text-main);
      outline: none;
      font-family: inherit;
      font-size: 0.8rem;
      cursor: pointer;
    }
    .preprocess-actions {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      margin-top: 8px;
    }

    /* Multi-file Sandbox Styles */
    .artifact-tabs {
      display: flex;
      gap: 8px;
      border-bottom: 1px solid var(--border-color);
      padding: 8px 16px;
      background: var(--bg-sidebar);
      border-radius: 8px 8px 0 0;
    }
    .artifact-tab-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      padding: 6px 14px;
      font-size: 0.82rem;
      font-weight: 600;
      cursor: pointer;
      border-radius: 6px;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .artifact-tab-btn:hover {
      background: var(--card-selected);
      color: var(--text-main);
    }
    .artifact-tab-btn.active {
      background: var(--primary);
      color: white;
    }
    .artifact-tab-content {
      display: none;
      width: 100%;
      height: calc(100vh - 120px);
      flex-direction: column;
    }
    .artifact-tab-content.active {
      display: flex;
    }
    .artifact-code-view-container {
      display: flex;
      width: 100%;
      height: 100%;
    }
    .artifact-file-tree {
      width: 180px;
      border-right: 1px solid var(--border-color);
      background: var(--bg-sidebar);
      overflow-y: auto;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex-shrink: 0;
    }
    .file-tree-item {
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 0.78rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--text-main);
      transition: background 0.15s;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .file-tree-item:hover {
      background: var(--card-selected);
    }
    .file-tree-item.active {
      background: var(--card-selected);
      font-weight: 600;
      border-left: 3px solid var(--primary);
    }
    .artifact-code-viewer-wrapper {
      flex: 1;
      background: #181818;
      color: #e0e0e0;
      overflow: auto;
      padding: 16px;
      font-family: 'Outfit', 'Courier New', Courier, monospace;
      font-size: 0.85rem;
      line-height: 1.5;
      white-space: pre-wrap;
      position: relative;
    }
    .artifact-code-viewer {
      margin: 0;
      font-family: 'Courier New', Courier, monospace;
      outline: none;
      tab-size: 4;
    }
    
    /* Git commit history & Diff UI */
    .history-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 16px;
      overflow-y: auto;
      height: 100%;
    }
    .history-item {
      border: 1px solid var(--border-color);
      border-radius: 10px;
      background: var(--bg-sidebar);
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: box-shadow 0.2s;
    }
    .history-item:hover {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }
    .history-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .history-sha {
      font-family: monospace;
      font-size: 0.78rem;
      color: var(--primary);
      font-weight: 600;
      background: var(--card-selected);
      padding: 2px 6px;
      border-radius: 4px;
    }
    .history-date {
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    .history-msg {
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-main);
      line-height: 1.4;
    }
    .history-actions {
      display: flex;
      gap: 8px;
      margin-top: 4px;
    }
    
    /* Diff modal/overlay */
    .diff-container {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 16px;
      background: var(--bg-main);
      border-radius: 8px;
      border: 1px solid var(--border-color);
      margin-top: 10px;
    }
    .diff-file {
      border: 1px solid var(--border-color);
      border-radius: 6px;
      overflow: hidden;
      margin-bottom: 12px;
    }
    .diff-file-header {
      background: var(--bg-sidebar);
      padding: 8px 12px;
      font-size: 0.8rem;
      font-weight: 600;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
    }
    .diff-file-patch {
      background: #181818;
      color: #e0e0e0;
      font-family: 'Courier New', Courier, monospace;
      font-size: 0.8rem;
      padding: 12px;
      overflow-x: auto;
      white-space: pre;
      margin: 0;
    }
    .diff-line-addition {
      background-color: rgba(34, 197, 94, 0.2) !important;
      color: #86efac;
    }
    .diff-line-deletion {
      background-color: rgba(239, 68, 68, 0.2) !important;
      color: #fca5a5;
    }
    .diff-line-normal {
      color: #9ca3af;
    }

    /* Generated Skill Package Styles */
    .skill-pkg-container {
      margin-top: 12px;
      padding: 14px;
      background: var(--input-bg);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.05);
      display: flex;
      flex-direction: column;
      gap: 10px;
      text-align: left;
    }
    body.dark-theme .skill-pkg-container {
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    .skill-pkg-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 8px;
      border-bottom: 1px dashed var(--border-color);
    }
    .skill-pkg-title {
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .skill-pkg-version {
      font-size: 0.75rem;
      background: var(--card-selected);
      padding: 2px 6px;
      border-radius: 4px;
      color: var(--text-muted);
    }
    .skill-pkg-desc {
      font-size: 0.8rem;
      color: var(--text-muted);
      line-height: 1.4;
    }
    .skill-pkg-files {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .skill-pkg-file-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 10px;
      background: var(--bg-sidebar);
      border-radius: 6px;
      font-size: 0.78rem;
      border: 1px solid var(--border-color);
    }
    .skill-pkg-file-name {
      font-family: monospace;
      font-weight: 500;
      color: var(--text-main);
    }
    .skill-preview-code-btn {
      background: none;
      border: none;
      color: var(--accent);
      cursor: pointer;
      font-size: 0.75rem;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .skill-preview-code-btn:hover {
      text-decoration: underline;
    }
    .skill-install-btn {
      width: 100%;
      padding: 8px 12px;
      background: var(--primary);
      color: #fff;
      border: none;
      border-radius: 8px;
      font-weight: 600;
      font-size: 0.82rem;
      cursor: pointer;
      transition: background 0.2s, transform 0.1s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .skill-install-btn:hover {
      background: var(--primary-hover);
    }
    .skill-install-btn:disabled {
      background: var(--text-muted);
      opacity: 0.7;
      cursor: not-allowed;
    }
    .skill-install-btn:active:not(:disabled) {
      transform: scale(0.98);
    }
    .skill-install-steps {
      font-size: 0.75rem;
      color: var(--text-muted);
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 8px;
      background: var(--bg-sidebar);
      border-radius: 6px;
      border: 1px solid var(--border-color);
      margin-top: 4px;
    }
    .skill-install-step-item {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .skill-install-step-item.ok {
      color: #10b981;
    }
    .skill-install-step-item.warn {
      color: #f59e0b;
    }

    /* Modal dialog style */
    .skill-preview-modal-overlay {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.6);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10000;
      animation: fadeIn 0.2s ease;
    }
    .skill-preview-modal {
      width: 80%;
      max-width: 800px;
      height: 80%;
      background: var(--bg-main);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      box-shadow: 0 10px 40px rgba(0,0,0,0.3);
      animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .skill-preview-modal-header {
      padding: 12px 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg-sidebar);
      border-radius: 12px 12px 0 0;
    }
    .skill-preview-modal-title {
      font-weight: 600;
      font-size: 0.95rem;
      color: var(--text-main);
    }
    .skill-preview-modal-close {
      background: none;
      border: none;
      font-size: 1.5rem;
      cursor: pointer;
      color: var(--text-muted);
    }
    .skill-preview-modal-close:hover {
      color: var(--text-main);
    }
    .skill-preview-modal-body {
      flex: 1;
      padding: 0;
      margin: 0;
      background: #181818;
      overflow: auto;
      border-radius: 0 0 12px 12px;
    }
    .skill-preview-modal-body pre {
      margin: 0;
      padding: 20px;
      color: #e0e0e0;
      font-family: 'Courier New', Courier, monospace;
      font-size: 0.85rem;
      line-height: 1.5;
      white-space: pre;
    }

    /* ==================== SYSTEM WHITEBOX LOGS PREMIUM STYLING ==================== */
    .action-log-card {
      margin: 12px 0;
      border-radius: 12px;
      background: rgba(30, 41, 59, 0.4);
      backdrop-filter: blur(12px) saturate(180%);
      -webkit-backdrop-filter: blur(12px) saturate(180%);
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 12px 16px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
      display: flex;
      flex-direction: column;
      gap: 6px;
      text-align: left;
      font-family: inherit;
    }
    
    body.dark-theme .action-log-card {
      background: rgba(15, 23, 42, 0.6);
      border-color: rgba(255, 255, 255, 0.05);
    }
    
    .action-log-card .log-header {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    
    .action-log-card .log-icon {
      font-size: 0.9rem;
    }
    
    .action-log-card .log-badge {
      padding: 2px 8px;
      border-radius: 20px;
      font-size: 0.68rem;
    }
    
    /* Search Service Card */
    .action-log-card.search {
      border-left: 4px solid #3b82f6;
      box-shadow: 0 4px 15px rgba(59, 130, 246, 0.05);
    }
    .action-log-card.search .log-badge {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
    }
    
    /* Model Inference Card */
    .action-log-card.model {
      border-left: 4px solid #8b5cf6;
      box-shadow: 0 4px 15px rgba(139, 92, 246, 0.05);
    }
    .action-log-card.model .log-badge {
      background: rgba(139, 92, 246, 0.15);
      color: #a78bfa;
    }
    
    /* MCP Integration Card */
    .action-log-card.mcp-header {
      border-left: 4px solid #06b6d4;
      box-shadow: 0 4px 15px rgba(6, 182, 212, 0.05);
    }
    .action-log-card.mcp-header .log-badge {
      background: rgba(6, 182, 212, 0.15);
      color: #22d3ee;
    }

    /* Direct Answer Card */
    .action-log-card.direct-header {
      border-left: 4px solid #f59e0b;
      box-shadow: 0 4px 15px rgba(245, 158, 11, 0.05);
    }
    .action-log-card.direct-header .log-badge {
      background: rgba(245, 158, 11, 0.15);
      color: #fbbf24;
    }
    
    .action-log-card .log-body {
      font-size: 0.82rem;
      color: var(--text-muted);
      line-height: 1.45;
      font-weight: 500;
    }
    
    /* Status indicator bar (Non-blocking status log) */
    .action-log-status {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 6px 14px;
      border-radius: 20px;
      background: rgba(0, 0, 0, 0.03);
      border: 1px solid var(--border-color);
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text-muted);
      margin: 4px 0;
      text-align: left;
    }
    
    body.dark-theme .action-log-status {
      background: rgba(255, 255, 255, 0.02);
    }
    
    .action-log-status .status-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      display: inline-block;
    }
    
    .action-log-status.success {
      border-color: rgba(16, 185, 129, 0.2);
      color: #10b981;
    }
    .action-log-status.success .status-dot {
      background: #10b981;
      box-shadow: 0 0 8px #10b981;
      animation: blink 2s infinite;
    }
    
    .action-log-status.pending {
      border-color: rgba(245, 158, 11, 0.2);
      color: #f59e0b;
    }
    .action-log-status.pending .status-dot {
      background: #f59e0b;
      box-shadow: 0 0 8px #f59e0b;
      animation: blink 1.5s infinite;
    }
    
    .action-log-status.warning {
      border-color: rgba(239, 68, 68, 0.2);
      color: #ef4444;
    }
    .action-log-status.warning .status-dot {
      background: #ef4444;
      box-shadow: 0 0 8px #ef4444;
      animation: blink 1.2s infinite;
    }
    
    @keyframes blink {
      0%, 100% { opacity: 0.3; transform: scale(0.9); }
      50% { opacity: 1; transform: scale(1.1); }
    }
    
    /* MCP Tool Execution Items in Markdown List */
    .chat-bubble li.mcp-log-item {
      list-style: none !important;
      margin: 8px 0 8px 12px !important;
      padding: 10px 14px !important;
      border-radius: 8px !important;
      background: rgba(0, 0, 0, 0.02) !important;
      border: 1px solid var(--border-color) !important;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 0.8rem;
      font-family: var(--font-mono, 'Courier New', Courier, monospace) !important;
      color: var(--text-main);
      box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
      transition: all 0.2s;
    }
    
    body.dark-theme .chat-bubble li.mcp-log-item {
      background: rgba(255, 255, 255, 0.01) !important;
    }
    
    .chat-bubble li.mcp-log-item:hover {
      background: rgba(0, 0, 0, 0.04) !important;
      transform: translateX(2px);
    }
    
    body.dark-theme .chat-bubble li.mcp-log-item:hover {
      background: rgba(255, 255, 255, 0.02) !important;
    }
    
    .chat-bubble li.mcp-log-item .log-icon {
      font-size: 0.85rem;
      flex-shrink: 0;
      margin-top: 2px;
    }
    
    .chat-bubble li.mcp-log-item .log-text {
      flex: 1;
      line-height: 1.5;
    }
    
    .chat-bubble li.mcp-log-item.call {
      border-left: 3px solid #06b6d4 !important;
    }
    .chat-bubble li.mcp-log-item.success {
      border-left: 3px solid #10b981 !important;
      background: rgba(16, 185, 129, 0.03) !important;
    }
    .chat-bubble li.mcp-log-item.error {
      border-left: 3px solid #ef4444 !important;
      background: rgba(239, 68, 68, 0.03) !important;
      color: #fca5a5;
    }
    .chat-bubble li.mcp-log-item.warning {
      border-left: 3px solid #f59e0b !important;
      background: rgba(245, 158, 11, 0.03) !important;
    }
    
    /* Ensure code and blockquotes within log cards fit correctly */
    .action-log-card code {
      font-family: var(--font-mono, monospace);
      background: rgba(0, 0, 0, 0.1);
      padding: 2px 5px;
      border-radius: 4px;
      font-size: 0.78rem;
    }
    body.dark-theme .action-log-card code {
      background: rgba(255, 255, 255, 0.08);
    }