/* =========================================
   自定义弹窗样式
   ========================================= */

/* Toast 提示样式 */
.custom-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 90%;
}

.custom-toast i {
    font-size: 18px;
}

.custom-toast.success {
    background: rgba(52, 199, 89, 0.95);
}

.custom-toast.error {
    background: rgba(255, 59, 48, 0.95);
}

.custom-toast.warning {
    background: rgba(255, 149, 0, 0.95);
}

.custom-toast.info {
    background: rgba(52, 120, 246, 0.95);
}

/* Toast 动画 */
.toast-fade-enter-active,
.toast-fade-leave-active {
    transition: all 0.3s ease;
}

.toast-fade-enter-from,
.toast-fade-leave-to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

/* Modal 遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 20px;
}

/* Modal 对话框 */
.modal-dialog {
    background: var(--bg-secondary);
    border-radius: 4px;
    max-width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.confirm-dialog,
.alert-dialog {
    width: 420px;
}

.prompt-dialog {
    width: 460px;
}

.medium-dialog {
    width: 560px;
}

.large-dialog {
    width: 680px;
}

/* Modal 头部 */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary-color);
    margin: 0;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary-color);
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary-color);
}

/* Modal 内容 */
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary-color);
    margin: 0;
}

/* Modal 底部 */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: stretch;
}

.modal-footer button {
    flex: 1;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-inverse);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

/* Modal 动画 - 移除 */

/* Prompt 输入框样式 */
.prompt-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    margin-top: 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary-color);
}

.prompt-input::placeholder {
    color: var(--text-tertiary-color);
}

.prompt-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

/* 好友申请列表样式 - 扁平化 */
.friend-requests-list {
    padding: 0;
}

.request-item-flat {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.request-item-flat:last-child {
    border-bottom: none;
}

.request-avatar-flat {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.request-content-flat {
    flex: 1;
    min-width: 0;
}

.request-nickname-flat {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary-color);
    margin-bottom: 4px;
}

.request-message-flat {
    font-size: 13px;
    color: var(--text-secondary-color);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-time-flat {
    font-size: 12px;
    color: var(--text-tertiary-color);
}

.request-actions-flat {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn-accept-flat,
.btn-reject-flat {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
}

.btn-accept-flat {
    background: var(--primary-fill);
    color: white;
}

.btn-reject-flat {
    background: var(--bg-tertiary);
    color: var(--text-primary-color);
}

.status-text-flat {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 4px;
}

.status-text-flat.accepted {
    color: #34c759;
    background: rgba(52, 199, 89, 0.1);
}

.status-text-flat.rejected {
    color: var(--text-secondary-color);
    background: var(--bg-tertiary);
}

/* 添加好友弹窗 - 扁平化 */
.add-friend-body {
    padding: 20px;
}

.search-section-flat {
    margin-bottom: 20px;
}

.search-box-flat {
    display: flex;
    gap: 8px;
}

.search-input-flat {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary-color);
}

.search-input-flat:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.btn-search-flat {
    padding: 10px 16px;
    background: var(--primary-fill);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.loading-flat {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary-color);
}

.search-result-flat {
    margin-top: 20px;
}

.user-card-flat {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 16px;
    gap: 12px;
}

.user-avatar-flat {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: cover;
}

.user-info-flat {
    flex: 1;
    min-width: 0;
}

.user-nickname-flat {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary-color);
    margin-bottom: 4px;
}

.user-username-flat {
    font-size: 13px;
    color: var(--text-secondary-color);
    margin-bottom: 2px;
}

.user-signature-flat {
    font-size: 13px;
    color: var(--text-secondary-color);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-add-flat {
    padding: 8px 16px;
    background: var(--primary-fill);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.already-friend-flat {
    font-size: 13px;
    color: var(--text-secondary-color);
    padding: 8px 16px;
    flex-shrink: 0;
}

.request-form-flat {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-top: 12px;
}

.request-message-flat {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary-color);
}

.request-message-flat:focus {
    outline: none;
    border-color: var(--primary-color);
}

.request-actions-flat-form {
    display: flex;
    gap: 12px;
    justify-content: stretch;
}

.request-actions-flat-form button {
    flex: 1;
}

.no-result-flat {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary-color);
}

.no-result-flat i {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-result-flat p {
    font-size: 15px;
}

/* 添加好友搜索样式 */
.search-section {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary-color);
}

.search-input::placeholder {
    color: var(--text-tertiary-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.btn-search {
    padding: 10px 20px;
    background: var(--primary-fill);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-search:hover {
    opacity: 0.9;
}

/* 搜索结果样式 */
.search-result {
    margin-top: 20px;
}

.user-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 16px;
    gap: 12px;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-nickname {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary-color);
    margin-bottom: 6px;
}

.user-username {
    font-size: 13px;
    color: var(--text-secondary-color);
    margin-bottom: 4px;
}

.user-signature {
    font-size: 13px;
    color: var(--text-secondary-color);
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-add {
    padding: 8px 16px;
    background: var(--primary-fill);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-add:hover {
    opacity: 0.9;
}

.already-friend {
    font-size: 13px;
    color: var(--text-secondary-color);
    padding: 10px 20px;
}

.no-result {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary-color);
}

.no-result i {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-result p {
    font-size: 15px;
}

/* 好友请求表单 */
.request-form {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-top: 12px;
}

.request-message {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary-color);
}

.request-message::placeholder {
    color: var(--text-tertiary-color);
}

.request-message:focus {
    outline: none;
    border-color: var(--primary-color);
}

.request-actions {
    display: flex;
    gap: 12px;
    justify-content: stretch;
}

.request-actions button {
    flex: 1;
}

/* 好友详情页面样式 */
.friend-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--bg-primary);
    overflow: hidden;
}

/* PC端好友详情优化 */
@media (min-width: 769px) {
    .friend-detail {
        background: var(--bg-primary);
        border-radius: 0;
    }
    
    .detail-header {
        padding: 18px 24px;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
    }
    
    .detail-title {
        font-size: 17px;
        font-weight: 600;
    }
    
    .detail-body {
        padding: 40px;
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: 700px;
        margin: 0 auto;
    }
    
    .friend-info-card {
        padding: 32px;
        border-radius: 20px;
        margin-bottom: 24px;
        width: 100%;
        box-shadow: var(--shadow-md);
    }
    
    .friend-detail-avatar {
        width: 100px;
        height: 100px;
        border-radius: 20px;
        margin-right: 24px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .friend-detail-info h3 {
        font-size: 26px;
        margin-bottom: 12px;
        font-weight: 600;
    }
    
    .friend-detail-info p {
        font-size: 15px;
        margin-top: 6px;
    }
    
    .info-section {
        border-radius: 16px;
        margin-bottom: 24px;
        width: 100%;
        box-shadow: var(--shadow-sm);
    }
    
    .info-item {
        padding: 18px 24px;
    }
    
    .info-label {
        font-size: 15px;
        font-weight: 500;
    }
    
    .info-value {
        font-size: 15px;
        font-weight: 400;
    }
    
    .action-section {
        gap: 14px;
        margin-top: 10px;
        width: 100%;
    }
    
    .action-btn {
        padding: 16px;
        font-size: 15px;
        border-radius: 12px;
        font-weight: 500;
    }
    
    .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

.detail-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    border: none;
    background: transparent;
    color: var(--text-primary-color);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--hover-bg);
}

.detail-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary-color);
}

.detail-body {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-primary);
}

/* 移动端详情页面优化 */
@media (max-width: 768px) {
    .detail-body {
        padding: 16px;
    }
    
    .friend-info-card {
        padding: 20px;
        border-radius: 10px;
    }
    
    .friend-detail-avatar {
        width: 65px;
        height: 65px;
    }
    
    .friend-detail-info h3 {
        font-size: 18px;
    }
    
    .info-section {
        border-radius: 10px;
    }
    
    .info-item {
        padding: 14px 18px;
    }
    
    .action-btn {
        padding: 12px;
        font-size: 14px;
    }
}

.friend-info-card {
    display: flex;
    align-items: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.friend-detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    margin-right: 18px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .friend-detail-avatar {
        width: 70px;
        height: 70px;
    }
}

.friend-detail-info {
    flex: 1;
    min-width: 0;
}

.friend-detail-info h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-detail-info p {
    color: var(--text-secondary-color);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .friend-detail-info h3 {
        font-size: 20px;
    }
}

.info-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.info-item:hover {
    background: var(--hover-bg);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item:first-child {
    padding-top: 18px;
}

.info-item:last-child {
    padding-bottom: 18px;
}

.info-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary-color);
}

.info-value {
    font-size: 15px;
    color: var(--text-primary-color);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.action-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.action-btn i {
    font-size: 16px;
}

.action-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-primary-color);
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-btn.danger {
    color: #ff3b30;
    border-color: rgba(255, 59, 48, 0.3);
}

.action-btn.danger:hover {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.5);
}

/* FAB 按钮样式 */
.fab-button {
    position: fixed;
    right: 30px;
    bottom: 90px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-fill);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 100;
}

.fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(79, 172, 254, 0.5);
}

.fab-button:active {
    transform: scale(0.95);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .confirm-dialog,
    .alert-dialog,
    .prompt-dialog,
    .medium-dialog,
    .large-dialog {
        width: 100%;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 12px 20px;
    }
    
    .custom-toast {
        top: 60px;
        font-size: 13px;
        padding: 10px 20px;
    }
    
    .fab-button {
        right: 20px;
        bottom: 80px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

