/**
 * 前端样式 - 用于assets目录的独立CSS文件
 * 这个文件用于经典编辑器和短代码的样式支持
 */

/* 主容器 */
.yukicat-spoiler {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: box-shadow 0.3s ease;
}

.yukicat-spoiler:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 警告头部 */
.yukicat-spoiler-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

/* 图标 */
.yukicat-spoiler-icon {
    font-size: 24px;
    flex-shrink: 0;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    animation: icon-pulse 2s ease-in-out infinite;
}

/* 标题 */
.yukicat-spoiler-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    z-index: 2;
}

/* 切换按钮 */
.yukicat-spoiler-toggle {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    z-index: 2;
    transition: all 0.2s ease;
}

.yukicat-spoiler-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.yukicat-spoiler-toggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.yukicat-spoiler-toggle:focus {
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 2px;
}

/* 内容区域 */
.yukicat-spoiler-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.yukicat-spoiler-content.is-expanded {
    max-height: 5000px;
    opacity: 1;
}

.yukicat-spoiler-content-inner {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.yukicat-spoiler-content-inner > * {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.yukicat-spoiler-content-inner > *:first-child {
    margin-top: 0;
}

.yukicat-spoiler-content-inner > *:last-child {
    margin-bottom: 0;
}

/* Warning 主题 */
.yukicat-spoiler-theme-warning .yukicat-spoiler-header {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.yukicat-spoiler-theme-warning .yukicat-spoiler-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    animation: stripe-move 20s linear infinite;
    z-index: 1;
}

/* Danger 主题 */
.yukicat-spoiler-theme-danger .yukicat-spoiler-header {
    background: linear-gradient(135deg, #f8d7da 0%, #ff7675 100%);
    color: #721c24;
}

.yukicat-spoiler-theme-danger .yukicat-spoiler-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    animation: stripe-move 20s linear infinite;
    z-index: 1;
}

/* Snow 主题 */
.yukicat-spoiler-theme-snow .yukicat-spoiler-header {
    background: linear-gradient(135deg, #e3f2fd 0%, #90caf9 100%);
    color: #0d47a1;
}

.yukicat-spoiler-theme-snow .yukicat-spoiler-header::after {
    content: '❄';
    position: absolute;
    top: -10px;
    left: 10%;
    font-size: 30px;
    opacity: 0.2;
    z-index: 1;
    animation: snowfall 8s linear infinite;
}

.yukicat-spoiler-theme-snow .yukicat-spoiler-header::before {
    content: '❅';
    position: absolute;
    top: -10px;
    left: 40%;
    font-size: 25px;
    opacity: 0.2;
    z-index: 1;
    animation: snowfall 10s linear infinite 2s;
}

/* Paw 主题 */
.yukicat-spoiler-theme-paw .yukicat-spoiler-header {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffb74d 100%);
    color: #e65100;
}

.yukicat-spoiler-theme-paw .yukicat-spoiler-header::after {
    content: '🐾';
    position: absolute;
    top: 10px;
    right: 30%;
    font-size: 40px;
    opacity: 0;
    z-index: 1;
    transform: rotate(-15deg);
    animation: paw-appear 4s ease-in-out infinite;
}

.yukicat-spoiler-theme-paw .yukicat-spoiler-header::before {
    content: '🐾';
    position: absolute;
    bottom: 10px;
    left: 25%;
    font-size: 35px;
    opacity: 0;
    z-index: 1;
    transform: rotate(25deg);
    animation: paw-appear 4s ease-in-out infinite 2s;
}

/* 动画 */
@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes stripe-move {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(50%);
    }
}

@keyframes snowfall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(70px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes paw-appear {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5) rotate(-15deg);
    }
    50% {
        opacity: 0.15;
        transform: scale(1) rotate(-15deg);
    }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .yukicat-spoiler {
        margin: 15px 0;
    }
    
    .yukicat-spoiler-header {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .yukicat-spoiler-icon {
        font-size: 20px;
    }
    
    .yukicat-spoiler-title {
        font-size: 14px;
    }
    
    .yukicat-spoiler-toggle {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .yukicat-spoiler-content-inner {
        padding: 15px;
    }
}

/* 打印样式 */
@media print {
    .yukicat-spoiler {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .yukicat-spoiler-toggle {
        display: none;
    }
    
    .yukicat-spoiler-content {
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible !important;
    }
    
    .yukicat-spoiler-header::before,
    .yukicat-spoiler-header::after {
        display: none;
    }
    
    .yukicat-spoiler-icon {
        animation: none;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .yukicat-spoiler-content-inner {
        background: rgba(30, 30, 30, 0.95);
        color: #e0e0e0;
    }
    
    .yukicat-spoiler-toggle {
        background: rgba(255, 255, 255, 0.9);
        color: #222;
    }
    
    .yukicat-spoiler-toggle:hover {
        background: rgba(255, 255, 255, 1);
    }
}

/* RTL支持 */
[dir="rtl"] .yukicat-spoiler-header {
    direction: rtl;
}

[dir="rtl"] .yukicat-spoiler-header .yukicat-spoiler-icon {
    order: 3;
}

[dir="rtl"] .yukicat-spoiler-header .yukicat-spoiler-title {
    order: 2;
}

[dir="rtl"] .yukicat-spoiler-header .yukicat-spoiler-toggle {
    order: 1;
}
