/* ==================== 悬浮投稿按钮（FAB） ==================== */
.submit-fab {
    position: fixed;
    right: 24px;
    bottom: 36px;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 48px;
    padding: 0 20px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow:
        0 4px 18px rgba(99, 102, 241, 0.38),
        0 1px 4px rgba(99, 102, 241, 0.2);
    z-index: 9999;
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.28s ease,
        background 0.28s ease,
        width 0.3s ease,
        padding 0.3s ease,
        border-radius 0.3s ease;
    overflow: visible;
    white-space: nowrap;
}

/* + 图标 */
.fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 17px;
    line-height: 1;
    font-weight: 300;
    transition:
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.25s ease;
}

/* 投稿文字 */
.fab-text {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    margin-left: 0 !important;
    transition: none !important;
}

/* ===== Hover 效果 ===== */
.submit-fab:hover {
    transform: translateY(-4px) scale(1.04);
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
    box-shadow:
        0 10px 36px rgba(91, 33, 182, 0.45),
        0 4px 14px rgba(124, 58, 237, 0.25);
}

.submit-fab:hover .fab-icon {
    transform: rotate(90deg) scale(1.08);
    background: rgba(255, 255, 255, 0.32);
}

/* 光晕扩散动画 */
.submit-fab::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.35), transparent 70%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.submit-fab:hover::after {
    opacity: 1;
}

/* ===== Active 按下效果 ===== */
.submit-fab:active {
    transform: translateY(-1px) scale(0.97);
    box-shadow:
        0 4px 14px rgba(99, 102, 241, 0.35),
        0 1px 3px rgba(99, 102, 241, 0.2);
    transition-duration: 0.12s;
}

.submit-fab:active .fab-icon {
    transform: rotate(90deg) scale(0.92);
}

/* 展开状态（弹窗打开时） */
.submit-fab.open {
    width: auto;
    padding: 0 22px;
    border-radius: 24px;
    gap: 7px;
}

.submit-fab.open::before,
.submit-fab.open::after {
    animation: none;
    display: none;
}

/* ==================== 投稿弹窗遮罩 ==================== */
.submit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.25s ease;
}

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

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== 投稿弹窗主体 ==================== */
.submit-modal {
    background: #fff;
    border-radius: 20px;
    width: 94%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.16),
        0 0 1px rgba(0, 0, 0, 0.1);
    animation: modalSlideUp 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 头部区域 */
.submit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 26px 0;
}

.submit-modal-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}

/* 关闭按钮 */
.submit-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.submit-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
    transform: rotate(90deg);
}

/* 表单样式 */
#submitForm {
    padding: 22px 26px 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.form-group label .required {
    color: #ef4444;
    margin-right: 2px;
}

/* 输入框统一样式 */
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    background: #fafafa;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #8b5cf6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

.form-group textarea {
    resize: vertical;
    min-height: 76px;
    line-height: 1.55;
}

/* 提示文字 */
.form-hint {
    margin: 2px 0 20px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

/* 主提交按钮 */
.submit-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition:
        opacity 0.2s ease,
        transform 0.18s ease,
        box-shadow 0.2s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.submit-btn-primary:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.42);
}

.submit-btn-primary:active:not(:disabled) {
    transform: scale(0.98) translateY(0);
}

.submit-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==================== Toast 提示 ==================== */
.submit-toast {
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 13px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    animation: toastSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    text-align: center;
    min-width: 220px;
    max-width: 380px;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.12),
        0 0 1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    to   { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(0.95); }
}

.submit-toast.success {
    background: rgba(236, 253, 245, 0.92);
    color: #047857;
    border: 1px solid rgba(167, 243, 208, 0.8);
}

.submit-toast.error {
    background: rgba(254, 242, 242, 0.92);
    color: #dc2626;
    border: 1px solid rgba(254, 202, 202, 0.8);
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 520px) {
    .submit-fab {
        right: 16px;
        bottom: 28px;
        height: 44px;
        padding: 0 16px;
        font-size: 14px;
        gap: 6px;
        border-radius: 22px;
    }

    .submit-fab .fab-icon {
        width: 22px;
        height: 22px;
        font-size: 15px;
    }

    .submit-modal {
        width: 96%;
        border-radius: 18px;
    }

    #submitForm {
        padding: 18px 22px 26px;
    }

    .submit-modal-header {
        padding: 20px 22px 0;
    }
}
