/* ============================================
   反馈功能样式
   从 base.html 内联 <style> 中提取
   ============================================ */

/* 反馈按钮 — 小幽灵助手 */
.feedback-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2d6a9f 0%, #1e3a5f 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(30,58,95,0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ghostBreathe 3s ease-in-out infinite;
}

@keyframes ghostBreathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.05); }
}

/* 悬停气泡提示 */
.feedback-btn::after {
    content: '有建议？';
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background: var(--text-primary, #1a202c);
    color: white;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.feedback-btn:hover {
    animation: none;
    transform: scale(1.12);
    box-shadow: 0 6px 24px rgba(30,58,95,0.4);
}

.feedback-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.feedback-btn:active {
    transform: scale(0.95);
}

/* 反馈模态框 */
.feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.feedback-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

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

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

.feedback-header {
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.feedback-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.feedback-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.feedback-body {
    padding: 0 24px 24px 24px;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feedback-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-form .form-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.feedback-form .form-input,
.feedback-form .form-textarea,
.feedback-form .form-select {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.feedback-form .form-input:focus,
.feedback-form .form-textarea:focus,
.feedback-form .form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.feedback-form .form-textarea {
    resize: vertical;
    min-height: 100px;
}

.feedback-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.contact-fields {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.contact-fields .form-label {
    margin-bottom: 8px;
}

.anonymous-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #f59e0b;
    margin-bottom: 16px;
}

.anonymous-notice p {
    margin: 0;
    font-size: 14px;
    color: #92400e;
}

.feedback-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.feedback-form .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.feedback-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.feedback-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.feedback-form .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.feedback-form .btn-secondary:hover {
    background: #e5e7eb;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.success-message, .error-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .feedback-btn {
        bottom: 70px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .feedback-form .form-row {
        grid-template-columns: 1fr;
    }

    .feedback-actions {
        flex-direction: column;
    }

    .feedback-form .btn {
        width: 100%;
    }
}
