﻿/* ========== 弹窗组件样式 ========== */
.tc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 100001 !important; /* 从 10001 改为 100001 */
    justify-content: center;
    align-items: center;
    padding: 15px;
    animation: tcFadeIn 0.2s ease;
}

    .tc-overlay.active {
        display: flex;
    }

.tc-modal {
    background: white;
    border-radius: 28px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: tcSlideUp 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
    transform-origin: center;
}

/* 弹窗头部 - 左上角布局 */
.tc-header {
    padding: 20px 24px 8px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* 小图标样式 */
.tc-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* 图标类型 */
.tc-icon-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.tc-icon-error {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.tc-icon-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
}

.tc-icon-info {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.tc-icon-question {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.2);
}

/* 标题样式 - 左对齐 */
.tc-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

/* 弹窗内容 */
.tc-body {
    padding: 16px 24px 24px 24px;
}

.tc-message {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
    white-space: pre-line;
    word-break: break-word;
    text-align: left;
}

/* 弹窗底部按钮 */
.tc-footer {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px 24px;
    justify-content: flex-end;
}

.tc-footer-single {
    justify-content: center;
}

.tc-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f3f4f6;
    color: #374151;
}

.tc-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

    .tc-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

.tc-btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

    .tc-btn-danger:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    }

.tc-btn-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

    .tc-btn-success:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }

.tc-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

    .tc-btn-secondary:hover {
        background: #e5e7eb;
    }

.tc-btn:active {
    transform: translateY(0);
}

/* 加载状态特殊样式 */
.tc-loading .tc-header {
    border-bottom: none;
    justify-content: center;
    padding-bottom: 8px;
}

.tc-loading .tc-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
    border-radius: 50%;
}

.tc-loading .tc-title {
    text-align: center;
}

/* ========== 图片/视频预览弹窗样式 ========== */
/* 预览弹窗 - 透明背景 */
#tc-image-preview.tc-overlay,
#tc-video-preview.tc-overlay {
    background: rgba(0, 0, 0, 0.85);
    z-index: 5000;
}

#tc-image-preview .tc-modal,
#tc-video-preview .tc-modal {
    background: transparent;
    box-shadow: none;
    max-width: 90vw;
    width: auto;
}

#tc-image-preview .tc-header,
#tc-video-preview .tc-header {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    #tc-image-preview .tc-header .tc-title,
    #tc-video-preview .tc-header .tc-title {
        color: white;
    }

    #tc-image-preview .tc-header .close-modal,
    #tc-video-preview .tc-header .close-modal {
        color: white;
        font-size: 24px;
        cursor: pointer;
        margin-left: auto;
        opacity: 0.8;
        transition: opacity 0.2s;
    }

        #tc-image-preview .tc-header .close-modal:hover,
        #tc-video-preview .tc-header .close-modal:hover {
            opacity: 1;
        }

#tc-image-preview .tc-body,
#tc-video-preview .tc-body {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
}

#tc-image-preview .tc-footer,
#tc-video-preview .tc-footer {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 0 0 16px 16px;
    padding: 12px 24px 20px 24px;
}

#tc-image-preview .tc-btn-primary,
#tc-video-preview .tc-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

#tc-image-preview img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#tc-video-preview video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
}

/* 动画 */
@keyframes tcFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes tcSlideUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .tc-modal {
        max-width: 320px;
    }

    .tc-header {
        padding: 16px 20px 6px 20px;
        gap: 10px;
    }

    .tc-icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
        border-radius: 8px;
    }

    .tc-title {
        font-size: 16px;
    }

    .tc-body {
        padding: 12px 20px 20px 20px;
    }

    .tc-message {
        font-size: 14px;
    }

    .tc-footer {
        padding: 0 20px 20px 20px;
        gap: 10px;
    }

    .tc-btn {
        padding: 8px 20px;
        font-size: 13px;
    }

    /* 预览弹窗移动端 */
    #tc-image-preview .tc-header,
    #tc-video-preview .tc-header {
        padding: 12px 16px;
    }

    #tc-image-preview .tc-body,
    #tc-video-preview .tc-body {
        padding: 16px;
    }

    #tc-image-preview .tc-footer,
    #tc-video-preview .tc-footer {
        padding: 12px 16px 16px 16px;
    }
}

/* ========== 全屏 iframe 模态框样式 ========== */
.tc-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

    .tc-fullscreen-overlay.active {
        opacity: 1;
    }

.tc-fullscreen-container {
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 头部样式 - 模仿原 .page-header */
.tc-fullscreen-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.tc-fullscreen-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-align: center;
    flex: 1;
    margin: 0 16px;
}

    .tc-fullscreen-title i {
        margin-right: 8px;
        color: #ffd700;
    }

/* 关闭按钮 - 样式类似返回按钮 */
.tc-fullscreen-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
    flex-shrink: 0;
}

    .tc-fullscreen-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }

/* 左侧占位元素，保持标题居中（可选，如果没有左侧按钮则不需要） */
.tc-fullscreen-header .placeholder {
    width: 36px;
    visibility: hidden;
    flex-shrink: 0;
}

.tc-fullscreen-body {
    flex: 1;
    overflow: auto;
    background: white;
}

.tc-fullscreen-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .tc-fullscreen-header {
        padding: 10px 12px;
    }

    .tc-fullscreen-title {
        font-size: 16px;
    }

    .tc-fullscreen-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}