/**
 * 公共样式文件
 * 包含错误消息、成功消息、加载状态等通用样式
 */

/* 统一错误消息样式 */
.error-message {
    display: none;
    padding: 15px 20px;
    margin: 20px 0;
    background-color: #fff1f2;
    border-left: 4px solid #be123c;
    border-radius: 5px;
    color: #9f1239;
    font-weight: 500;
    box-shadow: 0 10px 24px rgba(190, 18, 60, 0.12);
    animation: slideIn 0.3s ease;
}

.error-message.error-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 成功消息样式 */
.success-message {
    display: none;
    padding: 15px 20px;
    margin: 20px 0;
    background-color: #ecfdf5;
    border-left: 4px solid #0f766e;
    border-radius: 5px;
    color: #115e59;
    font-weight: 500;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.1);
    animation: slideIn 0.3s ease;
}

.success-message.success-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 加载状态样式 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6b7280;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0f766e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 滑入动画 */
.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 通用按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #115e59 0%, #134e4a 100%);
}

.btn-secondary {
    background-color: #e7e1d6;
    color: #1f2937;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #ddd4c6;
}

/* 通用卡片样式 */
.card {
    background: rgba(255, 253, 248, 0.9);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(36, 28, 19, 0.1);
}

/* 通用表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1f2937;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(31, 41, 55, 0.14);
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}
