/* ============================================================================
 * AI 反馈按钮组件样式
 * Phase F · 👍👎 按钮 + 弹窗 + 星级评分
 * ============================================================================ */

/* ==================== 反馈按钮行 ==================== */
.ai-feedback-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 4px;
    margin-top: 4px;
    border-top: 1px solid var(--border, #e5e7eb);
    font-size: 12px;
}

.ai-fb-label {
    color: var(--text-light, #9ca3af);
    font-size: 12px;
    margin-right: 4px;
}

.ai-fb-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.ai-fb-btn:hover {
    border-color: #9ca3af;
    background: #f3f4f6;
}

.ai-fb-up:hover {
    color: #059669;
    border-color: #059669;
    background: #ecfdf5;
}

.ai-fb-up:active {
    background: #d1fae5;
}

.ai-fb-down:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: #fef2f2;
}

.ai-fb-down:active {
    background: #fee2e2;
}

/* ==================== 已反馈状态 ==================== */
.ai-feedback-submitted {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 4px;
    margin-top: 4px;
    border-top: 1px solid var(--border, #e5e7eb);
    font-size: 12px;
    color: var(--text-light, #9ca3af);
}

/* ==================== 弹窗 ==================== */
.ai-fb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-fb-modal {
    background: #fff;
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-xl, 0 20px 60px rgba(0,0,0,0.3));
    width: 420px;
    max-width: 90vw;
    overflow: hidden;
}

.ai-fb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #1f2937);
}

.ai-fb-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-light, #9ca3af);
    padding: 4px 8px;
    border-radius: 4px;
}

.ai-fb-modal-close:hover {
    background: #f3f4f6;
    color: var(--text, #1f2937);
}

.ai-fb-modal-body {
    padding: 16px 20px;
}

.ai-fb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border, #e5e7eb);
    background: #f9fafb;
}

/* ==================== 表单 ==================== */
.ai-fb-form-group {
    margin-bottom: 14px;
}

.ai-fb-form-group:last-child {
    margin-bottom: 0;
}

.ai-fb-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #374151);
    margin-bottom: 6px;
}

.ai-fb-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ai-fb-textarea:focus {
    border-color: var(--secondary, #149EBB);
    box-shadow: 0 0 0 3px rgba(20, 158, 187, 0.1);
}

/* ==================== 星级评分（纯 CSS） ==================== */
.ai-fb-stars {
    display: flex;
    gap: 4px;
    direction: rtl; /* 从右往左渲染，hover 时左侧全亮 */
}

.ai-fb-star-label {
    cursor: pointer;
    direction: ltr;
}

.ai-fb-star-input {
    display: none;
}

.ai-fb-star {
    font-size: 28px;
    color: #d1d5db;
    transition: color 0.15s;
    display: inline-block;
}

/* hover 时当前及右边（视觉上左边）的星星亮起 */
.ai-fb-star-label:hover .ai-fb-star,
.ai-fb-star-label:hover ~ .ai-fb-star-label .ai-fb-star {
    color: #f59e0b;
}

/* 选中时保持亮色 */
.ai-fb-star-input:checked ~ .ai-fb-star-label .ai-fb-star,
.ai-fb-star-label:has(.ai-fb-star-input:checked) .ai-fb-star {
    color: #f59e0b;
}

/* ==================== 按钮样式 ==================== */
.ai-fb-btn-cancel {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm, 6px);
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-fb-btn-cancel:hover {
    background: #f3f4f6;
}

.ai-fb-btn-submit {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm, 6px);
    background: var(--primary, #F18D24);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-fb-btn-submit:hover {
    background: var(--primary-dark, #d97a1f);
}

.ai-fb-btn-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ==================== 抖动动画 ==================== */
@keyframes aiFbShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
}
