/* ========================================
   Session 列表 — CSS Module
   ======================================== */

.sessionList {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-sm);
    -webkit-app-region: no-drag;
}

.sessionItem {
    display: flex;
    flex-direction: column;
    padding: 6px var(--space-sm);
    margin-bottom: 1px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast), color var(--duration-fast);
    -webkit-app-region: no-drag;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    overflow: hidden;
    position: relative;
}

.sessionItem:hover {
    background: var(--accent-light);
}

.sessionItemActive {
    background: var(--accent-light);
}

.sessionItemTitle {
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.sessionItemActive .sessionItemTitle {
    color: var(--accent);
    font-weight: 600;
}

.sessionItemMeta {
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 1px;
    opacity: 0.8;
}

.sessionRcBadge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 0.35rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    font-size: 0.65rem;
    line-height: 1.2;
    font-weight: 600;
    max-width: calc(100% - 28px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 重命名按钮 */
.sessionPinBtn {
    position: absolute;
    bottom: 4px;
    right: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    border-radius: 3px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--duration-fast);
    z-index: 1;
}

.sessionPinBtn svg {
    pointer-events: none;
}

.sessionItem:hover .sessionPinBtn {
    opacity: 0.5;
}

.sessionPinBtn:hover {
    opacity: 1 !important;
    background: var(--accent-light);
    color: var(--accent);
}

.sessionRenameBtn {
    position: absolute;
    bottom: 4px;
    right: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    border-radius: 3px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--duration-fast);
    z-index: 1;
}

.sessionRenameBtn svg {
    pointer-events: none;
}

.sessionItem:hover .sessionRenameBtn {
    opacity: 0.5;
}

.sessionRenameBtn:hover {
    opacity: 1 !important;
    background: var(--accent-light);
    color: var(--accent);
}

/* 重命名输入框 */
.sessionRenameInput {
    font-size: 0.8rem;
    color: var(--accent);
    line-height: 1.4;
    background: var(--accent-light);
    border: none;
    border-radius: 2px;
    padding: 0 4px;
    outline: none;
    width: calc(100% - 24px);
    min-width: 0;
    font-family: inherit;
}

/* 归档按钮 */
.sessionArchiveBtn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    border-radius: 3px;
    color: var(--danger);
    cursor: pointer;
    opacity: 0;
    transition: all var(--duration-fast);
    z-index: 1;
}

.sessionArchiveBtn svg {
    pointer-events: none;
}

.sessionItem:hover .sessionArchiveBtn {
    opacity: 0.5;
}

.sessionArchiveBtn:hover {
    opacity: 1 !important;
    background: rgba(var(--danger-rgb), 0.08);
}

/* streaming 呼吸动画 */
.sessionStreamingDot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent, #b89a7a);
    flex-shrink: 0;
    animation: hana-pulse 2s ease-in-out infinite;
}

/* 浏览器标记 */
.sessionBrowserBadge {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
}

/* Agent badge */
.sessionAgentBadge {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    pointer-events: none;
}

.sessionAgentBadgeText {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.55rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sessionItemHeader {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
    padding-right: 22px;
}

/* 分组标题 */
.sessionSectionTitle {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0;
    padding: var(--space-sm) var(--space-sm) 2px;
    opacity: 0.72;
    user-select: none;
}

.sessionSectionTitle:first-child {
    padding-top: var(--space-xs);
}

.pinnedSection {
    margin: 0;
    padding: 0;
}

.pinnedSection .sessionSectionTitle {
    padding-top: var(--space-xs);
}

.pinnedSectionTitle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.pinnedTitleIcon {
    opacity: 0.8;
    flex-shrink: 0;
}

.sessionSummaryCard {
    position: fixed;
    z-index: 9998;
    width: min(320px, calc(100vw - 12px));
    max-height: min(340px, calc(100vh - 12px));
    padding: 10px 12px;
    background: var(--bg-card, var(--bg));
    border: 1px solid var(--overlay-light);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.07);
    font-family: inherit;
}

.sessionSummaryTitle {
    font-size: 0.65rem;
    line-height: 1.35;
    color: var(--text-muted);
    opacity: 0.78;
    margin-bottom: 5px;
    user-select: none;
}

.sessionSummaryBody {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 3px;
    font-size: 0.66rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.sessionSummaryBody h3 {
    margin: 0 0 4px;
    font-size: 0.66rem;
    line-height: 1.35;
    font-weight: 600;
    color: var(--text);
}

.sessionSummaryBody ul {
    margin: 0 0 7px;
    padding-left: 1rem;
}

.sessionSummaryBody li {
    margin: 0;
}

.sessionSummaryBody li + li {
    margin-top: 3px;
}

.sessionSummaryBody p {
    margin: 0 0 6px;
}

.sessionSummaryBody > div > :last-child {
    margin-bottom: 0;
}

.sessionSummaryPlaceholder {
    color: var(--text-faint, rgba(0, 0, 0, 0.38));
}

/* 空状态 */
.sessionEmpty {
    text-align: center;
    padding: var(--space-lg) var(--space-sm);
    color: var(--text-muted);
    font-size: 0.78rem;
}
