/* ============================================
   功能页专用样式（仅 face-swap / dressup / retouch / restore / person-swap / test 等生成页）
   ============================================ */

/* 主题色变量（各页面 override，写在 <style>:root{--grad-from:...}） */
:root {
    --grad-from: #667eea;
    --grad-to:   #764ba2;
    --btn-color: #667eea;
}

/* ========== 页面背景 ========== */
body.func-task-page {
    background: linear-gradient(135deg, var(--grad-from) 0%, var(--grad-to) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

/* ========== 容器 ========== */
.func-container {
    background: transparent;
    width: 100%;
    max-width: 480px;
}

/* ========== 上传区域 ========== */
.upload-area {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.upload-box {
    border: 2px dashed rgba(255,255,255,.5);
    border-radius: 12px;
    padding: 20px;
    width: 140px;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: .3s;
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(10px);
}

.upload-box:hover { border-color: #fff; background: rgba(255,255,255,.25); }
.upload-box.has-image { border-color: #4caf50; background: rgba(76,175,80,.2); }
.upload-box input[type=file] { display: none; }
.upload-icon  { font-size: 36px; margin-bottom: 8px; }
.upload-text  { color: rgba(255,255,255,.9); font-size: 12px; }
.preview-img  { max-width: 100%; max-height: 140px; border-radius: 8px; object-fit: cover; }

/* ========== 积分提示 ========== */
.cost-hint { color: rgba(255,255,255,.85); font-size: 13px; margin-top: 8px; text-align: center; }

/* ========== 提交按钮 ========== */
.btn-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ========== Loading ========== */
.loading, .result, .error {
    display: none;
.error a { color: #667eea !important; }
    margin-top: 20px;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.loading.show, .result.show, .error.show { display: block; }

.spinner {
    width: 40px; height: 40px;
    border: 4px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading p { color: #fff; font-size: 14px; }

/* ========== 结果展示 ========== */
.result img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    object-fit: contain;
}

.result a {
    color: var(--btn-color);
    text-decoration: none;
    font-size: 14px;
    margin: 5px;
    display: inline-block;
}

.error { background: #ffebee; color: #f44336; font-size: 13px; }
.error a { color: #667eea !important; }

/* ========== 结果按钮行 ========== */
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

.btn-action {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-back  { background: rgba(255,255,255,.2); color: #fff; }
.btn-download { background: #fff; color: var(--btn-color); }
.btn-home { background: rgba(255,255,255,.2); color: #fff; }
/* ========== 登录提示 ========== */
.login-warn {
    text-align: center;
    padding: 40px 20px;
    color: #fff;
}
.login-warn h3 { font-size: 20px; margin-bottom: 10px; }
.login-warn p  { font-size: 14px; color: rgba(255,255,255,.8); margin-bottom: 16px; }
.login-warn a  { display: inline-block; padding: 10px 28px; background: #fff; color: #667eea; border-radius: 20px; font-weight: bold; text-decoration: none; }
