/* 发布页面特定样式 */
.publish-content {
    background-color: var(--background-color);
    min-height: calc(100vh - 44px);
}

.publish-form {
    background-color: var(--card-color);
    margin-bottom: 8px;
}

.publish-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.publish-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.publish-user-info {
    flex: 1;
}

.publish-username {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
}

.publish-content-input {
    padding: 16px;
}

.content-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-color);
    background-color: transparent;
    min-height: 120px;
    font-family: inherit;
}

.content-textarea::placeholder {
    color: var(--text-secondary-color);
}

/* 工具栏 */
.publish-toolbar {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.toolbar-item:hover {
    background-color: var(--background-color);
}

.toolbar-icon {
    font-size: 24px;
}

.toolbar-text {
    font-size: 12px;
    color: var(--text-secondary-color);
}

/* 圈子选择 */
.circle-select-section {
    padding: 0 16px 16px;
    display: none;
}

.circle-select-section.active {
    display: block;
}

.circle-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.circle-select-title {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

.circle-select-close {
    font-size: 18px;
    color: var(--text-secondary-color);
    cursor: pointer;
}

.circle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.circle-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--background-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.circle-tag:hover {
    background-color: rgba(0, 122, 255, 0.1);
}

.circle-tag.selected {
    background-color: var(--primary-color);
    color: white;
}

.circle-tag.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.circle-avatar-mini {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

/* 媒体上传区域 */
.media-upload-section {
    padding: 0 16px 16px;
}

.media-upload-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.upload-preview {
    position: relative;
    width: calc(33.333% - 5.333px);
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--background-color);
}

.uploaded-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-media {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.add-media-btn {
    width: calc(33.333% - 5.333px);
    aspect-ratio: 1;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 4px;
}

.add-media-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 122, 255, 0.05);
}

.add-media-icon {
    font-size: 24px;
    color: var(--text-secondary-color);
}

.add-media-text {
    font-size: 12px;
    color: var(--text-secondary-color);
}

#mediaInput {
    display: none;
}

/* 视频预览 */
.video-preview-container {
    padding: 0 16px 16px;
    display: none;
}

.video-preview-container.active {
    display: block;
}

.video-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-preview-player {
    width: 100%;
    border-radius: 8px;
    max-height: 300px;
}

.remove-video {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

/* 发布按钮 */
.publish-actions {
    padding: 16px;
    background-color: var(--card-color);
    position: sticky;
    bottom: 0;
    border-top: 1px solid var(--border-color);
}

.publish-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.publish-btn:hover {
    background-color: #0066CC;
}

.publish-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.compression-info {
    padding: 0 16px 8px;
    font-size: 12px;
    color: var(--text-secondary-color);
}

/* 适配暗黑模式 */
@media (prefers-color-scheme: dark) {
    .add-media-btn {
        border-color: var(--border-color);
        background-color: var(--card-color);
    }
    
    .add-media-btn:hover {
        background-color: rgba(0, 122, 255, 0.1);
    }
}

/* 响应式调整 */
@media (max-width: 320px) {
    .publish-header {
        padding: 10px 12px;
    }
    
    .publish-content-input {
        padding: 12px;
    }
    
    .content-textarea {
        font-size: 15px;
        min-height: 100px;
    }
    
    .publish-toolbar {
        padding: 10px 12px;
        gap: 12px;
    }
    
    .media-upload-section {
        padding: 0 12px 12px;
    }
    
    .publish-actions {
        padding: 12px;
    }
    
    .publish-btn {
        padding: 10px;
        font-size: 15px;
    }
}