/* 广告位容器 */
.zib-self-ads-container {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 广告项容器 */
.ad-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

/* 广告项样式 */
.ad-item {
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ad-item:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ad-image-link img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.ad-text-link {
    display: block;
    padding: 15px 10px;
    text-align: center;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
}

/* 广告占位符 */
.ad-placeholder {
    padding: 30px 0;
    text-align: center;
    color: #999;
    border: 1px dashed #e0e0e0;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* 编辑按钮 */
.ad-edit-btn {
    text-align: center;
}

.edit-ad-btn {
    background-color: #4e6ef2;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.edit-ad-btn:hover {
    background-color: #3a59d4;
}

/* 广告提交弹窗 */
.zib-ad-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.zib-ad-modal.active {
    display: flex;
}

.ad-modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.ad-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
}

.ad-modal-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.ad-form-group {
    margin-bottom: 15px;
}

.ad-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.ad-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.ad-type-options {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.ad-type-option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ad-form-submit {
    width: 100%;
    background-color: #4e6ef2;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.ad-form-submit:hover {
    background-color: #3a59d4;
}

.ad-preview {
    margin: 10px 0;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    text-align: center;
}

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

/* 暗色模式适配 */
[data-theme="dark"] .zib-self-ads-container,
[data-theme="dark"] .ad-modal-content {
    background: #2d2d2d;
}

[data-theme="dark"] .ad-item {
    border-color: #383838;
}

[data-theme="dark"] .ad-text-link {
    color: #e5e5e5;
}

[data-theme="dark"] .ad-placeholder {
    color: #777;
    border-color: #444;
}

[data-theme="dark"] .ad-modal-title,
[data-theme="dark"] .ad-form-label {
    color: #e5e5e5;
}

[data-theme="dark"] .ad-form-control {
    background: #383838;
    border-color: #444;
    color: #e5e5e5;
}

[data-theme="dark"] .ad-preview {
    border-color: #444;
}