/* 闪图功能专用样式 */

/* 闪图消息基础样式 */
.flash-message {
    position: relative;
    width: 130px;
    height: 130px;
    min-width: 130px;
    min-height: 130px;
    flex-shrink: 0 !important;
    padding: 0;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform-style: preserve-3d;
    perspective: 800px;
}

.flash-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 22px;
    background: linear-gradient(125deg, transparent 20%, rgba(255, 255, 255, 0.3) 40%, transparent 60%);
    animation: prismShimmer 3s infinite;
    z-index: 1;
}

.flash-message::after {
    content: '';
    position: absolute;
    width: 250%;
    height: 250%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
    animation: rotateGlow 12s linear infinite;
    z-index: 0;
}

.flash-message:hover {
    transform: scale(1.05) translateY(-5px) rotateY(5deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 发送与接收样式改进 */
.flash-message.sent {
    background: linear-gradient(145deg, #6B5CFF, #8A76FF, #AC92FF);
    color: #fff;
    margin-left: auto;
    box-shadow: 0 8px 25px rgba(107, 92, 255, 0.3);
}

.flash-message.received {
    background: linear-gradient(145deg, #FF7B54, #FF9776, #FFBD9B);
    color: #fff;
    margin-right: auto;
    box-shadow: 0 8px 25px rgba(255, 123, 84, 0.3);
}

/* 闪图容器样式 */
.flash-message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 10px;
    position: relative;
    z-index: 2;
    padding: 12px;
    transition: transform 0.3s ease;
}

.flash-message:hover .flash-message-container {
    transform: translateZ(10px);
}

/* 闪电图标重新设计 */
.flash-icon {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    animation: floatIcon 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.flash-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    animation: electricPulse 1.5s ease-in-out infinite;
}

/* 发送闪图图标样式 */
.flash-message.sent .flash-icon .lightning-bolt {
    fill: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 0 12px rgba(107, 92, 255, 0.8));
}

.flash-message.sent .flash-icon .lightning-glow {
    fill: rgba(255, 236, 107, 0.6);
    filter: drop-shadow(0 0 20px rgba(255, 236, 107, 0.7));
}

/* 接收闪图图标样式 */
.flash-message.received .flash-icon .lightning-bolt {
    fill: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 0 12px rgba(255, 123, 84, 0.8));
}

.flash-message.received .flash-icon .lightning-glow {
    fill: rgba(255, 236, 107, 0.5);
    filter: drop-shadow(0 0 20px rgba(255, 236, 107, 0.6));
}

/* 时间戳样式改进 */
.flash-timestamp {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    position: absolute;
    bottom: 10px;
    width: 90%;
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    padding: 5px 0;
    border-radius: 12px;
    z-index: 2;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.flash-message:hover .flash-timestamp {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.25);
}

.flash-message-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.flash-message .flash-text {
    font-size: 14px;
    margin-bottom: 4px;
}

.flash-message .flash-time {
    font-size: 12px;
    opacity: 0.8;
}

/* 闪图查看器样式改进 */
.flash-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: overlayFadeIn 0.4s ease-out forwards;
}

.flash-viewer-overlay.closing {
    animation: fadeOut 0.3s ease forwards;
}

.flash-viewer-content {
    position: relative;
    max-width: 92%;
    max-height: 85vh;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    background-color: #111;
    animation: contentAppear 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.flash-viewer-image {
    max-width: 100%;
    max-height: 85vh;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.flash-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.flash-error-message {
    padding: 20px;
    color: #ff5555;
    text-align: center;
    font-size: 16px;
    background-color: rgba(255, 85, 85, 0.1);
}

/* 增强型动画效果 */
@keyframes prismShimmer {
    0% {
        transform: translateX(-100%) skewX(-15deg);
        opacity: 0;
    }
    20% {
        opacity: 0.7;
    }
    40% {
        opacity: 0.5;
    }
    60% {
        opacity: 0.7;
    }
    100% {
        transform: translateX(100%) skewX(-15deg);
        opacity: 0;
    }
}

@keyframes rotateGlow {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
        opacity: 0.6;
    }
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

/* 闪电特效动画 */
@keyframes electricPulse {
    0% {
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 236, 107, 0.8));
        transform: scale(1.1);
    }
    100% {
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
        transform: scale(1);
    }
}

/* 点击效果增强 */
.flash-message:active {
    transform: scale(0.98) translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

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

@keyframes contentAppear {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示样式 */
.flash-error {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 59, 48, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99999;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideUp {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* 新增：加载指示器样式 */
.flash-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99999;
}

.flash-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

.flash-loading-message {
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    max-width: 80%;
}

/* 闪图状态栏样式 */
.flash-status-bar {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 100;
    min-width: 140px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    pointer-events: none;
}

.flash-status-bar.sender {
    background-color: rgba(107, 92, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.flash-status-bar.receiver {
    background-color: rgba(255, 123, 84, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 倒计时样式 */
.flash-countdown {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 110;
}

.flash-countdown::before {
    content: '⏱️';
    font-size: 14px;
}

/* 确保闪图消息在消息列表中正确显示 */
#messages-area .flash-message {
    clear: both;
    float: none;
    display: flex;
    flex-shrink: 0 !important;
    min-width: 130px !important;
    min-height: 130px !important;
}

#messages-area .flash-message.sent {
    float: right;
}

#messages-area .flash-message.received {
    float: left;
}

/* 销毁状态的闪图改进 */
.flash-message.flash-destroyed, .flash-message.destroyed {
    background: linear-gradient(145deg, #777, #555) !important;
    opacity: 0.7;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

.flash-message.destroyed::before,
.flash-message.destroyed::after,
.flash-message.flash-destroyed::before,
.flash-message.flash-destroyed::after {
    display: none;
}

.flash-message.destroyed .flash-icon,
.flash-message.flash-destroyed .flash-icon {
    filter: grayscale(100%) opacity(0.6);
    transform: scale(0.9);
    animation: none;
}

.flash-message.destroyed .flash-icon svg,
.flash-message.flash-destroyed .flash-icon svg {
    animation: none;
}

.flash-message.destroyed .flash-icon .lightning-bolt,
.flash-message.flash-destroyed .flash-icon .lightning-bolt {
    fill: rgba(200, 200, 200, 0.5) !important;
    filter: none !important;
    stroke: rgba(150, 150, 150, 0.7) !important;
}

.flash-message.destroyed .flash-timestamp,
.flash-message.flash-destroyed .flash-timestamp {
    color: rgba(255, 255, 255, 0.6);
}

.flash-message.destroyed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.1) 10px,
        rgba(0, 0, 0, 0.1) 20px
    );
    opacity: 0.5;
    pointer-events: none;
}

/* 闪图销毁动画 */
@keyframes destructionEffect {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    30% {
        clip-path: polygon(0 0, 100% 0, 100% 60%, 0 60%);
    }
    35% {
        clip-path: polygon(0 0, 100% 0, 100% 55%, 0 55%);
    }
    40% {
        clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
    }
    45% {
        clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    }
}

.flash-message.destroying .flash-icon .lightning-bolt {
    animation: destructionEffect 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards !important;
}

.flash-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.flash-viewer img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* 媒体查询适配 */
@media (max-width: 768px) {
    .flash-message {
        width: 110px;
        height: 110px;
        border-radius: 18px;
    }
    
    .flash-icon {
        width: 50px;
        height: 50px;
    }
    
    .flash-timestamp {
        font-size: 12px;
        bottom: 8px;
    }
    
    .flash-viewer-image {
        max-height: 75vh;
    }
    
    .flash-countdown {
        padding: 8px 14px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .flash-message {
        width: 95px;
        height: 95px;
        border-radius: 15px;
    }
    
    .flash-icon {
        width: 45px;
        height: 45px;
    }
    
    .flash-timestamp {
        width: 85%;
        font-size: 11px;
        padding: 4px 0;
    }
}

/* 友好通知样式 */
.friendly-notice {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #8a5fff, #5e6bff); /* 渐变背景 */
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 6px 16px rgba(94, 107, 255, 0.25), 0 0 8px rgba(138, 95, 255, 0.15);
    z-index: 99999;
    animation: noticeSlideUp 0.3s ease, noticePulse 2s infinite, noticeHold 3s forwards;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    max-width: 80%;
}

@keyframes noticeSlideUp {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes noticePulse {
    0% { box-shadow: 0 6px 16px rgba(94, 107, 255, 0.25), 0 0 8px rgba(138, 95, 255, 0.15); }
    50% { box-shadow: 0 8px 20px rgba(94, 107, 255, 0.35), 0 0 12px rgba(138, 95, 255, 0.25); }
    100% { box-shadow: 0 6px 16px rgba(94, 107, 255, 0.25), 0 0 8px rgba(138, 95, 255, 0.15); }
}

@keyframes noticeHold {
    0%, 80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, 10px); }
}

/* 工具栏中的闪电图标 */
.tool-btn .flash-icon svg {
    width: 24px;
    height: 24px;
    animation: electricPulse 2s ease-in-out infinite;
}






