/* ========== 个人中心弹窗 ========== */
.user-profile-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);
}

.user-profile-dialog .el-dialog__header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color, #e5e5eb);
    background: var(--bg-secondary, #f7f7f8);
}

.user-profile-dialog .el-dialog__headerbtn {
    top: 18px;
    right: 16px;
}

.user-profile-dialog .el-dialog__headerbtn .el-dialog__close {
    color: var(--text-tertiary, #8e8ea0);
    font-size: 22px;
}

.user-profile-dialog .el-dialog__headerbtn:hover .el-dialog__close {
    color: var(--text-primary, #1a1a2e);
}

.user-profile-dialog .el-dialog__body {
    padding: 0;
    color: var(--text-primary, #1a1a2e);
    background: var(--dialog-bg, #ffffff);
}

.user-profile-dialog .el-dialog__footer {
    padding: 14px 24px 18px;
    border-top: 1px solid var(--border-color, #e5e5eb);
    background: var(--dialog-bg, #ffffff);
}

/* 标题 */
.profile-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-title-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent, #4f46e5), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    flex-shrink: 0;
}

.profile-title-text {
    flex: 1;
    min-width: 0;
}

.profile-title-main {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    line-height: 1.3;
}

.profile-title-sub {
    font-size: 12px;
    color: var(--text-tertiary, #8e8ea0);
    margin-top: 2px;
}

/* 主体布局：左侧 tab + 右侧内容 */
.profile-body {
    display: flex;
    min-height: 360px;
    max-height: 60vh;
}

.profile-tabs {
    width: 160px;
    flex-shrink: 0;
    background: var(--bg-secondary, #f7f7f8);
    border-right: 1px solid var(--border-color, #e5e5eb);
    padding: 12px 8px;
    box-sizing: border-box;
}

.profile-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary, #5a5a6e);
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}

.profile-tab:hover {
    background: var(--bg-hover, #e5e5eb);
    color: var(--text-primary, #1a1a2e);
}

.profile-tab.active {
    background: var(--accent, #4f46e5);
    color: #fff;
}

.profile-tab i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.profile-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 20px 24px;
}

/* 账户信息 - 头像区 */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #e5e5eb);
    margin-bottom: 20px;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    flex-shrink: 0;
}

.profile-avatar-info {
    flex: 1;
    min-width: 0;
}

.profile-avatar-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 2px;
}

.profile-avatar-sub {
    font-size: 12px;
    color: var(--text-tertiary, #8e8ea0);
}

/* 头像区操作按钮 */
.profile-avatar-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.profile-avatar-actions .el-button {
    border-radius: 8px;
}

/* 编辑模式输入框 */
.profile-edit-input {
    max-width: 260px;
}

.profile-edit-input .el-input__inner {
    border-radius: 6px;
}

/* 信息列表 */
.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #e5e5eb);
    font-size: 13px;
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-info-label {
    width: 80px;
    flex-shrink: 0;
    color: var(--text-tertiary, #8e8ea0);
}

.profile-info-value {
    flex: 1;
    color: var(--text-primary, #1a1a2e);
    word-break: break-all;
}

.profile-status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.profile-status-tag.ok {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.profile-status-tag.off {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* 区块标题 */
.profile-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 16px;
}

/* 表单 */
.profile-form .el-form-item {
    margin-bottom: 18px;
}

.profile-form .el-form-item__label {
    font-size: 13px;
    color: var(--text-secondary, #5a5a6e);
}

/* 数据卡片 */
.profile-data-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #e5e5eb);
    border-radius: 10px;
    background: var(--bg-secondary, #f7f7f8);
    margin-bottom: 10px;
}

.profile-data-info {
    flex: 1;
    min-width: 0;
}

.profile-data-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 2px;
}

.profile-data-desc {
    font-size: 12px;
    color: var(--text-tertiary, #8e8ea0);
}

/* footer */
.profile-footer {
    display: flex;
    justify-content: flex-end;
}

.profile-footer .el-button {
    border-radius: 8px;
}

/* ========== 我的分享样式 ========== */
.profile-shares-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.profile-shares-search {
    display: flex;
    gap: 6px;
}

.profile-shares-stats {
    font-size: 12px;
    color: var(--text-tertiary, #8e8ea0);
    margin-bottom: 12px;
}

.profile-shares-stats strong {
    color: var(--accent, #4f46e5);
    font-weight: 600;
}

.profile-shares-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

.profile-shares-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 10px;
    color: var(--text-tertiary, #8e8ea0);
}

.profile-shares-empty i {
    font-size: 36px;
    opacity: 0.4;
}

.profile-shares-empty span {
    font-size: 13px;
}

.profile-share-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #e5e5eb);
    border-radius: 10px;
    background: var(--bg-secondary, #f7f7f8);
    transition: all 0.15s;
}

.profile-share-item:hover {
    border-color: var(--accent, #4f46e5);
    background: var(--bg-hover, #f5f5fa);
}

.profile-share-info {
    flex: 1;
    min-width: 0;
}

.profile-share-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #1a1a2e);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
}

.profile-share-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.profile-share-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-tertiary, #8e8ea0);
}

.profile-share-tag i {
    font-size: 11px;
}

.profile-share-code {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e5e5eb);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary, #5a5a6e);
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    cursor: pointer;
    transition: all 0.15s;
    max-width: 280px;
}

.profile-share-code:hover {
    border-color: var(--accent, #4f46e5);
    color: var(--accent, #4f46e5);
}

.profile-share-code span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-share-copy {
    opacity: 0;
    transition: opacity 0.15s;
}

.profile-share-code:hover .profile-share-copy {
    opacity: 1;
}

.profile-share-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.profile-share-actions .el-button--text {
    padding: 6px 8px;
}

.profile-share-actions .danger {
    color: #ef4444;
}

.profile-share-actions .danger:hover {
    color: #dc2626;
}

.profile-shares-pagination {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .user-profile-dialog .el-dialog__header {
        padding: 16px 16px 12px;
    }

    .user-profile-dialog .el-dialog__footer {
        padding: 12px 16px 16px;
    }

    .profile-body {
        flex-direction: column;
        min-height: auto;
        max-height: 65vh;
    }

    .profile-tabs {
        width: 100%;
        display: flex;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e5e5eb);
        padding: 8px;
        gap: 6px;
        overflow-x: auto;
    }

    .profile-tab {
        margin-bottom: 0;
        padding: 8px 12px;
        flex-shrink: 0;
    }

    .profile-content {
        padding: 16px;
    }

    .profile-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .profile-avatar-section {
        flex-wrap: wrap;
    }

    .profile-avatar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .profile-edit-input {
        max-width: 100%;
    }

    .profile-info-label {
        width: 68px;
    }

    .profile-data-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .profile-shares-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .profile-shares-search {
        width: 100%;
    }

    .profile-share-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .profile-share-actions {
        justify-content: flex-end;
    }
}

/* ========== 暗黑模式适配 ========== */
html.dark .user-profile-dialog .profile-share-item {
    background: var(--bg-tertiary);
}

html.dark .user-profile-dialog .profile-share-item:hover {
    background: var(--bg-hover);
}

html.dark .user-profile-dialog .profile-share-code {
    background: var(--bg-primary);
}

html.dark .user-profile-dialog .profile-shares-search .el-input__inner {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}