/* ===============================
   超高级少女感去水印 - Pro Max UI
   =============================== */
:root {
    --primary: #ff758c;
    --primary-light: #ff7eb3;
    --primary-dark: #f05470;
    --secondary: #a1c4fd;
    --accent: #fcccb4;
    --text-dark: #3a3233;
    --text-muted: #8c7b7c;
    --glass-bg: rgba(255, 255, 255, 0.70);
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow-soft: 0 20px 40px rgba(255, 117, 140, 0.12);
    --shadow-glow: 0 0 20px rgba(255, 126, 179, 0.4);
    --radius-xl: 36px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    background-color: #fdfbfb;
}

/* ===============================
   动态弥散渐变背景层 (更高级的马卡龙浅光晕)
   =============================== */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
    background: linear-gradient(135deg, #fdfbfb 0%, #f6f7fb 100%);
}

/* 漂浮装饰圆球 (柔和质感光晕) */
.blob {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: floating 12s ease-in-out infinite alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #ff4d6d;
    top: -10%;
    left: 0%;
    opacity: 0.2;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: #a1c4fd;
    bottom: -10%;
    right: -5%;
    animation-delay: -3s;
    opacity: 0.25;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: #fdfbfb;
    top: 30%;
    left: 40%;
    animation-delay: -5s;
    opacity: 0.4;
}

@keyframes floating {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-30px, 40px) scale(1.05);
    }
}

/* ===============================
   主容器布局: 极致居中结构（适配页眉页脚）
   =============================== */
.app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    z-index: 10;
    align-items: center;
    justify-content: space-between;
    padding: 24px 5%;
}

/* ===============================
   页眉与页脚
   =============================== */
.site-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.site-header .logo-text {
    font-family: 'Mali', cursive;
    font-size: 1.6rem;
    font-weight: 800;
    /* 多彩渐变色带，流动模拟消除效果 */
    background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 20%, #a1c4fd 40%, #fcccb4 60%, #ff758c 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: flowGradient 4s linear infinite;
}

@keyframes flowGradient {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: -200% center;
    }
}

.site-header .version-badge {
    padding: 6px 14px;
    background: rgba(255, 117, 140, 0.1);
    color: #ff758c;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.site-footer {
    width: 100%;
    text-align: center;
    padding: 1.5rem 0;
    color: #9ea4b0;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===============================
   顶级质感交互卡片 (外层底座)
   =============================== */
.interaction-section {
    flex: 1;
    width: 650px;
    max-height: 650px;
    max-width: 90vw;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 悬浮立体粒子群 (分布在玻璃卡片周围与后方) */
.floating-deco {
    position: absolute;
    z-index: -1;
    filter: drop-shadow(0 6px 10px rgba(255, 117, 140, 0.15));
    animation: floatParticle 6s ease-in-out infinite alternate;
    user-select: none;
    pointer-events: none;
}

.deco-1 {
    top: 5%;
    left: -40px;
    width: 4.5rem;
    animation-delay: 0s;
    transform: rotate(-15deg);
}

.deco-2 {
    right: -30px;
    top: 15%;
    width: 3rem;
    animation-delay: -2s;
    transform: rotate(10deg);
}

.deco-3 {
    bottom: 15%;
    left: -40px;
    width: 3.5rem;
    animation-delay: -4s;
    transform: rotate(-25deg);
    opacity: 0.8;
}

.deco-4 {
    bottom: -10px;
    right: -25px;
    width: 3.2rem;
    animation-delay: -1s;
    transform: rotate(15deg);
}

@keyframes floatParticle {
    0% {
        transform: translateY(0px) scale(1);
    }

    100% {
        transform: translateY(-30px) scale(1.05);
    }
}

.glass-card {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 40px;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.05),
        inset 0 2px 4px rgba(255, 255, 255, 0.9);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 装饰光束边缘 */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

/* ===============================
   上传区视图
   =============================== */
.upload-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.upload-border-dash {
    flex: 1;
    border: 1.5px dashed rgba(255, 117, 140, 0.35);
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255, 240, 245, 0.85) 0%, rgba(255, 225, 235, 0.65) 100%);
    box-shadow:
        inset 0 4px 20px rgba(255, 117, 140, 0.10),
        inset 0 1px 4px rgba(255, 117, 140, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-border-dash::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 60%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.upload-border-dash:hover::before,
.upload-area.dragover .upload-border-dash::before {
    opacity: 0.8;
}

.upload-border-dash:hover,
.upload-area.dragover .upload-border-dash {
    background: linear-gradient(180deg, rgba(255, 250, 252, 0.8) 0%, rgba(255, 240, 245, 0.6) 100%);
    transform: scale(0.99);
}

.upload-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.upload-illustration {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: heartFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(255, 117, 140, 0.25));
}

.illustration-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.upload-content h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    color: #333333;
    letter-spacing: 0px;
}

.upload-content p {
    color: #a0a0a0;
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 1.8rem;
}

/* ===============================
   公用按钮体系 (重新绘制打磨的粉红糖果按钮)
   =============================== */
.cute-btn {
    font-family: inherit;
    font-weight: 800;
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    letter-spacing: 0.5px;
    gap: 6px;
    /* 文字与图标的间距 */
}

.cute-btn.primary {
    background: #ff758c;
    box-shadow:
        0 8px 20px rgba(255, 117, 140, 0.4),
        inset 0 -3px 0 rgba(0, 0, 0, 0.1),
        inset 0 3px 0 rgba(255, 255, 255, 0.2);
}

.cute-btn.primary:hover {
    transform: translateY(-2px);
    background: #ff8599;
    box-shadow:
        0 12px 25px rgba(255, 117, 140, 0.45),
        inset 0 -3px 0 rgba(0, 0, 0, 0.1),
        inset 0 3px 0 rgba(255, 255, 255, 0.3);
}

.cute-btn.primary:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 10px rgba(255, 117, 140, 0.3),
        inset 0 3px 6px rgba(0, 0, 0, 0.1);
}

.cute-btn.secondary {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.cute-btn.secondary:hover {
    transform: translateY(-3px);
    background: #fffafb;
}

.cute-btn:active {
    transform: translateY(1px) scale(0.98);
}

.cute-btn.large {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.15rem;
}

.cute-btn.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 20px;
}

.center-btn {
    margin: 0 auto;
}

.fluid {
    width: 100%;
}

/* ===============================
   预览编辑区 & 结果区
   =============================== */
.editor-area,
.result-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.status-badge {
    background: rgba(255, 126, 179, 0.1);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.icon-btn {
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.canvas-container,
.result-image-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
    min-height: 0;
}

.canvas-container {
    margin-bottom: 1.5rem;
}

.result-image-box {
    margin-bottom: 0.75rem;
}

.canvas-container img,
.result-image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: block;
}

.action-footer {
    margin-top: auto;
}

/* 魔法光晕按钮 */
.glow-effect {
    position: relative;
    overflow: hidden;
}

.glow-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg) translate(-50%, -50%);
    animation: shine 3s infinite;
}

/* ===============================
   结果下载区
   =============================== */
.success-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.success-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    animation: bounceIn 0.8s;
}

.success-text h3 {
    color: var(--primary-dark);
    font-size: 1.15rem;
    line-height: 1.2;
}

.success-text p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

/* 独立下载按钮区（图片下方） */
.result-actions {
    margin-bottom: 0.6rem;
}

.result-footer {
    margin-top: auto;
}

/* ===============================
   全屏处理遮罩
   =============================== */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    z-index: 50;
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-loader-card {
    background: linear-gradient(135deg, #ff758c, #ff7eb3, #a1c4fd, #fcccb4, #ff758c);
    background-size: 400% 400%;
    animation: aurora 8s ease infinite;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 3.5rem 4rem;
    border-radius: var(--radius-xl);
    box-shadow:
        0 25px 50px -12px rgba(255, 117, 140, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    position: relative;
    overflow: hidden;
}

/* 极光流动动画 */
@keyframes aurora {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* 魔法粒子效果 */
.magic-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
    filter: blur(1px);
    animation: particleFloat var(--d) ease-in-out infinite alternate;
}

.p1 {
    width: 4px;
    height: 4px;
    top: 20%;
    left: 10%;
    --d: 3s;
}

.p2 {
    width: 6px;
    height: 6px;
    top: 60%;
    left: 80%;
    --d: 5s;
}

.p3 {
    width: 3px;
    height: 3px;
    top: 80%;
    left: 30%;
    --d: 4s;
}

.p4 {
    width: 5px;
    height: 5px;
    top: 10%;
    left: 70%;
    --d: 6s;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }

    100% {
        transform: translate(20px, 30px) scale(1.5);
        opacity: 0.8;
    }
}

.cute-spinner {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #ff758c, #a1c4fd, #fcccb4, #ff758c);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #fff 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #fff 0);
    animation: spin 1s infinite linear, pulseGlow 2s infinite ease-in-out;
    margin-bottom: 2rem;
    z-index: 1;
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    }

    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 1;
        box-shadow: 0 0 50px rgba(255, 255, 255, 0.7);
    }
}

.glass-loader-card h4 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: 'Mali', cursive;
    letter-spacing: 2px;
    z-index: 1;
    background: linear-gradient(to right, #fff 20%, #ffebf0 50%, #fff 80%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.blink-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 700;
    animation: blink 1.5s infinite;
    z-index: 1;
    letter-spacing: 1px;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}


/* ===============================
   工具类与微动效
   =============================== */
.hidden {
    display: none !important;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

@keyframes shine {
    100% {
        transform: rotate(30deg) translate(150%, 150%);
    }
}

@keyframes heartFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.fade-in {
    animation: bounceIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

/* ===============================
   响应式调整 (Mobile)
   =============================== */
@media (max-width: 960px) {
    .app-container {
        padding: 1rem;
    }

    .interaction-section {
        width: 100%;
        height: 60vh;
        min-height: 500px;
    }

    .glass-card {
        padding: 16px;
        border-radius: 30px;
    }

    .upload-content h3 {
        font-size: 1.3rem;
    }

    .icon-pulse-wrapper {
        width: 60px;
        height: 60px;
    }

    /* === 手机端结果区适配 === */

    /* 压缩顶部成功提示，节省空间 */
    .success-header {
        margin-bottom: 0.6rem;
    }

    .success-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .success-text h3 {
        font-size: 1.1rem;
    }

    .success-text p {
        font-size: 0.8rem;
    }

    /* 结果区允许滚动，防止按钮被截断 */
    .result-area {
        overflow-y: auto;
    }

    /* 下载按钮全宽 */
    .result-actions .cute-btn {
        width: 100%;
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }
}