/**
 * YukiCat Spoiler Alert - Frontend Styles
 * 前端显示样式
 */

.yukicat-spoiler-wrapper {
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.yukicat-spoiler-wrapper:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.yukicat-spoiler-title {
    font-size: 18px;
    font-weight: 600;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.yukicat-spoiler-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    position: relative;
    overflow: hidden;
}

.yukicat-spoiler-alert::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    animation: stripe-animation 20s linear infinite;
    pointer-events: none;
}

@keyframes stripe-animation {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.yukicat-spoiler-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    color: #d63031;
    animation: pulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.yukicat-spoiler-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(214, 48, 49, 0.3));
}

.yukicat-spoiler-warning {
    flex-grow: 1;
    font-size: 18px;
    font-weight: 600;
    color: #2d3436;
    z-index: 1;
}

.yukicat-spoiler-toggle {
    padding: 12px 24px;
    background: #fff;
    color: #2d3436;
    border: 2px solid #2d3436;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    outline: none;
}

.yukicat-spoiler-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: #2d3436;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.yukicat-spoiler-toggle:hover::before,
.yukicat-spoiler-toggle:focus::before {
    width: 300px;
    height: 300px;
}

.yukicat-spoiler-toggle:hover,
.yukicat-spoiler-toggle:focus {
    color: #fff;
    border-color: #2d3436;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 52, 54, 0.3);
}

.yukicat-spoiler-toggle:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.yukicat-spoiler-toggle span {
    position: relative;
    z-index: 1;
}

.yukicat-spoiler-toggle:active {
    transform: translateY(0);
}

.yukicat-spoiler-content {
    padding: 25px 20px;
    background: #fff;
    line-height: 1.8;
    color: #333;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.yukicat-spoiler-content p {
    margin: 0 0 1em 0;
}

.yukicat-spoiler-content p:last-child {
    margin-bottom: 0;
}

.yukicat-spoiler-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
}

.yukicat-spoiler-content a {
    color: #007cba;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.yukicat-spoiler-content a:hover {
    border-bottom-color: #007cba;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .yukicat-spoiler-alert {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .yukicat-spoiler-toggle {
        width: 100%;
        padding: 14px 20px;
    }

    .yukicat-spoiler-content {
        padding: 20px 15px;
    }
    
    .yukicat-spoiler-title {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    .yukicat-spoiler-warning {
        font-size: 16px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .yukicat-spoiler-wrapper {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    .yukicat-spoiler-title {
        background: #2d3436;
        border-bottom-color: #636e72;
        color: #dfe6e9;
    }

    .yukicat-spoiler-content {
        background: #2d3436;
        color: #dfe6e9;
    }
    
    .yukicat-spoiler-content a {
        color: #74b9ff;
    }
    
    .yukicat-spoiler-content a:hover {
        border-bottom-color: #74b9ff;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .yukicat-spoiler-alert {
        border: 2px solid #000;
    }
    
    .yukicat-spoiler-toggle {
        border-width: 3px;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .yukicat-spoiler-wrapper,
    .yukicat-spoiler-toggle,
    .yukicat-spoiler-icon,
    .yukicat-spoiler-content {
        animation: none !important;
        transition: none !important;
    }
    
    .yukicat-spoiler-alert::before {
        animation: none !important;
    }
}

/* 打印样式 */
@media print {
    .yukicat-spoiler-content {
        display: block !important;
    }

    .yukicat-spoiler-toggle {
        display: none;
    }
    
    .yukicat-spoiler-alert::before {
        display: none;
    }
    
    .yukicat-spoiler-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* RTL（从右到左）语言支持 */
[dir="rtl"] .yukicat-spoiler-alert {
    direction: rtl;
}

/* 确保与常见主题兼容 */
.entry-content .yukicat-spoiler-wrapper,
.post-content .yukicat-spoiler-wrapper,
.article-content .yukicat-spoiler-wrapper {
    clear: both;
}
