/* ========== 分享会话弹窗 ========== */
.share-session-dialog .el-dialog {
    border-radius: 16px;
    overflow: hidden;
    background: var(--dialog-bg, #ffffff);
    box-shadow: var(--dialog-shadow, 0 20px 60px rgba(0, 0, 0, 0.18));
    border: 1px solid var(--border-color, #e5e5eb);
}

.share-session-dialog .el-dialog__header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border-color, #e5e5eb);
    background: var(--bg-secondary, #f7f7f8);
}

.share-session-dialog .el-dialog__headerbtn {
    top: 16px;
    right: 16px;
}

.share-session-dialog .el-dialog__headerbtn .el-dialog__close {
    color: var(--text-tertiary, #8e8ea0);
    font-size: 22px;
}

.share-session-dialog .el-dialog__headerbtn:hover .el-dialog__close {
    color: var(--text-primary, #1a1a2e);
}

.share-session-dialog .el-dialog__body {
    padding: 0;
    color: var(--text-primary, #1a1a2e);
    background: var(--dialog-bg, #ffffff);
}

.share-session-dialog .el-dialog__footer {
    padding: 14px 24px 16px;
    border-top: 1px solid var(--border-color, #e5e5eb);
    background: var(--dialog-bg, #ffffff);
}

/* 标题 */
.share-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

.share-title-icon.success {
    background: linear-gradient(135deg, var(--accent, #4f46e5), #7c3aed);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.share-title-text {
    flex: 1;
    min-width: 0;
}

.share-title-main {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    line-height: 1.3;
}

.share-title-sub {
    font-size: 12px;
    color: var(--text-tertiary, #8e8ea0);
    margin-top: 2px;
}

/* 主体 */
.share-body {
    max-height: 55vh;
    overflow-y: auto;
    padding: 16px 24px;
}

.share-session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary, #f7f7f8);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary, #5a5a6e);
}

.share-session-info i {
    color: var(--accent, #4f46e5);
}

.share-session-title {
    color: var(--text-primary, #1a1a2e);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 消息分组列表 */
.share-message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-message-group {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color, #e5e5eb);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-primary, #ffffff);
}

.share-message-group:hover {
    border-color: var(--accent, #4f46e5);
    background: var(--bg-hover, #f5f5fa);
}

.share-message-group.selected {
    border-color: var(--accent, #4f46e5);
    background: rgba(79, 70, 229, 0.06);
}

.share-group-checkbox {
    flex-shrink: 0;
    width: 22px;
    padding-top: 2px;
    font-size: 18px;
    color: var(--text-tertiary, #8e8ea0);
}

.share-message-group.selected .share-group-checkbox {
    color: var(--accent, #4f46e5);
}

.share-group-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
}

.share-msg-item {
    font-size: 13px;
}

.share-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.share-msg-avatar {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar {
    background: #e5e7eb;
    color: #4b5563;
}

.ai-avatar {
    background: linear-gradient(135deg, var(--accent, #4f46e5), #7c3aed);
    color: #fff;
}

.share-msg-role {
    font-weight: 500;
    color: var(--text-primary, #1a1a2e);
    font-size: 12px;
}

.share-msg-time {
    font-size: 11px;
    color: var(--text-tertiary, #8e8ea0);
}

.share-msg-body {
    color: var(--text-secondary, #5a5a6e);
    line-height: 1.5;
    padding-left: 30px;
    word-break: break-word;
}

.share-msg-item.user .share-msg-body {
    padding-left: 30px;
}

/* 空状态 */
.share-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: var(--text-tertiary, #8e8ea0);
}

.share-empty i {
    font-size: 42px;
    opacity: 0.5;
}

.share-empty span {
    font-size: 13px;
}

/* ========== 成功阶段样式 ========== */
.share-success-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px 24px;
    gap: 16px;
}

.share-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, #4f46e5), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
}

.share-success-desc {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary, #5a5a6e);
    line-height: 1.6;
    max-width: 420px;
}

.share-link-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    padding: 12px 14px;
    background: var(--bg-secondary, #f7f7f8);
    border: 1px solid var(--border-color, #e5e5eb);
    border-radius: 10px;
}

.share-link-text {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--text-primary, #1a1a2e);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

.share-copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent, #4f46e5);
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--accent, #4f46e5);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.share-copy-btn:hover {
    background: var(--accent, #4f46e5);
    color: #fff;
}

.share-copy-btn.copied {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

/* footer */
.share-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.share-footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.share-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary, #5a5a6e);
    transition: color 0.15s;
    user-select: none;
}

.share-select-all:hover {
    color: var(--text-primary, #1a1a2e);
}

.share-select-all i {
    font-size: 15px;
}

.share-selected-count {
    font-size: 12px;
    color: var(--text-tertiary, #8e8ea0);
}

.share-selected-count em {
    font-style: normal;
    color: var(--accent, #4f46e5);
    font-weight: 600;
    font-size: 13px;
}

.share-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-footer .el-button {
    border-radius: 8px;
}

/* ========== 暗黑模式适配（html.dark） ========== */
html.dark .share-session-dialog .share-message-group {
    background: var(--bg-secondary);
}

html.dark .share-session-dialog .share-message-group:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

html.dark .share-session-dialog .share-message-group.selected {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--accent);
}

html.dark .share-session-dialog .share-session-info {
    background: var(--bg-tertiary);
}

html.dark .share-session-dialog .user-avatar {
    background: #3a3a50;
    color: #c5c5d6;
}

html.dark .share-session-dialog .share-empty i {
    opacity: 0.4;
}

html.dark .share-session-dialog .share-link-box {
    background: var(--bg-tertiary);
}

html.dark .share-session-dialog .share-copy-btn {
    background: var(--bg-primary);
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .share-session-dialog .el-dialog__header {
        padding: 14px 16px 12px;
    }

    .share-session-dialog .el-dialog__body {
        padding: 0;
    }

    .share-session-dialog .el-dialog__footer {
        padding: 12px 16px 14px;
    }

    .share-body {
        padding: 12px 16px;
        max-height: 60vh;
    }

    .share-message-group {
        padding: 10px;
        gap: 10px;
    }

    .share-group-checkbox {
        width: 20px;
        font-size: 16px;
    }

    .share-msg-body {
        padding-left: 0 !important;
    }

    .share-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .share-footer-left {
        justify-content: space-between;
    }

    .share-footer-right {
        justify-content: flex-end;
    }

    .share-link-box {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .share-copy-btn {
        justify-content: center;
    }
}