/* ========================================= */
/* 新增：对话历史侧边栏样式 */
/* ========================================= */

.conversation-sidebar {
    width: 280px;
    background-color: var(--claude-left-rail);
    border-right: none;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    height: var(--app-viewport, 100vh) !important;
    min-height: var(--app-viewport, 100vh) !important;
    border-bottom: 1px solid var(--claude-border);
}

.conversation-sidebar,
.conversation-sidebar .conversation-header,
.conversation-sidebar .conversation-search,
.conversation-sidebar .conversation-list,
.conversation-sidebar .conversation-personal-entry,
.conversation-sidebar .conversation-collapsed-spacer {
    background-color: var(--claude-left-rail);
}

.conversation-collapsed-spacer {
    flex: 1 1 auto;
    background-color: inherit;
}

.conversation-sidebar.collapsed {
    width: 50px;
    overflow: hidden;
    height: var(--app-viewport, 100vh) !important;
    min-height: var(--app-viewport, 100vh) !important;
    background-color: var(--claude-left-rail);
}

.conversation-header {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(118, 103, 84, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background-color: inherit;
    color: var(--claude-text);
    position: sticky;
    top: 0;
    z-index: 60;
    min-height: 68px;
}

.conversation-header.collapsed-layout {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 16px 6px 12px;
    gap: 14px;
    border-bottom: none;
}

.workspace-immersive-toggle {
    padding: 12px 16px 8px;
    background-color: inherit;
}

.workspace-immersive-toggle.collapsed {
    padding: 12px 0 8px;
    display: flex;
    justify-content: center;
}

.workspace-immersive-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--claude-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.workspace-immersive-btn .workspace-immersive-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.workspace-immersive-btn .workspace-immersive-label {
    font-size: 13px;
    font-weight: 500;
}

.workspace-immersive-btn:hover,
.workspace-immersive-btn:focus-visible {
    color: var(--claude-accent);
    outline: none;
    transform: translateY(-1px);
}

.workspace-immersive-btn.active {
    color: var(--claude-accent);
}

.workspace-immersive-toggle.collapsed .workspace-immersive-btn {
    width: 100%;
    height: auto;
    border-radius: 10px;
    padding: 8px;
}

.workspace-immersive-toggle.collapsed .workspace-immersive-btn .workspace-immersive-label {
    display: none;
}

.collapsed-header-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.collapsed-control-btn {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    border: none;
    background: transparent;
    color: var(--claude-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.collapsed-control-btn:hover {
    transform: translateY(-1px);
    color: var(--claude-accent);
}

.conversation-menu-btn {
    color: #31271d;
}

.conversation-menu-btn:hover {
    color: var(--claude-accent);
}

.chat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.conversation-menu-btn svg {
    width: 30px;
    height: 30px;
}

.quick-plus-btn {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    border: none;
    background: transparent;
    color: #2f251b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.25s ease, transform 0.2s ease;
}

.quick-plus-btn:hover,
.quick-plus-btn:focus-visible {
    color: var(--claude-accent);
    transform: translateY(-1px);
}

.pencil-icon svg {
    width: 22px;
    height: 22px;
}

.display-mode-btn {
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.4);
    color: var(--claude-text);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.display-mode-btn .btn-text {
    font-size: 13px;
}

.display-mode-btn.active {
    background: rgba(218, 119, 86, 0.28);
    color: var(--claude-accent);
}

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

.monitor-mode-btn {
    background: transparent;
    color: inherit;
}

.monitor-mode-btn.active {
    color: var(--claude-accent);
}

.monitor-mode-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.conversation-sidebar.monitor-mode {
    --monitor-sidebar-icon: #0f141a;
}

.conversation-sidebar.monitor-mode:not(.collapsed) .conversation-header {
    gap: 10px;
    padding: 16px 18px;
    justify-content: flex-start;
}

.conversation-sidebar.monitor-mode:not(.collapsed) .conversation-header button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 24px;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    color: var(--monitor-sidebar-icon);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.conversation-sidebar.monitor-mode:not(.collapsed) .conversation-header button:hover,
.conversation-sidebar.monitor-mode:not(.collapsed) .conversation-header button:focus-visible {
    color: var(--claude-accent);
    background: transparent;
    outline: none;
}

.conversation-sidebar.monitor-mode:not(.collapsed) .new-conversation-btn,
.conversation-sidebar.monitor-mode:not(.collapsed) .display-mode-btn,
.conversation-sidebar.monitor-mode:not(.collapsed) .toggle-sidebar-btn {
    gap: 0;
}

.conversation-sidebar.monitor-mode:not(.collapsed) .display-mode-btn.active {
    background: transparent;
    color: var(--monitor-sidebar-icon);
}

.conversation-sidebar.monitor-mode:not(.collapsed) .icon-only .btn-icon,
.conversation-sidebar.monitor-mode:not(.collapsed) .icon-only .btn-text,
.conversation-sidebar.monitor-mode:not(.collapsed) .icon-only .toggle-arrow,
.conversation-sidebar.monitor-mode:not(.collapsed) .icon-only .toggle-close {
    display: none;
}

.conversation-sidebar.monitor-mode:not(.collapsed) .monitor-icon-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    --icon-size: 22px;
    color: inherit;
}

.conversation-sidebar.monitor-mode .collapsed-control-btn,
.conversation-sidebar.monitor-mode .monitor-mode-btn,
.conversation-sidebar.monitor-mode .new-conversation-btn,
.conversation-sidebar.monitor-mode .display-mode-btn,
.conversation-sidebar.monitor-mode .toggle-sidebar-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--monitor-sidebar-icon);
    transition: color 0.2s ease, transform 0.2s ease;
}

.conversation-sidebar.monitor-mode .collapsed-control-btn:hover,
.conversation-sidebar.monitor-mode .monitor-mode-btn:hover,
.conversation-sidebar.monitor-mode .new-conversation-btn:hover,
.conversation-sidebar.monitor-mode .display-mode-btn:hover,
.conversation-sidebar.monitor-mode .toggle-sidebar-btn:hover,
.conversation-sidebar.monitor-mode .collapsed-control-btn:focus-visible,
.conversation-sidebar.monitor-mode .monitor-mode-btn:focus-visible,
.conversation-sidebar.monitor-mode .new-conversation-btn:focus-visible,
.conversation-sidebar.monitor-mode .display-mode-btn:focus-visible,
.conversation-sidebar.monitor-mode .toggle-sidebar-btn:focus-visible {
    background: transparent;
    color: var(--claude-accent);
    outline: none;
}

.workspace-control-btn.active {
    color: var(--claude-accent);
}

.pencil-icon path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.new-conversation-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--claude-accent) 0%, var(--claude-accent-strong) 100%);
    color: #fff8f2;
    border: 1px solid rgba(189, 93, 58, 0.4);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 14px rgba(189, 93, 58, 0.18);
}

.new-conversation-btn:hover {
    background: linear-gradient(135deg, var(--claude-button-hover) 0%, var(--claude-button-active) 100%);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 16px;
    font-weight: bold;
}

.btn-text {
    white-space: nowrap;
}

.toggle-sidebar-btn {
    background: rgba(255, 255, 255, 0.7);
    color: var(--claude-text);
    border: 1px solid rgba(118, 103, 84, 0.18);
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.conversation-personal-entry {
    margin-top: auto;
    padding: 8px 16px 12px;
    display: flex;
    justify-content: center;
    background-color: inherit;
}

.conversation-personal-entry.collapsed {
    padding: 8px 0 10px;
}

.personal-page-btn {
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--claude-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.conversation-personal-entry:not(.collapsed) .personal-page-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
}

.personal-page-btn svg {
    width: 20px;
    height: 20px;
}

.personal-page-btn:hover,
.personal-page-btn:focus-visible {
    color: var(--claude-accent);
    transform: translateY(-1px);
}

.personal-page-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(218, 119, 86, 0.15);
}

.personal-page-btn.icon-only {
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 27px;
    color: var(--claude-text);
}

.personal-page-btn.icon-only svg {
    width: 26px;
    height: 26px;
}

.personal-page-btn.icon-only:hover,
.personal-page-btn.icon-only:focus-visible {
    color: var(--claude-accent);
    transform: translateY(-1px);
}

.conversation-personal-entry:not(.collapsed) .personal-page-btn:hover,
.conversation-personal-entry:not(.collapsed) .personal-page-btn:focus-visible {
    background: rgba(218, 119, 86, 0.08);
}

.personal-label {
    letter-spacing: 0.02em;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.conversation-search {
    padding: 12px;
    background-color: inherit;
    border-bottom: 1px solid var(--claude-border);
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--claude-border);
    border-radius: 6px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--claude-text);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--claude-accent);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 3px rgba(218, 119, 86, 0.18);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    background-color: inherit;
}

.loading-conversations,
o-conversations {
    text-align: center;
    color: var(--claude-text-secondary);
    padding: 30px 15px;
    font-size: 13px;
}

.conversation-item {
    padding: 12px 16px;
    margin: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 16px rgba(61, 57, 41, 0.04);
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(218, 119, 86, 0.35);
    box-shadow: 0 10px 24px rgba(61, 57, 41, 0.08);
}

.conversation-item.active {
    background: rgba(218, 119, 86, 0.18);
    border-color: var(--claude-accent);
    box-shadow: 0 10px 28px rgba(189, 93, 58, 0.18);
}

.conversation-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--claude-text);
    margin-bottom: 6px;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.conversation-meta {
    font-size: 11px;
    color: var(--claude-text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

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

.conversation-counts {
    text-align: right;
    white-space: nowrap;
    font-size: 10px;
}

.conversation-actions {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

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

.conversation-action-btn {
    border: none;
    border-radius: 4px;
    font-size: 13px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    color: white;
}

.conversation-action-btn.copy-btn {
    background: var(--claude-accent);
}

.conversation-action-btn.copy-btn:hover {
    background: var(--claude-button-hover);
    transform: translateY(-1px);
}

.conversation-action-btn.delete-btn {
    background: #d85a42;
}

.conversation-action-btn.delete-btn:hover {
    background: #bf422b;
    transform: translateY(-1px);
}

.load-more {
    padding: 12px 16px;
    text-align: center;
}

.load-more-btn {
    background: rgba(218, 119, 86, 0.12);
    color: var(--claude-accent);
    border: 1px solid rgba(218, 119, 86, 0.35);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover:not(:disabled) {
    background: var(--claude-accent);
    color: #fffdf8;
}

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