/**
 * Litematic三视图功能样式
 * 现代化UI设计，符合主题风格
 */

/* ==================== 对话框容器 ==================== */
.litematic-threeview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* 遮罩层 - 现代化毛玻璃效果 */
.litematic-threeview-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
}

/* 对话框容器 - 现代化卡片设计 */
.litematic-threeview-modal .modal-container {
    position: relative;
    width: 95%;
    max-width: 1400px;
    max-height: 92vh;
    background: var(--body-bg-color, #fff);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==================== 对话框头部 - 现代化纯色设计 ==================== */
.litematic-threeview-modal .modal-header {
    padding: 28px 35px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--theme-color, #2f8bfd);
    color: #fff;
    position: relative;
    text-align: center;
}

.litematic-threeview-modal .modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.3px;
}

.litematic-threeview-modal .modal-header h2 i {
    font-size: 26px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

.litematic-threeview-modal .modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.litematic-threeview-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.litematic-threeview-modal .modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ==================== 对话框主体 - 现代化布局 ==================== */
.litematic-threeview-modal .modal-body {
    padding: 35px;
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: var(--body-bg-color, #fafbfc);
}

/* 文件信息 - 现代化卡片 */
.litematic-threeview-modal .preview-info {
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 16px;
    border-left: 4px solid var(--theme-color, #2f8bfd);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.litematic-threeview-modal .preview-info:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.litematic-threeview-modal .preview-info p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--main-color, #333);
    line-height: 1.6;
}

.litematic-threeview-modal .preview-info .file-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--theme-color, #2f8bfd);
    display: flex;
    align-items: center;
    gap: 8px;
}

.litematic-threeview-modal .preview-info .file-name i {
    font-size: 18px;
}

.litematic-threeview-modal .preview-info .hint {
    color: var(--muted-color, #666);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.litematic-threeview-modal .preview-info .hint i {
    font-size: 14px;
}

/* 视图容器 - 现代化设计 */
.litematic-threeview-modal .preview-views-container {
    flex: 1;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 加载动画 - 现代化样式 */
.litematic-threeview-modal .view-loading {
    text-align: center;
    padding: 60px 20px;
}

.litematic-threeview-modal .view-loading i.fa-spinner {
    font-size: 56px;
    color: var(--theme-color, #2f8bfd);
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 8px rgba(47, 139, 253, 0.3));
}

.litematic-threeview-modal .view-loading .loading-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--main-color, #333);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.litematic-threeview-modal .view-loading .loading-detail {
    font-size: 15px;
    color: var(--muted-color, #666);
}

/* 视图网格布局 - 现代化三列布局 */
.litematic-threeview-modal .views-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    padding: 0;
    width: 100%;
}

.litematic-threeview-modal .view-item {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.litematic-threeview-modal .view-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--theme-color, #2f8bfd);
}

.litematic-threeview-modal .view-header {
    padding: 16px 20px;
    background: var(--theme-color, #2f8bfd);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    letter-spacing: 0.5px;
}

.litematic-threeview-modal .view-body {
    padding: 16px;
    text-align: center;
    background: #232323;
    position: relative;
}

.litematic-threeview-modal .view-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.litematic-threeview-modal .view-item:hover .view-body img {
    transform: scale(1.02);
}

/* ==================== 对话框底部 - 现代化设计 ==================== */
.litematic-threeview-modal .modal-footer {
    padding: 24px 35px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    background: #fafbfc;
}

.litematic-threeview-modal .modal-footer .btn {
    padding: 13px 32px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.litematic-threeview-modal .modal-footer .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.litematic-threeview-modal .modal-footer .btn:hover::before {
    width: 300px;
    height: 300px;
}

.litematic-threeview-modal .modal-footer .btn i {
    font-size: 17px;
    position: relative;
    z-index: 1;
}

.litematic-threeview-modal .modal-footer .btn span {
    position: relative;
    z-index: 1;
}

.litematic-threeview-modal .modal-footer .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.litematic-threeview-modal .modal-footer .btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.litematic-threeview-modal .modal-footer .btn-primary {
    background: var(--theme-color, #2f8bfd);
    color: #fff;
    box-shadow: 0 4px 14px rgba(47, 139, 253, 0.4);
}

.litematic-threeview-modal .modal-footer .btn-primary:hover {
    background: var(--key-color, #1e7ae0);
    box-shadow: 0 8px 24px rgba(47, 139, 253, 0.5);
}

.litematic-threeview-modal .modal-footer .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.litematic-threeview-modal .modal-footer .btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

.litematic-threeview-modal .modal-footer .btn-primary:disabled::before {
    display: none;
}

.litematic-threeview-modal .modal-footer .btn-cancel {
    background: #fff;
    border: 2px solid var(--main-border-color, #ddd);
    color: var(--muted-color, #666);
}

.litematic-threeview-modal .modal-footer .btn-cancel:hover {
    background: #f8f9fa;
    border-color: var(--theme-color, #2f8bfd);
    color: var(--theme-color, #2f8bfd);
}

/* ==================== 插入后的三视图布局 ==================== */
.litematic-threeviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.litematic-threeviews-grid > div {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 三视图标题样式 */
.litematic-threeviews-grid h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--main-color, #333);
    margin: 0;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--theme-color, #2f8bfd) 0%, #1e7ae0 100%);
    color: #fff;
    border-radius: 12px 12px 0 0;
    letter-spacing: 0.5px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.litematic-threeviews-grid h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}

/* 三视图图片样式 */
.litematic-threeviews-grid img {
    width: 100%;
    height: auto;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    display: block;
}

.litematic-threeviews-grid > div:hover img {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(-4px);
}

/* 垂直布局的标题样式 */
.post-content h2 + p img[alt*="视图"],
.entry-content h2 + p img[alt*="视图"] {
    margin-top: 0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 文章内容中的三视图标题 */
.post-content h2:has(+ p img[alt*="视图"]),
.entry-content h2:has(+ p img[alt*="视图"]) {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 24px 0 0 0;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--theme-color, #2f8bfd) 0%, #1e7ae0 100%);
    border-radius: 12px;
    letter-spacing: 0.5px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.post-content h2:has(+ p img[alt*="视图"])::before,
.entry-content h2:has(+ p img[alt*="视图"])::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .litematic-threeview-modal {
        padding: 10px;
    }

    .litematic-threeview-modal .modal-container {
        width: 100%;
        max-height: 95vh;
        border-radius: 16px;
    }

    .litematic-threeview-modal .modal-header {
        padding: 20px 24px;
    }

    .litematic-threeview-modal .modal-header h2 {
        font-size: 19px;
    }

    .litematic-threeview-modal .modal-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .litematic-threeview-modal .modal-body {
        padding: 24px 20px;
        gap: 20px;
    }

    .litematic-threeview-modal .views-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .litematic-threeview-modal .view-header {
        padding: 14px 16px;
        font-size: 15px;
    }

    .litematic-threeview-modal .modal-footer {
        padding: 20px 24px;
        flex-direction: column-reverse;
        gap: 12px;
    }

    .litematic-threeview-modal .modal-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }

    /* 插入后的三视图响应式 */
    .litematic-threeviews-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0;
    }

    .litematic-threeviews-grid h2 {
        font-size: 16px;
        padding: 10px 16px;
    }
}

/* ==================== 暗黑模式适配 ==================== */
.dark-theme .litematic-threeview-modal .modal-container {
    background: var(--body-bg-color, #1a1a1a);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 255, 255, 0.05);
}

.dark-theme .litematic-threeview-modal .modal-body {
    background: var(--body-bg-color, #1a1a1a);
}

.dark-theme .litematic-threeview-modal .preview-info {
    background: #2a2a2a;
    border-left-color: var(--theme-color, #2f8bfd);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark-theme .litematic-threeview-modal .view-item {
    background: var(--main-bg-color, #2a2a2a);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dark-theme .litematic-threeview-modal .view-item:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.dark-theme .litematic-threeview-modal .modal-footer {
    background: #1a1a1a;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.dark-theme .litematic-threeview-modal .modal-footer .btn-cancel {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.2);
    color: #ccc;
}

.dark-theme .litematic-threeview-modal .modal-footer .btn-cancel:hover {
    background: #333;
    border-color: var(--theme-color, #2f8bfd);
    color: var(--theme-color, #2f8bfd);
}

/* 暗黑模式下的三视图标题 */
.dark-theme .litematic-threeviews-grid h2,
.dark-theme .post-content h2:has(+ p img[alt*="视图"]),
.dark-theme .entry-content h2:has(+ p img[alt*="视图"]) {
    background: linear-gradient(135deg, #2f8bfd 0%, #1e7ae0 100%);
    color: #fff;
}

.dark-theme .litematic-threeviews-grid img,
.dark-theme .post-content h2 + p img[alt*="视图"],
.dark-theme .entry-content h2 + p img[alt*="视图"] {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.dark-theme .litematic-threeviews-grid > div:hover img {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}
