/* ==================== 表单整体容器 ==================== */
.ff-form {
    max-width: 640px;
    margin: 24px auto;
    padding: 28px 28px 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, .08), 0 2px 8px rgba(15, 23, 42, .04);
    border: 1px solid #eef2f7;
    font-size: 15px;
    color: #1f2937;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ff-form * {
    box-sizing: border-box;
}

/* ==================== 字段与标签 ==================== */
.ff-field {
    margin: 0 0 18px;
}

.ff-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.ff-required {
    color: #e11d48;
    margin-left: 2px;
}

.ff-optional {
    color: #9ca3af;
    font-weight: 400;
    font-size: 12px;
}

/* ==================== 输入框基础 ==================== */
.ff-field input[type="text"],
.ff-field input[type="email"],
.ff-field input[type="tel"],
.ff-field textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    line-height: 1.5;
    color: #111827;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    font-family: inherit;
}

.ff-field textarea {
    resize: vertical;
    min-height: 120px;
}

.ff-field input:focus,
.ff-field textarea:focus {
    background: #fff;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}

.ff-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

/* 实时字数统计 */
.ff-char-count {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 500;
    transition: color 0.2s;
}

/* ==================== 拖拽上传区域 ==================== */
.ff-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.ff-dropzone:hover,
.ff-dropzone.ff-drag-over {
    border-color: #6366f1;
    background: #eef2ff;
}

.ff-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #64748b;
    pointer-events: none; /* 避免内部元素拦截点击事件 */
}

.ff-dropzone-inner .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #94a3b8;
    transition: color 0.2s;
}

.ff-dropzone:hover .dashicons,
.ff-dropzone.ff-drag-over .dashicons {
    color: #4f46e5;
}

.ff-dropzone-inner p {
    margin: 0;
    font-size: 14px;
}

.ff-browse-btn {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: underline;
    pointer-events: auto; /* 恢复点击 */
}

/* ==================== 已选文件列表 ==================== */
.ff-attachment-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ff-file-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    animation: ffSlideIn 0.2s ease-out;
}

@keyframes ffSlideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.ff-file-icon {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #6366f1;
    margin-right: 10px;
}

.ff-file-name {
    flex: 1;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.ff-file-size {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 12px;
    white-space: nowrap;
}

.ff-file-remove {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ff-file-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

.ff-file-remove .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==================== 数学验证码 ==================== */
.ff-captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ff-captcha-question {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 10px 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #4338ca;
    background: #eef2ff;
    border-radius: 10px;
    user-select: none;
}

.ff-captcha-row input[type="text"] {
    width: 120px;
    flex: 0 0 auto;
}

.ff-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #4f46e5;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.ff-link-btn:hover {
    color: #3730a3;
}

/* ==================== 蜜罐字段 ==================== */
.ff-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==================== 提交按钮 ==================== */
.ff-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, opacity .2s;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .25);
    font-family: inherit;
}

.ff-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(79, 70, 229, .35);
}

.ff-submit:active:not(:disabled) {
    transform: translateY(0);
}

.ff-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==================== 前端精子弹窗 ==================== */
.ff-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .25s ease;
}

.ff-modal-overlay.ff-show {
    opacity: 1;
}

.ff-modal {
    width: 100%;
    max-width: 420px;
    padding: 34px 28px 28px;
    background: #fff;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
    transform: translateY(20px) scale(.94);
    transition: transform .35s cubic-bezier(.2, .9, .3, 1.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ff-modal-overlay.ff-show .ff-modal {
    transform: translateY(0) scale(1);
}

.ff-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ff-modal-icon.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.ff-modal-icon.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.ff-modal-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.ff-modal-text {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.6;
    color: #4b5563;
}

.ff-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 11px 26px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .3);
    font-family: inherit;
}

.ff-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, .4);
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 560px) {
    .ff-form {
        margin: 12px;
        padding: 22px 18px 26px;
        border-radius: 14px;
    }

    .ff-captcha-row {
        gap: 8px;
    }

    .ff-captcha-question {
        min-width: 96px;
        padding: 9px 10px;
        font-size: 14px;
    }

    .ff-captcha-row input[type="text"] {
        width: 90px;
    }

    .ff-modal {
        padding: 28px 20px 24px;
    }
}