/* ===== COReD Feedback Widget ===== */

/* ---- 浮动按钮 ---- */
#feedback-fab {
    position: fixed;
    bottom: 80px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px 0 14px;
    height: 46px;
    border-radius: 23px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.4);
    cursor: pointer;
    font-size: 15px;
    z-index: 9999;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
    /* 脉冲动画：页面加载后吸引注意 */
    animation: feedback-pulse 3s ease-in-out 3;
}

#feedback-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 24px rgba(26, 115, 232, 0.6);
}

#feedback-fab:active {
    transform: scale(0.96);
}

.fab-icon {
    font-size: 20px;
    line-height: 1;
}

.fab-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* 脉冲动画：闪烁三次吸引注意 */
@keyframes feedback-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(26, 115, 232, 0.4); }
    50% { box-shadow: 0 4px 24px rgba(26, 115, 232, 0.8), 0 0 0 8px rgba(26, 115, 232, 0.1); }
}

/* ---- 遮罩层 ---- */
#feedback-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    animation: feedback-fade-in 0.2s ease;
}

#feedback-overlay.active {
    display: block;
}

/* ---- 弹窗 ---- */
#feedback-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: 92vw;
    max-height: 85vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    z-index: 10001;
    overflow-y: auto;
    animation: feedback-slide-up 0.25s ease;
}

#feedback-modal.active {
    display: block;
}

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

@keyframes feedback-slide-up {
    from { opacity: 0; transform: translate(-50%, -50%) translateY(20px); }
    to { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
}

/* ---- 弹窗头部 ---- */
#feedback-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 12px;
    border-bottom: 1px solid #eee;
}

#feedback-modal .modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1a73e8;
    font-weight: 600;
}

#feedback-modal .modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 30px;
    text-align: center;
    color: #666;
    transition: background 0.15s;
}

#feedback-modal .modal-close:hover {
    background: #e0e0e0;
}

/* ---- 弹窗表单 ---- */
#feedback-modal .modal-body {
    padding: 16px 24px 20px;
}

#feedback-modal .form-group {
    margin-bottom: 14px;
}

#feedback-modal .form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 4px;
}

#feedback-modal .form-group label .required {
    color: #d32f2f;
    margin-left: 2px;
}

#feedback-modal .form-group label .optional {
    color: #999;
    font-weight: 400;
    font-size: 0.78rem;
    margin-left: 4px;
}

#feedback-modal .form-group textarea,
#feedback-modal .form-group input,
#feedback-modal .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#feedback-modal .form-group textarea:focus,
#feedback-modal .form-group input:focus,
#feedback-modal .form-group select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

#feedback-modal .form-group textarea {
    height: 110px;
    resize: vertical;
}

#feedback-modal .form-row {
    display: flex;
    gap: 12px;
}

#feedback-modal .form-row .form-group {
    flex: 1;
}

/* ---- 提交按钮 ---- */
#feedback-modal .submit-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

#feedback-modal .submit-btn:hover {
    opacity: 0.9;
}

#feedback-modal .submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- 提交状态 ---- */
#feedback-modal .feedback-status {
    display: none;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    text-align: center;
}

#feedback-modal .feedback-status.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

#feedback-modal .feedback-status.error {
    display: block;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ---- 响应式 ---- */
@media (max-width: 600px) {
    #feedback-fab {
        bottom: 70px;
        right: 16px;
        padding: 0 14px 0 12px;
        height: 40px;
        font-size: 13px;
    }
    .fab-icon { font-size: 17px; }
    .fab-label { font-size: 12px; }

    #feedback-modal .form-row {
        flex-direction: column;
        gap: 0;
    }

    #feedback-modal .modal-body {
        padding: 12px 16px 16px;
    }
}
