* {
    box-sizing: border-box;
}

html {
    background: #000;
}

body {
    background: transparent;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Optima', 'Candara', 'PingFang SC', sans-serif;
    min-height: 100vh;
    padding-top: 40px;
    padding-bottom:80px;
    color: #e2e2e2;
    overflow-x: hidden;
    position: relative;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000;
}

h1 {
    margin-bottom: 30px;
    font-weight: 200;
    letter-spacing: 12px;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    animation: glowTitle 4s ease-in-out infinite alternate;
}

@keyframes glowTitle {
    from { text-shadow: 0 0 10px rgba(255, 255, 255, 0.2); }
    to { text-shadow: 0 0 30px rgba(143, 148, 251, 0.8), 0 0 50px rgba(143, 148, 251, 0.4); }
}

.toolbar {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
    max-width: 800px;
    text-align: center;
}

.toolbar strong {
    font-size: 1.1em;
    line-height: 1.5;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    word-break: break-word;
}

.canvas-wrapper {
    position: relative;
    width: 800px;
    height: 400px;
    margin-top: 10px;
}

.witch-img {
    position: absolute;
    width: 500px;
    height: 500px;
    right: 0;
    top: 0;
    transform: translate(-620px, 50px) scale(0.8);
    z-index: 1;
    pointer-events: none;
    opacity: 0.9;
}

#paintCanvas {
    position: relative;
    z-index: 5;
    background: transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: crosshair;
    border-radius: 12px;
    touch-action: none;
    transition: transform 0.3s ease;
    box-shadow: none;
    display: block;
}

.canvas-actions {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 20;
    pointer-events: auto;
}

.canvas-actions button {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#paintCanvas:hover {
    transform: scale(1.01);
}

button {
    padding: 10px 24px;
    cursor: pointer;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
}

button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00d2ff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
    transform: translateY(-2px);
}

button.primary {
    background: linear-gradient(45deg, #4e54c8, #8f94fb);
    border: none;
}

button.primary:hover {
    box-shadow: 0 0 20px rgba(143, 148, 251, 0.6);
}

#modalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    display: none;
}

#aiResult {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 90%;
    max-width: 800px;
    padding: 40px;
    background: rgba(20, 15, 35, 0.92); /* 改为深色背景以衬托发光字 */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(143, 148, 251, 0.3);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    display: none;
    line-height: 1.8;
    font-size: 18px;
    overflow: hidden;
}

#resultWitch {
    position: absolute;
    bottom: -80px;
    right: 450px;
    width: 500px;
    height: auto;
    opacity: 0.4; /* 在深色背景下进一步降低透明度 */
    pointer-events: none;
    z-index: 1;
}

#aiResultContent {
    position: relative;
    z-index: 2;
}

#aiResultContent h1, #aiResultContent h2, #aiResultContent h3 {
    color: #fff;
    margin-top: 20px;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(143, 148, 251, 0.6);
}

#aiResultContent p {
    margin-bottom: 15px;
}

#uploadStatus {
    color: #8f94fb;
    font-style: italic;
}

#uploadStatus:empty {
    display: none;
}

/* 移动端遮罩样式 */
#mobile-warning {
    display: none;
}

@media screen and (max-width: 768px) {
    #mobile-warning {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 9999;
        display: flex;
        justify-content: center;
        align-items: center;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .warning-content {
        text-align: center;
        color: #fff;
        padding: 30px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 15px;
        background: rgba(255, 255, 255, 0.05);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .warning-content h2 {
        margin: 0;
        font-weight: 300;
        letter-spacing: 2px;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }

    /* 禁用底层交互 */
    .toolbar, .canvas-wrapper {
        pointer-events: none;
    }
}
