/**
 * PC 端公共 UI Helper 样式
 * 与 ui-helper.js 配合使用，提供统一的视觉风格
 */

/* 空状态样式 */
.ui-helper-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.ui-helper-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ddd;
    display: block;
}

.ui-helper-empty p {
    margin: 0 0 12px 0;
    font-size: 14px;
}

.ui-helper-empty a {
    color: #007bff;
    font-size: 14px;
    text-decoration: none;
}

.ui-helper-empty a:hover {
    text-decoration: underline;
}

/* 错误状态样式 */
.ui-helper-error {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.ui-helper-error i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #dc3545;
    display: block;
}

.ui-helper-error p {
    margin: 0 0 12px 0;
    font-size: 14px;
}

.ui-helper-error button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.ui-helper-error button:hover {
    background: #0056b3;
}

/* Loading 动画优化 */
.ui-helper-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-helper-overlay .loading-content {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-align: center;
    min-width: 120px;
}

.ui-helper-overlay .loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: ui-helper-spin 1s linear infinite;
    margin: 0 auto 12px;
}

.ui-helper-overlay .loading-text {
    color: #333;
    font-size: 14px;
}

/* Toast 提示样式 */
.ui-helper-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    max-width: 300px;
    animation: ui-helper-slide-in 0.3s ease;
}

.ui-helper-toast.success {
    background: #28a745;
    color: white;
}

.ui-helper-toast.error {
    background: #dc3545;
    color: white;
}

.ui-helper-toast.warning {
    background: #ffc107;
    color: #212529;
}

.ui-helper-toast.info {
    background: #007bff;
    color: white;
}

.ui-helper-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

/* Confirm 确认框样式 */
.ui-helper-confirm {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-helper-confirm-content {
    background: #fff;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.ui-helper-confirm-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ui-helper-confirm-icon {
    color: #dc3545;
    font-size: 18px;
}

.ui-helper-confirm-icon.warning {
    color: #ffc107;
}

.ui-helper-confirm-body {
    padding: 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.ui-helper-confirm-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ui-helper-confirm-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: none;
}

.ui-helper-confirm-btn.cancel {
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
}

.ui-helper-confirm-btn.cancel:hover {
    background: #f8f9fa;
}

.ui-helper-confirm-btn.confirm {
    background: #007bff;
    color: white;
}

.ui-helper-confirm-btn.confirm:hover {
    background: #0056b3;
}

.ui-helper-confirm-btn.danger {
    background: #dc3545;
    color: white;
}

.ui-helper-confirm-btn.danger:hover {
    background: #c82333;
}

/* Modal 自定义弹窗样式 */
.ui-helper-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-helper-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ui-helper-modal-content.small {
    max-width: 320px;
}

.ui-helper-modal-content.normal {
    max-width: 500px;
}

.ui-helper-modal-content.large {
    max-width: 800px;
}

.ui-helper-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ui-helper-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-helper-modal-close:hover {
    color: #666;
}

.ui-helper-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.ui-helper-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ui-helper-modal-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: none;
}

.ui-helper-modal-btn.secondary {
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
}

.ui-helper-modal-btn.secondary:hover {
    background: #f8f9fa;
}

.ui-helper-modal-btn.primary {
    background: #007bff;
    color: white;
}

.ui-helper-modal-btn.primary:hover {
    background: #0056b3;
}

/* 动画定义 */
@keyframes ui-helper-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ui-helper-slide-in {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes ui-helper-slide-out {
    from { 
        transform: translateX(0); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%); 
        opacity: 0; 
    }
}

@keyframes ui-helper-fade-in {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes ui-helper-fade-out {
    from { 
        opacity: 1; 
    }
    to { 
        opacity: 0; 
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .ui-helper-confirm-content,
    .ui-helper-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .ui-helper-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .ui-helper-overlay .loading-content {
        padding: 16px 24px;
        min-width: 100px;
    }
}
