/* 广告管家 - 前台样式 */
.custom-ad {
    position: relative;
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border: 1px dashed #d0d0d0;
    border-radius: 8px;
    overflow: hidden;
}

/* 广告标识（可自定义样式）- 不写死位置，由 ad-badge-top-left 等类控制 */
.custom-ad .ad-badge {
    position: absolute;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    font-size: 11px;
    padding: 4px 10px;
    line-height: 1.4;
    letter-spacing: 0.5px;
    box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.05);
}

.custom-ad .ad-badge-top-left {
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    border-radius: 0 0 6px 0;
}

.custom-ad .ad-badge-top-right {
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    border-radius: 0 0 0 6px;
}

.custom-ad .ad-badge-bottom-left {
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important;
    right: auto !important;
    border-radius: 0 6px 0 0;
}

.custom-ad .ad-badge-bottom-right {
    bottom: 0 !important;
    right: 0 !important;
    top: auto !important;
    left: auto !important;
    border-radius: 6px 0 0 0;
}

/* 广告内容区域 - 前台继承主题字体样式 */

.custom-ad .custom-ad-content p {
    margin: 0 0 1em 0;
}

.custom-ad .custom-ad-content p:last-child {
    margin-bottom: 0;
}

.custom-ad .custom-ad-content ul,
.custom-ad .custom-ad-content ol {
    margin: 0 0 1em 1.5em;
    padding: 0;
}

.custom-ad .custom-ad-content .table-r {
    margin: 0 0 1em 0;
    overflow-x: auto;
}

.custom-ad .custom-ad-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0;
}

.custom-ad .custom-ad-content td,
.custom-ad .custom-ad-content th {
    border: 1px solid #ddd !important;
    padding: 8px 12px;
    text-align: left;
}

.custom-ad .custom-ad-content img {
    max-width: 100%;
    height: auto;
}

.custom-ad .custom-ad-content a {
    color: #0073aa;
}

.custom-ad .custom-ad-content blockquote {
    margin: 0 0 1em 0;
    padding: 0 0 0 1em;
    border-left: 4px solid #ddd;
    color: #666;
}

.custom-ad .custom-ad-content strong,
.custom-ad .custom-ad-content b {
    font-weight: 600;
}

/* 预览弹窗 */
.cam-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.cam-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.cam-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.cam-modal-close:hover {
    color: #333;
}

.cam-modal-body {
    margin-top: 16px;
}

.cam-modal-body .custom-ad {
    margin: 0;
}
