/* ============================================
   反馈功能样式
   从 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%;
    }
}

/* ============================================
   分享悬浮按钮
   ============================================ */

.share-fab {
    position: fixed;
    bottom: 88px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f59e0b 0%, #ed8936 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(237,137,54,0.38);
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sharePulse 4s ease-in-out infinite;
}

@keyframes sharePulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-5px) scale(1.06); }
}

.share-fab::after {
    content: '分享平台';
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%) scale(0.85);
    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;
}

.share-fab:hover {
    animation: none;
    transform: scale(1.12);
    box-shadow: 0 6px 24px rgba(237,137,54,0.5);
}

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

.share-fab:active {
    transform: scale(0.94);
}

.share-fab.is-open {
    animation: none;
    transform: rotate(15deg) scale(1.05);
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 6px 20px rgba(185,28,28,0.35);
}

/* ── 弹出菜单卡片 ── */
.share-menu {
    position: fixed;
    bottom: 158px;
    right: 20px;
    width: 248px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1002;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease;
    overflow: hidden;
}

.share-menu.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.share-menu::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 24px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    transform: rotate(45deg);
    box-shadow: 3px 3px 6px rgba(0,0,0,0.06);
    border-radius: 2px;
}

.share-menu-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    letter-spacing: 0.04em;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}

.share-menu-items {
    padding: 6px 0;
}

.share-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    font-family: var(--font-sans, sans-serif);
}

.share-menu-item:hover {
    background: #f8f9fa;
}

.share-menu-item:last-child {
    border-top: 1px solid #f3f4f6;
}

.share-menu-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    color: white;
}

.share-menu-icon.icon-link   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.share-menu-icon.icon-wechat { background: linear-gradient(135deg, #22c55e, #15803d); }
.share-menu-icon.icon-weibo  { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.share-menu-icon.icon-poster { background: linear-gradient(135deg, #a855f7, #7c3aed); }

.share-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1a202c);
    line-height: 1.3;
}

.share-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    margin-top: 2px;
    line-height: 1.3;
}

/* ── 操作提示 Toast ── */
.share-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(20, 20, 20, 0.88);
    color: #fff;
    padding: 9px 20px;
    border-radius: 24px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(6px);
}

.share-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── 移动端适配 ── */
@media (max-width: 640px) {
    .share-fab {
        bottom: 130px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .share-menu {
        bottom: 186px;
        right: 16px;
        width: 220px;
    }

    .share-toast {
        bottom: 140px;
        font-size: 0.82rem;
        padding: 8px 16px;
    }
}

/* ============================================
   获取激活码悬浮按钮
   ============================================ */

.act-fab {
    position: fixed;
    bottom: 156px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 54, 93, 0.4);
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: actPulse 4.5s ease-in-out infinite;
}

.act-fab::before {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 11px;
    height: 11px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: actDotPulse 2s ease-in-out infinite;
}

.act-fab::after {
    content: '获取激活码';
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%) scale(0.85);
    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;
}

@keyframes actPulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-5px) scale(1.06); }
}

@keyframes actDotPulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.5); opacity: 0.6; }
}

.act-fab:hover {
    animation: none;
    transform: scale(1.12);
    box-shadow: 0 6px 24px rgba(26, 54, 93, 0.55);
}

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

.act-fab:active {
    transform: scale(0.94);
}

.act-fab.is-open {
    animation: none;
    transform: rotate(15deg) scale(1.05);
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 6px 20px rgba(185, 28, 28, 0.35);
}

.act-fab.is-open::before {
    display: none;
}

/* ── 激活码弹出菜单 ── */
.act-menu {
    position: fixed;
    bottom: 226px;
    right: 20px;
    width: 248px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1002;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease;
    overflow: hidden;
}

.act-menu.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.act-menu::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 24px;
    width: 14px;
    height: 14px;
    background: #fafafa;
    transform: rotate(45deg);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.06);
    border-radius: 2px;
}

.act-menu-footer {
    padding: 10px 16px;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.share-menu-icon.icon-taobao {
    background: linear-gradient(135deg, #ff6900 0%, #ff3d00 100%);
}

/* ── 移动端适配 ── */
@media (max-width: 640px) {
    .act-fab {
        bottom: 186px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .act-menu {
        bottom: 244px;
        right: 16px;
        width: 220px;
    }
}
