.session-empty {
    padding: 40px var(--spacing-md);
    text-align: center;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    color: var(--color-text-tertiary);
    background: var(--bg-warm-gradient);
    box-shadow: var(--shadow-subtle);
}

.session-empty::before {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-dark) 100%);
    opacity: 0.18;
}


/* ============================================
   回收站 — 极简·本质
   ============================================ */

/* ---- 空态 ---- */
.trash-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 64px 24px;
    text-align: center;
}

.trash-empty-svg {
    width: 56px;
    height: 56px;
    color: var(--color-text-muted);
    opacity: 0.6;
}

.trash-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid var(--color-border-soft);
    border-top-color: var(--color-brand);
    animation: trash-spin 0.7s linear infinite;
}

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

.trash-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.trash-empty-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    max-width: 280px;
    line-height: 1.5;
}

/* ---- 工具栏 ---- */
.trash-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.trash-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.trash-toolbar-count {
    font-weight: 600;
    color: var(--color-text-primary);
}

.trash-toolbar-retention {
    color: var(--color-text-muted);
    font-size: 12px;
}

.trash-toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ---- 列表 ---- */
.trash-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trash-item {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    transition: all 120ms var(--ease-spring);
}

.trash-item:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-alt);
}

.trash-item-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trash-item-main {
    flex: 1;
    min-width: 0;
}

.trash-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.trash-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-tertiary);
    flex-wrap: wrap;
}

.trash-item-time {
    white-space: nowrap;
}

.trash-item-cwd {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    color: var(--color-text-muted);
    font-family: var(--font-family-mono);
    font-size: 11px;
}

/* ---- 操作按钮（悬浮显示） ---- */
.trash-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 120ms var(--ease-spring);
}

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

.trash-action-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all 120ms var(--ease-spring);
    padding: 0;
}

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

.trash-action-btn:hover:not(:disabled) {
    border-color: var(--color-border-strong);
    color: var(--color-text-primary);
}

.trash-action-btn.restore:hover:not(:disabled) {
    border-color: var(--color-success);
    color: var(--color-success);
    background: rgba(75, 139, 106, 0.06);
}

.trash-action-btn.delete:hover:not(:disabled) {
    border-color: var(--color-error);
    color: var(--color-error);
    background: rgba(196, 69, 54, 0.06);
}

.trash-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.trash-action-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* ---- 加载更多 ---- */
.trash-list-footer {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
    .trash-item-body {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .trash-item-actions {
        opacity: 1;
        justify-content: flex-end;
    }

    .trash-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .trash-toolbar-right {
        justify-content: flex-end;
    }

    .trash-empty-state {
        padding: 40px 16px;
    }
}


.trash-item.session-item:hover,
.trash-item.session-item:active {
    transform: none;
    border-color: var(--color-border-soft);
    background: linear-gradient(to bottom, var(--color-surface) 0%, rgba(255, 255, 255, 0.92) 100%);
    box-shadow: var(--shadow-subtle);
}

.trash-item.session-item::before {
    background: var(--color-border-soft);
}

.trash-item-main {
    min-width: 0;
    flex: 1;
}

.trash-item-mainline {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.trash-item-title {
    flex: 1;
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-secondary);
    color: var(--color-text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.trash-item-meta {
    margin-top: 6px;
}

.trash-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    min-width: 132px;
}

.trash-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(116px, 116px));
    align-self: flex-end;
    justify-content: flex-end;
    gap: 8px;
}

.trash-item-actions .btn-mini {
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

.trash-item-time {
    width: 100%;
    text-align: right;
    white-space: nowrap;
    color: var(--color-text-tertiary);
}

.trash-item-path {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    white-space: normal;
    overflow-wrap: anywhere;
}

.trash-item-label {
    display: inline-block;
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-secondary);
}

.trash-item-path span:last-child {
    min-width: 0;
    word-break: break-word;
}

.trash-item .session-count-badge {
    margin-top: 2px;
}

.session-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: var(--spacing-md);
    align-items: start;
    height: min(72vh, 760px);
    min-height: 360px;
}

.session-layout.session-standalone {
    grid-template-columns: minmax(0, 1fr);
}

.session-standalone-page {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--spacing-sm) 0;
}

.session-standalone-title {
    font-size: var(--font-size-title);
    font-weight: var(--font-weight-title);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.01em;
}

.session-standalone-text {
    white-space: pre-wrap;
    font-family: var(--font-family-body);
    font-size: var(--font-size-body);
    line-height: 1.7;
    color: var(--color-text-primary);
    word-break: break-word;
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    position: sticky;
    top: 12px;
    height: 100%;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.session-list::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.session-item {
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--transition-fast) var(--ease-spring);
    user-select: none;
    min-width: 0;
    position: relative;
    overflow: hidden;
    min-height: 84px;
    content-visibility: auto;
    contain-intrinsic-size: 84px;
}

.session-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.session-item-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-item:hover {
    border-color: var(--color-brand);
    background: linear-gradient(to bottom, rgba(210, 107, 90, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
    transform: translateY(-1px);
}

.session-item:focus-visible {
    outline: 3px solid rgba(210, 107, 90, 0.2);
    outline-offset: 2px;
    border-color: var(--color-brand);
    background: linear-gradient(to bottom, rgba(210, 107, 90, 0.06) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.session-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: var(--color-border-soft);
    transition: background var(--transition-fast) var(--ease-spring);
}

.session-item:active {
    transform: scale(0.99);
}

.session-item.active {
    border-color: var(--color-brand);
    background: linear-gradient(to bottom, rgba(210, 107, 90, 0.06) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: var(--shadow-float);
}

.session-item.pinned {
    border-color: var(--color-brand);
    background: linear-gradient(to bottom, rgba(210, 107, 90, 0.08) 0%, rgba(255, 251, 247, 0.98) 100%);
    box-shadow: 0 4px 12px rgba(210, 107, 90, 0.08);
}

.session-item.pinned::before {
    background: linear-gradient(180deg, var(--color-brand), var(--color-brand-dark));
    opacity: 0.7;
}

.session-item.active::before {
    background: linear-gradient(180deg, var(--color-brand), var(--color-brand-dark));
}

.session-item-title {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-secondary);
    color: var(--color-text-primary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    max-width: none;
}

.session-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.session-item-copy {
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface-alt);
    color: var(--color-text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast) var(--ease-spring);
}

.session-item-copy:hover {
    border-color: var(--color-brand);
    background: var(--color-surface);
    color: var(--color-brand);
    transform: translateY(-1px);
}

.session-item-copy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.session-item-copy svg {
    width: 10px;
    height: 10px;
}

.session-item-pin {
    border-color: var(--color-border-soft);
}

.session-item-pin .pin-icon,
.session-item-pin svg {
    width: 9px;
    height: 9px;
    color: var(--color-text-tertiary);
}

.session-item.pinned .session-item-pin {
    background: var(--color-brand);
    border-color: var(--color-brand);
    opacity: 0.85;
}

.session-item.pinned .session-item-pin .pin-icon,
.session-item.pinned .session-item-pin svg {
    color: #fff;
}

.session-item-sub.session-item-snippet {
    display: none !important;
}

.session-item-sub {
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-item-sub.session-item-wrap {
    white-space: normal;
}

.session-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-top: 4px;
    margin-bottom: 2px;
}

.session-item-time {
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

.session-item-hot {
    font-size: var(--font-size-caption);
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-dark) 100%);
    color: #fff;
    line-height: 1;
    white-space: nowrap;
}

.session-item-cwd {
    flex: 1 0 100%;
    min-width: 0;
    color: var(--color-text-muted);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.session-preview {
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-xl);
    background: var(--color-surface-elevated);
    box-shadow: var(--shadow-card);
    min-height: 0;
    max-height: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--transition-normal) var(--ease-spring-soft);
}

.session-context-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.session-context-normal {
    background: rgba(75, 139, 106, 0.12);
    color: #4b8b6a;
}

.session-context-warning {
    background: rgba(217, 119, 6, 0.15);
    color: #b45309;
    animation: context-warning-pulse 2s ease-in-out infinite;
}

.session-context-critical {
    background: rgba(196, 69, 54, 0.18);
    color: #c2410c;
    animation: context-critical-pulse 1s ease-in-out infinite;
}

@keyframes context-warning-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes context-critical-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
