/**
 * 审核面板 - 媒体上传与预览（自 style.css 迁出）
 * 字体：Microsoft YaHei
 */

/* 媒体上传区域样式 */
.media-upload-section {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-secondary);
}

.media-upload-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.media-upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.media-upload-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
}

.media-upload-btn .btn-icon {
    font-size: 14px;
}

.paste-hint {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
}

/* 回复媒体上传样式 - 与正常留言保持一致 */
.reply-media-upload-section {
    margin-top: 8px;
    padding: 6px 0;
}

.reply-media-upload-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.reply-media-upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.reply-media-upload-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
}

.reply-media-upload-btn .btn-icon {
    font-size: 14px;
}

.reply-media-upload-btn .btn-text {
    font-size: 12px;
}

/* 回复媒体预览容器样式 - 与正常留言保持一致 */
.reply-media-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    min-height: 0;
}

.reply-media-preview-item {
    position: relative;
    width: 120px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-secondary);
    cursor: pointer;
    transition: transform 0.2s ease;
    background: var(--bg-tertiary);
}

.reply-media-preview-item:hover {
    transform: scale(1.05);
}

.reply-media-element {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.reply-media-element img,
.reply-media-element video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reply-media-element video {
    pointer-events: none; /* 防止在预览中播放 */
}

.reply-media-type-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.reply-media-file-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-size: 9px;
    padding: 4px 6px;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
    max-height: 30px;
    overflow: hidden;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.reply-media-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.reply-media-remove-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* 媒体预览容器样式 */
.media-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    min-height: 0;
}

.media-preview-item {
    position: relative;
    width: 120px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-secondary);
    cursor: pointer;
    transition: transform 0.2s ease;
    background: var(--bg-tertiary);
}

.media-preview-item:hover {
    transform: scale(1.05);
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-item video {
    pointer-events: none; /* 防止在预览中播放 */
}

.media-type-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

.media-size-info {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 9px;
}

.media-controls {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
}

.media-control-btn {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.media-control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.media-control-btn.remove-btn {
    background: #ff4757;
}

.media-control-btn.remove-btn:hover {
    background: #ff3838;
}

/* 图片预览容器样式（向后兼容） */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    min-height: 0;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-card);
}

.image-preview-item:hover {
    border-color: var(--border-accent);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.image-preview-item .remove-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

/* 图片预览弹窗 */
.image-preview-modal {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    padding: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0;
    top: 0;
    transform: none;
}

.image-preview-container-large {
    position: relative;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-height: auto;
    padding: 0;
    box-sizing: border-box;
}

.image-preview-container-large img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
    display: block;
    margin: auto;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
}

.image-preview-container-large img:active {
    cursor: grabbing;
}

/* 当图片被放大时，显示可拖拽的鼠标样式 */
.image-preview-container-large img[style*="scale"] {
    cursor: grab;
}

/* 图片预览窗口右下角：分辨率与体积显示 */
.image-preview-info {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.95);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}
